From owner-svn-src-all@freebsd.org Sun Nov 18 00:00:40 2018 Return-Path: Delivered-To: svn-src-all@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 81853110BB1F; Sun, 18 Nov 2018 00:00:40 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EEBB286CEF; Sun, 18 Nov 2018 00:00:39 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CDE0B328E; Sun, 18 Nov 2018 00:00:39 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAI00dcO072838; Sun, 18 Nov 2018 00:00:39 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAI00diU072837; Sun, 18 Nov 2018 00:00:39 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201811180000.wAI00diU072837@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Sun, 18 Nov 2018 00:00:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r340531 - stable/12/sys/netpfil/ipfw/nat64 X-SVN-Group: stable-12 X-SVN-Commit-Author: ae X-SVN-Commit-Paths: stable/12/sys/netpfil/ipfw/nat64 X-SVN-Commit-Revision: 340531 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: EEBB286CEF X-Spamd-Result: default: False [0.06 / 15.00]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.06)[0.062,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Nov 2018 00:00:40 -0000 Author: ae Date: Sun Nov 18 00:00:39 2018 New Revision: 340531 URL: https://svnweb.freebsd.org/changeset/base/340531 Log: MFC r339544: Call inet_ntop() only when its result is needed. Obtained from: Yandex LLC Sponsored by: Yandex LLC Modified: stable/12/sys/netpfil/ipfw/nat64/nat64lsn.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/netpfil/ipfw/nat64/nat64lsn.c ============================================================================== --- stable/12/sys/netpfil/ipfw/nat64/nat64lsn.c Sat Nov 17 23:58:55 2018 (r340530) +++ stable/12/sys/netpfil/ipfw/nat64/nat64lsn.c Sun Nov 18 00:00:39 2018 (r340531) @@ -643,7 +643,6 @@ static NAT64NOINLINE int nat64lsn_periodic_chkhost(struct nat64lsn_host *nh, struct nat64lsn_periodic_data *d) { - char a[INET6_ADDRSTRLEN]; struct nat64lsn_portgroup *pg; struct nat64lsn_job_item *ji; uint64_t delmask[NAT64LSN_PGPTRNMASK]; @@ -652,9 +651,13 @@ nat64lsn_periodic_chkhost(struct nat64lsn_host *nh, delcount = 0; memset(delmask, 0, sizeof(delmask)); - inet_ntop(AF_INET6, &nh->addr, a, sizeof(a)); - DPRINTF(DP_JQUEUE, "Checking %s host %s on cpu %d", - stale_nh(d->cfg, nh) ? "stale" : "non-stale", a, curcpu); + if (V_nat64_debug & DP_JQUEUE) { + char a[INET6_ADDRSTRLEN]; + + inet_ntop(AF_INET6, &nh->addr, a, sizeof(a)); + DPRINTF(DP_JQUEUE, "Checking %s host %s on cpu %d", + stale_nh(d->cfg, nh) ? "stale" : "non-stale", a, curcpu); + } if (!stale_nh(d->cfg, nh)) { /* Non-stale host. Inspect internals */ NAT64_LOCK(nh); @@ -1527,9 +1530,9 @@ nat64lsn_translate6(struct nat64lsn_cfg *cfg, struct i if (k++ > 1000) { DPRINTF(DP_ALL, "XXX: too long %d/%d %d/%d\n", sidx.idx, sidx.off, st->next.idx, st->next.off); - inet_ntop(AF_INET6, &nh->addr, a, sizeof(a)); DPRINTF(DP_GENERIC, "TR host %s %p on cpu %d", - a, nh, curcpu); + inet_ntop(AF_INET6, &nh->addr, a, sizeof(a)), + nh, curcpu); k = 0; } sidx = st->next; @@ -1542,10 +1545,10 @@ nat64lsn_translate6(struct nat64lsn_cfg *cfg, struct i /* No free states. Request more if we can */ if (nh->pg_used >= cfg->max_chunks) { /* Limit reached */ - inet_ntop(AF_INET6, &nh->addr, a, sizeof(a)); DPRINTF(DP_DROPS, "PG limit reached " " for host %s (used %u, allocated %u, " - "limit %u)", a, + "limit %u)", inet_ntop(AF_INET6, + &nh->addr, a, sizeof(a)), nh->pg_used * NAT64_CHUNK_SIZE, nh->pg_allocated * NAT64_CHUNK_SIZE, cfg->max_chunks * NAT64_CHUNK_SIZE); From owner-svn-src-all@freebsd.org Sun Nov 18 00:04:05 2018 Return-Path: Delivered-To: svn-src-all@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 E33AC110BEF4; Sun, 18 Nov 2018 00:04:04 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8901887116; Sun, 18 Nov 2018 00:04:04 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 677A33415; Sun, 18 Nov 2018 00:04:04 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAI044VG077868; Sun, 18 Nov 2018 00:04:04 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAI043uD077863; Sun, 18 Nov 2018 00:04:03 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201811180004.wAI043uD077863@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Sun, 18 Nov 2018 00:04:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r340532 - in stable/12: share/man/man9 sys/net sys/netinet sys/netinet6 X-SVN-Group: stable-12 X-SVN-Commit-Author: ae X-SVN-Commit-Paths: in stable/12: share/man/man9 sys/net sys/netinet sys/netinet6 X-SVN-Commit-Revision: 340532 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 8901887116 X-Spamd-Result: default: False [0.06 / 15.00]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.06)[0.060,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Nov 2018 00:04:05 -0000 Author: ae Date: Sun Nov 18 00:04:03 2018 New Revision: 340532 URL: https://svnweb.freebsd.org/changeset/base/340532 Log: MFC r339537: Add ifaddr_event_ext event. It is similar to ifaddr_event, but the handler receives the type of event IFADDR_EVENT_ADD/IFADDR_EVENT_DEL, and the pointer to ifaddr. Also ifaddr_event now is implemented using ifaddr_event_ext handler. Sponsored by: Yandex LLC Differential Revision: https://reviews.freebsd.org/D17100 Modified: stable/12/share/man/man9/EVENTHANDLER.9 stable/12/sys/net/if.c stable/12/sys/net/if_var.h stable/12/sys/netinet/in.c stable/12/sys/netinet6/in6.c Directory Properties: stable/12/ (props changed) Modified: stable/12/share/man/man9/EVENTHANDLER.9 ============================================================================== --- stable/12/share/man/man9/EVENTHANDLER.9 Sun Nov 18 00:00:39 2018 (r340531) +++ stable/12/share/man/man9/EVENTHANDLER.9 Sun Nov 18 00:04:03 2018 (r340532) @@ -23,7 +23,7 @@ .\" SUCH DAMAGE. .\" $FreeBSD$ .\" -.Dd September 6, 2018 +.Dd October 21, 2018 .Dt EVENTHANDLER 9 .Os .Sh NAME @@ -298,6 +298,8 @@ Callback invoked when an change has been made to an in Callback invoked when an interfance has been removed from an interface group. .It Vt ifaddr_event Callbacks invoked when an address is set up on a network interface. +.It Vt ifaddr_event_ext +Callback invoked when an address has been added or removed from an interface. .It Vt if_clone_event Callbacks invoked when an interface is cloned. .It Vt iflladdr_event Modified: stable/12/sys/net/if.c ============================================================================== --- stable/12/sys/net/if.c Sun Nov 18 00:00:39 2018 (r340531) +++ stable/12/sys/net/if.c Sun Nov 18 00:04:03 2018 (r340532) @@ -328,6 +328,18 @@ static MALLOC_DEFINE(M_IFNET, "ifnet", "interface inte MALLOC_DEFINE(M_IFADDR, "ifaddr", "interface address"); MALLOC_DEFINE(M_IFMADDR, "ether_multi", "link-level multicast address"); +/* + * Support for old ifaddr_event. + */ +static void +ifaddr_event_compat(void *arg __unused, struct ifnet *ifp, + struct ifaddr *ifa __unused, int event __unused) +{ + + EVENTHANDLER_INVOKE(ifaddr_event, ifp); +} +EVENTHANDLER_DEFINE(ifaddr_event_ext, ifaddr_event_compat, NULL, 0); + struct ifnet * ifnet_byindex_locked(u_short idx) { Modified: stable/12/sys/net/if_var.h ============================================================================== --- stable/12/sys/net/if_var.h Sun Nov 18 00:00:39 2018 (r340531) +++ stable/12/sys/net/if_var.h Sun Nov 18 00:04:03 2018 (r340532) @@ -432,6 +432,11 @@ EVENTHANDLER_DECLARE(iflladdr_event, iflladdr_event_ha /* interface address change event */ typedef void (*ifaddr_event_handler_t)(void *, struct ifnet *); EVENTHANDLER_DECLARE(ifaddr_event, ifaddr_event_handler_t); +typedef void (*ifaddr_event_ext_handler_t)(void *, struct ifnet *, + struct ifaddr *, int); +EVENTHANDLER_DECLARE(ifaddr_event_ext, ifaddr_event_ext_handler_t); +#define IFADDR_EVENT_ADD 0 +#define IFADDR_EVENT_DEL 1 /* new interface arrival event */ typedef void (*ifnet_arrival_event_handler_t)(void *, struct ifnet *); EVENTHANDLER_DECLARE(ifnet_arrival_event, ifnet_arrival_event_handler_t); Modified: stable/12/sys/netinet/in.c ============================================================================== --- stable/12/sys/netinet/in.c Sun Nov 18 00:00:39 2018 (r340531) +++ stable/12/sys/netinet/in.c Sun Nov 18 00:04:03 2018 (r340532) @@ -520,7 +520,12 @@ in_aifaddr_ioctl(u_long cmd, caddr_t data, struct ifne &ii->ii_allhosts); } - EVENTHANDLER_INVOKE(ifaddr_event, ifp); + /* + * Note: we don't need extra reference for ifa, since we called + * with sx lock held, and ifaddr can not be deleted in concurrent + * thread. + */ + EVENTHANDLER_INVOKE(ifaddr_event_ext, ifp, ifa, IFADDR_EVENT_ADD); return (error); @@ -643,7 +648,8 @@ in_difaddr_ioctl(u_long cmd, caddr_t data, struct ifne } IF_ADDR_WUNLOCK(ifp); - EVENTHANDLER_INVOKE(ifaddr_event, ifp); + EVENTHANDLER_INVOKE(ifaddr_event_ext, ifp, &ia->ia_ifa, + IFADDR_EVENT_DEL); ifa_free(&ia->ia_ifa); /* in_ifaddrhead */ return (0); Modified: stable/12/sys/netinet6/in6.c ============================================================================== --- stable/12/sys/netinet6/in6.c Sun Nov 18 00:00:39 2018 (r340531) +++ stable/12/sys/netinet6/in6.c Sun Nov 18 00:04:03 2018 (r340532) @@ -712,7 +712,8 @@ aifaddr_out: ND6_WUNLOCK(); nd6_prefix_del(pr); } - EVENTHANDLER_INVOKE(ifaddr_event, ifp); + EVENTHANDLER_INVOKE(ifaddr_event_ext, ifp, &ia->ia_ifa, + IFADDR_EVENT_DEL); break; } @@ -1456,7 +1457,10 @@ done: WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, NULL, "Invoking IPv6 network device address event may sleep"); - EVENTHANDLER_INVOKE(ifaddr_event, ifp); + ifa_ref(&ia->ia_ifa); + EVENTHANDLER_INVOKE(ifaddr_event_ext, ifp, &ia->ia_ifa, + IFADDR_EVENT_ADD); + ifa_free(&ia->ia_ifa); return (error); } From owner-svn-src-all@freebsd.org Sun Nov 18 00:09:35 2018 Return-Path: Delivered-To: svn-src-all@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 5A95F110C127; Sun, 18 Nov 2018 00:09:35 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F181B87349; Sun, 18 Nov 2018 00:09:34 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CC989341C; Sun, 18 Nov 2018 00:09:34 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAI09Ygr078160; Sun, 18 Nov 2018 00:09:34 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAI09YI8078157; Sun, 18 Nov 2018 00:09:34 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201811180009.wAI09YI8078157@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Sun, 18 Nov 2018 00:09:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r340533 - in stable/12/sys: net netinet X-SVN-Group: stable-12 X-SVN-Commit-Author: ae X-SVN-Commit-Paths: in stable/12/sys: net netinet X-SVN-Commit-Revision: 340533 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: F181B87349 X-Spamd-Result: default: False [-0.12 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.12)[-0.119,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Nov 2018 00:09:35 -0000 Author: ae Date: Sun Nov 18 00:09:33 2018 New Revision: 340533 URL: https://svnweb.freebsd.org/changeset/base/340533 Log: MFC r339550,339556: Add KPI that can be used by tunneling interfaces to handle IP addresses appearing and disappearing on the host system. Such handling is need, because tunneling interfaces must use addresses, that are configured on the host as ingress addresses for tunnels. Otherwise the system can send spoofed packets with source address, that belongs to foreign host. The KPI uses ifaddr_event_ext event to implement addresses tracking. Tunneling interfaces register event handlers and then they are notified by the kernel, when an address disappears or appears. ifaddr_event_compat() handler from if.c replaced by srcaddr_change_event() in the ip_encap.c Sponsored by: Yandex LLC Differential Revision: https://reviews.freebsd.org/D17134 Modified: stable/12/sys/net/if.c stable/12/sys/netinet/ip_encap.c stable/12/sys/netinet/ip_encap.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/net/if.c ============================================================================== --- stable/12/sys/net/if.c Sun Nov 18 00:04:03 2018 (r340532) +++ stable/12/sys/net/if.c Sun Nov 18 00:09:33 2018 (r340533) @@ -328,18 +328,6 @@ static MALLOC_DEFINE(M_IFNET, "ifnet", "interface inte MALLOC_DEFINE(M_IFADDR, "ifaddr", "interface address"); MALLOC_DEFINE(M_IFMADDR, "ether_multi", "link-level multicast address"); -/* - * Support for old ifaddr_event. - */ -static void -ifaddr_event_compat(void *arg __unused, struct ifnet *ifp, - struct ifaddr *ifa __unused, int event __unused) -{ - - EVENTHANDLER_INVOKE(ifaddr_event, ifp); -} -EVENTHANDLER_DEFINE(ifaddr_event_ext, ifaddr_event_compat, NULL, 0); - struct ifnet * ifnet_byindex_locked(u_short idx) { Modified: stable/12/sys/netinet/ip_encap.c ============================================================================== --- stable/12/sys/netinet/ip_encap.c Sun Nov 18 00:04:03 2018 (r340532) +++ stable/12/sys/netinet/ip_encap.c Sun Nov 18 00:09:33 2018 (r340533) @@ -66,6 +66,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -100,22 +101,139 @@ struct encaptab { encap_input_t input; }; +struct srcaddrtab { + CK_LIST_ENTRY(srcaddrtab) chain; + + encap_srcaddr_t srcaddr; + void *arg; +}; + CK_LIST_HEAD(encaptab_head, encaptab); +CK_LIST_HEAD(srcaddrtab_head, srcaddrtab); #ifdef INET static struct encaptab_head ipv4_encaptab = CK_LIST_HEAD_INITIALIZER(); +static struct srcaddrtab_head ipv4_srcaddrtab = CK_LIST_HEAD_INITIALIZER(); #endif #ifdef INET6 static struct encaptab_head ipv6_encaptab = CK_LIST_HEAD_INITIALIZER(); +static struct srcaddrtab_head ipv6_srcaddrtab = CK_LIST_HEAD_INITIALIZER(); #endif -static struct mtx encapmtx; +static struct mtx encapmtx, srcaddrmtx; MTX_SYSINIT(encapmtx, &encapmtx, "encapmtx", MTX_DEF); +MTX_SYSINIT(srcaddrmtx, &srcaddrmtx, "srcaddrmtx", MTX_DEF); #define ENCAP_WLOCK() mtx_lock(&encapmtx) #define ENCAP_WUNLOCK() mtx_unlock(&encapmtx) -#define ENCAP_RLOCK() struct epoch_tracker encap_et; epoch_enter_preempt(net_epoch_preempt, &encap_et) -#define ENCAP_RUNLOCK() epoch_exit_preempt(net_epoch_preempt, &encap_et) +#define ENCAP_RLOCK_TRACKER struct epoch_tracker encap_et +#define ENCAP_RLOCK() \ + epoch_enter_preempt(net_epoch_preempt, &encap_et) +#define ENCAP_RUNLOCK() \ + epoch_exit_preempt(net_epoch_preempt, &encap_et) #define ENCAP_WAIT() epoch_wait_preempt(net_epoch_preempt) +#define SRCADDR_WLOCK() mtx_lock(&srcaddrmtx) +#define SRCADDR_WUNLOCK() mtx_unlock(&srcaddrmtx) +#define SRCADDR_RLOCK_TRACKER struct epoch_tracker srcaddr_et +#define SRCADDR_RLOCK() \ + epoch_enter_preempt(net_epoch_preempt, &srcaddr_et) +#define SRCADDR_RUNLOCK() \ + epoch_exit_preempt(net_epoch_preempt, &srcaddr_et) +#define SRCADDR_WAIT() epoch_wait_preempt(net_epoch_preempt) + +/* + * ifaddr_event_ext handler. + * + * Tunnelling interfaces may request the kernel to notify when + * some interface addresses appears or disappears. Usually tunnelling + * interface must use an address configured on the local machine as + * ingress address to be able receive datagramms and do not send + * spoofed packets. + */ +static void +srcaddr_change_event(void *arg __unused, struct ifnet *ifp, + struct ifaddr *ifa, int event) +{ + SRCADDR_RLOCK_TRACKER; + struct srcaddrtab_head *head; + struct srcaddrtab *p; + + /* Support for old ifaddr_event. */ + EVENTHANDLER_INVOKE(ifaddr_event, ifp); + + switch (ifa->ifa_addr->sa_family) { +#ifdef INET + case AF_INET: + head = &ipv4_srcaddrtab; + break; +#endif +#ifdef INET6 + case AF_INET6: + head = &ipv6_srcaddrtab; + break; +#endif + default: + /* ignore event */ + return; + } + + SRCADDR_RLOCK(); + CK_LIST_FOREACH(p, head, chain) { + (*p->srcaddr)(p->arg, ifa->ifa_addr, event); + } + SRCADDR_RUNLOCK(); +} +EVENTHANDLER_DEFINE(ifaddr_event_ext, srcaddr_change_event, NULL, 0); + +static struct srcaddrtab * +encap_register_srcaddr(struct srcaddrtab_head *head, encap_srcaddr_t func, + void *arg, int mflags) +{ + struct srcaddrtab *p, *tmp; + + if (func == NULL) + return (NULL); + p = malloc(sizeof(*p), M_NETADDR, mflags); + if (p == NULL) + return (NULL); + p->srcaddr = func; + p->arg = arg; + + SRCADDR_WLOCK(); + CK_LIST_FOREACH(tmp, head, chain) { + if (func == tmp->srcaddr && arg == tmp->arg) + break; + } + if (tmp == NULL) + CK_LIST_INSERT_HEAD(head, p, chain); + SRCADDR_WUNLOCK(); + + if (tmp != NULL) { + free(p, M_NETADDR); + p = tmp; + } + return (p); +} + +static int +encap_unregister_srcaddr(struct srcaddrtab_head *head, + const struct srcaddrtab *cookie) +{ + struct srcaddrtab *p; + + SRCADDR_WLOCK(); + CK_LIST_FOREACH(p, head, chain) { + if (p == cookie) { + CK_LIST_REMOVE(p, chain); + SRCADDR_WUNLOCK(); + SRCADDR_WAIT(); + free(p, M_NETADDR); + return (0); + } + } + SRCADDR_WUNLOCK(); + return (EINVAL); +} + static struct encaptab * encap_attach(struct encaptab_head *head, const struct encap_config *cfg, void *arg, int mflags) @@ -175,6 +293,7 @@ encap_detach(struct encaptab_head *head, const struct static int encap_input(struct encaptab_head *head, struct mbuf *m, int off, int proto) { + ENCAP_RLOCK_TRACKER; struct encaptab *ep, *match; void *arg; int matchprio, ret; @@ -220,6 +339,20 @@ encap_input(struct encaptab_head *head, struct mbuf *m } #ifdef INET +const struct srcaddrtab * +ip_encap_register_srcaddr(encap_srcaddr_t func, void *arg, int mflags) +{ + + return (encap_register_srcaddr(&ipv4_srcaddrtab, func, arg, mflags)); +} + +int +ip_encap_unregister_srcaddr(const struct srcaddrtab *cookie) +{ + + return (encap_unregister_srcaddr(&ipv4_srcaddrtab, cookie)); +} + const struct encaptab * ip_encap_attach(const struct encap_config *cfg, void *arg, int mflags) { @@ -245,6 +378,20 @@ encap4_input(struct mbuf **mp, int *offp, int proto) #endif /* INET */ #ifdef INET6 +const struct srcaddrtab * +ip6_encap_register_srcaddr(encap_srcaddr_t func, void *arg, int mflags) +{ + + return (encap_register_srcaddr(&ipv6_srcaddrtab, func, arg, mflags)); +} + +int +ip6_encap_unregister_srcaddr(const struct srcaddrtab *cookie) +{ + + return (encap_unregister_srcaddr(&ipv6_srcaddrtab, cookie)); +} + const struct encaptab * ip6_encap_attach(const struct encap_config *cfg, void *arg, int mflags) { Modified: stable/12/sys/netinet/ip_encap.h ============================================================================== --- stable/12/sys/netinet/ip_encap.h Sun Nov 18 00:04:03 2018 (r340532) +++ stable/12/sys/netinet/ip_encap.h Sun Nov 18 00:09:33 2018 (r340533) @@ -43,7 +43,8 @@ int encap6_input(struct mbuf **, int *, int); typedef int (*encap_lookup_t)(const struct mbuf *, int, int, void **); typedef int (*encap_check_t)(const struct mbuf *, int, int, void *); -typedef int (*encap_input_t)(struct mbuf *, int , int, void *); +typedef int (*encap_input_t)(struct mbuf *, int, int, void *); +typedef void (*encap_srcaddr_t)(void *, const struct sockaddr *, int); struct encap_config { int proto; /* protocol */ @@ -60,12 +61,20 @@ struct encap_config { }; struct encaptab; +struct srcaddrtab; const struct encaptab *ip_encap_attach(const struct encap_config *, void *arg, int mflags); const struct encaptab *ip6_encap_attach(const struct encap_config *, void *arg, int mflags); +const struct srcaddrtab *ip_encap_register_srcaddr(encap_srcaddr_t, + void *arg, int mflags); +const struct srcaddrtab *ip6_encap_register_srcaddr(encap_srcaddr_t, + void *arg, int mflags); + +int ip_encap_unregister_srcaddr(const struct srcaddrtab *); +int ip6_encap_unregister_srcaddr(const struct srcaddrtab *); int ip_encap_detach(const struct encaptab *); int ip6_encap_detach(const struct encaptab *); #endif From owner-svn-src-all@freebsd.org Sun Nov 18 00:11:20 2018 Return-Path: Delivered-To: svn-src-all@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 0F5C8110C216; Sun, 18 Nov 2018 00:11:20 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id ACC958782E; Sun, 18 Nov 2018 00:11:19 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8DAFD38C1; Sun, 18 Nov 2018 00:11:19 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAI0BJRD079021; Sun, 18 Nov 2018 00:11:19 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAI0BJTk079020; Sun, 18 Nov 2018 00:11:19 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201811180011.wAI0BJTk079020@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Sun, 18 Nov 2018 00:11:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r340534 - stable/11/lib/libvmmapi X-SVN-Group: stable-11 X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: stable/11/lib/libvmmapi X-SVN-Commit-Revision: 340534 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: ACC958782E X-Spamd-Result: default: False [-0.11 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.11)[-0.107,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Nov 2018 00:11:20 -0000 Author: jhb Date: Sun Nov 18 00:11:19 2018 New Revision: 340534 URL: https://svnweb.freebsd.org/changeset/base/340534 Log: MFC 338511: bhyve: Use MAP_GUARD when mapping guest memory ranges. Instead of relying on PROT_NONE mappings with MAP_ANON, use MAP_GUARD to reserve address space around guest memory ranges including the guard ranges of address space around mappings. Modified: stable/11/lib/libvmmapi/vmmapi.c Directory Properties: stable/11/ (props changed) Modified: stable/11/lib/libvmmapi/vmmapi.c ============================================================================== --- stable/11/lib/libvmmapi/vmmapi.c Sun Nov 18 00:09:33 2018 (r340533) +++ stable/11/lib/libvmmapi/vmmapi.c Sun Nov 18 00:11:19 2018 (r340534) @@ -360,7 +360,7 @@ vm_setup_memory(struct vmctx *ctx, size_t memsize, enu size_t objsize, len; vm_paddr_t gpa; char *baseaddr, *ptr; - int error, flags; + int error; assert(vms == VM_MMAP_ALL); @@ -387,8 +387,7 @@ vm_setup_memory(struct vmctx *ctx, size_t memsize, enu * and the adjoining guard regions. */ len = VM_MMAP_GUARD_SIZE + objsize + VM_MMAP_GUARD_SIZE; - flags = MAP_PRIVATE | MAP_ANON | MAP_NOCORE | MAP_ALIGNED_SUPER; - ptr = mmap(NULL, len, PROT_NONE, flags, -1, 0); + ptr = mmap(NULL, len, PROT_NONE, MAP_GUARD | MAP_ALIGNED_SUPER, -1, 0); if (ptr == MAP_FAILED) return (-1); @@ -490,8 +489,8 @@ vm_create_devmem(struct vmctx *ctx, int segid, const c * adjoining guard regions. */ len2 = VM_MMAP_GUARD_SIZE + len + VM_MMAP_GUARD_SIZE; - flags = MAP_PRIVATE | MAP_ANON | MAP_NOCORE | MAP_ALIGNED_SUPER; - base = mmap(NULL, len2, PROT_NONE, flags, -1, 0); + base = mmap(NULL, len2, PROT_NONE, MAP_GUARD | MAP_ALIGNED_SUPER, -1, + 0); if (base == MAP_FAILED) goto done; From owner-svn-src-all@freebsd.org Sun Nov 18 00:17:09 2018 Return-Path: Delivered-To: svn-src-all@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 883B9110C608; Sun, 18 Nov 2018 00:17:09 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DAB72884C2; Sun, 18 Nov 2018 00:17:08 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BB90A3941; Sun, 18 Nov 2018 00:17:08 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAI0H8WF083048; Sun, 18 Nov 2018 00:17:08 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAI0H6cK083038; Sun, 18 Nov 2018 00:17:06 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201811180017.wAI0H6cK083038@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Sun, 18 Nov 2018 00:17:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r340535 - in stable/12: share/man/man4 sys/net sys/netinet sys/netinet6 X-SVN-Group: stable-12 X-SVN-Commit-Author: ae X-SVN-Commit-Paths: in stable/12: share/man/man4 sys/net sys/netinet sys/netinet6 X-SVN-Commit-Revision: 340535 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: DAB72884C2 X-Spamd-Result: default: False [-0.13 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.13)[-0.130,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Nov 2018 00:17:09 -0000 Author: ae Date: Sun Nov 18 00:17:06 2018 New Revision: 340535 URL: https://svnweb.freebsd.org/changeset/base/340535 Log: MFC r339551: Add handling for appearing/disappearing of ingress addresses to if_gif(4). * register handler for ingress address appearing/disappearing; * add new srcaddr hash table for fast softc lookup by srcaddr; * when srcaddr disappears, clear IFF_DRV_RUNNING flag from interface, and set it otherwise; * remove the note about ingress address from BUGS section. Sponsored by: Yandex LLC Differential Revision: https://reviews.freebsd.org/D17134 MFC r339552: Add handling for appearing/disappearing of ingress addresses to if_gre(4). * register handler for ingress address appearing/disappearing; * add new srcaddr hash table for fast softc lookup by srcaddr; * when srcaddr disappears, clear IFF_DRV_RUNNING flag from interface, and set it otherwise; Sponsored by: Yandex LLC Differential Revision: https://reviews.freebsd.org/D17214 MFC r339553: Add handling for appearing/disappearing of ingress addresses to if_me(4). * register handler for ingress address appearing/disappearing; * add new srcaddr hash table for fast softc lookup by srcaddr; * when srcaddr disappears, clear IFF_DRV_RUNNING flag from interface, and set it otherwise; Sponsored by: Yandex LLC MFC r339649: Add the check that current VNET is ready and access to srchash is allowed. This change is similar to r339646. The callback that checks for appearing and disappearing of tunnel ingress address can be called during VNET teardown. To prevent access to already freed memory, add check to the callback and epoch_wait() call to be sure that callback has finished its work. Modified: stable/12/share/man/man4/gif.4 stable/12/sys/net/if_gif.c stable/12/sys/net/if_gif.h stable/12/sys/net/if_gre.c stable/12/sys/net/if_gre.h stable/12/sys/net/if_me.c stable/12/sys/netinet/in_gif.c stable/12/sys/netinet/ip_gre.c stable/12/sys/netinet6/in6_gif.c stable/12/sys/netinet6/ip6_gre.c Directory Properties: stable/12/ (props changed) Modified: stable/12/share/man/man4/gif.4 ============================================================================== --- stable/12/share/man/man4/gif.4 Sun Nov 18 00:11:19 2018 (r340534) +++ stable/12/share/man/man4/gif.4 Sun Nov 18 00:17:06 2018 (r340535) @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 5, 2018 +.Dd October 21, 2018 .Dt GIF 4 .Os .Sh NAME @@ -206,15 +206,6 @@ and are picky about outer header fields. For example, you cannot usually use .Nm to talk with IPsec devices that use IPsec tunnel mode. -.Pp -The current code does not check if the ingress address -(outer source address) -configured in the -.Nm -interface makes sense. -Make sure to specify an address which belongs to your node. -Otherwise, your node will not be able to receive packets from the peer, -and it will generate packets with a spoofed source address. .Pp If the outer protocol is IPv4, .Nm Modified: stable/12/sys/net/if_gif.c ============================================================================== --- stable/12/sys/net/if_gif.c Sun Nov 18 00:11:19 2018 (r340534) +++ stable/12/sys/net/if_gif.c Sun Nov 18 00:17:06 2018 (r340535) @@ -284,6 +284,7 @@ gif_transmit(struct ifnet *ifp, struct mbuf *m) sc = ifp->if_softc; if ((ifp->if_flags & IFF_MONITOR) != 0 || (ifp->if_flags & IFF_UP) == 0 || + (ifp->if_drv_flags & IFF_DRV_RUNNING) == 0 || sc->gif_family == 0 || (error = if_tunnel_check_nesting(ifp, m, MTAG_GIF, V_max_gif_nesting)) != 0) { @@ -674,7 +675,6 @@ gif_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) cmd == SIOCSIFPHYADDR_IN6 || #endif 0) { - ifp->if_drv_flags |= IFF_DRV_RUNNING; if_link_state_change(ifp, LINK_STATE_UP); } } @@ -689,6 +689,7 @@ gif_delete_tunnel(struct gif_softc *sc) sx_assert(&gif_ioctl_sx, SA_XLOCKED); if (sc->gif_family != 0) { + CK_LIST_REMOVE(sc, srchash); CK_LIST_REMOVE(sc, chain); /* Wait until it become safe to free gif_hdr */ GIF_WAIT(); Modified: stable/12/sys/net/if_gif.h ============================================================================== --- stable/12/sys/net/if_gif.h Sun Nov 18 00:11:19 2018 (r340534) +++ stable/12/sys/net/if_gif.h Sun Nov 18 00:17:06 2018 (r340535) @@ -63,6 +63,7 @@ struct gif_softc { } gif_uhdr; CK_LIST_ENTRY(gif_softc) chain; + CK_LIST_ENTRY(gif_softc) srchash; }; CK_LIST_HEAD(gif_list, gif_softc); MALLOC_DECLARE(M_GIF); Modified: stable/12/sys/net/if_gre.c ============================================================================== --- stable/12/sys/net/if_gre.c Sun Nov 18 00:11:19 2018 (r340534) +++ stable/12/sys/net/if_gre.c Sun Nov 18 00:17:06 2018 (r340535) @@ -326,7 +326,6 @@ gre_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) cmd == SIOCSIFPHYADDR_IN6 || #endif 0) { - ifp->if_drv_flags |= IFF_DRV_RUNNING; if_link_state_change(ifp, LINK_STATE_UP); } } @@ -342,6 +341,7 @@ gre_delete_tunnel(struct gre_softc *sc) sx_assert(&gre_ioctl_sx, SA_XLOCKED); if (sc->gre_family != 0) { CK_LIST_REMOVE(sc, chain); + CK_LIST_REMOVE(sc, srchash); GRE_WAIT(); free(sc->gre_hdr, M_GRE); sc->gre_family = 0; @@ -543,6 +543,7 @@ gre_setseqn(struct grehdr *gh, uint32_t seq) static int gre_transmit(struct ifnet *ifp, struct mbuf *m) { + GRE_RLOCK_TRACKER; struct gre_softc *sc; struct grehdr *gh; uint32_t af; @@ -562,6 +563,7 @@ gre_transmit(struct ifnet *ifp, struct mbuf *m) sc = ifp->if_softc; if ((ifp->if_flags & IFF_MONITOR) != 0 || (ifp->if_flags & IFF_UP) == 0 || + (ifp->if_drv_flags & IFF_DRV_RUNNING) == 0 || sc->gre_family == 0 || (error = if_tunnel_check_nesting(ifp, m, MTAG_GRE, V_max_gre_nesting)) != 0) { Modified: stable/12/sys/net/if_gre.h ============================================================================== --- stable/12/sys/net/if_gre.h Sun Nov 18 00:11:19 2018 (r340534) +++ stable/12/sys/net/if_gre.h Sun Nov 18 00:17:06 2018 (r340535) @@ -82,6 +82,7 @@ struct gre_softc { } gre_uhdr; CK_LIST_ENTRY(gre_softc) chain; + CK_LIST_ENTRY(gre_softc) srchash; }; CK_LIST_HEAD(gre_list, gre_softc); MALLOC_DECLARE(M_GRE); @@ -91,7 +92,8 @@ MALLOC_DECLARE(M_GRE); #endif #define GRE2IFP(sc) ((sc)->gre_ifp) -#define GRE_RLOCK() struct epoch_tracker gre_et; epoch_enter_preempt(net_epoch_preempt, &gre_et) +#define GRE_RLOCK_TRACKER struct epoch_tracker gre_et +#define GRE_RLOCK() epoch_enter_preempt(net_epoch_preempt, &gre_et) #define GRE_RUNLOCK() epoch_exit_preempt(net_epoch_preempt, &gre_et) #define GRE_WAIT() epoch_wait_preempt(net_epoch_preempt) Modified: stable/12/sys/net/if_me.c ============================================================================== --- stable/12/sys/net/if_me.c Sun Nov 18 00:11:19 2018 (r340534) +++ stable/12/sys/net/if_me.c Sun Nov 18 00:17:06 2018 (r340535) @@ -83,11 +83,13 @@ struct me_softc { struct in_addr me_dst; CK_LIST_ENTRY(me_softc) chain; + CK_LIST_ENTRY(me_softc) srchash; }; CK_LIST_HEAD(me_list, me_softc); #define ME2IFP(sc) ((sc)->me_ifp) #define ME_READY(sc) ((sc)->me_src.s_addr != 0) -#define ME_RLOCK() struct epoch_tracker me_et; epoch_enter_preempt(net_epoch_preempt, &me_et) +#define ME_RLOCK_TRACKER struct epoch_tracker me_et +#define ME_RLOCK() epoch_enter_preempt(net_epoch_preempt, &me_et) #define ME_RUNLOCK() epoch_exit_preempt(net_epoch_preempt, &me_et) #define ME_WAIT() epoch_wait_preempt(net_epoch_preempt) @@ -95,9 +97,13 @@ CK_LIST_HEAD(me_list, me_softc); #define ME_HASH_SIZE (1 << 4) #endif VNET_DEFINE_STATIC(struct me_list *, me_hashtbl) = NULL; +VNET_DEFINE_STATIC(struct me_list *, me_srchashtbl) = NULL; #define V_me_hashtbl VNET(me_hashtbl) +#define V_me_srchashtbl VNET(me_srchashtbl) #define ME_HASH(src, dst) (V_me_hashtbl[\ me_hashval((src), (dst)) & (ME_HASH_SIZE - 1)]) +#define ME_SRCHASH(src) (V_me_srchashtbl[\ + fnv_32_buf(&(src), sizeof(src), FNV1_32_INIT) & (ME_HASH_SIZE - 1)]) static struct sx me_ioctl_sx; SX_SYSINIT(me_ioctl_sx, &me_ioctl_sx, "me_ioctl"); @@ -155,6 +161,7 @@ me_hashinit(void) static void vnet_me_init(const void *unused __unused) { + V_me_cloner = if_clone_simple(mename, me_clone_create, me_clone_destroy, 0); } @@ -165,8 +172,12 @@ static void vnet_me_uninit(const void *unused __unused) { - if (V_me_hashtbl != NULL) + if (V_me_hashtbl != NULL) { free(V_me_hashtbl, M_IFME); + V_me_hashtbl = NULL; + ME_WAIT(); + free(V_me_srchashtbl, M_IFME); + } if_clone_detach(V_me_cloner); } VNET_SYSUNINIT(vnet_me_uninit, SI_SUB_PROTO_IFATTACHDOMAIN, SI_ORDER_ANY, @@ -330,6 +341,44 @@ me_lookup(const struct mbuf *m, int off, int proto, vo return (0); } +/* + * Check that ingress address belongs to local host. + */ +static void +me_set_running(struct me_softc *sc) +{ + + if (in_localip(sc->me_src)) + ME2IFP(sc)->if_drv_flags |= IFF_DRV_RUNNING; + else + ME2IFP(sc)->if_drv_flags &= ~IFF_DRV_RUNNING; +} + +/* + * ifaddr_event handler. + * Clear IFF_DRV_RUNNING flag when ingress address disappears to prevent + * source address spoofing. + */ +static void +me_srcaddr(void *arg __unused, const struct sockaddr *sa, + int event __unused) +{ + const struct sockaddr_in *sin; + struct me_softc *sc; + + /* Check that VNET is ready */ + if (V_me_hashtbl == NULL) + return; + + MPASS(in_epoch(net_epoch_preempt)); + sin = (const struct sockaddr_in *)sa; + CK_LIST_FOREACH(sc, &ME_SRCHASH(sin->sin_addr.s_addr), srchash) { + if (sc->me_src.s_addr != sin->sin_addr.s_addr) + continue; + me_set_running(sc); + } +} + static int me_set_tunnel(struct me_softc *sc, in_addr_t src, in_addr_t dst) { @@ -337,8 +386,10 @@ me_set_tunnel(struct me_softc *sc, in_addr_t src, in_a sx_assert(&me_ioctl_sx, SA_XLOCKED); - if (V_me_hashtbl == NULL) + if (V_me_hashtbl == NULL) { V_me_hashtbl = me_hashinit(); + V_me_srchashtbl = me_hashinit(); + } if (sc->me_src.s_addr == src && sc->me_dst.s_addr == dst) return (0); @@ -355,8 +406,9 @@ me_set_tunnel(struct me_softc *sc, in_addr_t src, in_a sc->me_dst.s_addr = dst; sc->me_src.s_addr = src; CK_LIST_INSERT_HEAD(&ME_HASH(src, dst), sc, chain); + CK_LIST_INSERT_HEAD(&ME_SRCHASH(src), sc, srchash); - ME2IFP(sc)->if_drv_flags |= IFF_DRV_RUNNING; + me_set_running(sc); if_link_state_change(ME2IFP(sc), LINK_STATE_UP); return (0); } @@ -368,6 +420,7 @@ me_delete_tunnel(struct me_softc *sc) sx_assert(&me_ioctl_sx, SA_XLOCKED); if (ME_READY(sc)) { CK_LIST_REMOVE(sc, chain); + CK_LIST_REMOVE(sc, srchash); ME_WAIT(); sc->me_src.s_addr = 0; @@ -473,6 +526,7 @@ me_output(struct ifnet *ifp, struct mbuf *m, const str static int me_transmit(struct ifnet *ifp, struct mbuf *m) { + ME_RLOCK_TRACKER; struct mobhdr mh; struct me_softc *sc; struct ip *ip; @@ -490,6 +544,7 @@ me_transmit(struct ifnet *ifp, struct mbuf *m) if (sc == NULL || !ME_READY(sc) || (ifp->if_flags & IFF_MONITOR) != 0 || (ifp->if_flags & IFF_UP) == 0 || + (ifp->if_drv_flags & IFF_DRV_RUNNING) == 0 || (error = if_tunnel_check_nesting(ifp, m, MTAG_ME, V_max_me_nesting)) != 0) { m_freem(m); @@ -567,6 +622,7 @@ me_qflush(struct ifnet *ifp __unused) } +static const struct srcaddrtab *me_srcaddrtab = NULL; static const struct encaptab *ecookie = NULL; static const struct encap_config me_encap_cfg = { .proto = IPPROTO_MOBILE, @@ -583,10 +639,13 @@ memodevent(module_t mod, int type, void *data) switch (type) { case MOD_LOAD: + me_srcaddrtab = ip_encap_register_srcaddr(me_srcaddr, + NULL, M_WAITOK); ecookie = ip_encap_attach(&me_encap_cfg, NULL, M_WAITOK); break; case MOD_UNLOAD: ip_encap_detach(ecookie); + ip_encap_unregister_srcaddr(me_srcaddrtab); break; default: return (EOPNOTSUPP); Modified: stable/12/sys/netinet/in_gif.c ============================================================================== --- stable/12/sys/netinet/in_gif.c Sun Nov 18 00:11:19 2018 (r340534) +++ stable/12/sys/netinet/in_gif.c Sun Nov 18 00:17:06 2018 (r340535) @@ -82,12 +82,16 @@ SYSCTL_INT(_net_inet_ip, IPCTL_GIF_TTL, gifttl, CTLFLA * Interfaces with GIF_IGNORE_SOURCE flag are linked into plain list. */ VNET_DEFINE_STATIC(struct gif_list *, ipv4_hashtbl) = NULL; +VNET_DEFINE_STATIC(struct gif_list *, ipv4_srchashtbl) = NULL; VNET_DEFINE_STATIC(struct gif_list, ipv4_list) = CK_LIST_HEAD_INITIALIZER(); #define V_ipv4_hashtbl VNET(ipv4_hashtbl) +#define V_ipv4_srchashtbl VNET(ipv4_srchashtbl) #define V_ipv4_list VNET(ipv4_list) #define GIF_HASH(src, dst) (V_ipv4_hashtbl[\ in_gif_hashval((src), (dst)) & (GIF_HASH_SIZE - 1)]) +#define GIF_SRCHASH(src) (V_ipv4_srchashtbl[\ + fnv_32_buf(&(src), sizeof(src), FNV1_32_INIT) & (GIF_HASH_SIZE - 1)]) #define GIF_HASH_SC(sc) GIF_HASH((sc)->gif_iphdr->ip_src.s_addr,\ (sc)->gif_iphdr->ip_dst.s_addr) static uint32_t @@ -119,7 +123,45 @@ in_gif_checkdup(const struct gif_softc *sc, in_addr_t return (0); } +/* + * Check that ingress address belongs to local host. + */ static void +in_gif_set_running(struct gif_softc *sc) +{ + + if (in_localip(sc->gif_iphdr->ip_src)) + GIF2IFP(sc)->if_drv_flags |= IFF_DRV_RUNNING; + else + GIF2IFP(sc)->if_drv_flags &= ~IFF_DRV_RUNNING; +} + +/* + * ifaddr_event handler. + * Clear IFF_DRV_RUNNING flag when ingress address disappears to prevent + * source address spoofing. + */ +static void +in_gif_srcaddr(void *arg __unused, const struct sockaddr *sa, + int event __unused) +{ + const struct sockaddr_in *sin; + struct gif_softc *sc; + + /* Check that VNET is ready */ + if (V_ipv4_hashtbl == NULL) + return; + + MPASS(in_epoch(net_epoch_preempt)); + sin = (const struct sockaddr_in *)sa; + CK_LIST_FOREACH(sc, &GIF_SRCHASH(sin->sin_addr.s_addr), srchash) { + if (sc->gif_iphdr->ip_src.s_addr != sin->sin_addr.s_addr) + continue; + in_gif_set_running(sc); + } +} + +static void in_gif_attach(struct gif_softc *sc) { @@ -127,6 +169,9 @@ in_gif_attach(struct gif_softc *sc) CK_LIST_INSERT_HEAD(&V_ipv4_list, sc, chain); else CK_LIST_INSERT_HEAD(&GIF_HASH_SC(sc), sc, chain); + + CK_LIST_INSERT_HEAD(&GIF_SRCHASH(sc->gif_iphdr->ip_src.s_addr), + sc, srchash); } int @@ -139,6 +184,7 @@ in_gif_setopts(struct gif_softc *sc, u_int options) if ((options & GIF_IGNORE_SOURCE) != (sc->gif_options & GIF_IGNORE_SOURCE)) { + CK_LIST_REMOVE(sc, srchash); CK_LIST_REMOVE(sc, chain); sc->gif_options = options; in_gif_attach(sc); @@ -172,8 +218,10 @@ in_gif_ioctl(struct gif_softc *sc, u_long cmd, caddr_t error = EADDRNOTAVAIL; break; } - if (V_ipv4_hashtbl == NULL) + if (V_ipv4_hashtbl == NULL) { V_ipv4_hashtbl = gif_hashinit(); + V_ipv4_srchashtbl = gif_hashinit(); + } error = in_gif_checkdup(sc, src->sin_addr.s_addr, dst->sin_addr.s_addr); if (error == EADDRNOTAVAIL) @@ -188,6 +236,7 @@ in_gif_ioctl(struct gif_softc *sc, u_long cmd, caddr_t ip->ip_dst.s_addr = dst->sin_addr.s_addr; if (sc->gif_family != 0) { /* Detach existing tunnel first */ + CK_LIST_REMOVE(sc, srchash); CK_LIST_REMOVE(sc, chain); GIF_WAIT(); free(sc->gif_hdr, M_GIF); @@ -196,6 +245,7 @@ in_gif_ioctl(struct gif_softc *sc, u_long cmd, caddr_t sc->gif_family = AF_INET; sc->gif_iphdr = ip; in_gif_attach(sc); + in_gif_set_running(sc); break; case SIOCGIFPSRCADDR: case SIOCGIFPDSTADDR: @@ -342,6 +392,7 @@ done: return (ret); } +static const struct srcaddrtab *ipv4_srcaddrtab; static struct { const struct encap_config encap; const struct encaptab *cookie; @@ -387,6 +438,9 @@ in_gif_init(void) if (!IS_DEFAULT_VNET(curvnet)) return; + + ipv4_srcaddrtab = ip_encap_register_srcaddr(in_gif_srcaddr, + NULL, M_WAITOK); for (i = 0; i < nitems(ipv4_encap_cfg); i++) ipv4_encap_cfg[i].cookie = ip_encap_attach( &ipv4_encap_cfg[i].encap, NULL, M_WAITOK); @@ -400,8 +454,13 @@ in_gif_uninit(void) if (IS_DEFAULT_VNET(curvnet)) { for (i = 0; i < nitems(ipv4_encap_cfg); i++) ip_encap_detach(ipv4_encap_cfg[i].cookie); + ip_encap_unregister_srcaddr(ipv4_srcaddrtab); } - if (V_ipv4_hashtbl != NULL) + if (V_ipv4_hashtbl != NULL) { gif_hashdestroy(V_ipv4_hashtbl); + V_ipv4_hashtbl = NULL; + GIF_WAIT(); + gif_hashdestroy(V_ipv4_srchashtbl); + } } Modified: stable/12/sys/netinet/ip_gre.c ============================================================================== --- stable/12/sys/netinet/ip_gre.c Sun Nov 18 00:11:19 2018 (r340534) +++ stable/12/sys/netinet/ip_gre.c Sun Nov 18 00:17:06 2018 (r340535) @@ -75,9 +75,13 @@ SYSCTL_INT(_net_inet_ip, OID_AUTO, grettl, CTLFLAG_VNE &VNET_NAME(ip_gre_ttl), 0, "Default TTL value for encapsulated packets"); VNET_DEFINE_STATIC(struct gre_list *, ipv4_hashtbl) = NULL; +VNET_DEFINE_STATIC(struct gre_list *, ipv4_srchashtbl) = NULL; #define V_ipv4_hashtbl VNET(ipv4_hashtbl) +#define V_ipv4_srchashtbl VNET(ipv4_srchashtbl) #define GRE_HASH(src, dst) (V_ipv4_hashtbl[\ in_gre_hashval((src), (dst)) & (GRE_HASH_SIZE - 1)]) +#define GRE_SRCHASH(src) (V_ipv4_srchashtbl[\ + fnv_32_buf(&(src), sizeof(src), FNV1_32_INIT) & (GRE_HASH_SIZE - 1)]) #define GRE_HASH_SC(sc) GRE_HASH((sc)->gre_oip.ip_src.s_addr,\ (sc)->gre_oip.ip_dst.s_addr) @@ -138,7 +142,45 @@ in_gre_lookup(const struct mbuf *m, int off, int proto return (0); } +/* + * Check that ingress address belongs to local host. + */ static void +in_gre_set_running(struct gre_softc *sc) +{ + + if (in_localip(sc->gre_oip.ip_src)) + GRE2IFP(sc)->if_drv_flags |= IFF_DRV_RUNNING; + else + GRE2IFP(sc)->if_drv_flags &= ~IFF_DRV_RUNNING; +} + +/* + * ifaddr_event handler. + * Clear IFF_DRV_RUNNING flag when ingress address disappears to prevent + * source address spoofing. + */ +static void +in_gre_srcaddr(void *arg __unused, const struct sockaddr *sa, + int event __unused) +{ + const struct sockaddr_in *sin; + struct gre_softc *sc; + + /* Check that VNET is ready */ + if (V_ipv4_hashtbl == NULL) + return; + + MPASS(in_epoch(net_epoch_preempt)); + sin = (const struct sockaddr_in *)sa; + CK_LIST_FOREACH(sc, &GRE_SRCHASH(sin->sin_addr.s_addr), srchash) { + if (sc->gre_oip.ip_src.s_addr != sin->sin_addr.s_addr) + continue; + in_gre_set_running(sc); + } +} + +static void in_gre_attach(struct gre_softc *sc) { @@ -148,6 +190,8 @@ in_gre_attach(struct gre_softc *sc) sc->gre_oip.ip_p = IPPROTO_GRE; gre_updatehdr(sc, &sc->gre_gihdr->gi_gre); CK_LIST_INSERT_HEAD(&GRE_HASH_SC(sc), sc, chain); + CK_LIST_INSERT_HEAD(&GRE_SRCHASH(sc->gre_oip.ip_src.s_addr), + sc, srchash); } void @@ -159,6 +203,7 @@ in_gre_setopts(struct gre_softc *sc, u_long cmd, uint3 /* NOTE: we are protected with gre_ioctl_sx lock */ MPASS(sc->gre_family == AF_INET); CK_LIST_REMOVE(sc, chain); + CK_LIST_REMOVE(sc, srchash); GRE_WAIT(); if (cmd == GRESKEY) sc->gre_key = value; @@ -193,8 +238,10 @@ in_gre_ioctl(struct gre_softc *sc, u_long cmd, caddr_t error = EADDRNOTAVAIL; break; } - if (V_ipv4_hashtbl == NULL) + if (V_ipv4_hashtbl == NULL) { V_ipv4_hashtbl = gre_hashinit(); + V_ipv4_srchashtbl = gre_hashinit(); + } error = in_gre_checkdup(sc, src->sin_addr.s_addr, dst->sin_addr.s_addr); if (error == EADDRNOTAVAIL) @@ -211,6 +258,7 @@ in_gre_ioctl(struct gre_softc *sc, u_long cmd, caddr_t if (sc->gre_family != 0) { /* Detach existing tunnel first */ CK_LIST_REMOVE(sc, chain); + CK_LIST_REMOVE(sc, srchash); GRE_WAIT(); free(sc->gre_hdr, M_GRE); /* XXX: should we notify about link state change? */ @@ -220,6 +268,7 @@ in_gre_ioctl(struct gre_softc *sc, u_long cmd, caddr_t sc->gre_oseq = 0; sc->gre_iseq = UINT32_MAX; in_gre_attach(sc); + in_gre_set_running(sc); break; case SIOCGIFPSRCADDR: case SIOCGIFPDSTADDR: @@ -271,6 +320,7 @@ in_gre_output(struct mbuf *m, int af, int hlen) return (ip_output(m, NULL, NULL, IP_FORWARDING, NULL, NULL)); } +static const struct srcaddrtab *ipv4_srcaddrtab = NULL; static const struct encaptab *ecookie = NULL; static const struct encap_config ipv4_encap_cfg = { .proto = IPPROTO_GRE, @@ -286,6 +336,8 @@ in_gre_init(void) if (!IS_DEFAULT_VNET(curvnet)) return; + ipv4_srcaddrtab = ip_encap_register_srcaddr(in_gre_srcaddr, + NULL, M_WAITOK); ecookie = ip_encap_attach(&ipv4_encap_cfg, NULL, M_WAITOK); } @@ -293,8 +345,14 @@ void in_gre_uninit(void) { - if (IS_DEFAULT_VNET(curvnet)) + if (IS_DEFAULT_VNET(curvnet)) { ip_encap_detach(ecookie); - if (V_ipv4_hashtbl != NULL) + ip_encap_unregister_srcaddr(ipv4_srcaddrtab); + } + if (V_ipv4_hashtbl != NULL) { gre_hashdestroy(V_ipv4_hashtbl); + V_ipv4_hashtbl = NULL; + GRE_WAIT(); + gre_hashdestroy(V_ipv4_srchashtbl); + } } Modified: stable/12/sys/netinet6/in6_gif.c ============================================================================== --- stable/12/sys/netinet6/in6_gif.c Sun Nov 18 00:11:19 2018 (r340534) +++ stable/12/sys/netinet6/in6_gif.c Sun Nov 18 00:17:06 2018 (r340535) @@ -87,12 +87,16 @@ SYSCTL_INT(_net_inet6_ip6, IPV6CTL_GIF_HLIM, gifhlim, * Interfaces with GIF_IGNORE_SOURCE flag are linked into plain list. */ VNET_DEFINE_STATIC(struct gif_list *, ipv6_hashtbl) = NULL; +VNET_DEFINE_STATIC(struct gif_list *, ipv6_srchashtbl) = NULL; VNET_DEFINE_STATIC(struct gif_list, ipv6_list) = CK_LIST_HEAD_INITIALIZER(); #define V_ipv6_hashtbl VNET(ipv6_hashtbl) +#define V_ipv6_srchashtbl VNET(ipv6_srchashtbl) #define V_ipv6_list VNET(ipv6_list) #define GIF_HASH(src, dst) (V_ipv6_hashtbl[\ in6_gif_hashval((src), (dst)) & (GIF_HASH_SIZE - 1)]) +#define GIF_SRCHASH(src) (V_ipv6_srchashtbl[\ + fnv_32_buf((src), sizeof(*src), FNV1_32_INIT) & (GIF_HASH_SIZE - 1)]) #define GIF_HASH_SC(sc) GIF_HASH(&(sc)->gif_ip6hdr->ip6_src,\ &(sc)->gif_ip6hdr->ip6_dst) static uint32_t @@ -125,7 +129,45 @@ in6_gif_checkdup(const struct gif_softc *sc, const str return (0); } +/* + * Check that ingress address belongs to local host. + */ static void +in6_gif_set_running(struct gif_softc *sc) +{ + + if (in6_localip(&sc->gif_ip6hdr->ip6_src)) + GIF2IFP(sc)->if_drv_flags |= IFF_DRV_RUNNING; + else + GIF2IFP(sc)->if_drv_flags &= ~IFF_DRV_RUNNING; +} + +/* + * ifaddr_event handler. + * Clear IFF_DRV_RUNNING flag when ingress address disappears to prevent + * source address spoofing. + */ +static void +in6_gif_srcaddr(void *arg __unused, const struct sockaddr *sa, int event) +{ + const struct sockaddr_in6 *sin; + struct gif_softc *sc; + + /* Check that VNET is ready */ + if (V_ipv6_hashtbl == NULL) + return; + + MPASS(in_epoch(net_epoch_preempt)); + sin = (const struct sockaddr_in6 *)sa; + CK_LIST_FOREACH(sc, &GIF_SRCHASH(&sin->sin6_addr), srchash) { + if (IN6_ARE_ADDR_EQUAL(&sc->gif_ip6hdr->ip6_src, + &sin->sin6_addr) == 0) + continue; + in6_gif_set_running(sc); + } +} + +static void in6_gif_attach(struct gif_softc *sc) { @@ -133,6 +175,9 @@ in6_gif_attach(struct gif_softc *sc) CK_LIST_INSERT_HEAD(&V_ipv6_list, sc, chain); else CK_LIST_INSERT_HEAD(&GIF_HASH_SC(sc), sc, chain); + + CK_LIST_INSERT_HEAD(&GIF_SRCHASH(&sc->gif_ip6hdr->ip6_src), + sc, srchash); } int @@ -145,6 +190,7 @@ in6_gif_setopts(struct gif_softc *sc, u_int options) if ((options & GIF_IGNORE_SOURCE) != (sc->gif_options & GIF_IGNORE_SOURCE)) { + CK_LIST_REMOVE(sc, srchash); CK_LIST_REMOVE(sc, chain); sc->gif_options = options; in6_gif_attach(sc); @@ -187,8 +233,10 @@ in6_gif_ioctl(struct gif_softc *sc, u_long cmd, caddr_ (error = sa6_embedscope(dst, 0)) != 0) break; - if (V_ipv6_hashtbl == NULL) + if (V_ipv6_hashtbl == NULL) { V_ipv6_hashtbl = gif_hashinit(); + V_ipv6_srchashtbl = gif_hashinit(); + } error = in6_gif_checkdup(sc, &src->sin6_addr, &dst->sin6_addr); if (error == EADDRNOTAVAIL) @@ -204,6 +252,7 @@ in6_gif_ioctl(struct gif_softc *sc, u_long cmd, caddr_ ip6->ip6_vfc = IPV6_VERSION; if (sc->gif_family != 0) { /* Detach existing tunnel first */ + CK_LIST_REMOVE(sc, srchash); CK_LIST_REMOVE(sc, chain); GIF_WAIT(); free(sc->gif_hdr, M_GIF); @@ -212,6 +261,7 @@ in6_gif_ioctl(struct gif_softc *sc, u_long cmd, caddr_ sc->gif_family = AF_INET6; sc->gif_ip6hdr = ip6; in6_gif_attach(sc); + in6_gif_set_running(sc); break; case SIOCGIFPSRCADDR_IN6: case SIOCGIFPDSTADDR_IN6: @@ -365,6 +415,7 @@ done: return (ret); } +static const struct srcaddrtab *ipv6_srcaddrtab; static struct { const struct encap_config encap; const struct encaptab *cookie; @@ -410,6 +461,9 @@ in6_gif_init(void) if (!IS_DEFAULT_VNET(curvnet)) return; + + ipv6_srcaddrtab = ip6_encap_register_srcaddr(in6_gif_srcaddr, + NULL, M_WAITOK); for (i = 0; i < nitems(ipv6_encap_cfg); i++) ipv6_encap_cfg[i].cookie = ip6_encap_attach( &ipv6_encap_cfg[i].encap, NULL, M_WAITOK); @@ -423,7 +477,12 @@ in6_gif_uninit(void) if (IS_DEFAULT_VNET(curvnet)) { for (i = 0; i < nitems(ipv6_encap_cfg); i++) ip6_encap_detach(ipv6_encap_cfg[i].cookie); + ip6_encap_unregister_srcaddr(ipv6_srcaddrtab); } - if (V_ipv6_hashtbl != NULL) + if (V_ipv6_hashtbl != NULL) { gif_hashdestroy(V_ipv6_hashtbl); + V_ipv6_hashtbl = NULL; + GIF_WAIT(); + gif_hashdestroy(V_ipv6_srchashtbl); + } } Modified: stable/12/sys/netinet6/ip6_gre.c ============================================================================== --- stable/12/sys/netinet6/ip6_gre.c Sun Nov 18 00:11:19 2018 (r340534) +++ stable/12/sys/netinet6/ip6_gre.c Sun Nov 18 00:17:06 2018 (r340535) @@ -66,9 +66,13 @@ SYSCTL_INT(_net_inet6_ip6, OID_AUTO, grehlim, CTLFLAG_ &VNET_NAME(ip6_gre_hlim), 0, "Default hop limit for encapsulated packets"); VNET_DEFINE_STATIC(struct gre_list *, ipv6_hashtbl) = NULL; +VNET_DEFINE_STATIC(struct gre_list *, ipv6_srchashtbl) = NULL; #define V_ipv6_hashtbl VNET(ipv6_hashtbl) +#define V_ipv6_srchashtbl VNET(ipv6_srchashtbl) #define GRE_HASH(src, dst) (V_ipv6_hashtbl[\ in6_gre_hashval((src), (dst)) & (GRE_HASH_SIZE - 1)]) +#define GRE_SRCHASH(src) (V_ipv6_srchashtbl[\ + fnv_32_buf((src), sizeof(*src), FNV1_32_INIT) & (GRE_HASH_SIZE - 1)]) #define GRE_HASH_SC(sc) GRE_HASH(&(sc)->gre_oip6.ip6_src,\ &(sc)->gre_oip6.ip6_dst) @@ -131,7 +135,46 @@ in6_gre_lookup(const struct mbuf *m, int off, int prot return (0); } +/* + * Check that ingress address belongs to local host. + */ static void +in6_gre_set_running(struct gre_softc *sc) +{ + + if (in6_localip(&sc->gre_oip6.ip6_src)) + GRE2IFP(sc)->if_drv_flags |= IFF_DRV_RUNNING; + else + GRE2IFP(sc)->if_drv_flags &= ~IFF_DRV_RUNNING; +} + +/* + * ifaddr_event handler. + * Clear IFF_DRV_RUNNING flag when ingress address disappears to prevent + * source address spoofing. + */ +static void +in6_gre_srcaddr(void *arg __unused, const struct sockaddr *sa, + int event __unused) +{ + const struct sockaddr_in6 *sin; + struct gre_softc *sc; + + /* Check that VNET is ready */ + if (V_ipv6_hashtbl == NULL) + return; + + MPASS(in_epoch(net_epoch_preempt)); + sin = (const struct sockaddr_in6 *)sa; + CK_LIST_FOREACH(sc, &GRE_SRCHASH(&sin->sin6_addr), srchash) { + if (IN6_ARE_ADDR_EQUAL(&sc->gre_oip6.ip6_src, + &sin->sin6_addr) == 0) + continue; + in6_gre_set_running(sc); + } +} + +static void in6_gre_attach(struct gre_softc *sc) { @@ -140,6 +183,7 @@ in6_gre_attach(struct gre_softc *sc) sc->gre_oip6.ip6_nxt = IPPROTO_GRE; gre_updatehdr(sc, &sc->gre_gi6hdr->gi6_gre); CK_LIST_INSERT_HEAD(&GRE_HASH_SC(sc), sc, chain); + CK_LIST_INSERT_HEAD(&GRE_SRCHASH(&sc->gre_oip6.ip6_src), sc, srchash); } void @@ -151,6 +195,7 @@ in6_gre_setopts(struct gre_softc *sc, u_long cmd, uint /* NOTE: we are protected with gre_ioctl_sx lock */ MPASS(sc->gre_family == AF_INET6); CK_LIST_REMOVE(sc, chain); + CK_LIST_REMOVE(sc, srchash); GRE_WAIT(); if (cmd == GRESKEY) sc->gre_key = value; @@ -194,8 +239,10 @@ in6_gre_ioctl(struct gre_softc *sc, u_long cmd, caddr_ (error = sa6_embedscope(dst, 0)) != 0) break; - if (V_ipv6_hashtbl == NULL) + if (V_ipv6_hashtbl == NULL) { V_ipv6_hashtbl = gre_hashinit(); + V_ipv6_srchashtbl = gre_hashinit(); + } error = in6_gre_checkdup(sc, &src->sin6_addr, &dst->sin6_addr); if (error == EADDRNOTAVAIL) @@ -212,6 +259,7 @@ in6_gre_ioctl(struct gre_softc *sc, u_long cmd, caddr_ if (sc->gre_family != 0) { /* Detach existing tunnel first */ CK_LIST_REMOVE(sc, chain); + CK_LIST_REMOVE(sc, srchash); GRE_WAIT(); free(sc->gre_hdr, M_GRE); /* XXX: should we notify about link state change? */ @@ -221,6 +269,7 @@ in6_gre_ioctl(struct gre_softc *sc, u_long cmd, caddr_ sc->gre_oseq = 0; sc->gre_iseq = UINT32_MAX; in6_gre_attach(sc); + in6_gre_set_running(sc); break; case SIOCGIFPSRCADDR_IN6: case SIOCGIFPDSTADDR_IN6: @@ -254,6 +303,7 @@ in6_gre_output(struct mbuf *m, int af __unused, int hl return (ip6_output(m, NULL, NULL, IPV6_MINMTU, NULL, NULL, NULL)); } +static const struct srcaddrtab *ipv6_srcaddrtab = NULL; static const struct encaptab *ecookie = NULL; static const struct encap_config ipv6_encap_cfg = { .proto = IPPROTO_GRE, @@ -274,6 +324,8 @@ in6_gre_init(void) if (!IS_DEFAULT_VNET(curvnet)) return; + ipv6_srcaddrtab = ip6_encap_register_srcaddr(in6_gre_srcaddr, + NULL, M_WAITOK); ecookie = ip6_encap_attach(&ipv6_encap_cfg, NULL, M_WAITOK); } @@ -281,8 +333,14 @@ void in6_gre_uninit(void) { - if (IS_DEFAULT_VNET(curvnet)) + if (IS_DEFAULT_VNET(curvnet)) { ip6_encap_detach(ecookie); - if (V_ipv6_hashtbl != NULL) + ip6_encap_unregister_srcaddr(ipv6_srcaddrtab); + } + if (V_ipv6_hashtbl != NULL) { gre_hashdestroy(V_ipv6_hashtbl); + V_ipv6_hashtbl = NULL; + GRE_WAIT(); + gre_hashdestroy(V_ipv6_srchashtbl); + } } From owner-svn-src-all@freebsd.org Sun Nov 18 00:22:02 2018 Return-Path: Delivered-To: svn-src-all@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 E1176110CB4F; Sun, 18 Nov 2018 00:22:01 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 96DDF88913; Sun, 18 Nov 2018 00:22:01 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 783BC3B31; Sun, 18 Nov 2018 00:22:01 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAI0M1lC087766; Sun, 18 Nov 2018 00:22:01 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAI0M10B087765; Sun, 18 Nov 2018 00:22:01 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201811180022.wAI0M10B087765@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Sun, 18 Nov 2018 00:22:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r340536 - stable/12/sys/net X-SVN-Group: stable-12 X-SVN-Commit-Author: ae X-SVN-Commit-Paths: stable/12/sys/net X-SVN-Commit-Revision: 340536 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 96DDF88913 X-Spamd-Result: default: False [-0.12 / 15.00]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.12)[-0.124,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Nov 2018 00:22:02 -0000 Author: ae Date: Sun Nov 18 00:22:01 2018 New Revision: 340536 URL: https://svnweb.freebsd.org/changeset/base/340536 Log: MFC r339554: Rework if_ipsec(4) to use epoch(9) instead of rmlock. * use CK_LIST and FNV hash to keep chains of softc; * read access to softc is protected by epoch(); * write access is protected by ipsec_ioctl_sx. Changing of softc fields is allowed only when softc is unlinked from CK_LIST chains. * linking/unlinking of softc is allowed only when ipsec_ioctl_sx is exclusive locked. * the plain LIST of all softc is replaced by hash table that uses ingress address of tunnels as a key. * added support for appearing/disappearing of ingress address handling. Now it is allowed configure non-local ingress IP address, and thus the problem with if_ipsec(4) configuration that happens on boot, when ingress address is not yet configured, is solved. Sponsored by: Yandex LLC Differential Revision: https://reviews.freebsd.org/D17190 MFC r339555: Follow the fix in r339532 (by glebius): Fix exiting an epoch(9) we never entered. May happen only with MAC. MFC r339642: Remove softc from idhash when interface is destroyed. MFC r339646: Add the check that current VNET is ready and access to srchash is allowed. ipsec_srcaddr() callback can be called during VNET teardown, since ingress address checking subsystem isn't VNET specific. And thus callback can make access to already freed memory. To prevent this, use V_ipsec_idhtbl pointer as indicator of VNET readiness. And make epoch_wait() after resetting it to NULL in vnet_ipsec_uninit() to be sure that ipsec_srcaddr() is finished its work. Reported by: kp Modified: stable/12/sys/net/if_ipsec.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/net/if_ipsec.c ============================================================================== --- stable/12/sys/net/if_ipsec.c Sun Nov 18 00:17:06 2018 (r340535) +++ stable/12/sys/net/if_ipsec.c Sun Nov 18 00:22:01 2018 (r340536) @@ -1,6 +1,6 @@ /*- - * Copyright (c) 2016 Yandex LLC - * Copyright (c) 2016 Andrey V. Elsukov + * Copyright (c) 2016-2018 Yandex LLC + * Copyright (c) 2016-2018 Andrey V. Elsukov * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -40,7 +40,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include @@ -61,6 +60,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -87,58 +87,72 @@ static const char ipsecname[] = "ipsec"; struct ipsec_softc { struct ifnet *ifp; - - struct rmlock lock; struct secpolicy *sp[IPSEC_SPCOUNT]; - uint32_t reqid; u_int family; u_int fibnum; - LIST_ENTRY(ipsec_softc) chain; - LIST_ENTRY(ipsec_softc) hash; + + CK_LIST_ENTRY(ipsec_softc) idhash; + CK_LIST_ENTRY(ipsec_softc) srchash; }; -#define IPSEC_LOCK_INIT(sc) rm_init(&(sc)->lock, "if_ipsec softc") -#define IPSEC_LOCK_DESTROY(sc) rm_destroy(&(sc)->lock) -#define IPSEC_RLOCK_TRACKER struct rm_priotracker ipsec_tracker -#define IPSEC_RLOCK(sc) rm_rlock(&(sc)->lock, &ipsec_tracker) -#define IPSEC_RUNLOCK(sc) rm_runlock(&(sc)->lock, &ipsec_tracker) -#define IPSEC_RLOCK_ASSERT(sc) rm_assert(&(sc)->lock, RA_RLOCKED) -#define IPSEC_WLOCK(sc) rm_wlock(&(sc)->lock) -#define IPSEC_WUNLOCK(sc) rm_wunlock(&(sc)->lock) -#define IPSEC_WLOCK_ASSERT(sc) rm_assert(&(sc)->lock, RA_WLOCKED) +#define IPSEC_RLOCK_TRACKER struct epoch_tracker ipsec_et +#define IPSEC_RLOCK() epoch_enter_preempt(net_epoch_preempt, &ipsec_et) +#define IPSEC_RUNLOCK() epoch_exit_preempt(net_epoch_preempt, &ipsec_et) +#define IPSEC_WAIT() epoch_wait_preempt(net_epoch_preempt) -static struct rmlock ipsec_sc_lock; -RM_SYSINIT(ipsec_sc_lock, &ipsec_sc_lock, "if_ipsec softc list"); +#ifndef IPSEC_HASH_SIZE +#define IPSEC_HASH_SIZE (1 << 5) +#endif -#define IPSEC_SC_RLOCK_TRACKER struct rm_priotracker ipsec_sc_tracker -#define IPSEC_SC_RLOCK() rm_rlock(&ipsec_sc_lock, &ipsec_sc_tracker) -#define IPSEC_SC_RUNLOCK() rm_runlock(&ipsec_sc_lock, &ipsec_sc_tracker) -#define IPSEC_SC_RLOCK_ASSERT() rm_assert(&ipsec_sc_lock, RA_RLOCKED) -#define IPSEC_SC_WLOCK() rm_wlock(&ipsec_sc_lock) -#define IPSEC_SC_WUNLOCK() rm_wunlock(&ipsec_sc_lock) -#define IPSEC_SC_WLOCK_ASSERT() rm_assert(&ipsec_sc_lock, RA_WLOCKED) +CK_LIST_HEAD(ipsec_iflist, ipsec_softc); +VNET_DEFINE_STATIC(struct ipsec_iflist *, ipsec_idhtbl) = NULL; +#define V_ipsec_idhtbl VNET(ipsec_idhtbl) -LIST_HEAD(ipsec_iflist, ipsec_softc); -VNET_DEFINE_STATIC(struct ipsec_iflist, ipsec_sc_list); -VNET_DEFINE_STATIC(struct ipsec_iflist *, ipsec_sc_htbl); -VNET_DEFINE_STATIC(u_long, ipsec_sc_hmask); -#define V_ipsec_sc_list VNET(ipsec_sc_list) -#define V_ipsec_sc_htbl VNET(ipsec_sc_htbl) -#define V_ipsec_sc_hmask VNET(ipsec_sc_hmask) +#ifdef INET +VNET_DEFINE_STATIC(struct ipsec_iflist *, ipsec4_srchtbl) = NULL; +#define V_ipsec4_srchtbl VNET(ipsec4_srchtbl) +static const struct srcaddrtab *ipsec4_srctab = NULL; +#endif -static uint32_t -ipsec_hash(uint32_t id) +#ifdef INET6 +VNET_DEFINE_STATIC(struct ipsec_iflist *, ipsec6_srchtbl) = NULL; +#define V_ipsec6_srchtbl VNET(ipsec6_srchtbl) +static const struct srcaddrtab *ipsec6_srctab = NULL; +#endif + +static struct ipsec_iflist * +ipsec_idhash(uint32_t id) { - return (fnv_32_buf(&id, sizeof(id), FNV1_32_INIT)); + return (&V_ipsec_idhtbl[fnv_32_buf(&id, sizeof(id), + FNV1_32_INIT) & (IPSEC_HASH_SIZE - 1)]); } -#define SCHASH_NHASH_LOG2 5 -#define SCHASH_NHASH (1 << SCHASH_NHASH_LOG2) -#define SCHASH_HASHVAL(id) (ipsec_hash((id)) & V_ipsec_sc_hmask) -#define SCHASH_HASH(id) &V_ipsec_sc_htbl[SCHASH_HASHVAL(id)] +static struct ipsec_iflist * +ipsec_srchash(const struct sockaddr *sa) +{ + uint32_t hval; + switch (sa->sa_family) { +#ifdef INET + case AF_INET: + hval = fnv_32_buf( + &((const struct sockaddr_in *)sa)->sin_addr.s_addr, + sizeof(in_addr_t), FNV1_32_INIT); + return (&V_ipsec4_srchtbl[hval & (IPSEC_HASH_SIZE - 1)]); +#endif +#ifdef INET6 + case AF_INET6: + hval = fnv_32_buf( + &((const struct sockaddr_in6 *)sa)->sin6_addr, + sizeof(struct in6_addr), FNV1_32_INIT); + return (&V_ipsec6_srchtbl[hval & (IPSEC_HASH_SIZE - 1)]); +#endif + } + return (NULL); +} + /* * ipsec_ioctl_sx protects from concurrent ioctls. */ @@ -148,12 +162,14 @@ SX_SYSINIT(ipsec_ioctl_sx, &ipsec_ioctl_sx, "ipsec_ioc static int ipsec_init_reqid(struct ipsec_softc *); static int ipsec_set_tunnel(struct ipsec_softc *, struct sockaddr *, struct sockaddr *, uint32_t); -static void ipsec_delete_tunnel(struct ifnet *, int); +static void ipsec_delete_tunnel(struct ipsec_softc *); static int ipsec_set_addresses(struct ifnet *, struct sockaddr *, struct sockaddr *); -static int ipsec_set_reqid(struct ifnet *, uint32_t); +static int ipsec_set_reqid(struct ipsec_softc *, uint32_t); +static void ipsec_set_running(struct ipsec_softc *); +static void ipsec_srcaddr(void *, const struct sockaddr *, int); static int ipsec_ioctl(struct ifnet *, u_long, caddr_t); static int ipsec_transmit(struct ifnet *, struct mbuf *); static int ipsec_output(struct ifnet *, struct mbuf *, @@ -174,7 +190,6 @@ ipsec_clone_create(struct if_clone *ifc, int unit, cad sc = malloc(sizeof(*sc), M_IPSEC, M_WAITOK | M_ZERO); sc->fibnum = curthread->td_proc->p_fibnum; sc->ifp = ifp = if_alloc(IFT_TUNNEL); - IPSEC_LOCK_INIT(sc); ifp->if_softc = sc; if_initname(ifp, ipsecname, unit); @@ -188,9 +203,6 @@ ipsec_clone_create(struct if_clone *ifc, int unit, cad if_attach(ifp); bpfattach(ifp, DLT_NULL, sizeof(uint32_t)); - IPSEC_SC_WLOCK(); - LIST_INSERT_HEAD(&V_ipsec_sc_list, sc, chain); - IPSEC_SC_WUNLOCK(); return (0); } @@ -201,28 +213,54 @@ ipsec_clone_destroy(struct ifnet *ifp) sx_xlock(&ipsec_ioctl_sx); sc = ifp->if_softc; - - IPSEC_SC_WLOCK(); - ipsec_delete_tunnel(ifp, 1); - LIST_REMOVE(sc, chain); - IPSEC_SC_WUNLOCK(); - + ipsec_delete_tunnel(sc); + /* + * Delete softc from idhash on interface destroy, since + * ipsec_delete_tunnel() keeps reqid unchanged. + */ + if (sc->reqid != 0) + CK_LIST_REMOVE(sc, idhash); bpfdetach(ifp); if_detach(ifp); ifp->if_softc = NULL; sx_xunlock(&ipsec_ioctl_sx); + IPSEC_WAIT(); if_free(ifp); - IPSEC_LOCK_DESTROY(sc); free(sc, M_IPSEC); } +static struct ipsec_iflist * +ipsec_hashinit(void) +{ + struct ipsec_iflist *hash; + int i; + + hash = malloc(sizeof(struct ipsec_iflist) * IPSEC_HASH_SIZE, + M_IPSEC, M_WAITOK); + for (i = 0; i < IPSEC_HASH_SIZE; i++) + CK_LIST_INIT(&hash[i]); + + return (hash); +} + static void vnet_ipsec_init(const void *unused __unused) { - LIST_INIT(&V_ipsec_sc_list); - V_ipsec_sc_htbl = hashinit(SCHASH_NHASH, M_IPSEC, &V_ipsec_sc_hmask); + V_ipsec_idhtbl = ipsec_hashinit(); +#ifdef INET + V_ipsec4_srchtbl = ipsec_hashinit(); + if (IS_DEFAULT_VNET(curvnet)) + ipsec4_srctab = ip_encap_register_srcaddr(ipsec_srcaddr, + NULL, M_WAITOK); +#endif +#ifdef INET6 + V_ipsec6_srchtbl = ipsec_hashinit(); + if (IS_DEFAULT_VNET(curvnet)) + ipsec6_srctab = ip6_encap_register_srcaddr(ipsec_srcaddr, + NULL, M_WAITOK); +#endif V_ipsec_cloner = if_clone_simple(ipsecname, ipsec_clone_create, ipsec_clone_destroy, 0); } @@ -234,7 +272,24 @@ vnet_ipsec_uninit(const void *unused __unused) { if_clone_detach(V_ipsec_cloner); - hashdestroy(V_ipsec_sc_htbl, M_IPSEC, V_ipsec_sc_hmask); + free(V_ipsec_idhtbl, M_IPSEC); + /* + * Use V_ipsec_idhtbl pointer as indicator that VNET is going to be + * destroyed, it is used by ipsec_srcaddr() callback. + */ + V_ipsec_idhtbl = NULL; + IPSEC_WAIT(); + +#ifdef INET + if (IS_DEFAULT_VNET(curvnet)) + ip_encap_unregister_srcaddr(ipsec4_srctab); + free(V_ipsec4_srchtbl, M_IPSEC); +#endif +#ifdef INET6 + if (IS_DEFAULT_VNET(curvnet)) + ip6_encap_unregister_srcaddr(ipsec6_srctab); + free(V_ipsec6_srchtbl, M_IPSEC); +#endif } VNET_SYSUNINIT(vnet_ipsec_uninit, SI_SUB_PROTO_IFATTACHDOMAIN, SI_ORDER_ANY, vnet_ipsec_uninit, NULL); @@ -281,6 +336,7 @@ ipsec_transmit(struct ifnet *ifp, struct mbuf *m) uint32_t af; int error; + IPSEC_RLOCK(); #ifdef MAC error = mac_ifnet_check_transmit(ifp, m); if (error) { @@ -292,7 +348,7 @@ ipsec_transmit(struct ifnet *ifp, struct mbuf *m) sc = ifp->if_softc; if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0 || (ifp->if_flags & IFF_MONITOR) != 0 || - (ifp->if_flags & IFF_UP) == 0) { + (ifp->if_flags & IFF_UP) == 0 || sc->family == 0) { m_freem(m); goto err; } @@ -327,16 +383,9 @@ ipsec_transmit(struct ifnet *ifp, struct mbuf *m) goto err; } - IPSEC_RLOCK(sc); - if (sc->family == 0) { - IPSEC_RUNLOCK(sc); - m_freem(m); - goto err; - } sp = ipsec_getpolicy(sc, IPSEC_DIR_OUTBOUND, af); key_addref(sp); M_SETFIB(m, sc->fibnum); - IPSEC_RUNLOCK(sc); BPF_MTAP2(ifp, &af, sizeof(af), m); if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1); @@ -359,6 +408,7 @@ ipsec_transmit(struct ifnet *ifp, struct mbuf *m) err: if (error != 0) if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); + IPSEC_RUNLOCK(); return (error); } @@ -379,7 +429,7 @@ ipsec_output(struct ifnet *ifp, struct mbuf *m, const int ipsec_if_input(struct mbuf *m, struct secasvar *sav, uint32_t af) { - IPSEC_SC_RLOCK_TRACKER; + IPSEC_RLOCK_TRACKER; struct secasindex *saidx; struct ipsec_softc *sc; struct ifnet *ifp; @@ -394,13 +444,10 @@ ipsec_if_input(struct mbuf *m, struct secasvar *sav, u sav->sah->saidx.proto != IPPROTO_ESP) return (0); - IPSEC_SC_RLOCK(); - /* - * We only acquire SC_RLOCK() while we are doing search in - * ipsec_sc_htbl. It is safe, because removing softc or changing - * of reqid/addresses requires removing from hash table. - */ - LIST_FOREACH(sc, SCHASH_HASH(sav->sah->saidx.reqid), hash) { + IPSEC_RLOCK(); + CK_LIST_FOREACH(sc, ipsec_idhash(sav->sah->saidx.reqid), idhash) { + if (sc->family == 0) + continue; saidx = ipsec_getsaidx(sc, IPSEC_DIR_INBOUND, sav->sah->saidx.src.sa.sa_family); /* SA's reqid should match reqid in SP */ @@ -416,14 +463,14 @@ ipsec_if_input(struct mbuf *m, struct secasvar *sav, u break; } if (sc == NULL) { - IPSEC_SC_RUNLOCK(); + IPSEC_RUNLOCK(); /* Tunnel was not found. Nothing to do. */ return (0); } ifp = sc->ifp; if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0 || (ifp->if_flags & IFF_UP) == 0) { - IPSEC_SC_RUNLOCK(); + IPSEC_RUNLOCK(); m_freem(m); return (ENETDOWN); } @@ -432,7 +479,6 @@ ipsec_if_input(struct mbuf *m, struct secasvar *sav, u * Set its ifnet as receiving interface. */ m->m_pkthdr.rcvif = ifp; - IPSEC_SC_RUNLOCK(); m_clrprotoflags(m); M_SETFIB(m, ifp->if_fib); @@ -440,17 +486,17 @@ ipsec_if_input(struct mbuf *m, struct secasvar *sav, u if_inc_counter(ifp, IFCOUNTER_IPACKETS, 1); if_inc_counter(ifp, IFCOUNTER_IBYTES, m->m_pkthdr.len); if ((ifp->if_flags & IFF_MONITOR) != 0) { + IPSEC_RUNLOCK(); m_freem(m); return (ENETDOWN); } + IPSEC_RUNLOCK(); return (0); } -/* XXX how should we handle IPv6 scope on SIOC[GS]IFPHYADDR? */ -int +static int ipsec_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) { - IPSEC_RLOCK_TRACKER; struct ifreq *ifr = (struct ifreq*)data; struct sockaddr *dst, *src; struct ipsec_softc *sc; @@ -564,9 +610,10 @@ ipsec_ioctl(struct ifnet *ifp, u_long cmd, caddr_t dat #endif #ifdef INET6 case AF_INET6: - if (IN6_IS_ADDR_UNSPECIFIED(&satosin6(src)->sin6_addr) - || - IN6_IS_ADDR_UNSPECIFIED(&satosin6(dst)->sin6_addr)) + if (IN6_IS_ADDR_UNSPECIFIED( + &satosin6(src)->sin6_addr) || + IN6_IS_ADDR_UNSPECIFIED( + &satosin6(dst)->sin6_addr)) goto bad; /* * Check validity of the scope zone ID of the @@ -584,7 +631,7 @@ ipsec_ioctl(struct ifnet *ifp, u_long cmd, caddr_t dat error = ipsec_set_addresses(ifp, src, dst); break; case SIOCDIFPHYADDR: - ipsec_delete_tunnel(ifp, 0); + ipsec_delete_tunnel(sc); break; case SIOCGIFPSRCADDR: case SIOCGIFPDSTADDR: @@ -592,9 +639,7 @@ ipsec_ioctl(struct ifnet *ifp, u_long cmd, caddr_t dat case SIOCGIFPSRCADDR_IN6: case SIOCGIFPDSTADDR_IN6: #endif - IPSEC_RLOCK(sc); if (sc->family == 0) { - IPSEC_RUNLOCK(sc); error = EADDRNOTAVAIL; break; } @@ -650,7 +695,6 @@ ipsec_ioctl(struct ifnet *ifp, u_long cmd, caddr_t dat #endif } } - IPSEC_RUNLOCK(sc); if (error != 0) break; switch (cmd) { @@ -696,7 +740,7 @@ ipsec_ioctl(struct ifnet *ifp, u_long cmd, caddr_t dat error = copyin(ifr_data_get_ptr(ifr), &reqid, sizeof(reqid)); if (error != 0) break; - error = ipsec_set_reqid(ifp, reqid); + error = ipsec_set_reqid(sc, reqid); break; default: error = EINVAL; @@ -708,6 +752,63 @@ bad: } /* + * Check that ingress address belongs to local host. + */ +static void +ipsec_set_running(struct ipsec_softc *sc) +{ + struct secasindex *saidx; + int localip; + + saidx = ipsec_getsaidx(sc, IPSEC_DIR_OUTBOUND, sc->family); + localip = 0; + switch (sc->family) { +#ifdef INET + case AF_INET: + localip = in_localip(saidx->src.sin.sin_addr); + break; +#endif +#ifdef INET6 + case AF_INET6: + localip = in6_localip(&saidx->src.sin6.sin6_addr); + break; +#endif + } + if (localip != 0) + sc->ifp->if_drv_flags |= IFF_DRV_RUNNING; + else + sc->ifp->if_drv_flags &= ~IFF_DRV_RUNNING; +} + +/* + * ifaddr_event handler. + * Clear IFF_DRV_RUNNING flag when ingress address disappears to prevent + * source address spoofing. + */ +static void +ipsec_srcaddr(void *arg __unused, const struct sockaddr *sa, + int event __unused) +{ + struct ipsec_softc *sc; + struct secasindex *saidx; + + /* Check that VNET is ready */ + if (V_ipsec_idhtbl == NULL) + return; + + MPASS(in_epoch(net_epoch_preempt)); + CK_LIST_FOREACH(sc, ipsec_srchash(sa), srchash) { + if (sc->family == 0) + continue; + saidx = ipsec_getsaidx(sc, IPSEC_DIR_OUTBOUND, sa->sa_family); + if (saidx == NULL || + key_sockaddrcmp(&saidx->src.sa, sa, 0) != 0) + continue; + ipsec_set_running(sc); + } +} + +/* * Allocate new private security policies for tunneling interface. * Each tunneling interface has following security policies for * both AF: @@ -779,8 +880,8 @@ ipsec_check_reqid(uint32_t reqid) { struct ipsec_softc *sc; - IPSEC_SC_RLOCK_ASSERT(); - LIST_FOREACH(sc, &V_ipsec_sc_list, chain) { + sx_assert(&ipsec_ioctl_sx, SA_XLOCKED); + CK_LIST_FOREACH(sc, ipsec_idhash(reqid), idhash) { if (sc->reqid == reqid) return (EEXIST); } @@ -800,8 +901,7 @@ ipsec_init_reqid(struct ipsec_softc *sc) uint32_t reqid; int trycount; - IPSEC_SC_RLOCK_ASSERT(); - + sx_assert(&ipsec_ioctl_sx, SA_XLOCKED); if (sc->reqid != 0) /* already initialized */ return (0); @@ -814,6 +914,7 @@ ipsec_init_reqid(struct ipsec_softc *sc) if (trycount == 0) return (EEXIST); sc->reqid = reqid; + CK_LIST_INSERT_HEAD(ipsec_idhash(reqid), sc, idhash); return (0); } @@ -824,34 +925,30 @@ ipsec_init_reqid(struct ipsec_softc *sc) * Also softc would not disappear while we hold ioctl_sx lock. */ static int -ipsec_set_reqid(struct ifnet *ifp, uint32_t reqid) +ipsec_set_reqid(struct ipsec_softc *sc, uint32_t reqid) { - IPSEC_SC_RLOCK_TRACKER; - struct ipsec_softc *sc; struct secasindex *saidx; sx_assert(&ipsec_ioctl_sx, SA_XLOCKED); - sc = ifp->if_softc; if (sc->reqid == reqid && reqid != 0) return (0); - IPSEC_SC_RLOCK(); if (reqid != 0) { /* Check that specified reqid doesn't exist */ - if (ipsec_check_reqid(reqid) != 0) { - IPSEC_SC_RUNLOCK(); + if (ipsec_check_reqid(reqid) != 0) return (EEXIST); + if (sc->reqid != 0) { + CK_LIST_REMOVE(sc, idhash); + IPSEC_WAIT(); } sc->reqid = reqid; + CK_LIST_INSERT_HEAD(ipsec_idhash(reqid), sc, idhash); } else { /* Generate new reqid */ - if (ipsec_init_reqid(sc) != 0) { - IPSEC_SC_RUNLOCK(); + if (ipsec_init_reqid(sc) != 0) return (EEXIST); - } } - IPSEC_SC_RUNLOCK(); /* Tunnel isn't fully configured, just return. */ if (sc->family == 0) @@ -871,7 +968,6 @@ static int ipsec_set_addresses(struct ifnet *ifp, struct sockaddr *src, struct sockaddr *dst) { - IPSEC_SC_RLOCK_TRACKER; struct ipsec_softc *sc, *tsc; struct secasindex *saidx; @@ -887,43 +983,21 @@ ipsec_set_addresses(struct ifnet *ifp, struct sockaddr return (0); /* Nothing has been changed. */ } - /* - * We cannot service IPsec tunnel when source address is - * not our own. - */ -#ifdef INET - if (src->sa_family == AF_INET && - in_localip(satosin(src)->sin_addr) == 0) - return (EADDRNOTAVAIL); -#endif -#ifdef INET6 - /* - * NOTE: IPv6 addresses are in kernel internal form with - * embedded scope zone id. - */ - if (src->sa_family == AF_INET6 && - in6_localip(&satosin6(src)->sin6_addr) == 0) - return (EADDRNOTAVAIL); -#endif /* Check that given addresses aren't already configured */ - IPSEC_SC_RLOCK(); - LIST_FOREACH(tsc, &V_ipsec_sc_list, chain) { - if (tsc == sc || tsc->family != src->sa_family) + CK_LIST_FOREACH(tsc, ipsec_srchash(src), srchash) { + if (tsc == sc) continue; + MPASS(tsc->family == src->sa_family); saidx = ipsec_getsaidx(tsc, IPSEC_DIR_OUTBOUND, tsc->family); if (key_sockaddrcmp(&saidx->src.sa, src, 0) == 0 && key_sockaddrcmp(&saidx->dst.sa, dst, 0) == 0) { /* We already have tunnel with such addresses */ - IPSEC_SC_RUNLOCK(); return (EADDRNOTAVAIL); } } /* If reqid is not set, generate new one. */ - if (ipsec_init_reqid(sc) != 0) { - IPSEC_SC_RUNLOCK(); + if (ipsec_init_reqid(sc) != 0) return (EEXIST); - } - IPSEC_SC_RUNLOCK(); return (ipsec_set_tunnel(sc, src, dst, sc->reqid)); } @@ -932,8 +1006,7 @@ ipsec_set_tunnel(struct ipsec_softc *sc, struct sockad struct sockaddr *dst, uint32_t reqid) { struct secpolicy *sp[IPSEC_SPCOUNT]; - struct secpolicy *oldsp[IPSEC_SPCOUNT]; - int i, f; + int i; sx_assert(&ipsec_ioctl_sx, SA_XLOCKED); @@ -945,58 +1018,39 @@ ipsec_set_tunnel(struct ipsec_softc *sc, struct sockad key_freesp(&sp[i]); return (EAGAIN); } - IPSEC_SC_WLOCK(); - if ((f = sc->family) != 0) - LIST_REMOVE(sc, hash); - IPSEC_WLOCK(sc); - for (i = 0; i < IPSEC_SPCOUNT; i++) { - oldsp[i] = sc->sp[i]; + if (sc->family != 0) + ipsec_delete_tunnel(sc); + for (i = 0; i < IPSEC_SPCOUNT; i++) sc->sp[i] = sp[i]; - } sc->family = src->sa_family; - IPSEC_WUNLOCK(sc); - LIST_INSERT_HEAD(SCHASH_HASH(sc->reqid), sc, hash); - IPSEC_SC_WUNLOCK(); + CK_LIST_INSERT_HEAD(ipsec_srchash(src), sc, srchash); } else { sc->ifp->if_drv_flags &= ~IFF_DRV_RUNNING; return (ENOMEM); } - - sc->ifp->if_drv_flags |= IFF_DRV_RUNNING; - if (f != 0) { - key_unregister_ifnet(oldsp, IPSEC_SPCOUNT); - for (i = 0; i < IPSEC_SPCOUNT; i++) - key_freesp(&oldsp[i]); - } + ipsec_set_running(sc); return (0); } static void -ipsec_delete_tunnel(struct ifnet *ifp, int locked) +ipsec_delete_tunnel(struct ipsec_softc *sc) { - struct ipsec_softc *sc = ifp->if_softc; - struct secpolicy *oldsp[IPSEC_SPCOUNT]; int i; sx_assert(&ipsec_ioctl_sx, SA_XLOCKED); - ifp->if_drv_flags &= ~IFF_DRV_RUNNING; + sc->ifp->if_drv_flags &= ~IFF_DRV_RUNNING; if (sc->family != 0) { - if (!locked) - IPSEC_SC_WLOCK(); - /* Remove from hash table */ - LIST_REMOVE(sc, hash); - IPSEC_WLOCK(sc); - for (i = 0; i < IPSEC_SPCOUNT; i++) { - oldsp[i] = sc->sp[i]; - sc->sp[i] = NULL; - } + CK_LIST_REMOVE(sc, srchash); sc->family = 0; - IPSEC_WUNLOCK(sc); - if (!locked) - IPSEC_SC_WUNLOCK(); - key_unregister_ifnet(oldsp, IPSEC_SPCOUNT); + /* + * Make sure that ipsec_if_input() will not do access + * to softc's policies. + */ + IPSEC_WAIT(); + + key_unregister_ifnet(sc->sp, IPSEC_SPCOUNT); for (i = 0; i < IPSEC_SPCOUNT; i++) - key_freesp(&oldsp[i]); + key_freesp(&sc->sp[i]); } } From owner-svn-src-all@freebsd.org Sun Nov 18 00:26:10 2018 Return-Path: Delivered-To: svn-src-all@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 0A11D110CE23; Sun, 18 Nov 2018 00:26:10 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A61E388C7E; Sun, 18 Nov 2018 00:26:09 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 855CA3B6A; Sun, 18 Nov 2018 00:26:09 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAI0Q9AJ087987; Sun, 18 Nov 2018 00:26:09 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAI0Q9oq087986; Sun, 18 Nov 2018 00:26:09 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201811180026.wAI0Q9oq087986@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Sun, 18 Nov 2018 00:26:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r340537 - stable/11/sbin/ifconfig X-SVN-Group: stable-11 X-SVN-Commit-Author: ae X-SVN-Commit-Paths: stable/11/sbin/ifconfig X-SVN-Commit-Revision: 340537 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A61E388C7E X-Spamd-Result: default: False [-0.11 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.11)[-0.107,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Nov 2018 00:26:10 -0000 Author: ae Date: Sun Nov 18 00:26:09 2018 New Revision: 340537 URL: https://svnweb.freebsd.org/changeset/base/340537 Log: MFC r339535: Do not allow use `create` keyword as hostname when ifconfig(8) is invoked for already existing interface. It appeared, that ifconfig(8) assumes `create` keyword as hostname and tries to resolve it, when `ifconfig ifname create` invoked for already existing interface. This can produce some unexpected results, when hostname resolving has successfully happened. This patch adds check for such case. When an interface is already exists, and create is only one argument, return error message. But when there are some other arguments, just remove create keyword from the arguments list. Obtained from: Yandex LLC Sponsored by: Yandex LLC Differential Revision: https://reviews.freebsd.org/D17171 MFC r339536: Fix grammar. Modified: stable/11/sbin/ifconfig/ifconfig.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sbin/ifconfig/ifconfig.c ============================================================================== --- stable/11/sbin/ifconfig/ifconfig.c Sun Nov 18 00:22:01 2018 (r340536) +++ stable/11/sbin/ifconfig/ifconfig.c Sun Nov 18 00:26:09 2018 (r340537) @@ -501,6 +501,18 @@ main(int argc, char *argv[]) } #endif errx(1, "interface %s does not exist", ifname); + } else { + /* + * Do not allow use `create` command as hostname if + * address family is not specified. + */ + if (argc > 0 && (strcmp(argv[0], "create") == 0 || + strcmp(argv[0], "plumb") == 0)) { + if (argc == 1) + errx(1, "interface %s already exists", + ifname); + argc--, argv++; + } } } From owner-svn-src-all@freebsd.org Sun Nov 18 00:27:48 2018 Return-Path: Delivered-To: svn-src-all@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 1D111110CEFA; Sun, 18 Nov 2018 00:27:48 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B7E8088DCE; Sun, 18 Nov 2018 00:27:47 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 98D673B6C; Sun, 18 Nov 2018 00:27:47 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAI0RlKc088105; Sun, 18 Nov 2018 00:27:47 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAI0RlEh088104; Sun, 18 Nov 2018 00:27:47 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201811180027.wAI0RlEh088104@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Sun, 18 Nov 2018 00:27:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r340538 - stable/11/sys/netpfil/ipfw X-SVN-Group: stable-11 X-SVN-Commit-Author: ae X-SVN-Commit-Paths: stable/11/sys/netpfil/ipfw X-SVN-Commit-Revision: 340538 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B7E8088DCE X-Spamd-Result: default: False [-0.11 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.11)[-0.107,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Nov 2018 00:27:48 -0000 Author: ae Date: Sun Nov 18 00:27:47 2018 New Revision: 340538 URL: https://svnweb.freebsd.org/changeset/base/340538 Log: MFC r339545: Do not decrement RST life time if keep_alive is not turned on. This allows use differen values configured by user for sysctl variable net.inet.ip.fw.dyn_rst_lifetime. Obtained from: Yandex LLC Sponsored by: Yandex LLC Modified: stable/11/sys/netpfil/ipfw/ip_fw_dynamic.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/netpfil/ipfw/ip_fw_dynamic.c ============================================================================== --- stable/11/sys/netpfil/ipfw/ip_fw_dynamic.c Sun Nov 18 00:26:09 2018 (r340537) +++ stable/11/sys/netpfil/ipfw/ip_fw_dynamic.c Sun Nov 18 00:27:47 2018 (r340538) @@ -978,7 +978,8 @@ dyn_update_tcp_state(struct dyn_data *data, const stru break; default: - if (V_dyn_rst_lifetime >= V_dyn_keepalive_period) + if (V_dyn_keepalive != 0 && + V_dyn_rst_lifetime >= V_dyn_keepalive_period) V_dyn_rst_lifetime = V_dyn_keepalive_period - 1; expire = time_uptime + V_dyn_rst_lifetime; } From owner-svn-src-all@freebsd.org Sun Nov 18 00:28:58 2018 Return-Path: Delivered-To: svn-src-all@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 E1495110CF8A; Sun, 18 Nov 2018 00:28:57 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8A3A788F16; Sun, 18 Nov 2018 00:28:57 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 508D83B6D; Sun, 18 Nov 2018 00:28:57 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAI0Sv0m088207; Sun, 18 Nov 2018 00:28:57 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAI0SvFf088206; Sun, 18 Nov 2018 00:28:57 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201811180028.wAI0SvFf088206@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Sun, 18 Nov 2018 00:28:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r340539 - in stable/11: sbin/ipfw sys/netinet X-SVN-Group: stable-11 X-SVN-Commit-Author: ae X-SVN-Commit-Paths: in stable/11: sbin/ipfw sys/netinet X-SVN-Commit-Revision: 340539 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 8A3A788F16 X-Spamd-Result: default: False [-0.11 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.11)[-0.107,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Nov 2018 00:28:58 -0000 Author: ae Date: Sun Nov 18 00:28:56 2018 New Revision: 340539 URL: https://svnweb.freebsd.org/changeset/base/340539 Log: MFC r339539: Add IPFW_RULE_JUSTOPTS flag, that is used by ipfw(8) to mark rule, that was added using "new rule format". And then, when the kernel returns rule with this flag, ipfw(8) can correctly show it. Reported by: lev Sponsored by: Yandex LLC Differential Revision: https://reviews.freebsd.org/D17373 Modified: stable/11/sbin/ipfw/ipfw2.c stable/11/sys/netinet/ip_fw.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sbin/ipfw/ipfw2.c ============================================================================== --- stable/11/sbin/ipfw/ipfw2.c Sun Nov 18 00:27:47 2018 (r340538) +++ stable/11/sbin/ipfw/ipfw2.c Sun Nov 18 00:28:56 2018 (r340539) @@ -2207,6 +2207,12 @@ show_static_rule(struct cmdline_opts *co, struct forma */ if (co->comment_only != 0) goto end; + + if (rule->flags & IPFW_RULE_JUSTOPTS) { + state.flags |= HAVE_PROTO | HAVE_SRCIP | HAVE_DSTIP; + goto justopts; + } + print_proto(bp, fo, &state); /* Print source */ @@ -2219,6 +2225,7 @@ show_static_rule(struct cmdline_opts *co, struct forma print_address(bp, fo, &state, dst_opcodes, nitems(dst_opcodes), O_IP_DSTPORT, HAVE_DSTIP); +justopts: /* Print the rest of options */ while (print_opcode(bp, fo, &state, -1)) ; @@ -4340,8 +4347,10 @@ chkarg: } } else if (first_cmd != cmd) { errx(EX_DATAERR, "invalid protocol ``%s''", *av); - } else + } else { + rule->flags |= IPFW_RULE_JUSTOPTS; goto read_options; + } OR_BLOCK(get_proto); /* Modified: stable/11/sys/netinet/ip_fw.h ============================================================================== --- stable/11/sys/netinet/ip_fw.h Sun Nov 18 00:27:47 2018 (r340538) +++ stable/11/sys/netinet/ip_fw.h Sun Nov 18 00:28:56 2018 (r340539) @@ -613,6 +613,7 @@ struct ip_fw_rule { ipfw_insn cmd[1]; /* storage for commands */ }; #define IPFW_RULE_NOOPT 0x01 /* Has no options in body */ +#define IPFW_RULE_JUSTOPTS 0x02 /* new format of rule body */ /* Unaligned version */ From owner-svn-src-all@freebsd.org Sun Nov 18 00:31:10 2018 Return-Path: Delivered-To: svn-src-all@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 511F1110D0DC; Sun, 18 Nov 2018 00:31:10 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EDB6089125; Sun, 18 Nov 2018 00:31:09 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CEBFE3BA6; Sun, 18 Nov 2018 00:31:09 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAI0V9Kc088393; Sun, 18 Nov 2018 00:31:09 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAI0V96j088392; Sun, 18 Nov 2018 00:31:09 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201811180031.wAI0V96j088392@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Sun, 18 Nov 2018 00:31:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r340540 - stable/11/sys/netipsec X-SVN-Group: stable-11 X-SVN-Commit-Author: ae X-SVN-Commit-Paths: stable/11/sys/netipsec X-SVN-Commit-Revision: 340540 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: EDB6089125 X-Spamd-Result: default: False [-0.11 / 15.00]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.11)[-0.107,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Nov 2018 00:31:10 -0000 Author: ae Date: Sun Nov 18 00:31:09 2018 New Revision: 340540 URL: https://svnweb.freebsd.org/changeset/base/340540 Log: MFC r339533: Add sadb_x_sa2 extension to SADB_ACQUIRE requests. SADB_ACQUIRE requests are send by kernel, when security policy doesn't have corresponding security association for outbound packet. IKE daemon usually registers its handler for such messages and when the kernel asks for SA it can handle this request. Now such requests will contain additional fields that can help IKE daemon to create SA. And IKE now can create SAs using only information from SADB_ACQUIRE request, this is useful when many if_ipsec(4) interfaces are in use and IKE doesn track security policies that was installed by kernel. Obtained from: Yandex LLC Sponsored by: Yandex LLC Modified: stable/11/sys/netipsec/key.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/netipsec/key.c ============================================================================== --- stable/11/sys/netipsec/key.c Sun Nov 18 00:28:56 2018 (r340539) +++ stable/11/sys/netipsec/key.c Sun Nov 18 00:31:09 2018 (r340540) @@ -6552,7 +6552,9 @@ key_acquire(const struct secasindex *saidx, struct sec /* XXX proxy address (optional) */ - /* set sadb_x_policy */ + /* + * Set sadb_x_policy. This is KAME extension to RFC2367. + */ if (sp != NULL) { m = key_setsadbxpolicy(sp->policy, sp->spidx.dir, sp->id, sp->priority); @@ -6563,6 +6565,18 @@ key_acquire(const struct secasindex *saidx, struct sec m_cat(result, m); } + /* + * Set sadb_x_sa2 extension if saidx->reqid is not zero. + * This is FreeBSD extension to RFC2367. + */ + if (saidx->reqid != 0) { + m = key_setsadbxsa2(saidx->mode, 0, saidx->reqid); + if (m == NULL) { + error = ENOBUFS; + goto fail; + } + m_cat(result, m); + } /* XXX identity (optional) */ #if 0 if (idexttype && fqdn) { From owner-svn-src-all@freebsd.org Sun Nov 18 00:34:26 2018 Return-Path: Delivered-To: svn-src-all@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 4B2A4110D49F; Sun, 18 Nov 2018 00:34:26 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E87EB894FA; Sun, 18 Nov 2018 00:34:25 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CA3173D0D; Sun, 18 Nov 2018 00:34:25 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAI0YPqO093782; Sun, 18 Nov 2018 00:34:25 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAI0YOS7093777; Sun, 18 Nov 2018 00:34:24 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201811180034.wAI0YOS7093777@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Sun, 18 Nov 2018 00:34:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r340541 - in stable/11: sbin/ipfw sys/conf sys/modules/ipfw_nat64 sys/netpfil/ipfw/nat64 X-SVN-Group: stable-11 X-SVN-Commit-Author: ae X-SVN-Commit-Paths: in stable/11: sbin/ipfw sys/conf sys/modules/ipfw_nat64 sys/netpfil/ipfw/nat64 X-SVN-Commit-Revision: 340541 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E87EB894FA X-Spamd-Result: default: False [-0.12 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.12)[-0.119,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Nov 2018 00:34:26 -0000 Author: ae Date: Sun Nov 18 00:34:24 2018 New Revision: 340541 URL: https://svnweb.freebsd.org/changeset/base/340541 Log: MFC r339542: Retire IPFIREWALL_NAT64_DIRECT_OUTPUT kernel option. And add ability to switch the output method in run-time. Also document some sysctl variables that can by changed for NAT64 module. NAT64 had compile time option IPFIREWALL_NAT64_DIRECT_OUTPUT to use if_output directly from nat64 module. By default is used netisr based output method. Now both methods can be used, but they require different handling by rules. Obtained from: Yandex LLC Sponsored by: Yandex LLC Differential Revision: https://reviews.freebsd.org/D16647 Modified: stable/11/sbin/ipfw/ipfw.8 stable/11/sys/conf/options stable/11/sys/modules/ipfw_nat64/Makefile stable/11/sys/netpfil/ipfw/nat64/ip_fw_nat64.c stable/11/sys/netpfil/ipfw/nat64/nat64_translate.c stable/11/sys/netpfil/ipfw/nat64/nat64_translate.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sbin/ipfw/ipfw.8 ============================================================================== --- stable/11/sbin/ipfw/ipfw.8 Sun Nov 18 00:31:09 2018 (r340540) +++ stable/11/sbin/ipfw/ipfw.8 Sun Nov 18 00:34:24 2018 (r340541) @@ -1,7 +1,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 27, 2018 +.Dd October 21, 2018 .Dt IPFW 8 .Os .Sh NAME @@ -3284,9 +3284,14 @@ Make sure that ND6 neighbor solicitation (ICMPv6 type advertisement (ICMPv6 type 136) messages will not be handled by translation rules. .Pp -After translation NAT64 translator sends packets through corresponding netisr -queue. +After translation NAT64 translator by default sends packets through +corresponding netisr queue. Thus translator host should be configured as IPv4 and IPv6 router. +Also this means, that a packet is handled by firewall twice. +First time an original packet is handled and consumed by translator, +and then it is handled again as translated packet. +This behavior can be changed by sysctl variable +.Va net.inet.ip.fw.nat64_direct_output . .Pp The stateful NAT64 configuration command is the following: .Bd -ragged -offset indent @@ -3909,6 +3914,41 @@ Default is no. Controls whether bridged packets are passed to .Nm . Default is no. +.It Va net.inet.ip.fw.nat64_allow_private : No 0 +Defines how +.Nm nat64 +handles private IPv4 addresses: +.Bl -tag -width indent +.It Cm 0 +Packets with private IPv4 will not be handled by translator +.It Cm 1 +Translator will accept and process packets with private IPv4 addresses. +.El +.It Va net.inet.ip.fw.nat64_debug : No 0 +Controls debugging messages produced by +.Nm ipfw_nat64 +module. +.It Va net.inet.ip.fw.nat64_direct_output : No 0 +Controls the output method used by +.Nm ipfw_nat64 +module: +.Bl -tag -width indent +.It Cm 0 +A packet is handled by +.Nm ipfw +twice. +First time an original packet is handled by +.Nm ipfw +and consumed by +.Nm ipfw_nat64 +translator. +Then translated packet is queued via netisr to input processing again. +.It Cm 1 +A packet is handled by +.Nm ipfw +only once, and after translation it will be pushed directly to outgoing +interface. +.El .El .Sh INTERNAL DIAGNOSTICS There are some commands that may be useful to understand current state Modified: stable/11/sys/conf/options ============================================================================== --- stable/11/sys/conf/options Sun Nov 18 00:31:09 2018 (r340540) +++ stable/11/sys/conf/options Sun Nov 18 00:34:24 2018 (r340541) @@ -422,7 +422,6 @@ IPFIREWALL opt_ipfw.h IPFIREWALL_DEFAULT_TO_ACCEPT opt_ipfw.h IPFIREWALL_NAT opt_ipfw.h IPFIREWALL_NAT64 opt_ipfw.h -IPFIREWALL_NAT64_DIRECT_OUTPUT opt_ipfw.h IPFIREWALL_NPTV6 opt_ipfw.h IPFIREWALL_VERBOSE opt_ipfw.h IPFIREWALL_VERBOSE_LIMIT opt_ipfw.h Modified: stable/11/sys/modules/ipfw_nat64/Makefile ============================================================================== --- stable/11/sys/modules/ipfw_nat64/Makefile Sun Nov 18 00:31:09 2018 (r340540) +++ stable/11/sys/modules/ipfw_nat64/Makefile Sun Nov 18 00:34:24 2018 (r340541) @@ -6,8 +6,5 @@ KMOD= ipfw_nat64 SRCS= ip_fw_nat64.c nat64_translate.c SRCS+= nat64lsn.c nat64lsn_control.c SRCS+= nat64stl.c nat64stl_control.c -SRCS+= opt_ipfw.h - -#CFLAGS+= -DIPFIREWALL_NAT64_DIRECT_OUTPUT .include Modified: stable/11/sys/netpfil/ipfw/nat64/ip_fw_nat64.c ============================================================================== --- stable/11/sys/netpfil/ipfw/nat64/ip_fw_nat64.c Sun Nov 18 00:31:09 2018 (r340540) +++ stable/11/sys/netpfil/ipfw/nat64/ip_fw_nat64.c Sun Nov 18 00:34:24 2018 (r340541) @@ -48,6 +48,7 @@ __FBSDID("$FreeBSD$"); #include #include "ip_fw_nat64.h" +#include "nat64_translate.h" VNET_DEFINE(int, nat64_debug) = 0; VNET_DEFINE(int, nat64_allow_private) = 0; @@ -56,8 +57,26 @@ SYSCTL_DECL(_net_inet_ip_fw); SYSCTL_INT(_net_inet_ip_fw, OID_AUTO, nat64_debug, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(nat64_debug), 0, "Debug level for NAT64 module"); SYSCTL_INT(_net_inet_ip_fw, OID_AUTO, nat64_allow_private, - CTLFLAG_VNET |CTLFLAG_RW, &VNET_NAME(nat64_allow_private), 0, + CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(nat64_allow_private), 0, "Allow use of non-global IPv4 addresses with NAT64"); + +static int +sysctl_direct_output(SYSCTL_HANDLER_ARGS) +{ + uint32_t value; + int error; + + value = nat64_get_output_method(); + error = sysctl_handle_32(oidp, &value, 0, req); + /* Read operation or some error */ + if ((error != 0) || (req->newptr == NULL)) + return (error); + nat64_set_output_method(value); + return (0); +} +SYSCTL_PROC(_net_inet_ip_fw, OID_AUTO, nat64_direct_output, + CTLFLAG_VNET | CTLTYPE_U32 | CTLFLAG_RW, 0, 0, sysctl_direct_output, "IU", + "Use if_output directly instead of deffered netisr-based processing"); static int vnet_ipfw_nat64_init(const void *arg __unused) Modified: stable/11/sys/netpfil/ipfw/nat64/nat64_translate.c ============================================================================== --- stable/11/sys/netpfil/ipfw/nat64/nat64_translate.c Sun Nov 18 00:31:09 2018 (r340540) +++ stable/11/sys/netpfil/ipfw/nat64/nat64_translate.c Sun Nov 18 00:34:24 2018 (r340541) @@ -25,8 +25,6 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include "opt_ipfw.h" - #include __FBSDID("$FreeBSD$"); @@ -71,6 +69,53 @@ __FBSDID("$FreeBSD$"); #include "ip_fw_nat64.h" #include "nat64_translate.h" + +typedef int (*nat64_output_t)(struct ifnet *, struct mbuf *, + struct sockaddr *, struct nat64_counters *, void *); +typedef int (*nat64_output_one_t)(struct mbuf *, struct nat64_counters *, + void *); + +static int nat64_find_route4(struct nhop4_basic *, struct sockaddr_in *, + struct mbuf *); +static int nat64_find_route6(struct nhop6_basic *, struct sockaddr_in6 *, + struct mbuf *); +static int nat64_output_one(struct mbuf *, struct nat64_counters *, void *); +static int nat64_output(struct ifnet *, struct mbuf *, struct sockaddr *, + struct nat64_counters *, void *); +static int nat64_direct_output_one(struct mbuf *, struct nat64_counters *, + void *); +static int nat64_direct_output(struct ifnet *, struct mbuf *, + struct sockaddr *, struct nat64_counters *, void *); + +struct nat64_methods { + nat64_output_t output; + nat64_output_one_t output_one; +}; +static const struct nat64_methods nat64_netisr = { + .output = nat64_output, + .output_one = nat64_output_one +}; +static const struct nat64_methods nat64_direct = { + .output = nat64_direct_output, + .output_one = nat64_direct_output_one +}; +VNET_DEFINE_STATIC(const struct nat64_methods *, nat64out) = &nat64_netisr; +#define V_nat64out VNET(nat64out) + +void +nat64_set_output_method(int direct) +{ + + V_nat64out = direct != 0 ? &nat64_direct: &nat64_netisr; +} + +int +nat64_get_output_method(void) +{ + + return (V_nat64out == &nat64_direct ? 1: 0); +} + static void nat64_log(struct pfloghdr *logdata, struct mbuf *m, sa_family_t family) { @@ -80,14 +125,8 @@ nat64_log(struct pfloghdr *logdata, struct mbuf *m, sa ipfw_bpf_mtap2(logdata, PFLOG_HDRLEN, m); } -#ifdef IPFIREWALL_NAT64_DIRECT_OUTPUT -static NAT64NOINLINE int nat64_find_route4(struct nhop4_basic *, - struct sockaddr_in *, struct mbuf *); -static NAT64NOINLINE int nat64_find_route6(struct nhop6_basic *, - struct sockaddr_in6 *, struct mbuf *); - -static NAT64NOINLINE int -nat64_output(struct ifnet *ifp, struct mbuf *m, struct sockaddr *dst, +static int +nat64_direct_output(struct ifnet *ifp, struct mbuf *m, struct sockaddr *dst, struct nat64_counters *stats, void *logdata) { int error; @@ -100,8 +139,9 @@ nat64_output(struct ifnet *ifp, struct mbuf *m, struct return (error); } -static NAT64NOINLINE int -nat64_output_one(struct mbuf *m, struct nat64_counters *stats, void *logdata) +static int +nat64_direct_output_one(struct mbuf *m, struct nat64_counters *stats, + void *logdata) { struct nhop6_basic nh6; struct nhop4_basic nh4; @@ -153,8 +193,8 @@ nat64_output_one(struct mbuf *m, struct nat64_counters NAT64STAT_INC(stats, oerrors); return (error); } -#else /* !IPFIREWALL_NAT64_DIRECT_OUTPUT */ -static NAT64NOINLINE int + +static int nat64_output(struct ifnet *ifp, struct mbuf *m, struct sockaddr *dst, struct nat64_counters *stats, void *logdata) { @@ -185,13 +225,12 @@ nat64_output(struct ifnet *ifp, struct mbuf *m, struct return (ret); } -static NAT64NOINLINE int +static int nat64_output_one(struct mbuf *m, struct nat64_counters *stats, void *logdata) { return (nat64_output(NULL, m, NULL, stats, logdata)); } -#endif /* !IPFIREWALL_NAT64_DIRECT_OUTPUT */ /* * Check the given IPv6 prefix and length according to RFC6052: @@ -424,12 +463,10 @@ nat64_init_ip4hdr(const struct ip6_hdr *ip6, const str ip->ip_hl = sizeof(*ip) >> 2; ip->ip_tos = (ntohl(ip6->ip6_flow) >> 20) & 0xff; ip->ip_len = htons(sizeof(*ip) + plen); -#ifdef IPFIREWALL_NAT64_DIRECT_OUTPUT - ip->ip_ttl = ip6->ip6_hlim - IPV6_HLIMDEC; -#else - /* Forwarding code will decrement TTL. */ ip->ip_ttl = ip6->ip6_hlim; -#endif + /* Forwarding code will decrement TTL for netisr based output. */ + if (V_nat64out == &nat64_direct) + ip->ip_ttl -= IPV6_HLIMDEC; ip->ip_sum = 0; ip->ip_p = (proto == IPPROTO_ICMPV6) ? IPPROTO_ICMP: proto; ip_fillid(ip); @@ -647,7 +684,7 @@ nat64_icmp6_reflect(struct mbuf *m, uint8_t type, uint icmp6->icmp6_cksum = in6_cksum(n, IPPROTO_ICMPV6, sizeof(struct ip6_hdr), plen); m_freem(m); - nat64_output_one(n, stats, logdata); + V_nat64out->output_one(n, stats, logdata); return; freeit: NAT64STAT_INC(stats, dropped); @@ -750,7 +787,7 @@ nat64_icmp_reflect(struct mbuf *m, uint8_t type, icmp->icmp_cksum = in_cksum_skip(n, sizeof(struct ip) + plen, sizeof(struct ip)); m_freem(m); - nat64_output_one(n, stats, logdata); + V_nat64out->output_one(n, stats, logdata); return; freeit: NAT64STAT_INC(stats, dropped); @@ -1167,12 +1204,10 @@ nat64_do_handle_ip4(struct mbuf *m, struct in6_addr *s ip6.ip6_flow = htonl(ip->ip_tos << 20); ip6.ip6_vfc |= IPV6_VERSION; -#ifdef IPFIREWALL_NAT64_DIRECT_OUTPUT - ip6.ip6_hlim = ip->ip_ttl - IPTTLDEC; -#else - /* Forwarding code will decrement HLIM. */ ip6.ip6_hlim = ip->ip_ttl; -#endif + /* Forwarding code will decrement TTL for netisr based output. */ + if (V_nat64out == &nat64_direct) + ip6.ip6_hlim -= IPTTLDEC; ip6.ip6_plen = htons(plen); ip6.ip6_nxt = (proto == IPPROTO_ICMP) ? IPPROTO_ICMPV6: proto; /* Convert checksums. */ @@ -1205,7 +1240,7 @@ nat64_do_handle_ip4(struct mbuf *m, struct in6_addr *s mbufq_init(&mq, 255); nat64_fragment6(&cfg->stats, &ip6, &mq, m, nh.nh_mtu, ip_id, ip_off); while ((m = mbufq_dequeue(&mq)) != NULL) { - if (nat64_output(nh.nh_ifp, m, (struct sockaddr *)&dst, + if (V_nat64out->output(nh.nh_ifp, m, (struct sockaddr *)&dst, &cfg->stats, logdata) != 0) break; NAT64STAT_INC(&cfg->stats, opcnt46); @@ -1415,9 +1450,8 @@ nat64_handle_icmp6(struct mbuf *m, int hlen, uint32_t ip.ip_dst.s_addr = aaddr; ip.ip_src.s_addr = nat64_extract_ip4(cfg, &ip6i->ip6_src); /* XXX: Make fake ulp header */ -#ifdef IPFIREWALL_NAT64_DIRECT_OUTPUT - ip6i->ip6_hlim += IPV6_HLIMDEC; /* init_ip4hdr will decrement it */ -#endif + if (V_nat64out == &nat64_direct) /* init_ip4hdr will decrement it */ + ip6i->ip6_hlim += IPV6_HLIMDEC; nat64_init_ip4hdr(ip6i, ip6f, plen, proto, &ip); m_adj(m, hlen - sizeof(struct ip)); bcopy(&ip, mtod(m, void *), sizeof(ip)); @@ -1587,7 +1621,7 @@ nat64_do_handle_ip6(struct mbuf *m, uint32_t aaddr, ui m_adj(m, hlen - sizeof(ip)); bcopy(&ip, mtod(m, void *), sizeof(ip)); - if (nat64_output(nh.nh_ifp, m, (struct sockaddr *)&dst, + if (V_nat64out->output(nh.nh_ifp, m, (struct sockaddr *)&dst, &cfg->stats, logdata) == 0) NAT64STAT_INC(&cfg->stats, opcnt64); return (NAT64RETURN); Modified: stable/11/sys/netpfil/ipfw/nat64/nat64_translate.h ============================================================================== --- stable/11/sys/netpfil/ipfw/nat64/nat64_translate.h Sun Nov 18 00:31:09 2018 (r340540) +++ stable/11/sys/netpfil/ipfw/nat64/nat64_translate.h Sun Nov 18 00:34:24 2018 (r340541) @@ -1,6 +1,6 @@ /*- - * Copyright (c) 2015-2016 Yandex LLC - * Copyright (c) 2015-2016 Andrey V. Elsukov + * Copyright (c) 2015-2018 Yandex LLC + * Copyright (c) 2015-2018 Andrey V. Elsukov * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -141,6 +141,9 @@ void nat64_embed_ip4(const struct nat64_config *cfg, i struct in6_addr *ip6); in_addr_t nat64_extract_ip4(const struct nat64_config *cfg, const struct in6_addr *ip6); + +void nat64_set_output_method(int); +int nat64_get_output_method(void); #endif From owner-svn-src-all@freebsd.org Sun Nov 18 00:35:37 2018 Return-Path: Delivered-To: svn-src-all@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 61A65110D568; Sun, 18 Nov 2018 00:35:37 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0A0C189685; Sun, 18 Nov 2018 00:35:37 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E0DF53D10; Sun, 18 Nov 2018 00:35:36 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAI0Zar9093898; Sun, 18 Nov 2018 00:35:36 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAI0ZabJ093897; Sun, 18 Nov 2018 00:35:36 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201811180035.wAI0ZabJ093897@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Sun, 18 Nov 2018 00:35:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r340542 - stable/11/sys/netpfil/ipfw/nat64 X-SVN-Group: stable-11 X-SVN-Commit-Author: ae X-SVN-Commit-Paths: stable/11/sys/netpfil/ipfw/nat64 X-SVN-Commit-Revision: 340542 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 0A0C189685 X-Spamd-Result: default: False [-0.11 / 15.00]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.11)[-0.107,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Nov 2018 00:35:37 -0000 Author: ae Date: Sun Nov 18 00:35:36 2018 New Revision: 340542 URL: https://svnweb.freebsd.org/changeset/base/340542 Log: MFC r339544: Call inet_ntop() only when its result is needed. Obtained from: Yandex LLC Sponsored by: Yandex LLC Modified: stable/11/sys/netpfil/ipfw/nat64/nat64lsn.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/netpfil/ipfw/nat64/nat64lsn.c ============================================================================== --- stable/11/sys/netpfil/ipfw/nat64/nat64lsn.c Sun Nov 18 00:34:24 2018 (r340541) +++ stable/11/sys/netpfil/ipfw/nat64/nat64lsn.c Sun Nov 18 00:35:36 2018 (r340542) @@ -643,7 +643,6 @@ static NAT64NOINLINE int nat64lsn_periodic_chkhost(struct nat64lsn_host *nh, struct nat64lsn_periodic_data *d) { - char a[INET6_ADDRSTRLEN]; struct nat64lsn_portgroup *pg; struct nat64lsn_job_item *ji; uint64_t delmask[NAT64LSN_PGPTRNMASK]; @@ -652,9 +651,13 @@ nat64lsn_periodic_chkhost(struct nat64lsn_host *nh, delcount = 0; memset(delmask, 0, sizeof(delmask)); - inet_ntop(AF_INET6, &nh->addr, a, sizeof(a)); - DPRINTF(DP_JQUEUE, "Checking %s host %s on cpu %d", - stale_nh(d->cfg, nh) ? "stale" : "non-stale", a, curcpu); + if (V_nat64_debug & DP_JQUEUE) { + char a[INET6_ADDRSTRLEN]; + + inet_ntop(AF_INET6, &nh->addr, a, sizeof(a)); + DPRINTF(DP_JQUEUE, "Checking %s host %s on cpu %d", + stale_nh(d->cfg, nh) ? "stale" : "non-stale", a, curcpu); + } if (!stale_nh(d->cfg, nh)) { /* Non-stale host. Inspect internals */ NAT64_LOCK(nh); @@ -1527,9 +1530,9 @@ nat64lsn_translate6(struct nat64lsn_cfg *cfg, struct i if (k++ > 1000) { DPRINTF(DP_ALL, "XXX: too long %d/%d %d/%d\n", sidx.idx, sidx.off, st->next.idx, st->next.off); - inet_ntop(AF_INET6, &nh->addr, a, sizeof(a)); DPRINTF(DP_GENERIC, "TR host %s %p on cpu %d", - a, nh, curcpu); + inet_ntop(AF_INET6, &nh->addr, a, sizeof(a)), + nh, curcpu); k = 0; } sidx = st->next; @@ -1542,10 +1545,10 @@ nat64lsn_translate6(struct nat64lsn_cfg *cfg, struct i /* No free states. Request more if we can */ if (nh->pg_used >= cfg->max_chunks) { /* Limit reached */ - inet_ntop(AF_INET6, &nh->addr, a, sizeof(a)); DPRINTF(DP_DROPS, "PG limit reached " " for host %s (used %u, allocated %u, " - "limit %u)", a, + "limit %u)", inet_ntop(AF_INET6, + &nh->addr, a, sizeof(a)), nh->pg_used * NAT64_CHUNK_SIZE, nh->pg_allocated * NAT64_CHUNK_SIZE, cfg->max_chunks * NAT64_CHUNK_SIZE); From owner-svn-src-all@freebsd.org Sun Nov 18 00:52:29 2018 Return-Path: Delivered-To: svn-src-all@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 F2DB0110E042; Sun, 18 Nov 2018 00:52:28 +0000 (UTC) (envelope-from marius@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 9AF148A0DB; Sun, 18 Nov 2018 00:52:28 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7C0B04096; Sun, 18 Nov 2018 00:52:28 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAI0qSNm003601; Sun, 18 Nov 2018 00:52:28 GMT (envelope-from marius@FreeBSD.org) Received: (from marius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAI0qRUA003598; Sun, 18 Nov 2018 00:52:27 GMT (envelope-from marius@FreeBSD.org) Message-Id: <201811180052.wAI0qRUA003598@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: marius set sender to marius@FreeBSD.org using -f From: Marius Strobl Date: Sun, 18 Nov 2018 00:52:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340543 - head/sys/dev/sdhci X-SVN-Group: head X-SVN-Commit-Author: marius X-SVN-Commit-Paths: head/sys/dev/sdhci X-SVN-Commit-Revision: 340543 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 9AF148A0DB X-Spamd-Result: default: False [-0.14 / 15.00]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.14)[-0.141,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Nov 2018 00:52:29 -0000 Author: marius Date: Sun Nov 18 00:52:27 2018 New Revision: 340543 URL: https://svnweb.freebsd.org/changeset/base/340543 Log: Add a quirk handling for AMDI0040 controllers allowing them to do HS400. Submitted by: Shreyank Amartya (original version) Modified: head/sys/dev/sdhci/sdhci.c head/sys/dev/sdhci/sdhci.h head/sys/dev/sdhci/sdhci_acpi.c Modified: head/sys/dev/sdhci/sdhci.c ============================================================================== --- head/sys/dev/sdhci/sdhci.c Sun Nov 18 00:35:36 2018 (r340542) +++ head/sys/dev/sdhci/sdhci.c Sun Nov 18 00:52:27 2018 (r340543) @@ -898,6 +898,9 @@ sdhci_init_slot(device_t dev, struct sdhci_slot *slot, if (slot->quirks & SDHCI_QUIRK_CAPS_BIT63_FOR_MMC_HS400 && caps2 & SDHCI_CAN_MMC_HS400) host_caps |= MMC_CAP_MMC_HS400; + if (slot->quirks & SDHCI_QUIRK_MMC_HS400_IF_CAN_SDR104 && + caps2 & SDHCI_CAN_SDR104) + host_caps |= MMC_CAP_MMC_HS400; /* * Disable UHS-I and eMMC modes if the set_uhs_timing method is the Modified: head/sys/dev/sdhci/sdhci.h ============================================================================== --- head/sys/dev/sdhci/sdhci.h Sun Nov 18 00:35:36 2018 (r340542) +++ head/sys/dev/sdhci/sdhci.h Sun Nov 18 00:52:27 2018 (r340543) @@ -93,6 +93,8 @@ #define SDHCI_QUIRK_PRESET_VALUE_BROKEN (1 << 27) /* Controller does not support or the support for ACMD12 is broken. */ #define SDHCI_QUIRK_BROKEN_AUTO_STOP (1 << 28) +/* Controller supports eMMC HS400 mode if SDHCI_CAN_SDR104 is set. */ +#define SDHCI_QUIRK_MMC_HS400_IF_CAN_SDR104 (1 << 29) /* * Controller registers Modified: head/sys/dev/sdhci/sdhci_acpi.c ============================================================================== --- head/sys/dev/sdhci/sdhci_acpi.c Sun Nov 18 00:35:36 2018 (r340542) +++ head/sys/dev/sdhci/sdhci_acpi.c Sun Nov 18 00:52:27 2018 (r340543) @@ -45,12 +45,15 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include "mmcbr_if.h" #include "sdhci_if.h" +#define SDHCI_AMD_RESET_DLL_REG 0x908 + static const struct sdhci_acpi_device { const char* hid; int uid; @@ -80,7 +83,8 @@ static const struct sdhci_acpi_device { SDHCI_QUIRK_CAPS_BIT63_FOR_MMC_HS400 | SDHCI_QUIRK_PRESET_VALUE_BROKEN }, { "AMDI0040", 0, "AMD eMMC 5.0 Controller", - SDHCI_QUIRK_32BIT_DMA_SIZE }, + SDHCI_QUIRK_32BIT_DMA_SIZE | + SDHCI_QUIRK_MMC_HS400_IF_CAN_SDR104 }, { NULL, 0, NULL, 0} }; @@ -94,12 +98,11 @@ static char *sdhci_ids[] = { }; struct sdhci_acpi_softc { - u_int quirks; /* Chip specific quirks */ - struct resource *irq_res; /* IRQ resource */ - void *intrhand; /* Interrupt handle */ - struct sdhci_slot slot; struct resource *mem_res; /* Memory resource */ + struct resource *irq_res; /* IRQ resource */ + void *intrhand; /* Interrupt handle */ + const struct sdhci_acpi_device *acpi_dev; }; static void sdhci_acpi_intr(void *arg); @@ -189,6 +192,52 @@ sdhci_acpi_write_multi_4(device_t dev, struct sdhci_sl bus_write_multi_stream_4(sc->mem_res, off, data, count); } +static void +sdhci_acpi_set_uhs_timing(device_t dev, struct sdhci_slot *slot) +{ + const struct sdhci_acpi_softc *sc; + const struct sdhci_acpi_device *acpi_dev; + const struct mmc_ios *ios; + device_t bus; + uint16_t old_timing; + enum mmc_bus_timing timing; + + bus = slot->bus; + old_timing = sdhci_acpi_read_2(bus, slot, SDHCI_HOST_CONTROL2); + old_timing &= SDHCI_CTRL2_UHS_MASK; + sdhci_generic_set_uhs_timing(dev, slot); + + sc = device_get_softc(dev); + acpi_dev = sc->acpi_dev; + /* + * AMDI0040 controllers require SDHCI_CTRL2_SAMPLING_CLOCK to be + * disabled when switching from HS200 to high speed and to always + * be turned on again when tuning for HS400. In the later case, + * an AMD-specific DLL reset additionally is needed. + */ + if (strcmp(acpi_dev->hid, "AMDI0040") == 0 && acpi_dev->uid == 0) { + ios = &slot->host.ios; + timing = ios->timing; + if (old_timing == SDHCI_CTRL2_UHS_SDR104 && + timing == bus_timing_hs) + sdhci_acpi_write_2(bus, slot, SDHCI_HOST_CONTROL2, + sdhci_acpi_read_2(bus, slot, SDHCI_HOST_CONTROL2) & + ~SDHCI_CTRL2_SAMPLING_CLOCK); + if (ios->clock > SD_SDR50_MAX && + old_timing != SDHCI_CTRL2_MMC_HS400 && + timing == bus_timing_mmc_hs400) { + sdhci_acpi_write_2(bus, slot, SDHCI_HOST_CONTROL2, + sdhci_acpi_read_2(bus, slot, SDHCI_HOST_CONTROL2) | + SDHCI_CTRL2_SAMPLING_CLOCK); + sdhci_acpi_write_4(bus, slot, SDHCI_AMD_RESET_DLL_REG, + 0x40003210); + DELAY(20); + sdhci_acpi_write_4(bus, slot, SDHCI_AMD_RESET_DLL_REG, + 0x40033210); + } + } +} + static const struct sdhci_acpi_device * sdhci_acpi_find_device(device_t dev) { @@ -198,7 +247,7 @@ sdhci_acpi_find_device(device_t dev) ACPI_STATUS status; int rv; - rv = ACPI_ID_PROBE(device_get_parent(dev), dev, sdhci_ids, &hid); + rv = ACPI_ID_PROBE(device_get_parent(dev), dev, sdhci_ids, &hid); if (rv > 0) return (NULL); @@ -238,13 +287,15 @@ sdhci_acpi_attach(device_t dev) { struct sdhci_acpi_softc *sc = device_get_softc(dev); int rid, err; + u_int quirks; const struct sdhci_acpi_device *acpi_dev; acpi_dev = sdhci_acpi_find_device(dev); if (acpi_dev == NULL) return (ENXIO); - sc->quirks = acpi_dev->quirks; + sc->acpi_dev = acpi_dev; + quirks = acpi_dev->quirks; /* Allocate IRQ. */ rid = 0; @@ -272,11 +323,10 @@ sdhci_acpi_attach(device_t dev) if (strcmp(acpi_dev->hid, "80860F14") == 0 && acpi_dev->uid == 1 && SDHCI_READ_4(dev, &sc->slot, SDHCI_CAPABILITIES) == 0x446cc8b2 && SDHCI_READ_4(dev, &sc->slot, SDHCI_CAPABILITIES2) == 0x00000807) - sc->quirks |= SDHCI_QUIRK_MMC_DDR52 | - SDHCI_QUIRK_DATA_TIMEOUT_1MHZ; - sc->quirks &= ~sdhci_quirk_clear; - sc->quirks |= sdhci_quirk_set; - sc->slot.quirks = sc->quirks; + quirks |= SDHCI_QUIRK_MMC_DDR52 | SDHCI_QUIRK_DATA_TIMEOUT_1MHZ; + quirks &= ~sdhci_quirk_clear; + quirks |= sdhci_quirk_set; + sc->slot.quirks = quirks; err = sdhci_init_slot(dev, &sc->slot, 0); if (err) { @@ -393,7 +443,7 @@ static device_method_t sdhci_methods[] = { DEVMETHOD(sdhci_write_2, sdhci_acpi_write_2), DEVMETHOD(sdhci_write_4, sdhci_acpi_write_4), DEVMETHOD(sdhci_write_multi_4, sdhci_acpi_write_multi_4), - DEVMETHOD(sdhci_set_uhs_timing, sdhci_generic_set_uhs_timing), + DEVMETHOD(sdhci_set_uhs_timing, sdhci_acpi_set_uhs_timing), DEVMETHOD_END }; From owner-svn-src-all@freebsd.org Sun Nov 18 01:04:55 2018 Return-Path: Delivered-To: svn-src-all@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 77442110E57A; Sun, 18 Nov 2018 01:04:55 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1A01F8A5FF; Sun, 18 Nov 2018 01:04:55 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EF3654257; Sun, 18 Nov 2018 01:04:54 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAI14sOo009079; Sun, 18 Nov 2018 01:04:54 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAI14rWw009071; Sun, 18 Nov 2018 01:04:53 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201811180104.wAI14rWw009071@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Sun, 18 Nov 2018 01:04:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r340544 - in stable/11: sbin/ipfw sys/conf sys/modules/ipfw_nat64 sys/netpfil/ipfw/nat64 X-SVN-Group: stable-11 X-SVN-Commit-Author: ae X-SVN-Commit-Paths: in stable/11: sbin/ipfw sys/conf sys/modules/ipfw_nat64 sys/netpfil/ipfw/nat64 X-SVN-Commit-Revision: 340544 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 1A01F8A5FF X-Spamd-Result: default: False [-0.12 / 15.00]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.12)[-0.119,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Nov 2018 01:04:55 -0000 Author: ae Date: Sun Nov 18 01:04:53 2018 New Revision: 340544 URL: https://svnweb.freebsd.org/changeset/base/340544 Log: Revert r340541. It requires VNET_DEFINE_STATIC() macro that is not yet merged into stable/11. Modified: stable/11/sbin/ipfw/ipfw.8 stable/11/sys/conf/options stable/11/sys/modules/ipfw_nat64/Makefile stable/11/sys/netpfil/ipfw/nat64/ip_fw_nat64.c stable/11/sys/netpfil/ipfw/nat64/nat64_translate.c stable/11/sys/netpfil/ipfw/nat64/nat64_translate.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sbin/ipfw/ipfw.8 ============================================================================== --- stable/11/sbin/ipfw/ipfw.8 Sun Nov 18 00:52:27 2018 (r340543) +++ stable/11/sbin/ipfw/ipfw.8 Sun Nov 18 01:04:53 2018 (r340544) @@ -1,7 +1,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 21, 2018 +.Dd September 27, 2018 .Dt IPFW 8 .Os .Sh NAME @@ -3284,14 +3284,9 @@ Make sure that ND6 neighbor solicitation (ICMPv6 type advertisement (ICMPv6 type 136) messages will not be handled by translation rules. .Pp -After translation NAT64 translator by default sends packets through -corresponding netisr queue. +After translation NAT64 translator sends packets through corresponding netisr +queue. Thus translator host should be configured as IPv4 and IPv6 router. -Also this means, that a packet is handled by firewall twice. -First time an original packet is handled and consumed by translator, -and then it is handled again as translated packet. -This behavior can be changed by sysctl variable -.Va net.inet.ip.fw.nat64_direct_output . .Pp The stateful NAT64 configuration command is the following: .Bd -ragged -offset indent @@ -3914,41 +3909,6 @@ Default is no. Controls whether bridged packets are passed to .Nm . Default is no. -.It Va net.inet.ip.fw.nat64_allow_private : No 0 -Defines how -.Nm nat64 -handles private IPv4 addresses: -.Bl -tag -width indent -.It Cm 0 -Packets with private IPv4 will not be handled by translator -.It Cm 1 -Translator will accept and process packets with private IPv4 addresses. -.El -.It Va net.inet.ip.fw.nat64_debug : No 0 -Controls debugging messages produced by -.Nm ipfw_nat64 -module. -.It Va net.inet.ip.fw.nat64_direct_output : No 0 -Controls the output method used by -.Nm ipfw_nat64 -module: -.Bl -tag -width indent -.It Cm 0 -A packet is handled by -.Nm ipfw -twice. -First time an original packet is handled by -.Nm ipfw -and consumed by -.Nm ipfw_nat64 -translator. -Then translated packet is queued via netisr to input processing again. -.It Cm 1 -A packet is handled by -.Nm ipfw -only once, and after translation it will be pushed directly to outgoing -interface. -.El .El .Sh INTERNAL DIAGNOSTICS There are some commands that may be useful to understand current state Modified: stable/11/sys/conf/options ============================================================================== --- stable/11/sys/conf/options Sun Nov 18 00:52:27 2018 (r340543) +++ stable/11/sys/conf/options Sun Nov 18 01:04:53 2018 (r340544) @@ -422,6 +422,7 @@ IPFIREWALL opt_ipfw.h IPFIREWALL_DEFAULT_TO_ACCEPT opt_ipfw.h IPFIREWALL_NAT opt_ipfw.h IPFIREWALL_NAT64 opt_ipfw.h +IPFIREWALL_NAT64_DIRECT_OUTPUT opt_ipfw.h IPFIREWALL_NPTV6 opt_ipfw.h IPFIREWALL_VERBOSE opt_ipfw.h IPFIREWALL_VERBOSE_LIMIT opt_ipfw.h Modified: stable/11/sys/modules/ipfw_nat64/Makefile ============================================================================== --- stable/11/sys/modules/ipfw_nat64/Makefile Sun Nov 18 00:52:27 2018 (r340543) +++ stable/11/sys/modules/ipfw_nat64/Makefile Sun Nov 18 01:04:53 2018 (r340544) @@ -6,5 +6,8 @@ KMOD= ipfw_nat64 SRCS= ip_fw_nat64.c nat64_translate.c SRCS+= nat64lsn.c nat64lsn_control.c SRCS+= nat64stl.c nat64stl_control.c +SRCS+= opt_ipfw.h + +#CFLAGS+= -DIPFIREWALL_NAT64_DIRECT_OUTPUT .include Modified: stable/11/sys/netpfil/ipfw/nat64/ip_fw_nat64.c ============================================================================== --- stable/11/sys/netpfil/ipfw/nat64/ip_fw_nat64.c Sun Nov 18 00:52:27 2018 (r340543) +++ stable/11/sys/netpfil/ipfw/nat64/ip_fw_nat64.c Sun Nov 18 01:04:53 2018 (r340544) @@ -48,7 +48,6 @@ __FBSDID("$FreeBSD$"); #include #include "ip_fw_nat64.h" -#include "nat64_translate.h" VNET_DEFINE(int, nat64_debug) = 0; VNET_DEFINE(int, nat64_allow_private) = 0; @@ -57,26 +56,8 @@ SYSCTL_DECL(_net_inet_ip_fw); SYSCTL_INT(_net_inet_ip_fw, OID_AUTO, nat64_debug, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(nat64_debug), 0, "Debug level for NAT64 module"); SYSCTL_INT(_net_inet_ip_fw, OID_AUTO, nat64_allow_private, - CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(nat64_allow_private), 0, + CTLFLAG_VNET |CTLFLAG_RW, &VNET_NAME(nat64_allow_private), 0, "Allow use of non-global IPv4 addresses with NAT64"); - -static int -sysctl_direct_output(SYSCTL_HANDLER_ARGS) -{ - uint32_t value; - int error; - - value = nat64_get_output_method(); - error = sysctl_handle_32(oidp, &value, 0, req); - /* Read operation or some error */ - if ((error != 0) || (req->newptr == NULL)) - return (error); - nat64_set_output_method(value); - return (0); -} -SYSCTL_PROC(_net_inet_ip_fw, OID_AUTO, nat64_direct_output, - CTLFLAG_VNET | CTLTYPE_U32 | CTLFLAG_RW, 0, 0, sysctl_direct_output, "IU", - "Use if_output directly instead of deffered netisr-based processing"); static int vnet_ipfw_nat64_init(const void *arg __unused) Modified: stable/11/sys/netpfil/ipfw/nat64/nat64_translate.c ============================================================================== --- stable/11/sys/netpfil/ipfw/nat64/nat64_translate.c Sun Nov 18 00:52:27 2018 (r340543) +++ stable/11/sys/netpfil/ipfw/nat64/nat64_translate.c Sun Nov 18 01:04:53 2018 (r340544) @@ -25,6 +25,8 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#include "opt_ipfw.h" + #include __FBSDID("$FreeBSD$"); @@ -69,53 +71,6 @@ __FBSDID("$FreeBSD$"); #include "ip_fw_nat64.h" #include "nat64_translate.h" - -typedef int (*nat64_output_t)(struct ifnet *, struct mbuf *, - struct sockaddr *, struct nat64_counters *, void *); -typedef int (*nat64_output_one_t)(struct mbuf *, struct nat64_counters *, - void *); - -static int nat64_find_route4(struct nhop4_basic *, struct sockaddr_in *, - struct mbuf *); -static int nat64_find_route6(struct nhop6_basic *, struct sockaddr_in6 *, - struct mbuf *); -static int nat64_output_one(struct mbuf *, struct nat64_counters *, void *); -static int nat64_output(struct ifnet *, struct mbuf *, struct sockaddr *, - struct nat64_counters *, void *); -static int nat64_direct_output_one(struct mbuf *, struct nat64_counters *, - void *); -static int nat64_direct_output(struct ifnet *, struct mbuf *, - struct sockaddr *, struct nat64_counters *, void *); - -struct nat64_methods { - nat64_output_t output; - nat64_output_one_t output_one; -}; -static const struct nat64_methods nat64_netisr = { - .output = nat64_output, - .output_one = nat64_output_one -}; -static const struct nat64_methods nat64_direct = { - .output = nat64_direct_output, - .output_one = nat64_direct_output_one -}; -VNET_DEFINE_STATIC(const struct nat64_methods *, nat64out) = &nat64_netisr; -#define V_nat64out VNET(nat64out) - -void -nat64_set_output_method(int direct) -{ - - V_nat64out = direct != 0 ? &nat64_direct: &nat64_netisr; -} - -int -nat64_get_output_method(void) -{ - - return (V_nat64out == &nat64_direct ? 1: 0); -} - static void nat64_log(struct pfloghdr *logdata, struct mbuf *m, sa_family_t family) { @@ -125,8 +80,14 @@ nat64_log(struct pfloghdr *logdata, struct mbuf *m, sa ipfw_bpf_mtap2(logdata, PFLOG_HDRLEN, m); } -static int -nat64_direct_output(struct ifnet *ifp, struct mbuf *m, struct sockaddr *dst, +#ifdef IPFIREWALL_NAT64_DIRECT_OUTPUT +static NAT64NOINLINE int nat64_find_route4(struct nhop4_basic *, + struct sockaddr_in *, struct mbuf *); +static NAT64NOINLINE int nat64_find_route6(struct nhop6_basic *, + struct sockaddr_in6 *, struct mbuf *); + +static NAT64NOINLINE int +nat64_output(struct ifnet *ifp, struct mbuf *m, struct sockaddr *dst, struct nat64_counters *stats, void *logdata) { int error; @@ -139,9 +100,8 @@ nat64_direct_output(struct ifnet *ifp, struct mbuf *m, return (error); } -static int -nat64_direct_output_one(struct mbuf *m, struct nat64_counters *stats, - void *logdata) +static NAT64NOINLINE int +nat64_output_one(struct mbuf *m, struct nat64_counters *stats, void *logdata) { struct nhop6_basic nh6; struct nhop4_basic nh4; @@ -193,8 +153,8 @@ nat64_direct_output_one(struct mbuf *m, struct nat64_c NAT64STAT_INC(stats, oerrors); return (error); } - -static int +#else /* !IPFIREWALL_NAT64_DIRECT_OUTPUT */ +static NAT64NOINLINE int nat64_output(struct ifnet *ifp, struct mbuf *m, struct sockaddr *dst, struct nat64_counters *stats, void *logdata) { @@ -225,12 +185,13 @@ nat64_output(struct ifnet *ifp, struct mbuf *m, struct return (ret); } -static int +static NAT64NOINLINE int nat64_output_one(struct mbuf *m, struct nat64_counters *stats, void *logdata) { return (nat64_output(NULL, m, NULL, stats, logdata)); } +#endif /* !IPFIREWALL_NAT64_DIRECT_OUTPUT */ /* * Check the given IPv6 prefix and length according to RFC6052: @@ -463,10 +424,12 @@ nat64_init_ip4hdr(const struct ip6_hdr *ip6, const str ip->ip_hl = sizeof(*ip) >> 2; ip->ip_tos = (ntohl(ip6->ip6_flow) >> 20) & 0xff; ip->ip_len = htons(sizeof(*ip) + plen); +#ifdef IPFIREWALL_NAT64_DIRECT_OUTPUT + ip->ip_ttl = ip6->ip6_hlim - IPV6_HLIMDEC; +#else + /* Forwarding code will decrement TTL. */ ip->ip_ttl = ip6->ip6_hlim; - /* Forwarding code will decrement TTL for netisr based output. */ - if (V_nat64out == &nat64_direct) - ip->ip_ttl -= IPV6_HLIMDEC; +#endif ip->ip_sum = 0; ip->ip_p = (proto == IPPROTO_ICMPV6) ? IPPROTO_ICMP: proto; ip_fillid(ip); @@ -684,7 +647,7 @@ nat64_icmp6_reflect(struct mbuf *m, uint8_t type, uint icmp6->icmp6_cksum = in6_cksum(n, IPPROTO_ICMPV6, sizeof(struct ip6_hdr), plen); m_freem(m); - V_nat64out->output_one(n, stats, logdata); + nat64_output_one(n, stats, logdata); return; freeit: NAT64STAT_INC(stats, dropped); @@ -787,7 +750,7 @@ nat64_icmp_reflect(struct mbuf *m, uint8_t type, icmp->icmp_cksum = in_cksum_skip(n, sizeof(struct ip) + plen, sizeof(struct ip)); m_freem(m); - V_nat64out->output_one(n, stats, logdata); + nat64_output_one(n, stats, logdata); return; freeit: NAT64STAT_INC(stats, dropped); @@ -1204,10 +1167,12 @@ nat64_do_handle_ip4(struct mbuf *m, struct in6_addr *s ip6.ip6_flow = htonl(ip->ip_tos << 20); ip6.ip6_vfc |= IPV6_VERSION; +#ifdef IPFIREWALL_NAT64_DIRECT_OUTPUT + ip6.ip6_hlim = ip->ip_ttl - IPTTLDEC; +#else + /* Forwarding code will decrement HLIM. */ ip6.ip6_hlim = ip->ip_ttl; - /* Forwarding code will decrement TTL for netisr based output. */ - if (V_nat64out == &nat64_direct) - ip6.ip6_hlim -= IPTTLDEC; +#endif ip6.ip6_plen = htons(plen); ip6.ip6_nxt = (proto == IPPROTO_ICMP) ? IPPROTO_ICMPV6: proto; /* Convert checksums. */ @@ -1240,7 +1205,7 @@ nat64_do_handle_ip4(struct mbuf *m, struct in6_addr *s mbufq_init(&mq, 255); nat64_fragment6(&cfg->stats, &ip6, &mq, m, nh.nh_mtu, ip_id, ip_off); while ((m = mbufq_dequeue(&mq)) != NULL) { - if (V_nat64out->output(nh.nh_ifp, m, (struct sockaddr *)&dst, + if (nat64_output(nh.nh_ifp, m, (struct sockaddr *)&dst, &cfg->stats, logdata) != 0) break; NAT64STAT_INC(&cfg->stats, opcnt46); @@ -1450,8 +1415,9 @@ nat64_handle_icmp6(struct mbuf *m, int hlen, uint32_t ip.ip_dst.s_addr = aaddr; ip.ip_src.s_addr = nat64_extract_ip4(cfg, &ip6i->ip6_src); /* XXX: Make fake ulp header */ - if (V_nat64out == &nat64_direct) /* init_ip4hdr will decrement it */ - ip6i->ip6_hlim += IPV6_HLIMDEC; +#ifdef IPFIREWALL_NAT64_DIRECT_OUTPUT + ip6i->ip6_hlim += IPV6_HLIMDEC; /* init_ip4hdr will decrement it */ +#endif nat64_init_ip4hdr(ip6i, ip6f, plen, proto, &ip); m_adj(m, hlen - sizeof(struct ip)); bcopy(&ip, mtod(m, void *), sizeof(ip)); @@ -1621,7 +1587,7 @@ nat64_do_handle_ip6(struct mbuf *m, uint32_t aaddr, ui m_adj(m, hlen - sizeof(ip)); bcopy(&ip, mtod(m, void *), sizeof(ip)); - if (V_nat64out->output(nh.nh_ifp, m, (struct sockaddr *)&dst, + if (nat64_output(nh.nh_ifp, m, (struct sockaddr *)&dst, &cfg->stats, logdata) == 0) NAT64STAT_INC(&cfg->stats, opcnt64); return (NAT64RETURN); Modified: stable/11/sys/netpfil/ipfw/nat64/nat64_translate.h ============================================================================== --- stable/11/sys/netpfil/ipfw/nat64/nat64_translate.h Sun Nov 18 00:52:27 2018 (r340543) +++ stable/11/sys/netpfil/ipfw/nat64/nat64_translate.h Sun Nov 18 01:04:53 2018 (r340544) @@ -1,6 +1,6 @@ /*- - * Copyright (c) 2015-2018 Yandex LLC - * Copyright (c) 2015-2018 Andrey V. Elsukov + * Copyright (c) 2015-2016 Yandex LLC + * Copyright (c) 2015-2016 Andrey V. Elsukov * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -141,9 +141,6 @@ void nat64_embed_ip4(const struct nat64_config *cfg, i struct in6_addr *ip6); in_addr_t nat64_extract_ip4(const struct nat64_config *cfg, const struct in6_addr *ip6); - -void nat64_set_output_method(int); -int nat64_get_output_method(void); #endif From owner-svn-src-all@freebsd.org Sun Nov 18 01:07:37 2018 Return-Path: Delivered-To: svn-src-all@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 91925110E678; Sun, 18 Nov 2018 01:07:37 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3113D8A772; Sun, 18 Nov 2018 01:07:37 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0DAC2425C; Sun, 18 Nov 2018 01:07:37 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAI17a6X009249; Sun, 18 Nov 2018 01:07:36 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAI17a0C009245; Sun, 18 Nov 2018 01:07:36 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201811180107.wAI17a0C009245@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Sun, 18 Nov 2018 01:07:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r340545 - in stable/11/sys/amd64: include vmm/amd vmm/intel X-SVN-Group: stable-11 X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in stable/11/sys/amd64: include vmm/amd vmm/intel X-SVN-Commit-Revision: 340545 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 3113D8A772 X-Spamd-Result: default: False [-0.11 / 15.00]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.11)[-0.113,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Nov 2018 01:07:37 -0000 Author: jhb Date: Sun Nov 18 01:07:36 2018 New Revision: 340545 URL: https://svnweb.freebsd.org/changeset/base/340545 Log: MFC 339312,339364: Restore more descriptors during VM exits. 339312: Fully restore the GDTR, IDTR, and LDTR after VT-x VM exits. The VT-x VMCS only stores the base address of the GDTR and IDTR. As a result, VM exits use a fixed limit of 0xffff for the host GDTR and IDTR losing the smaller limits set in when the initial GDT is loaded on each CPU during boot. Explicitly save and restore the full GDTR and IDTR contents around VM entries and exits to restore the correct limit. Similarly, explicitly save and restore the LDT selector. VM exits always clear the host LDTR as if the LDT was loaded with a NULL selector and a userspace hypervisor is probably using a NULL selector anyway, but save and restore the LDT explicitly just to be safe. 339364: Reload the LDT selector after an AMD-v #VMEXIT. cpu_switch() always reloads the LDT, so this can only affect the hypervisor process itself. Fix this by explicitly reloading the host LDT selector after each #VMEXIT. The stock bhyve process on FreeBSD never uses a custom LDT, so this change is cosmetic. PR: 230773 Modified: stable/11/sys/amd64/include/cpufunc.h stable/11/sys/amd64/vmm/amd/svm.c stable/11/sys/amd64/vmm/intel/vmx.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/amd64/include/cpufunc.h ============================================================================== --- stable/11/sys/amd64/include/cpufunc.h Sun Nov 18 01:04:53 2018 (r340544) +++ stable/11/sys/amd64/include/cpufunc.h Sun Nov 18 01:07:36 2018 (r340545) @@ -726,6 +726,15 @@ lldt(u_short sel) __asm __volatile("lldt %0" : : "r" (sel)); } +static __inline u_short +sldt(void) +{ + u_short sel; + + __asm __volatile("sldt %0" : "=r" (sel)); + return (sel); +} + static __inline void ltr(u_short sel) { Modified: stable/11/sys/amd64/vmm/amd/svm.c ============================================================================== --- stable/11/sys/amd64/vmm/amd/svm.c Sun Nov 18 01:04:53 2018 (r340544) +++ stable/11/sys/amd64/vmm/amd/svm.c Sun Nov 18 01:07:36 2018 (r340545) @@ -1940,6 +1940,7 @@ svm_vmrun(void *arg, int vcpu, register_t rip, pmap_t struct vm *vm; uint64_t vmcb_pa; int handled; + uint16_t ldt_sel; svm_sc = arg; vm = svm_sc->vm; @@ -2018,6 +2019,15 @@ svm_vmrun(void *arg, int vcpu, register_t rip, pmap_t break; } + /* + * #VMEXIT resumes the host with the guest LDTR, so + * save the current LDT selector so it can be restored + * after an exit. The userspace hypervisor probably + * doesn't use a LDT, but save and restore it to be + * safe. + */ + ldt_sel = sldt(); + svm_inj_interrupts(svm_sc, vcpu, vlapic); /* Activate the nested pmap on 'curcpu' */ @@ -2047,6 +2057,9 @@ svm_vmrun(void *arg, int vcpu, register_t rip, pmap_t * to be restored explicitly. */ restore_host_tss(); + + /* Restore host LDTR. */ + lldt(ldt_sel); /* #VMEXIT disables interrupts so re-enable them here. */ enable_gintr(); Modified: stable/11/sys/amd64/vmm/intel/vmx.c ============================================================================== --- stable/11/sys/amd64/vmm/intel/vmx.c Sun Nov 18 01:04:53 2018 (r340544) +++ stable/11/sys/amd64/vmm/intel/vmx.c Sun Nov 18 01:07:36 2018 (r340545) @@ -2701,6 +2701,8 @@ vmx_run(void *arg, int vcpu, register_t rip, pmap_t pm struct vm_exit *vmexit; struct vlapic *vlapic; uint32_t exit_reason; + struct region_descriptor gdtr, idtr; + uint16_t ldt_sel; vmx = arg; vm = vmx->vm; @@ -2786,10 +2788,30 @@ vmx_run(void *arg, int vcpu, register_t rip, pmap_t pm break; } + /* + * VM exits restore the base address but not the + * limits of GDTR and IDTR. The VMCS only stores the + * base address, so VM exits set the limits to 0xffff. + * Save and restore the full GDTR and IDTR to restore + * the limits. + * + * The VMCS does not save the LDTR at all, and VM + * exits clear LDTR as if a NULL selector were loaded. + * The userspace hypervisor probably doesn't use a + * LDT, but save and restore it to be safe. + */ + sgdt(&gdtr); + sidt(&idtr); + ldt_sel = sldt(); + vmx_run_trace(vmx, vcpu); vmx_dr_enter_guest(vmxctx); rc = vmx_enter_guest(vmxctx, vmx, launched); vmx_dr_leave_guest(vmxctx); + + bare_lgdt(&gdtr); + lidt(&idtr); + lldt(ldt_sel); /* Collect some information for VM exit processing */ vmexit->rip = rip = vmcs_guest_rip(); From owner-svn-src-all@freebsd.org Sun Nov 18 01:27:18 2018 Return-Path: Delivered-To: svn-src-all@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 43F07110F2F2; Sun, 18 Nov 2018 01:27:18 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.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 DE2E18B3C4; Sun, 18 Nov 2018 01:27:17 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BCF3E45C6; Sun, 18 Nov 2018 01:27:17 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAI1RH6S019325; Sun, 18 Nov 2018 01:27:17 GMT (envelope-from alc@FreeBSD.org) Received: (from alc@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAI1RHUv019324; Sun, 18 Nov 2018 01:27:17 GMT (envelope-from alc@FreeBSD.org) Message-Id: <201811180127.wAI1RHUv019324@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: alc set sender to alc@FreeBSD.org using -f From: Alan Cox Date: Sun, 18 Nov 2018 01:27:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340546 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: alc X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 340546 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: DE2E18B3C4 X-Spamd-Result: default: False [-0.14 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.14)[-0.141,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Nov 2018 01:27:18 -0000 Author: alc Date: Sun Nov 18 01:27:17 2018 New Revision: 340546 URL: https://svnweb.freebsd.org/changeset/base/340546 Log: Tidy up vm_map_simplify_entry() and its recently introduced helper functions. Notably, reflow the text of some comments so that they occupy fewer lines, and introduce an assertion in one of the new helper functions so that it is not misused by a future caller. In collaboration with: Doug Moore MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D17635 Modified: head/sys/vm/vm_map.c Modified: head/sys/vm/vm_map.c ============================================================================== --- head/sys/vm/vm_map.c Sun Nov 18 01:07:36 2018 (r340545) +++ head/sys/vm/vm_map.c Sun Nov 18 01:27:17 2018 (r340546) @@ -1644,16 +1644,25 @@ vm_map_find_min(vm_map_t map, vm_object_t object, vm_o } } +/* + * A map entry with any of the following flags set must not be merged with + * another entry. + */ +#define MAP_ENTRY_NOMERGE_MASK (MAP_ENTRY_GROWS_DOWN | MAP_ENTRY_GROWS_UP | \ + MAP_ENTRY_IN_TRANSITION | MAP_ENTRY_IS_SUB_MAP) + static bool vm_map_mergeable_neighbors(vm_map_entry_t prev, vm_map_entry_t entry) { - vm_size_t prevsize; - prevsize = prev->end - prev->start; + KASSERT((prev->eflags & MAP_ENTRY_NOMERGE_MASK) == 0 || + (entry->eflags & MAP_ENTRY_NOMERGE_MASK) == 0, + ("vm_map_mergeable_neighbors: neither %p nor %p are mergeable", + prev, entry)); return (prev->end == entry->start && prev->object.vm_object == entry->object.vm_object && (prev->object.vm_object == NULL || - prev->offset + prevsize == entry->offset) && + prev->offset + (prev->end - prev->start) == entry->offset) && prev->eflags == entry->eflags && prev->protection == entry->protection && prev->max_protection == entry->max_protection && @@ -1667,18 +1676,14 @@ vm_map_merged_neighbor_dispose(vm_map_t map, vm_map_en { /* - * If the backing object is a vnode object, - * vm_object_deallocate() calls vrele(). - * However, vrele() does not lock the vnode - * because the vnode has additional - * references. Thus, the map lock can be kept - * without causing a lock-order reversal with - * the vnode lock. + * If the backing object is a vnode object, vm_object_deallocate() + * calls vrele(). However, vrele() does not lock the vnode because + * the vnode has additional references. Thus, the map lock can be + * kept without causing a lock-order reversal with the vnode lock. * - * Since we count the number of virtual page - * mappings in object->un_pager.vnp.writemappings, - * the writemappings value should not be adjusted - * when the entry is disposed of. + * Since we count the number of virtual page mappings in + * object->un_pager.vnp.writemappings, the writemappings value + * should not be adjusted when the entry is disposed of. */ if (entry->object.vm_object != NULL) vm_object_deallocate(entry->object.vm_object); @@ -1704,10 +1709,8 @@ vm_map_simplify_entry(vm_map_t map, vm_map_entry_t ent { vm_map_entry_t next, prev; - if ((entry->eflags & (MAP_ENTRY_GROWS_DOWN | MAP_ENTRY_GROWS_UP | - MAP_ENTRY_IN_TRANSITION | MAP_ENTRY_IS_SUB_MAP)) != 0) + if ((entry->eflags & MAP_ENTRY_NOMERGE_MASK) != 0) return; - prev = entry->prev; if (vm_map_mergeable_neighbors(prev, entry)) { vm_map_entry_unlink(map, prev); @@ -1717,7 +1720,6 @@ vm_map_simplify_entry(vm_map_t map, vm_map_entry_t ent vm_map_entry_resize_free(map, entry->prev); vm_map_merged_neighbor_dispose(map, prev); } - next = entry->next; if (vm_map_mergeable_neighbors(entry, next)) { vm_map_entry_unlink(map, next); @@ -1726,6 +1728,7 @@ vm_map_simplify_entry(vm_map_t map, vm_map_entry_t ent vm_map_merged_neighbor_dispose(map, next); } } + /* * vm_map_clip_start: [ internal use only ] * From owner-svn-src-all@freebsd.org Sun Nov 18 01:58:49 2018 Return-Path: Delivered-To: svn-src-all@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 A52EC1121753; Sun, 18 Nov 2018 01:58:49 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.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 41C028C390; Sun, 18 Nov 2018 01:58:49 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 207774B10; Sun, 18 Nov 2018 01:58:49 +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 wAI1wntS034732; Sun, 18 Nov 2018 01:58:49 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAI1wmfM034730; Sun, 18 Nov 2018 01:58:48 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201811180158.wAI1wmfM034730@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sun, 18 Nov 2018 01:58:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340547 - head/sbin/dumpon X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sbin/dumpon X-SVN-Commit-Revision: 340547 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 41C028C390 X-Spamd-Result: default: False [-0.14 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.14)[-0.141,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Nov 2018 01:58:49 -0000 Author: markj Date: Sun Nov 18 01:58:48 2018 New Revision: 340547 URL: https://svnweb.freebsd.org/changeset/base/340547 Log: Change dumpon(8)'s handling of -g. Rather than using a special value to denote "use the default router", treat the absence of the -g option to mean the same thing. The in-kernel netdump client will always attempt to reach the server directly before falling back to the configured gateway anyway. This change makes it cleaner to support a hostname value for -g. Reviewed by: cem MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D18025 Modified: head/sbin/dumpon/dumpon.8 head/sbin/dumpon/dumpon.c Modified: head/sbin/dumpon/dumpon.8 ============================================================================== --- head/sbin/dumpon/dumpon.8 Sun Nov 18 01:27:17 2018 (r340546) +++ head/sbin/dumpon/dumpon.8 Sun Nov 18 01:58:48 2018 (r340547) @@ -28,7 +28,7 @@ .\" From: @(#)swapon.8 8.1 (Berkeley) 6/5/93 .\" $FreeBSD$ .\" -.Dd October 26, 2018 +.Dd November 17, 2018 .Dt DUMPON 8 .Os .Sh NAME @@ -46,7 +46,7 @@ .Op Fl k Ar pubkey .Op Fl Z .Op Fl z -.Op Fl g Ar gateway | Li default +.Op Fl g Ar gateway .Fl s Ar server .Fl c Ar client .Ar iface @@ -140,21 +140,22 @@ The local IP address of the .Xr netdump 4 client. .It Fl g Ar gateway -Optional. -If not specified, it is assumed that the -.Ar server -is on the same link as the -.Ar client . -.Pp -If specified, -.Ar gateway -is the address of the first-hop router between the +The first-hop router between .Ar client -and the +and .Ar server . -The special value -.Dv Dq default -indicates that the currently configured system default route should be used. +If the +.Fl g +option is not specified and the system has a default route, the default +router is used as the +.Xr netdump 4 +gateway. +If the +.Fl g +option is not specified and the system does not have a default route, +.Ar server +is assumed to be on the same link as +.Ar client . .It Fl s Ar server The IP address of the .Xr netdumpd 8 Modified: head/sbin/dumpon/dumpon.c ============================================================================== --- head/sbin/dumpon/dumpon.c Sun Nov 18 01:27:17 2018 (r340546) +++ head/sbin/dumpon/dumpon.c Sun Nov 18 01:58:48 2018 (r340547) @@ -88,7 +88,7 @@ usage(void) fprintf(stderr, "usage: dumpon [-v] [-k ] [-Zz] \n" " dumpon [-v] [-k ] [-Zz]\n" - " [-g |default] -s -c \n" + " [-g ] -s -c \n" " dumpon [-v] off\n" " dumpon [-v] -l\n"); exit(EX_USAGE); @@ -109,8 +109,6 @@ find_gateway(const char *ifname) size_t sz; int error, i, ifindex, mib[7]; - ret = NULL; - /* First look up the interface index. */ if (getifaddrs(&ifap) != 0) err(EX_OSERR, "getifaddrs"); @@ -148,6 +146,7 @@ find_gateway(const char *ifname) free(buf); } + ret = NULL; for (next = buf; next < buf + sz; next += rtm->rtm_msglen) { rtm = (struct rt_msghdr *)(void *)next; if (rtm->rtm_version != RTM_VERSION) @@ -476,12 +475,13 @@ main(int argc, char *argv[]) if (inet_aton(client, &ndconf.ndc_client) == 0) errx(EX_USAGE, "invalid client address '%s'", client); - if (gateway == NULL) + gateway = find_gateway(argv[0]); + if (gateway == NULL) { + if (verbose) + printf("failed to look up gateway for %s\n", + server); gateway = server; - else if (strcmp(gateway, "default") == 0 && - (gateway = find_gateway(argv[0])) == NULL) - errx(EX_NOHOST, - "failed to look up next-hop router for %s", server); + } if (inet_aton(gateway, &ndconf.ndc_gateway) == 0) errx(EX_USAGE, "invalid gateway address '%s'", gateway); From owner-svn-src-all@freebsd.org Sun Nov 18 02:53:15 2018 Return-Path: Delivered-To: svn-src-all@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 CA27A11243DD; Sun, 18 Nov 2018 02:53:15 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 196398E4EB; Sun, 18 Nov 2018 02:53:14 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id wAI2rCHI054182; Sat, 17 Nov 2018 18:53:12 -0800 (PST) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id wAI2rCR5054181; Sat, 17 Nov 2018 18:53:12 -0800 (PST) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201811180253.wAI2rCR5054181@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r340511 - stable/12/sys/kern In-Reply-To: <20181117235144.GA2799@raichu> To: Mark Johnston Date: Sat, 17 Nov 2018 18:53:12 -0800 (PST) CC: rgrimes@freebsd.org, src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Rspamd-Queue-Id: 196398E4EB X-Spamd-Result: default: False [1.37 / 15.00]; ARC_NA(0.00)[]; HAS_REPLYTO(0.00)[rgrimes@freebsd.org]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_SPAM_SHORT(0.50)[0.500,0]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[dnsmgr.net]; REPLYTO_DOM_NEQ_FROM_DOM(0.00)[]; AUTH_NA(1.00)[]; RCPT_COUNT_FIVE(0.00)[6]; RCVD_COUNT_THREE(0.00)[3]; IP_SCORE(-0.02)[country: US(-0.10)]; MX_GOOD(-0.01)[cached: pdx.rh.CN85.dnsmgr.net]; R_SPF_NA(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:13868, ipnet:69.59.192.0/19, country:US]; MID_RHS_MATCH_FROM(0.00)[] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Nov 2018 02:53:16 -0000 > On Sat, Nov 17, 2018 at 03:47:16PM -0800, Rodney W. Grimes wrote: > > > Author: markj > > > Date: Sat Nov 17 20:01:35 2018 > > > New Revision: 340511 > > > URL: https://svnweb.freebsd.org/changeset/base/340511 > > > > > > Log: > > > MFC r339731: > > > Add FALLTHROUGH comments to appease Coverity. > > > > > > Modified: > > > stable/12/sys/kern/kern_environment.c > > > stable/12/sys/kern/vfs_mount.c > > > Directory Properties: > > > stable/12/ (props changed) > > > > > > Modified: stable/12/sys/kern/kern_environment.c > > > ============================================================================== > > > --- stable/12/sys/kern/kern_environment.c Sat Nov 17 20:00:10 2018 (r340510) > > > +++ stable/12/sys/kern/kern_environment.c Sat Nov 17 20:01:35 2018 (r340511) > > > @@ -839,10 +839,13 @@ getenv_quad(const char *name, quad_t *data) > > > switch (vtp[0]) { > > > case 't': case 'T': > > > iv *= 1024; > > > + /* FALLTHROUGH */ > > > case 'g': case 'G': > > > iv *= 1024; > > > + /* FALLTHROUGH */ > > > case 'm': case 'M': > > > iv *= 1024; > > > + /* FALLTHROUGH */ > > > case 'k': case 'K': > > > iv *= 1024; > > Missing /* FALLTHROUGH */ ?? > > The statement following "case '\0':" is a break. > > > > > > case '\0': > > > > And a refactor: > > > > case 't': case 'T': > > case 'g': case 'G': > > case 'm': case 'M': > > case 'k': case 'K': > > iv *= 1024; > > /* FALLTHROUGH */ > > case '\0': > > > > Isnt that the same functionality? > > No, it isn't. Gag, for some reason I was reading iv *=1024 as *iv = 1024, I need more sleep :-( -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Sun Nov 18 09:45:53 2018 Return-Path: Delivered-To: svn-src-all@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 A8FBD11326FD; Sun, 18 Nov 2018 09:45:53 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DA927413E; Sun, 18 Nov 2018 09:45:53 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2E9C011A73; Sun, 18 Nov 2018 09:45:53 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAI9jrjQ075673; Sun, 18 Nov 2018 09:45:53 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAI9jrYZ075672; Sun, 18 Nov 2018 09:45:53 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201811180945.wAI9jrYZ075672@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 18 Nov 2018 09:45:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r340548 - stable/12/sys/kern X-SVN-Group: stable-12 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/12/sys/kern X-SVN-Commit-Revision: 340548 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4DA927413E X-Spamd-Result: default: False [-0.05 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.05)[-0.052,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Nov 2018 09:45:53 -0000 Author: kib Date: Sun Nov 18 09:45:52 2018 New Revision: 340548 URL: https://svnweb.freebsd.org/changeset/base/340548 Log: MFC r340344: Remove single-use variable, cleanup warnings. Modified: stable/12/sys/kern/sysv_shm.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/kern/sysv_shm.c ============================================================================== --- stable/12/sys/kern/sysv_shm.c Sun Nov 18 01:58:48 2018 (r340547) +++ stable/12/sys/kern/sysv_shm.c Sun Nov 18 09:45:52 2018 (r340548) @@ -332,9 +332,6 @@ kern_shmdt_locked(struct thread *td, const void *shmad { struct proc *p = td->td_proc; struct shmmap_state *shmmap_s; -#if defined(AUDIT) || defined(MAC) - struct shmid_kernel *shmsegptr; -#endif #ifdef MAC int error; #endif @@ -355,11 +352,9 @@ kern_shmdt_locked(struct thread *td, const void *shmad } if (i == shminfo.shmseg) return (EINVAL); -#if (defined(AUDIT) && defined(KDTRACE_HOOKS)) || defined(MAC) - shmsegptr = &shmsegs[IPCID_TO_IX(shmmap_s->shmid)]; -#endif #ifdef MAC - error = mac_sysvshm_check_shmdt(td->td_ucred, shmsegptr); + error = mac_sysvshm_check_shmdt(td->td_ucred, + &shmsegs[IPCID_TO_IX(shmmap_s->shmid)]); if (error != 0) return (error); #endif From owner-svn-src-all@freebsd.org Sun Nov 18 09:47:31 2018 Return-Path: Delivered-To: svn-src-all@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 960EC113274B; Sun, 18 Nov 2018 09:47:31 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 37EF774241; Sun, 18 Nov 2018 09:47:31 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1377F11A77; Sun, 18 Nov 2018 09:47:31 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAI9lUt4075805; Sun, 18 Nov 2018 09:47:30 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAI9lUWN075804; Sun, 18 Nov 2018 09:47:30 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201811180947.wAI9lUWN075804@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Sun, 18 Nov 2018 09:47:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r340549 - stable/12/sbin/pfctl X-SVN-Group: stable-12 X-SVN-Commit-Author: kp X-SVN-Commit-Paths: stable/12/sbin/pfctl X-SVN-Commit-Revision: 340549 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 37EF774241 X-Spamd-Result: default: False [-0.05 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.05)[-0.052,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Nov 2018 09:47:31 -0000 Author: kp Date: Sun Nov 18 09:47:30 2018 New Revision: 340549 URL: https://svnweb.freebsd.org/changeset/base/340549 Log: MFC r339464: pfctl: Dup strings When we set the ifname we have to copy the string, rather than just keep the pointer. PR: 231323 Modified: stable/12/sbin/pfctl/parse.y Directory Properties: stable/12/ (props changed) Modified: stable/12/sbin/pfctl/parse.y ============================================================================== --- stable/12/sbin/pfctl/parse.y Sun Nov 18 09:45:52 2018 (r340548) +++ stable/12/sbin/pfctl/parse.y Sun Nov 18 09:47:30 2018 (r340549) @@ -4408,7 +4408,7 @@ route_host : STRING { $$ = calloc(1, sizeof(struct node_host)); if ($$ == NULL) err(1, "route_host: calloc"); - $$->ifname = $1; + $$->ifname = strdup($1); set_ipmask($$, 128); $$->next = NULL; $$->tail = $$; @@ -4418,7 +4418,7 @@ route_host : STRING { $$ = $3; for (n = $3; n != NULL; n = n->next) - n->ifname = $2; + n->ifname = strdup($2); } ; From owner-svn-src-all@freebsd.org Sun Nov 18 10:54:51 2018 Return-Path: Delivered-To: svn-src-all@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 D92D71135013; Sun, 18 Nov 2018 10:54:51 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A6D7576FE8; Sun, 18 Nov 2018 10:54:50 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E3DE6125DE; Sun, 18 Nov 2018 10:54:47 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAIAslGR011796; Sun, 18 Nov 2018 10:54:47 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAIAslpq011795; Sun, 18 Nov 2018 10:54:47 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201811181054.wAIAslpq011795@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Sun, 18 Nov 2018 10:54:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r340561 - stable/12/sbin/pfctl X-SVN-Group: stable-12 X-SVN-Commit-Author: kp X-SVN-Commit-Paths: stable/12/sbin/pfctl X-SVN-Commit-Revision: 340561 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A6D7576FE8 X-Spamd-Result: default: False [-0.05 / 15.00]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.05)[-0.052,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Nov 2018 10:54:52 -0000 Author: kp Date: Sun Nov 18 10:54:47 2018 New Revision: 340561 URL: https://svnweb.freebsd.org/changeset/base/340561 Log: MFC r339578: pfctl: Fix line numbers when \ is used inside "" PR: 201520 Obtained from: OpenBSD Modified: stable/12/sbin/pfctl/parse.y Directory Properties: stable/12/ (props changed) Modified: stable/12/sbin/pfctl/parse.y ============================================================================== --- stable/12/sbin/pfctl/parse.y Sun Nov 18 10:54:38 2018 (r340560) +++ stable/12/sbin/pfctl/parse.y Sun Nov 18 10:54:47 2018 (r340561) @@ -5765,8 +5765,10 @@ top: return (0); if (next == quotec || c == ' ' || c == '\t') c = next; - else if (next == '\n') + else if (next == '\n') { + file->lineno++; continue; + } else lungetc(next); } else if (c == quotec) { From owner-svn-src-all@freebsd.org Sun Nov 18 10:46:56 2018 Return-Path: Delivered-To: svn-src-all@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 E19971134D0C; Sun, 18 Nov 2018 10:46:55 +0000 (UTC) (envelope-from tijl@freebsd.org) Received: from mailrelay101.isp.belgacom.be (mailrelay101.isp.belgacom.be [195.238.20.128]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "relay.skynet.be", Issuer "GlobalSign Organization Validation CA - SHA256 - G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0A49876970; Sun, 18 Nov 2018 10:46:54 +0000 (UTC) (envelope-from tijl@freebsd.org) X-Belgacom-Dynamic: yes IronPort-PHdr: =?us-ascii?q?9a23=3AbPxHsBBI4rlaOW9lqMT+UyQJP3N1i/DPJgcQr6?= =?us-ascii?q?AfoPdwSPT6pMbcNUDSrc9gkEXOFd2Cra4c26yO6+jJYi8p2d65qncMcZhBBV?= =?us-ascii?q?cuqP49uEgeOvODElDxN/XwbiY3T4xoXV5h+GynYwAOQJ6tL1LdrWev4jEMBx?= =?us-ascii?q?7xKRR6JvjvGo7Vks+7y/2+94fcbglUhzexe69+IAmrpgjNq8cahpdvJLwswR?= =?us-ascii?q?XTuHtIfOpWxWJsJV2Nmhv3+9m98p1+/SlOovwt78FPX7n0cKQ+VrxYES8pM3?= =?us-ascii?q?sp683xtBnMVhWA630BWWgLiBVIAgzF7BbnXpfttybxq+Rw1DWGMcDwULs5Qi?= =?us-ascii?q?qp4bt1RxD0iScHLz85/3/Risxsl6JQvRatqwViz4LIfI2ZMfxzdb7fc9wHX2?= =?us-ascii?q?pMRshfWSxfDI2hbIUADeQBMulEoIfyvFYOsQK+CRWwCO/z1jNFhHn71rA63e?= =?us-ascii?q?Q7FgHG2RQtEcwLsnTQsd74KqASUeeuzKbWyDXMdfVW2Szg44XPbhAhoPOMXb?= =?us-ascii?q?ZrfMTR00kgCR3Kg0iNp4LrJT+V0f4Ns2eC4udmSOmhhWknqwRrrTiuwMchko?= =?us-ascii?q?bJhoMJylDE6CV225w5KsG/SE5+edKkH51QtzyAO4txWMMiTGdlszs5xL0eoZ?= =?us-ascii?q?O2fyoHxI4myhPQcfCLboyF7x35WOqPPDt1i3Roc6+liRmo60iv0Oj8W9Gx0F?= =?us-ascii?q?ZNsyVKjMHBtmsI1xzP8siHTeZ9/lu51TaPyQ/T7uZELFg3laXBL54hw7swmY?= =?us-ascii?q?QJsUTEBCP2hET2jK2Sdkk+5ueo7OPnYq74qZ+ZLYB0jBr+Pr4pmsylDuQ0Kg?= =?us-ascii?q?kOX26F9uSgzLDu/k/0TK9Lg/A5iKXVrZTXKMsBqqKnHgNY3Z4v6xOlADen1N?= =?us-ascii?q?QYk2MHLFVAeB+fk4jpOlPOIPTjAPexmVSjjilkyOvdPrL8GJnNKWLDkLj5cb?= =?us-ascii?q?Zn90Fc0BYzzcxY559MD7EOOu7zVlX0tNPCEhA4Mxe5w+niCNpn14MeXXiDDb?= =?us-ascii?q?OeMKPX4he04bcKKvWQZIIK8BP0IOlts/vnkTk8kFQMVaas1JoTLnu/G6I1DV?= =?us-ascii?q?+eZC/QZdNJOmANpQc7RerxwAmeUDxXT1ioUq8W3R19D5ipW9SQDruxiaCMiX?= =?us-ascii?q?/oVqZdYXpLXxXVSS/l?= X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: =?us-ascii?q?A2AgAACEQfFb/9bCQFdiGwEBAQEDAQE?= =?us-ascii?q?BBwMBAQGBUQYBAQELAQGBVC5mcBIng3iIGF+LGgEBggw1AYhRdo05gXowhEk?= =?us-ascii?q?Cg1MjNAkNAQMBAQIBAQIBbBwMQgEBAQMJAoFjJAGCYQEBAQMBIzMjBQsLDgo?= =?us-ascii?q?CAgUhAgIPEhgeBhODIoFpAw0MC6cTgS+ELQGDQw2BC4EJBYELixGBf4QjglY?= =?us-ascii?q?sGQIBgWCDBIJXAp9BLgmGeocCgyAjkH2NOYEIixs4gVVNMAiDJ4YIhRSFPz4?= =?us-ascii?q?DMAGDaoFoiFoBAQ?= X-IPAS-Result: =?us-ascii?q?A2AgAACEQfFb/9bCQFdiGwEBAQEDAQEBBwMBAQGBUQYBA?= =?us-ascii?q?QELAQGBVC5mcBIng3iIGF+LGgEBggw1AYhRdo05gXowhEkCg1MjNAkNAQMBA?= =?us-ascii?q?QIBAQIBbBwMQgEBAQMJAoFjJAGCYQEBAQMBIzMjBQsLDgoCAgUhAgIPEhgeB?= =?us-ascii?q?hODIoFpAw0MC6cTgS+ELQGDQw2BC4EJBYELixGBf4QjglYsGQIBgWCDBIJXA?= =?us-ascii?q?p9BLgmGeocCgyAjkH2NOYEIixs4gVVNMAiDJ4YIhRSFPz4DMAGDaoFoiFoBA?= =?us-ascii?q?Q?= Received: from 214.194-64-87.adsl-dyn.isp.belgacom.be (HELO kalimero.tijl.coosemans.org) ([87.64.194.214]) by relay.skynet.be with ESMTP; 18 Nov 2018 11:45:44 +0100 Received: from kalimero.tijl.coosemans.org (kalimero.tijl.coosemans.org [127.0.0.1]) by kalimero.tijl.coosemans.org (8.15.2/8.15.2) with ESMTP id wAIAjedB001654; Sun, 18 Nov 2018 11:45:43 +0100 (CET) (envelope-from tijl@FreeBSD.org) Date: Sun, 18 Nov 2018 11:45:38 +0100 From: =?UTF-8?B?VMSzbA==?= Coosemans To: Matthew Macy Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r339618 - head/sys/compat/linuxkpi/common/include/linux Message-ID: <20181118114538.546a4fab@kalimero.tijl.coosemans.org> In-Reply-To: References: <201810222055.w9MKtZPt013627@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: 0A49876970 X-Spamd-Result: default: False [-0.03 / 15.00]; local_wl_from(0.00)[freebsd.org]; TAGGED_RCPT(0.00)[]; NEURAL_HAM_SHORT(-0.03)[-0.034,0]; ASN(0.00)[asn:5432, ipnet:195.238.0.0/19, country:BE] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Nov 2018 10:46:56 -0000 On Sat, 17 Nov 2018 14:55:05 -0800 Matthew Macy wrote: > When looking at powerpc io.h raw and relaxed are not aliases, but it > appears that on x86, they are: > https://github.com/torvalds/linux/blob/master/arch/x86/include/asm/io.h >=20 > Sorry for the noise. But let's starting moving the x86 specific > atomic.h and io.h under asm/x86. Yes, I agree that the file should be moved to an arch specific location. And the functions should probably be implemented using inline asm like they are on Linux in case there are differences in the way compilers treat the C code versus the asm code. > On Sat, Nov 17, 2018 at 2:01 PM Matthew Macy wrote: >> You should probably revert this. The implied understanding of the >> _relaxed version is incorrect. compiler_membar is there to prevent >> instruction reordering which is possible on FreeBSD because the accesses >> are done in C. The relaxed variants still do not permit instruction >> reordering. On Linux __compiler_member (referred to as barrier there) >> isn=E2=80=99t necessary in the mmio accessors because they always use vo= latile >> asm which can=E2=80=99t be reordered. The distinction between the relaxe= d and >> non relaxed variants is that the relaxed variant lacks memory barriers >> (sync / lwsync / eieio on ppc, membar on sparc, etc). Quoting https://gcc.gnu.org/onlinedocs/gcc/Extended-Asm.html: "Note that the compiler can move even volatile asm instructions relative to other code, including across jump instructions." So I think the Linux implementation of the relaxed variant lacks both CPU and compiler barriers. >> Most of the time we don=E2=80=99t run in to problems on x86 because with= TSO >> the only reordering possible is writes that happen before reads can >> become visible in memory after they occur in the instruction stream. Note that these functions are normally used on uncacheable memory which is strongly ordered on x86. There should be no reordering at all. On PowerPC barrier instructions are needed to prevent reordering. From owner-svn-src-all@freebsd.org Sun Nov 18 09:48:53 2018 Return-Path: Delivered-To: svn-src-all@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 D5469113278E; Sun, 18 Nov 2018 09:48:52 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7610774428; Sun, 18 Nov 2018 09:48:52 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3C91B11A7E; Sun, 18 Nov 2018 09:48:52 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAI9mqoC076005; Sun, 18 Nov 2018 09:48:52 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAI9mpHM076002; Sun, 18 Nov 2018 09:48:51 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201811180948.wAI9mpHM076002@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Sun, 18 Nov 2018 09:48:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r340551 - in stable/12/sbin/pfctl/tests: . files X-SVN-Group: stable-12 X-SVN-Commit-Author: kp X-SVN-Commit-Paths: in stable/12/sbin/pfctl/tests: . files X-SVN-Commit-Revision: 340551 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 7610774428 X-Spamd-Result: default: False [-0.05 / 15.00]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.05)[-0.049,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Nov 2018 09:48:53 -0000 Author: kp Date: Sun Nov 18 09:48:51 2018 New Revision: 340551 URL: https://svnweb.freebsd.org/changeset/base/340551 Log: MFC r339466: pfctl tests: Basic test case for PR 231323 PR: 231323 Added: stable/12/sbin/pfctl/tests/files/pf1005.in - copied unchanged from r339466, head/sbin/pfctl/tests/files/pf1005.in stable/12/sbin/pfctl/tests/files/pf1005.ok - copied unchanged from r339466, head/sbin/pfctl/tests/files/pf1005.ok Modified: stable/12/sbin/pfctl/tests/files/pfctl_test_descr.sh stable/12/sbin/pfctl/tests/pfctl_test.sh Directory Properties: stable/12/ (props changed) Copied: stable/12/sbin/pfctl/tests/files/pf1005.in (from r339466, head/sbin/pfctl/tests/files/pf1005.in) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/12/sbin/pfctl/tests/files/pf1005.in Sun Nov 18 09:48:51 2018 (r340551, copy of r339466, head/sbin/pfctl/tests/files/pf1005.in) @@ -0,0 +1,3 @@ +rdr on em0 proto tcp from any to any -> 1.1.1.1 port 2121 +pass out log quick on lo0 route-to lo0 from any to any +pass in log quick on lo0 route-to (lo0 localhost) from any to any Copied: stable/12/sbin/pfctl/tests/files/pf1005.ok (from r339466, head/sbin/pfctl/tests/files/pf1005.ok) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/12/sbin/pfctl/tests/files/pf1005.ok Sun Nov 18 09:48:51 2018 (r340551, copy of r339466, head/sbin/pfctl/tests/files/pf1005.ok) @@ -0,0 +1,2 @@ +pass out log quick on lo0 route-to (lo0 ?) all flags S/SA keep state +pass in log quick on lo0 route-to (lo0 ::1) inet6 all flags S/SA keep state Modified: stable/12/sbin/pfctl/tests/files/pfctl_test_descr.sh ============================================================================== --- stable/12/sbin/pfctl/tests/files/pfctl_test_descr.sh Sun Nov 18 09:47:39 2018 (r340550) +++ stable/12/sbin/pfctl/tests/files/pfctl_test_descr.sh Sun Nov 18 09:48:51 2018 (r340551) @@ -79,3 +79,4 @@ pf1001_descr () { echo "Binat" ; } pf1002_descr () { echo "Set timeout interval" ; } pf1003_descr () { echo "ALTQ" ; } pf1004_descr () { echo "ALTQ with Codel" ; } +pf1005_descr () { echo "PR 231323" ; } Modified: stable/12/sbin/pfctl/tests/pfctl_test.sh ============================================================================== --- stable/12/sbin/pfctl/tests/pfctl_test.sh Sun Nov 18 09:47:39 2018 (r340550) +++ stable/12/sbin/pfctl/tests/pfctl_test.sh Sun Nov 18 09:48:51 2018 (r340551) @@ -22,7 +22,7 @@ pftests="0001 0002 0003 0004 0005 0006 0007 0008 0009 0032 0034 0035 0038 0039 0040 0041 0047 0048 0049 0050 0052 0053 0055 0056 0057 0060 0061 0065 0067 0069 0070 0071 0072 0074 0075 0077 0078 0079 0081 0082 0084 0085 0087 0088 0089 0090 0091 0092 0094 0095 0096 -0097 0098 0100 0101 0102 0104 1001 1002 1003 1004" +0097 0098 0100 0101 0102 0104 1001 1002 1003 1004 1005" . $(atf_get_srcdir)/files/pfctl_test_descr.sh From owner-svn-src-all@freebsd.org Sun Nov 18 09:55:58 2018 Return-Path: Delivered-To: svn-src-all@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 7DFFC1132D34; Sun, 18 Nov 2018 09:55:58 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 22FEE74CD7; Sun, 18 Nov 2018 09:55:58 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 041DF11C16; Sun, 18 Nov 2018 09:55:58 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAI9tvAr081049; Sun, 18 Nov 2018 09:55:57 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAI9tv21081048; Sun, 18 Nov 2018 09:55:57 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201811180955.wAI9tv21081048@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 18 Nov 2018 09:55:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r340554 - stable/12/sys/amd64/amd64 X-SVN-Group: stable-12 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/12/sys/amd64/amd64 X-SVN-Commit-Revision: 340554 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 22FEE74CD7 X-Spamd-Result: default: False [-0.05 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.05)[-0.052,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Nov 2018 09:55:58 -0000 Author: kib Date: Sun Nov 18 09:55:57 2018 New Revision: 340554 URL: https://svnweb.freebsd.org/changeset/base/340554 Log: MFC r339893: Style. Modified: stable/12/sys/amd64/amd64/machdep.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/amd64/amd64/machdep.c ============================================================================== --- stable/12/sys/amd64/amd64/machdep.c Sun Nov 18 09:54:03 2018 (r340553) +++ stable/12/sys/amd64/amd64/machdep.c Sun Nov 18 09:55:57 2018 (r340554) @@ -2694,25 +2694,31 @@ DEFINE_IFUNC(, void *, memset, (void *, int, size_t), { return ((cpu_stdext_feature & CPUID_STDEXT_ERMS) != 0 ? - memset_erms : memset_std); + memset_erms : memset_std); } -void *memmove_std(void * _Nonnull dst, const void * _Nonnull src, size_t len); -void *memmove_erms(void * _Nonnull dst, const void * _Nonnull src, size_t len); -DEFINE_IFUNC(, void *, memmove, (void * _Nonnull, const void * _Nonnull, size_t), static) +void *memmove_std(void * _Nonnull dst, const void * _Nonnull src, + size_t len); +void *memmove_erms(void * _Nonnull dst, const void * _Nonnull src, + size_t len); +DEFINE_IFUNC(, void *, memmove, (void * _Nonnull, const void * _Nonnull, + size_t), static) { return ((cpu_stdext_feature & CPUID_STDEXT_ERMS) != 0 ? - memmove_erms : memmove_std); + memmove_erms : memmove_std); } -void *memcpy_std(void * _Nonnull dst, const void * _Nonnull src, size_t len); -void *memcpy_erms(void * _Nonnull dst, const void * _Nonnull src, size_t len); -DEFINE_IFUNC(, void *, memcpy, (void * _Nonnull, const void * _Nonnull, size_t), static) +void *memcpy_std(void * _Nonnull dst, const void * _Nonnull src, + size_t len); +void *memcpy_erms(void * _Nonnull dst, const void * _Nonnull src, + size_t len); +DEFINE_IFUNC(, void *, memcpy, (void * _Nonnull, const void * _Nonnull,size_t), + static) { return ((cpu_stdext_feature & CPUID_STDEXT_ERMS) != 0 ? - memcpy_erms : memcpy_std); + memcpy_erms : memcpy_std); } void pagezero_std(void *addr); @@ -2721,5 +2727,5 @@ DEFINE_IFUNC(, void , pagezero, (void *), static) { return ((cpu_stdext_feature & CPUID_STDEXT_ERMS) != 0 ? - pagezero_erms : pagezero_std); + pagezero_erms : pagezero_std); } From owner-svn-src-all@freebsd.org Sun Nov 18 09:57:13 2018 Return-Path: Delivered-To: svn-src-all@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 238331132D5E; Sun, 18 Nov 2018 09:57:13 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.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 B849074DC3; Sun, 18 Nov 2018 09:57:12 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 951CE11C17; Sun, 18 Nov 2018 09:57:12 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAI9vCeW081156; Sun, 18 Nov 2018 09:57:12 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAI9vCdE081155; Sun, 18 Nov 2018 09:57:12 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201811180957.wAI9vCdE081155@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 18 Nov 2018 09:57:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r340555 - stable/12/sys/arm/include X-SVN-Group: stable-12 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/12/sys/arm/include X-SVN-Commit-Revision: 340555 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B849074DC3 X-Spamd-Result: default: False [-0.05 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.05)[-0.052,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Nov 2018 09:57:13 -0000 Author: kib Date: Sun Nov 18 09:57:12 2018 New Revision: 340555 URL: https://svnweb.freebsd.org/changeset/base/340555 Log: MFC r340136: Move the fixed base for PIE loading on arm. Modified: stable/12/sys/arm/include/elf.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/arm/include/elf.h ============================================================================== --- stable/12/sys/arm/include/elf.h Sun Nov 18 09:55:57 2018 (r340554) +++ stable/12/sys/arm/include/elf.h Sun Nov 18 09:57:12 2018 (r340555) @@ -116,7 +116,7 @@ __ElfType(Auxinfo); */ #define MAGIC_TRAMP_NUMBER 0x5c000003 -#define ET_DYN_LOAD_ADDR 0x12000 +#define ET_DYN_LOAD_ADDR 0x500000 /* Flags passed in AT_HWCAP. */ #define HWCAP_SWP 0x00000001 /* Unsupported, never set. */ From owner-svn-src-all@freebsd.org Sun Nov 18 10:22:43 2018 Return-Path: Delivered-To: svn-src-all@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 7FC291133A1B; Sun, 18 Nov 2018 10:22:43 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2476275BE0; Sun, 18 Nov 2018 10:22:43 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 05766120FC; Sun, 18 Nov 2018 10:22:43 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAIAMgJE096313; Sun, 18 Nov 2018 10:22:42 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAIAMgT4096312; Sun, 18 Nov 2018 10:22:42 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201811181022.wAIAMgT4096312@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 18 Nov 2018 10:22:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r340557 - stable/11/libexec/rtld-elf/amd64 X-SVN-Group: stable-11 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/11/libexec/rtld-elf/amd64 X-SVN-Commit-Revision: 340557 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 2476275BE0 X-Spamd-Result: default: False [-0.05 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.05)[-0.052,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Nov 2018 10:22:43 -0000 Author: kib Date: Sun Nov 18 10:22:42 2018 New Revision: 340557 URL: https://svnweb.freebsd.org/changeset/base/340557 Log: MFC r339897: Remove rtld use of libc amd64_set_fsbase(). Modified: stable/11/libexec/rtld-elf/amd64/reloc.c Directory Properties: stable/11/ (props changed) Modified: stable/11/libexec/rtld-elf/amd64/reloc.c ============================================================================== --- stable/11/libexec/rtld-elf/amd64/reloc.c Sun Nov 18 09:58:36 2018 (r340556) +++ stable/11/libexec/rtld-elf/amd64/reloc.c Sun Nov 18 10:22:42 2018 (r340557) @@ -33,8 +33,9 @@ #include #include -#include #include +#include +#include #include #include @@ -490,17 +491,26 @@ pre_init(void) } +int __getosreldate(void); + void allocate_initial_tls(Obj_Entry *objs) { - /* - * Fix the size of the static TLS block by using the maximum - * offset allocated so far and adding a bit for dynamic modules to - * use. - */ - tls_static_space = tls_last_offset + RTLD_STATIC_TLS_EXTRA; - amd64_set_fsbase(allocate_tls(objs, 0, - 3*sizeof(Elf_Addr), sizeof(Elf_Addr))); + void *addr; + + /* + * Fix the size of the static TLS block by using the maximum + * offset allocated so far and adding a bit for dynamic + * modules to use. + */ + tls_static_space = tls_last_offset + RTLD_STATIC_TLS_EXTRA; + + addr = allocate_tls(objs, 0, 3 * sizeof(Elf_Addr), sizeof(Elf_Addr)); + if (__getosreldate() >= P_OSREL_WRFSBASE && + (cpu_stdext_feature & CPUID_STDEXT_FSGSBASE) != 0) + wrfsbase((uintptr_t)addr); + else + sysarch(AMD64_SET_FSBASE, &addr); } void *__tls_get_addr(tls_index *ti) From owner-svn-src-all@freebsd.org Sun Nov 18 09:47:44 2018 Return-Path: Delivered-To: svn-src-all@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 3E4681132752; Sun, 18 Nov 2018 09:47:44 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D639074318; Sun, 18 Nov 2018 09:47:43 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 74B3511A79; Sun, 18 Nov 2018 09:47:40 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAI9lelR075873; Sun, 18 Nov 2018 09:47:40 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAI9leM5075872; Sun, 18 Nov 2018 09:47:40 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201811180947.wAI9leM5075872@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Sun, 18 Nov 2018 09:47:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r340550 - stable/11/sbin/pfctl X-SVN-Group: stable-11 X-SVN-Commit-Author: kp X-SVN-Commit-Paths: stable/11/sbin/pfctl X-SVN-Commit-Revision: 340550 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D639074318 X-Spamd-Result: default: False [-0.05 / 15.00]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.05)[-0.052,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Nov 2018 09:47:44 -0000 Author: kp Date: Sun Nov 18 09:47:39 2018 New Revision: 340550 URL: https://svnweb.freebsd.org/changeset/base/340550 Log: MFC r339464: pfctl: Dup strings When we set the ifname we have to copy the string, rather than just keep the pointer. PR: 231323 Modified: stable/11/sbin/pfctl/parse.y Directory Properties: stable/11/ (props changed) Modified: stable/11/sbin/pfctl/parse.y ============================================================================== --- stable/11/sbin/pfctl/parse.y Sun Nov 18 09:47:30 2018 (r340549) +++ stable/11/sbin/pfctl/parse.y Sun Nov 18 09:47:39 2018 (r340550) @@ -4402,7 +4402,7 @@ route_host : STRING { $$ = calloc(1, sizeof(struct node_host)); if ($$ == NULL) err(1, "route_host: calloc"); - $$->ifname = $1; + $$->ifname = strdup($1); set_ipmask($$, 128); $$->next = NULL; $$->tail = $$; @@ -4412,7 +4412,7 @@ route_host : STRING { $$ = $3; for (n = $3; n != NULL; n = n->next) - n->ifname = $2; + n->ifname = strdup($2); } ; From owner-svn-src-all@freebsd.org Sun Nov 18 09:49:26 2018 Return-Path: Delivered-To: svn-src-all@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 5112011327C6; Sun, 18 Nov 2018 09:49:26 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EA34E74519; Sun, 18 Nov 2018 09:49:25 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CB32111A80; Sun, 18 Nov 2018 09:49:25 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAI9nPUL076104; Sun, 18 Nov 2018 09:49:25 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAI9nOpa076097; Sun, 18 Nov 2018 09:49:24 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201811180949.wAI9nOpa076097@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 18 Nov 2018 09:49:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r340552 - in stable/12/sys: amd64/amd64 amd64/ia32 amd64/include dev/cpuctl X-SVN-Group: stable-12 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in stable/12/sys: amd64/amd64 amd64/ia32 amd64/include dev/cpuctl X-SVN-Commit-Revision: 340552 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: EA34E74519 X-Spamd-Result: default: False [-0.05 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.05)[-0.049,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Nov 2018 09:49:26 -0000 Author: kib Date: Sun Nov 18 09:49:24 2018 New Revision: 340552 URL: https://svnweb.freebsd.org/changeset/base/340552 Log: MFC r339507: amd64: flush L1 data cache on syscall return with an error. Modified: stable/12/sys/amd64/amd64/initcpu.c stable/12/sys/amd64/amd64/machdep.c stable/12/sys/amd64/amd64/support.S stable/12/sys/amd64/amd64/trap.c stable/12/sys/amd64/ia32/ia32_syscall.c stable/12/sys/amd64/include/md_var.h stable/12/sys/dev/cpuctl/cpuctl.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/amd64/amd64/initcpu.c ============================================================================== --- stable/12/sys/amd64/amd64/initcpu.c Sun Nov 18 09:48:51 2018 (r340551) +++ stable/12/sys/amd64/amd64/initcpu.c Sun Nov 18 09:49:24 2018 (r340552) @@ -253,6 +253,7 @@ initializecpu(void) } hw_ibrs_recalculate(); hw_ssb_recalculate(false); + amd64_syscall_ret_flush_l1d_recalc(); switch (cpu_vendor_id) { case CPU_VENDOR_AMD: init_amd(); Modified: stable/12/sys/amd64/amd64/machdep.c ============================================================================== --- stable/12/sys/amd64/amd64/machdep.c Sun Nov 18 09:48:51 2018 (r340551) +++ stable/12/sys/amd64/amd64/machdep.c Sun Nov 18 09:49:24 2018 (r340552) @@ -1728,6 +1728,11 @@ hammer_time(u_int64_t modulep, u_int64_t physfree) != NULL) vty_set_preferred(VTY_VT); + TUNABLE_INT_FETCH("hw.ibrs_disable", &hw_ibrs_disable); + TUNABLE_INT_FETCH("hw.spec_store_bypass_disable", &hw_ssb_disable); + TUNABLE_INT_FETCH("machdep.syscall_ret_l1d_flush", + &syscall_ret_l1d_flush_mode); + finishidentcpu(); /* Final stage of CPU initialization */ initializecpu(); /* Initialize CPU registers */ @@ -1875,9 +1880,6 @@ hammer_time(u_int64_t modulep, u_int64_t physfree) x86_init_fdt(); #endif thread0.td_critnest = 0; - - TUNABLE_INT_FETCH("hw.ibrs_disable", &hw_ibrs_disable); - TUNABLE_INT_FETCH("hw.spec_store_bypass_disable", &hw_ssb_disable); TSEXIT(); Modified: stable/12/sys/amd64/amd64/support.S ============================================================================== --- stable/12/sys/amd64/amd64/support.S Sun Nov 18 09:48:51 2018 (r340551) +++ stable/12/sys/amd64/amd64/support.S Sun Nov 18 09:49:24 2018 (r340552) @@ -1556,3 +1556,10 @@ ENTRY(flush_l1d_sw) ret #undef L1D_FLUSH_SIZE END(flush_l1d_sw) + +ENTRY(flush_l1d_sw_abi) + pushq %rbx + call flush_l1d_sw + popq %rbx + ret +END(flush_l1d_sw_abi) Modified: stable/12/sys/amd64/amd64/trap.c ============================================================================== --- stable/12/sys/amd64/amd64/trap.c Sun Nov 18 09:48:51 2018 (r340551) +++ stable/12/sys/amd64/amd64/trap.c Sun Nov 18 09:49:24 2018 (r340552) @@ -1056,6 +1056,84 @@ cpu_fetch_syscall_args(struct thread *td) #include "../../kern/subr_syscall.c" +static void (*syscall_ret_l1d_flush)(void); +int syscall_ret_l1d_flush_mode; + +static void +flush_l1d_hw(void) +{ + + wrmsr(MSR_IA32_FLUSH_CMD, IA32_FLUSH_CMD_L1D); +} + +static void __inline +amd64_syscall_ret_flush_l1d_inline(int error) +{ + void (*p)(void); + + if (error != 0 && error != EEXIST && error != EAGAIN && + error != EXDEV && error != ENOENT && error != ENOTCONN && + error != EINPROGRESS) { + p = syscall_ret_l1d_flush; + if (p != NULL) + p(); + } +} + +void +amd64_syscall_ret_flush_l1d(int error) +{ + + amd64_syscall_ret_flush_l1d_inline(error); +} + +void +amd64_syscall_ret_flush_l1d_recalc(void) +{ + bool l1d_hw; + + l1d_hw = (cpu_stdext_feature3 & CPUID_STDEXT3_L1D_FLUSH) != 0; +again: + switch (syscall_ret_l1d_flush_mode) { + case 0: + syscall_ret_l1d_flush = NULL; + break; + case 1: + syscall_ret_l1d_flush = l1d_hw ? flush_l1d_hw : + flush_l1d_sw_abi; + break; + case 2: + syscall_ret_l1d_flush = l1d_hw ? flush_l1d_hw : NULL; + break; + case 3: + syscall_ret_l1d_flush = flush_l1d_sw_abi; + break; + default: + syscall_ret_l1d_flush_mode = 1; + goto again; + } +} + +static int +machdep_syscall_ret_flush_l1d(SYSCTL_HANDLER_ARGS) +{ + int error, val; + + val = syscall_ret_l1d_flush_mode; + error = sysctl_handle_int(oidp, &val, 0, req); + if (error != 0 || req->newptr == NULL) + return (error); + syscall_ret_l1d_flush_mode = val; + amd64_syscall_ret_flush_l1d_recalc(); + return (0); +} +SYSCTL_PROC(_machdep, OID_AUTO, syscall_ret_flush_l1d, CTLTYPE_INT | + CTLFLAG_RWTUN | CTLFLAG_NOFETCH | CTLFLAG_MPSAFE, NULL, 0, + machdep_syscall_ret_flush_l1d, "I", + "Flush L1D on syscall return with error (0 - off, 1 - on, " + "2 - use hw only, 3 - use sw only"); + + /* * System call handler for native binaries. The trap frame is already * set up by the assembler trampoline and a pointer to it is saved in @@ -1110,4 +1188,6 @@ amd64_syscall(struct thread *td, int traced) */ if (__predict_false(td->td_frame->tf_rip >= VM_MAXUSER_ADDRESS)) set_pcb_flags(td->td_pcb, PCB_FULL_IRET); + + amd64_syscall_ret_flush_l1d_inline(error); } Modified: stable/12/sys/amd64/ia32/ia32_syscall.c ============================================================================== --- stable/12/sys/amd64/ia32/ia32_syscall.c Sun Nov 18 09:48:51 2018 (r340551) +++ stable/12/sys/amd64/ia32/ia32_syscall.c Sun Nov 18 09:49:24 2018 (r340552) @@ -231,6 +231,7 @@ ia32_syscall(struct trapframe *frame) } syscallret(td, error); + amd64_syscall_ret_flush_l1d(error); } static void Modified: stable/12/sys/amd64/include/md_var.h ============================================================================== --- stable/12/sys/amd64/include/md_var.h Sun Nov 18 09:48:51 2018 (r340551) +++ stable/12/sys/amd64/include/md_var.h Sun Nov 18 09:49:24 2018 (r340552) @@ -41,6 +41,7 @@ extern int hw_lower_amd64_sharedpage; extern int hw_ibrs_disable; extern int hw_ssb_disable; extern int nmi_flush_l1d_sw; +extern int syscall_ret_l1d_flush_mode; extern vm_paddr_t intel_graphics_stolen_base; extern vm_paddr_t intel_graphics_stolen_size; @@ -58,8 +59,11 @@ void amd64_conf_fast_syscall(void); void amd64_db_resume_dbreg(void); void amd64_lower_shared_page(struct sysentvec *); void amd64_syscall(struct thread *td, int traced); +void amd64_syscall_ret_flush_l1d(int error); +void amd64_syscall_ret_flush_l1d_recalc(void); void doreti_iret(void) __asm(__STRING(doreti_iret)); void doreti_iret_fault(void) __asm(__STRING(doreti_iret_fault)); +void flush_l1d_sw_abi(void); void ld_ds(void) __asm(__STRING(ld_ds)); void ld_es(void) __asm(__STRING(ld_es)); void ld_fs(void) __asm(__STRING(ld_fs)); Modified: stable/12/sys/dev/cpuctl/cpuctl.c ============================================================================== --- stable/12/sys/dev/cpuctl/cpuctl.c Sun Nov 18 09:48:51 2018 (r340551) +++ stable/12/sys/dev/cpuctl/cpuctl.c Sun Nov 18 09:49:24 2018 (r340552) @@ -521,6 +521,9 @@ cpuctl_do_eval_cpu_features(int cpu, struct thread *td hw_ibrs_recalculate(); restore_cpu(oldcpu, is_bound, td); hw_ssb_recalculate(true); +#ifdef __amd64__ + amd64_syscall_ret_flush_l1d_recalc(); +#endif printcpuinfo(); return (0); } From owner-svn-src-all@freebsd.org Sun Nov 18 10:57:32 2018 Return-Path: Delivered-To: svn-src-all@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 3409A11350B9; Sun, 18 Nov 2018 10:57:32 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CB52477141; Sun, 18 Nov 2018 10:57:31 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AC51A125E6; Sun, 18 Nov 2018 10:57:31 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAIAvVpn012014; Sun, 18 Nov 2018 10:57:31 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAIAvVvE012013; Sun, 18 Nov 2018 10:57:31 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201811181057.wAIAvVvE012013@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Sun, 18 Nov 2018 10:57:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r340562 - stable/12/sys/netpfil/pf X-SVN-Group: stable-12 X-SVN-Commit-Author: kp X-SVN-Commit-Paths: stable/12/sys/netpfil/pf X-SVN-Commit-Revision: 340562 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: CB52477141 X-Spamd-Result: default: False [-0.05 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.05)[-0.052,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Nov 2018 10:57:32 -0000 Author: kp Date: Sun Nov 18 10:57:31 2018 New Revision: 340562 URL: https://svnweb.freebsd.org/changeset/base/340562 Log: MFC r339676: pf: Fix copy/paste error in IPv6 address rewriting We checked the destination address, but replaced the source address. This was fixed in OpenBSD as part of their NAT rework, which we don't want to import right now. CID: 1009561 Modified: stable/12/sys/netpfil/pf/pf.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/netpfil/pf/pf.c ============================================================================== --- stable/12/sys/netpfil/pf/pf.c Sun Nov 18 10:54:47 2018 (r340561) +++ stable/12/sys/netpfil/pf/pf.c Sun Nov 18 10:57:31 2018 (r340562) @@ -3429,7 +3429,7 @@ pf_test_rule(struct pf_rule **rm, struct pf_state **sm if (PF_ANEQ(daddr, &nk->addr[pd->didx], AF_INET6)) - PF_ACPY(saddr, &nk->addr[pd->didx], af); + PF_ACPY(daddr, &nk->addr[pd->didx], af); break; #endif /* INET */ } From owner-svn-src-all@freebsd.org Sun Nov 18 09:54:04 2018 Return-Path: Delivered-To: svn-src-all@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 35BB61132C77; Sun, 18 Nov 2018 09:54:04 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C8C8674B7C; Sun, 18 Nov 2018 09:54:03 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A9BDC11C10; Sun, 18 Nov 2018 09:54:03 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAI9s3JO080893; Sun, 18 Nov 2018 09:54:03 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAI9s3gr080892; Sun, 18 Nov 2018 09:54:03 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201811180954.wAI9s3gr080892@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 18 Nov 2018 09:54:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r340553 - stable/12/libexec/rtld-elf/amd64 X-SVN-Group: stable-12 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/12/libexec/rtld-elf/amd64 X-SVN-Commit-Revision: 340553 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C8C8674B7C X-Spamd-Result: default: False [-0.05 / 15.00]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.05)[-0.052,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Nov 2018 09:54:04 -0000 Author: kib Date: Sun Nov 18 09:54:03 2018 New Revision: 340553 URL: https://svnweb.freebsd.org/changeset/base/340553 Log: MFC r339897: Remove rtld use of libc amd64_set_fsbase(). Modified: stable/12/libexec/rtld-elf/amd64/reloc.c Directory Properties: stable/12/ (props changed) Modified: stable/12/libexec/rtld-elf/amd64/reloc.c ============================================================================== --- stable/12/libexec/rtld-elf/amd64/reloc.c Sun Nov 18 09:49:24 2018 (r340552) +++ stable/12/libexec/rtld-elf/amd64/reloc.c Sun Nov 18 09:54:03 2018 (r340553) @@ -35,8 +35,9 @@ #include #include -#include #include +#include +#include #include #include @@ -492,17 +493,26 @@ pre_init(void) } +int __getosreldate(void); + void allocate_initial_tls(Obj_Entry *objs) { - /* - * Fix the size of the static TLS block by using the maximum - * offset allocated so far and adding a bit for dynamic modules to - * use. - */ - tls_static_space = tls_last_offset + RTLD_STATIC_TLS_EXTRA; - amd64_set_fsbase(allocate_tls(objs, 0, - 3*sizeof(Elf_Addr), sizeof(Elf_Addr))); + void *addr; + + /* + * Fix the size of the static TLS block by using the maximum + * offset allocated so far and adding a bit for dynamic + * modules to use. + */ + tls_static_space = tls_last_offset + RTLD_STATIC_TLS_EXTRA; + + addr = allocate_tls(objs, 0, 3 * sizeof(Elf_Addr), sizeof(Elf_Addr)); + if (__getosreldate() >= P_OSREL_WRFSBASE && + (cpu_stdext_feature & CPUID_STDEXT_FSGSBASE) != 0) + wrfsbase((uintptr_t)addr); + else + sysarch(AMD64_SET_FSBASE, &addr); } void *__tls_get_addr(tls_index *ti) From owner-svn-src-all@freebsd.org Sun Nov 18 09:58:37 2018 Return-Path: Delivered-To: svn-src-all@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 1B41B1132DCD; Sun, 18 Nov 2018 09:58:37 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B087D74EC0; Sun, 18 Nov 2018 09:58:36 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8F0B611C1D; Sun, 18 Nov 2018 09:58:36 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAI9wa0V081267; Sun, 18 Nov 2018 09:58:36 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAI9waoR081266; Sun, 18 Nov 2018 09:58:36 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201811180958.wAI9waoR081266@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 18 Nov 2018 09:58:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r340556 - stable/11/sys/arm/include X-SVN-Group: stable-11 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/11/sys/arm/include X-SVN-Commit-Revision: 340556 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B087D74EC0 X-Spamd-Result: default: False [-0.05 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.05)[-0.052,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Nov 2018 09:58:37 -0000 Author: kib Date: Sun Nov 18 09:58:36 2018 New Revision: 340556 URL: https://svnweb.freebsd.org/changeset/base/340556 Log: MFC r340136: Move the fixed base for PIE loading on arm. Modified: stable/11/sys/arm/include/elf.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/arm/include/elf.h ============================================================================== --- stable/11/sys/arm/include/elf.h Sun Nov 18 09:57:12 2018 (r340555) +++ stable/11/sys/arm/include/elf.h Sun Nov 18 09:58:36 2018 (r340556) @@ -114,7 +114,7 @@ __ElfType(Auxinfo); */ #define MAGIC_TRAMP_NUMBER 0x5c000003 -#define ET_DYN_LOAD_ADDR 0x12000 +#define ET_DYN_LOAD_ADDR 0x500000 /* Flags passed in AT_HWCAP. */ #define HWCAP_SWP 0x00000001 /* Unsupported, never set. */ From owner-svn-src-all@freebsd.org Sun Nov 18 11:11:28 2018 Return-Path: Delivered-To: svn-src-all@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 434C9113579A; Sun, 18 Nov 2018 11:11:28 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DDDAC779C4; Sun, 18 Nov 2018 11:11:27 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C0113127EB; Sun, 18 Nov 2018 11:11:27 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAIBBROg020696; Sun, 18 Nov 2018 11:11:27 GMT (envelope-from oshogbo@FreeBSD.org) Received: (from oshogbo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAIBBRaJ020695; Sun, 18 Nov 2018 11:11:27 GMT (envelope-from oshogbo@FreeBSD.org) Message-Id: <201811181111.wAIBBRaJ020695@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: oshogbo set sender to oshogbo@FreeBSD.org using -f From: Mariusz Zaborski Date: Sun, 18 Nov 2018 11:11:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340564 - head/lib/libcasper/services/cap_dns X-SVN-Group: head X-SVN-Commit-Author: oshogbo X-SVN-Commit-Paths: head/lib/libcasper/services/cap_dns X-SVN-Commit-Revision: 340564 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: DDDAC779C4 X-Spamd-Result: default: False [0.03 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.03)[0.033,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Nov 2018 11:11:28 -0000 Author: oshogbo Date: Sun Nov 18 11:11:27 2018 New Revision: 340564 URL: https://svnweb.freebsd.org/changeset/base/340564 Log: Update the names in the LIMITS and EXAMPLES sections after r340363. Reported by: markj Modified: head/lib/libcasper/services/cap_dns/cap_dns.3 Modified: head/lib/libcasper/services/cap_dns/cap_dns.3 ============================================================================== --- head/lib/libcasper/services/cap_dns/cap_dns.3 Sun Nov 18 10:57:39 2018 (r340563) +++ head/lib/libcasper/services/cap_dns/cap_dns.3 Sun Nov 18 11:11:27 2018 (r340564) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 12, 2018 +.Dd November 18, 2018 .Dt CAP_DNS 3 .Os .Sh NAME @@ -133,7 +133,7 @@ can have two values: or .Dv NAME2ADDR . The -.Dv ADDR +.Dv ADDR2NAME means that reverse DNS lookups are allowed with .Fn cap_getnameinfo and @@ -142,7 +142,7 @@ functions. In case when .Va type is set to -.Dv NAME +.Dv NAME2ADDR the name resolution is allowed with .Fn cap_getaddrinfo , .Fn cap_gethostbyname , @@ -164,7 +164,7 @@ casper service and uses it to resolve an IP address. cap_channel_t *capcas, *capdns; int familylimit, error; const char *ipstr = "127.0.0.1"; -const char *typelimit = "ADDR"; +const char *typelimit = "ADDR2NAME"; char hname[NI_MAXHOST]; struct addrinfo hints, *res; From owner-svn-src-all@freebsd.org Sun Nov 18 10:47:51 2018 Return-Path: Delivered-To: svn-src-all@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 CD4A21134D28; Sun, 18 Nov 2018 10:47:51 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5C9B576B35; Sun, 18 Nov 2018 10:47:51 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3E7C11244B; Sun, 18 Nov 2018 10:47:51 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAIAlpjG006728; Sun, 18 Nov 2018 10:47:51 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAIAlpGn006727; Sun, 18 Nov 2018 10:47:51 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201811181047.wAIAlpGn006727@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Sun, 18 Nov 2018 10:47:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r340559 - stable/11/sys/netpfil/pf X-SVN-Group: stable-11 X-SVN-Commit-Author: kp X-SVN-Commit-Paths: stable/11/sys/netpfil/pf X-SVN-Commit-Revision: 340559 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 5C9B576B35 X-Spamd-Result: default: False [-0.05 / 15.00]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.05)[-0.052,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Nov 2018 10:47:52 -0000 Author: kp Date: Sun Nov 18 10:47:50 2018 New Revision: 340559 URL: https://svnweb.freebsd.org/changeset/base/340559 Log: MFC r339470: pf synproxy will do the 3WHS on behalf of the target machine, and once the 3WHS is completed, establish the backend connection. The trigger for "3WHS completed" is the reception of the first ACK. However, we should not proceed if that ACK also has RST or FIN set. PR: 197484 Obtained from: OpenBSD Modified: stable/11/sys/netpfil/pf/pf.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/netpfil/pf/pf.c ============================================================================== --- stable/11/sys/netpfil/pf/pf.c Sun Nov 18 10:47:36 2018 (r340558) +++ stable/11/sys/netpfil/pf/pf.c Sun Nov 18 10:47:50 2018 (r340559) @@ -4389,7 +4389,7 @@ pf_test_state_tcp(struct pf_state **state, int directi TH_SYN|TH_ACK, 0, (*state)->src.mss, 0, 1, 0, NULL); REASON_SET(reason, PFRES_SYNPROXY); return (PF_SYNPROXY_DROP); - } else if (!(th->th_flags & TH_ACK) || + } else if ((th->th_flags & (TH_ACK|TH_RST|TH_FIN)) != TH_ACK || (ntohl(th->th_ack) != (*state)->src.seqhi + 1) || (ntohl(th->th_seq) != (*state)->src.seqlo + 1)) { REASON_SET(reason, PFRES_SYNPROXY); From owner-svn-src-all@freebsd.org Sun Nov 18 10:54:39 2018 Return-Path: Delivered-To: svn-src-all@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 E08FA1135003; Sun, 18 Nov 2018 10:54:39 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8271276F1D; Sun, 18 Nov 2018 10:54:39 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5FEF0125DC; Sun, 18 Nov 2018 10:54:39 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAIAsdCq011730; Sun, 18 Nov 2018 10:54:39 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAIAsdle011729; Sun, 18 Nov 2018 10:54:39 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201811181054.wAIAsdle011729@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Sun, 18 Nov 2018 10:54:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r340560 - stable/11/sbin/pfctl X-SVN-Group: stable-11 X-SVN-Commit-Author: kp X-SVN-Commit-Paths: stable/11/sbin/pfctl X-SVN-Commit-Revision: 340560 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 8271276F1D X-Spamd-Result: default: False [-0.05 / 15.00]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.05)[-0.052,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Nov 2018 10:54:40 -0000 Author: kp Date: Sun Nov 18 10:54:38 2018 New Revision: 340560 URL: https://svnweb.freebsd.org/changeset/base/340560 Log: MFC r339578: pfctl: Fix line numbers when \ is used inside "" PR: 201520 Obtained from: OpenBSD Modified: stable/11/sbin/pfctl/parse.y Directory Properties: stable/11/ (props changed) Modified: stable/11/sbin/pfctl/parse.y ============================================================================== --- stable/11/sbin/pfctl/parse.y Sun Nov 18 10:47:50 2018 (r340559) +++ stable/11/sbin/pfctl/parse.y Sun Nov 18 10:54:38 2018 (r340560) @@ -5758,8 +5758,10 @@ top: return (0); if (next == quotec || c == ' ' || c == '\t') c = next; - else if (next == '\n') + else if (next == '\n') { + file->lineno++; continue; + } else lungetc(next); } else if (c == quotec) { From owner-svn-src-all@freebsd.org Sun Nov 18 10:57:43 2018 Return-Path: Delivered-To: svn-src-all@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 6597411350BF; Sun, 18 Nov 2018 10:57:43 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 08B13771F7; Sun, 18 Nov 2018 10:57:43 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 133CC125E7; Sun, 18 Nov 2018 10:57:40 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAIAvdSk012069; Sun, 18 Nov 2018 10:57:39 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAIAvd77012068; Sun, 18 Nov 2018 10:57:39 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201811181057.wAIAvd77012068@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Sun, 18 Nov 2018 10:57:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r340563 - stable/11/sys/netpfil/pf X-SVN-Group: stable-11 X-SVN-Commit-Author: kp X-SVN-Commit-Paths: stable/11/sys/netpfil/pf X-SVN-Commit-Revision: 340563 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 08B13771F7 X-Spamd-Result: default: False [-0.05 / 15.00]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.05)[-0.052,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Nov 2018 10:57:43 -0000 Author: kp Date: Sun Nov 18 10:57:39 2018 New Revision: 340563 URL: https://svnweb.freebsd.org/changeset/base/340563 Log: MFC r339676: pf: Fix copy/paste error in IPv6 address rewriting We checked the destination address, but replaced the source address. This was fixed in OpenBSD as part of their NAT rework, which we don't want to import right now. CID: 1009561 Modified: stable/11/sys/netpfil/pf/pf.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/netpfil/pf/pf.c ============================================================================== --- stable/11/sys/netpfil/pf/pf.c Sun Nov 18 10:57:31 2018 (r340562) +++ stable/11/sys/netpfil/pf/pf.c Sun Nov 18 10:57:39 2018 (r340563) @@ -3417,7 +3417,7 @@ pf_test_rule(struct pf_rule **rm, struct pf_state **sm if (PF_ANEQ(daddr, &nk->addr[pd->didx], AF_INET6)) - PF_ACPY(saddr, &nk->addr[pd->didx], af); + PF_ACPY(daddr, &nk->addr[pd->didx], af); break; #endif /* INET */ } From owner-svn-src-all@freebsd.org Sun Nov 18 11:55:58 2018 Return-Path: Delivered-To: svn-src-all@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 328941137394; Sun, 18 Nov 2018 11:55:58 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C7F4979854; Sun, 18 Nov 2018 11:55:57 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A8E8313009; Sun, 18 Nov 2018 11:55:57 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAIBtvnZ042954; Sun, 18 Nov 2018 11:55:57 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAIBtuZU042946; Sun, 18 Nov 2018 11:55:56 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201811181155.wAIBtuZU042946@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Sun, 18 Nov 2018 11:55:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r340565 - in stable/12/sys: net netpfil/pf X-SVN-Group: stable-12 X-SVN-Commit-Author: kp X-SVN-Commit-Paths: in stable/12/sys: net netpfil/pf X-SVN-Commit-Revision: 340565 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C7F4979854 X-Spamd-Result: default: False [0.06 / 15.00]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.06)[0.064,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Nov 2018 11:55:58 -0000 Author: kp Date: Sun Nov 18 11:55:56 2018 New Revision: 340565 URL: https://svnweb.freebsd.org/changeset/base/340565 Log: MFC r340065: pfsync: Make pfsync callbacks per-vnet The callbacks are installed and removed depending on the state of the pfsync device, which is per-vnet. The callbacks must also be per-vnet. Sponsored by: Orange Business Services Modified: stable/12/sys/net/pfvar.h stable/12/sys/netpfil/pf/if_pfsync.c stable/12/sys/netpfil/pf/pf.c stable/12/sys/netpfil/pf/pf_ioctl.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/net/pfvar.h ============================================================================== --- stable/12/sys/net/pfvar.h Sun Nov 18 11:11:27 2018 (r340564) +++ stable/12/sys/net/pfvar.h Sun Nov 18 11:55:56 2018 (r340565) @@ -825,12 +825,18 @@ typedef void pfsync_delete_state_t(struct pf_state *) typedef void pfsync_clear_states_t(u_int32_t, const char *); typedef int pfsync_defer_t(struct pf_state *, struct mbuf *); -extern pfsync_state_import_t *pfsync_state_import_ptr; -extern pfsync_insert_state_t *pfsync_insert_state_ptr; -extern pfsync_update_state_t *pfsync_update_state_ptr; -extern pfsync_delete_state_t *pfsync_delete_state_ptr; -extern pfsync_clear_states_t *pfsync_clear_states_ptr; -extern pfsync_defer_t *pfsync_defer_ptr; +VNET_DECLARE(pfsync_state_import_t *, pfsync_state_import_ptr); +#define V_pfsync_state_import_ptr VNET(pfsync_state_import_ptr) +VNET_DECLARE(pfsync_insert_state_t *, pfsync_insert_state_ptr); +#define V_pfsync_insert_state_ptr VNET(pfsync_insert_state_ptr) +VNET_DECLARE(pfsync_update_state_t *, pfsync_update_state_ptr); +#define V_pfsync_update_state_ptr VNET(pfsync_update_state_ptr) +VNET_DECLARE(pfsync_delete_state_t *, pfsync_delete_state_ptr); +#define V_pfsync_delete_state_ptr VNET(pfsync_delete_state_ptr) +VNET_DECLARE(pfsync_clear_states_t *, pfsync_clear_states_ptr); +#define V_pfsync_clear_states_ptr VNET(pfsync_clear_states_ptr) +VNET_DECLARE(pfsync_defer_t *, pfsync_defer_ptr); +#define V_pfsync_defer_ptr VNET(pfsync_defer_ptr) void pfsync_state_export(struct pfsync_state *, struct pf_state *); Modified: stable/12/sys/netpfil/pf/if_pfsync.c ============================================================================== --- stable/12/sys/netpfil/pf/if_pfsync.c Sun Nov 18 11:11:27 2018 (r340564) +++ stable/12/sys/netpfil/pf/if_pfsync.c Sun Nov 18 11:55:56 2018 (r340565) @@ -1362,10 +1362,10 @@ pfsyncioctl(struct ifnet *ifp, u_long cmd, caddr_t dat sc->sc_maxupdates = pfsyncr.pfsyncr_maxupdates; if (pfsyncr.pfsyncr_defer) { sc->sc_flags |= PFSYNCF_DEFER; - pfsync_defer_ptr = pfsync_defer; + V_pfsync_defer_ptr = pfsync_defer; } else { sc->sc_flags &= ~PFSYNCF_DEFER; - pfsync_defer_ptr = NULL; + V_pfsync_defer_ptr = NULL; } if (sifp == NULL) { @@ -2311,12 +2311,12 @@ pfsync_pointers_init() { PF_RULES_WLOCK(); - pfsync_state_import_ptr = pfsync_state_import; - pfsync_insert_state_ptr = pfsync_insert_state; - pfsync_update_state_ptr = pfsync_update_state; - pfsync_delete_state_ptr = pfsync_delete_state; - pfsync_clear_states_ptr = pfsync_clear_states; - pfsync_defer_ptr = pfsync_defer; + V_pfsync_state_import_ptr = pfsync_state_import; + V_pfsync_insert_state_ptr = pfsync_insert_state; + V_pfsync_update_state_ptr = pfsync_update_state; + V_pfsync_delete_state_ptr = pfsync_delete_state; + V_pfsync_clear_states_ptr = pfsync_clear_states; + V_pfsync_defer_ptr = pfsync_defer; PF_RULES_WUNLOCK(); } @@ -2325,12 +2325,12 @@ pfsync_pointers_uninit() { PF_RULES_WLOCK(); - pfsync_state_import_ptr = NULL; - pfsync_insert_state_ptr = NULL; - pfsync_update_state_ptr = NULL; - pfsync_delete_state_ptr = NULL; - pfsync_clear_states_ptr = NULL; - pfsync_defer_ptr = NULL; + V_pfsync_state_import_ptr = NULL; + V_pfsync_insert_state_ptr = NULL; + V_pfsync_update_state_ptr = NULL; + V_pfsync_delete_state_ptr = NULL; + V_pfsync_clear_states_ptr = NULL; + V_pfsync_defer_ptr = NULL; PF_RULES_WUNLOCK(); } @@ -2347,6 +2347,8 @@ vnet_pfsync_init(const void *unused __unused) if_clone_detach(V_pfsync_cloner); log(LOG_INFO, "swi_add() failed in %s\n", __func__); } + + pfsync_pointers_init(); } VNET_SYSINIT(vnet_pfsync_init, SI_SUB_PROTO_FIREWALL, SI_ORDER_ANY, vnet_pfsync_init, NULL); @@ -2355,6 +2357,8 @@ static void vnet_pfsync_uninit(const void *unused __unused) { + pfsync_pointers_uninit(); + if_clone_detach(V_pfsync_cloner); swi_remove(V_pfsync_swi_cookie); } @@ -2380,7 +2384,6 @@ pfsync_init() return (error); } #endif - pfsync_pointers_init(); return (0); } @@ -2388,8 +2391,6 @@ pfsync_init() static void pfsync_uninit() { - - pfsync_pointers_uninit(); #ifdef INET ipproto_unregister(IPPROTO_PFSYNC); Modified: stable/12/sys/netpfil/pf/pf.c ============================================================================== --- stable/12/sys/netpfil/pf/pf.c Sun Nov 18 11:11:27 2018 (r340564) +++ stable/12/sys/netpfil/pf/pf.c Sun Nov 18 11:55:56 2018 (r340565) @@ -1268,8 +1268,8 @@ pf_state_insert(struct pfi_kif *kif, struct pf_state_k refcount_init(&s->refs, 2); counter_u64_add(V_pf_status.fcounters[FCNT_STATE_INSERT], 1); - if (pfsync_insert_state_ptr != NULL) - pfsync_insert_state_ptr(s); + if (V_pfsync_insert_state_ptr != NULL) + V_pfsync_insert_state_ptr(s); /* Returns locked. */ return (0); @@ -1672,8 +1672,8 @@ pf_unlink_state(struct pf_state *s, u_int flags) LIST_REMOVE(s, entry); pf_src_tree_remove_state(s); - if (pfsync_delete_state_ptr != NULL) - pfsync_delete_state_ptr(s); + if (V_pfsync_delete_state_ptr != NULL) + V_pfsync_delete_state_ptr(s); STATE_DEC_COUNTERS(s); @@ -3582,7 +3582,7 @@ pf_test_rule(struct pf_rule **rm, struct pf_state **sm if (*sm != NULL && !((*sm)->state_flags & PFSTATE_NOSYNC) && direction == PF_OUT && - pfsync_defer_ptr != NULL && pfsync_defer_ptr(*sm, m)) + V_pfsync_defer_ptr != NULL && V_pfsync_defer_ptr(*sm, m)) /* * We want the state created, but we dont * want to send this in case a partner @@ -5996,8 +5996,8 @@ pf_test(int dir, int pflags, struct ifnet *ifp, struct action = pf_test_state_tcp(&s, dir, kif, m, off, h, &pd, &reason); if (action == PF_PASS) { - if (pfsync_update_state_ptr != NULL) - pfsync_update_state_ptr(s); + if (V_pfsync_update_state_ptr != NULL) + V_pfsync_update_state_ptr(s); r = s->rule.ptr; a = s->anchor.ptr; log = s->log; @@ -6025,8 +6025,8 @@ pf_test(int dir, int pflags, struct ifnet *ifp, struct } action = pf_test_state_udp(&s, dir, kif, m, off, h, &pd); if (action == PF_PASS) { - if (pfsync_update_state_ptr != NULL) - pfsync_update_state_ptr(s); + if (V_pfsync_update_state_ptr != NULL) + V_pfsync_update_state_ptr(s); r = s->rule.ptr; a = s->anchor.ptr; log = s->log; @@ -6048,8 +6048,8 @@ pf_test(int dir, int pflags, struct ifnet *ifp, struct action = pf_test_state_icmp(&s, dir, kif, m, off, h, &pd, &reason); if (action == PF_PASS) { - if (pfsync_update_state_ptr != NULL) - pfsync_update_state_ptr(s); + if (V_pfsync_update_state_ptr != NULL) + V_pfsync_update_state_ptr(s); r = s->rule.ptr; a = s->anchor.ptr; log = s->log; @@ -6071,8 +6071,8 @@ pf_test(int dir, int pflags, struct ifnet *ifp, struct default: action = pf_test_state_other(&s, dir, kif, m, &pd); if (action == PF_PASS) { - if (pfsync_update_state_ptr != NULL) - pfsync_update_state_ptr(s); + if (V_pfsync_update_state_ptr != NULL) + V_pfsync_update_state_ptr(s); r = s->rule.ptr; a = s->anchor.ptr; log = s->log; @@ -6435,8 +6435,8 @@ pf_test6(int dir, int pflags, struct ifnet *ifp, struc action = pf_test_state_tcp(&s, dir, kif, m, off, h, &pd, &reason); if (action == PF_PASS) { - if (pfsync_update_state_ptr != NULL) - pfsync_update_state_ptr(s); + if (V_pfsync_update_state_ptr != NULL) + V_pfsync_update_state_ptr(s); r = s->rule.ptr; a = s->anchor.ptr; log = s->log; @@ -6464,8 +6464,8 @@ pf_test6(int dir, int pflags, struct ifnet *ifp, struc } action = pf_test_state_udp(&s, dir, kif, m, off, h, &pd); if (action == PF_PASS) { - if (pfsync_update_state_ptr != NULL) - pfsync_update_state_ptr(s); + if (V_pfsync_update_state_ptr != NULL) + V_pfsync_update_state_ptr(s); r = s->rule.ptr; a = s->anchor.ptr; log = s->log; @@ -6494,8 +6494,8 @@ pf_test6(int dir, int pflags, struct ifnet *ifp, struc action = pf_test_state_icmp(&s, dir, kif, m, off, h, &pd, &reason); if (action == PF_PASS) { - if (pfsync_update_state_ptr != NULL) - pfsync_update_state_ptr(s); + if (V_pfsync_update_state_ptr != NULL) + V_pfsync_update_state_ptr(s); r = s->rule.ptr; a = s->anchor.ptr; log = s->log; @@ -6508,8 +6508,8 @@ pf_test6(int dir, int pflags, struct ifnet *ifp, struc default: action = pf_test_state_other(&s, dir, kif, m, &pd); if (action == PF_PASS) { - if (pfsync_update_state_ptr != NULL) - pfsync_update_state_ptr(s); + if (V_pfsync_update_state_ptr != NULL) + V_pfsync_update_state_ptr(s); r = s->rule.ptr; a = s->anchor.ptr; log = s->log; Modified: stable/12/sys/netpfil/pf/pf_ioctl.c ============================================================================== --- stable/12/sys/netpfil/pf/pf_ioctl.c Sun Nov 18 11:11:27 2018 (r340564) +++ stable/12/sys/netpfil/pf/pf_ioctl.c Sun Nov 18 11:55:56 2018 (r340565) @@ -212,12 +212,13 @@ struct sx pf_ioctl_lock; struct sx pf_end_lock; /* pfsync */ -pfsync_state_import_t *pfsync_state_import_ptr = NULL; -pfsync_insert_state_t *pfsync_insert_state_ptr = NULL; -pfsync_update_state_t *pfsync_update_state_ptr = NULL; -pfsync_delete_state_t *pfsync_delete_state_ptr = NULL; -pfsync_clear_states_t *pfsync_clear_states_ptr = NULL; -pfsync_defer_t *pfsync_defer_ptr = NULL; +VNET_DEFINE(pfsync_state_import_t *, pfsync_state_import_ptr); +VNET_DEFINE(pfsync_insert_state_t *, pfsync_insert_state_ptr); +VNET_DEFINE(pfsync_update_state_t *, pfsync_update_state_ptr); +VNET_DEFINE(pfsync_delete_state_t *, pfsync_delete_state_ptr); +VNET_DEFINE(pfsync_clear_states_t *, pfsync_clear_states_ptr); +VNET_DEFINE(pfsync_defer_t *, pfsync_defer_ptr); + /* pflog */ pflog_packet_t *pflog_packet_ptr = NULL; @@ -1873,8 +1874,8 @@ relock_DIOCCLRSTATES: PF_HASHROW_UNLOCK(ih); } psk->psk_killed = killed; - if (pfsync_clear_states_ptr != NULL) - pfsync_clear_states_ptr(V_pf_status.hostid, psk->psk_ifname); + if (V_pfsync_clear_states_ptr != NULL) + V_pfsync_clear_states_ptr(V_pf_status.hostid, psk->psk_ifname); break; } @@ -1961,9 +1962,9 @@ relock_DIOCKILLSTATES: error = EINVAL; break; } - if (pfsync_state_import_ptr != NULL) { + if (V_pfsync_state_import_ptr != NULL) { PF_RULES_RLOCK(); - error = pfsync_state_import_ptr(sp, PFSYNC_SI_IOCTL); + error = V_pfsync_state_import_ptr(sp, PFSYNC_SI_IOCTL); PF_RULES_RUNLOCK(); } else error = EOPNOTSUPP; From owner-svn-src-all@freebsd.org Sun Nov 18 11:55:59 2018 Return-Path: Delivered-To: svn-src-all@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 AE24D1137398; Sun, 18 Nov 2018 11:55:59 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 50F4D79855; Sun, 18 Nov 2018 11:55:59 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 31FB81300A; Sun, 18 Nov 2018 11:55:59 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAIBtxLq043001; Sun, 18 Nov 2018 11:55:59 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAIBtw3q042997; Sun, 18 Nov 2018 11:55:58 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201811181155.wAIBtw3q042997@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Sun, 18 Nov 2018 11:55:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r340566 - in stable/11/sys: net netpfil/pf X-SVN-Group: stable-11 X-SVN-Commit-Author: kp X-SVN-Commit-Paths: in stable/11/sys: net netpfil/pf X-SVN-Commit-Revision: 340566 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 50F4D79855 X-Spamd-Result: default: False [0.06 / 15.00]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.06)[0.064,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Nov 2018 11:55:59 -0000 Author: kp Date: Sun Nov 18 11:55:58 2018 New Revision: 340566 URL: https://svnweb.freebsd.org/changeset/base/340566 Log: MFC r340065: pfsync: Make pfsync callbacks per-vnet The callbacks are installed and removed depending on the state of the pfsync device, which is per-vnet. The callbacks must also be per-vnet. Sponsored by: Orange Business Services Modified: stable/11/sys/net/pfvar.h stable/11/sys/netpfil/pf/if_pfsync.c stable/11/sys/netpfil/pf/pf.c stable/11/sys/netpfil/pf/pf_ioctl.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/net/pfvar.h ============================================================================== --- stable/11/sys/net/pfvar.h Sun Nov 18 11:55:56 2018 (r340565) +++ stable/11/sys/net/pfvar.h Sun Nov 18 11:55:58 2018 (r340566) @@ -821,12 +821,18 @@ typedef void pfsync_delete_state_t(struct pf_state *) typedef void pfsync_clear_states_t(u_int32_t, const char *); typedef int pfsync_defer_t(struct pf_state *, struct mbuf *); -extern pfsync_state_import_t *pfsync_state_import_ptr; -extern pfsync_insert_state_t *pfsync_insert_state_ptr; -extern pfsync_update_state_t *pfsync_update_state_ptr; -extern pfsync_delete_state_t *pfsync_delete_state_ptr; -extern pfsync_clear_states_t *pfsync_clear_states_ptr; -extern pfsync_defer_t *pfsync_defer_ptr; +VNET_DECLARE(pfsync_state_import_t *, pfsync_state_import_ptr); +#define V_pfsync_state_import_ptr VNET(pfsync_state_import_ptr) +VNET_DECLARE(pfsync_insert_state_t *, pfsync_insert_state_ptr); +#define V_pfsync_insert_state_ptr VNET(pfsync_insert_state_ptr) +VNET_DECLARE(pfsync_update_state_t *, pfsync_update_state_ptr); +#define V_pfsync_update_state_ptr VNET(pfsync_update_state_ptr) +VNET_DECLARE(pfsync_delete_state_t *, pfsync_delete_state_ptr); +#define V_pfsync_delete_state_ptr VNET(pfsync_delete_state_ptr) +VNET_DECLARE(pfsync_clear_states_t *, pfsync_clear_states_ptr); +#define V_pfsync_clear_states_ptr VNET(pfsync_clear_states_ptr) +VNET_DECLARE(pfsync_defer_t *, pfsync_defer_ptr); +#define V_pfsync_defer_ptr VNET(pfsync_defer_ptr) void pfsync_state_export(struct pfsync_state *, struct pf_state *); Modified: stable/11/sys/netpfil/pf/if_pfsync.c ============================================================================== --- stable/11/sys/netpfil/pf/if_pfsync.c Sun Nov 18 11:55:56 2018 (r340565) +++ stable/11/sys/netpfil/pf/if_pfsync.c Sun Nov 18 11:55:58 2018 (r340566) @@ -1360,10 +1360,10 @@ pfsyncioctl(struct ifnet *ifp, u_long cmd, caddr_t dat sc->sc_maxupdates = pfsyncr.pfsyncr_maxupdates; if (pfsyncr.pfsyncr_defer) { sc->sc_flags |= PFSYNCF_DEFER; - pfsync_defer_ptr = pfsync_defer; + V_pfsync_defer_ptr = pfsync_defer; } else { sc->sc_flags &= ~PFSYNCF_DEFER; - pfsync_defer_ptr = NULL; + V_pfsync_defer_ptr = NULL; } if (sifp == NULL) { @@ -2309,12 +2309,12 @@ pfsync_pointers_init() { PF_RULES_WLOCK(); - pfsync_state_import_ptr = pfsync_state_import; - pfsync_insert_state_ptr = pfsync_insert_state; - pfsync_update_state_ptr = pfsync_update_state; - pfsync_delete_state_ptr = pfsync_delete_state; - pfsync_clear_states_ptr = pfsync_clear_states; - pfsync_defer_ptr = pfsync_defer; + V_pfsync_state_import_ptr = pfsync_state_import; + V_pfsync_insert_state_ptr = pfsync_insert_state; + V_pfsync_update_state_ptr = pfsync_update_state; + V_pfsync_delete_state_ptr = pfsync_delete_state; + V_pfsync_clear_states_ptr = pfsync_clear_states; + V_pfsync_defer_ptr = pfsync_defer; PF_RULES_WUNLOCK(); } @@ -2323,12 +2323,12 @@ pfsync_pointers_uninit() { PF_RULES_WLOCK(); - pfsync_state_import_ptr = NULL; - pfsync_insert_state_ptr = NULL; - pfsync_update_state_ptr = NULL; - pfsync_delete_state_ptr = NULL; - pfsync_clear_states_ptr = NULL; - pfsync_defer_ptr = NULL; + V_pfsync_state_import_ptr = NULL; + V_pfsync_insert_state_ptr = NULL; + V_pfsync_update_state_ptr = NULL; + V_pfsync_delete_state_ptr = NULL; + V_pfsync_clear_states_ptr = NULL; + V_pfsync_defer_ptr = NULL; PF_RULES_WUNLOCK(); } @@ -2345,6 +2345,8 @@ vnet_pfsync_init(const void *unused __unused) if_clone_detach(V_pfsync_cloner); log(LOG_INFO, "swi_add() failed in %s\n", __func__); } + + pfsync_pointers_init(); } VNET_SYSINIT(vnet_pfsync_init, SI_SUB_PROTO_FIREWALL, SI_ORDER_ANY, vnet_pfsync_init, NULL); @@ -2353,6 +2355,8 @@ static void vnet_pfsync_uninit(const void *unused __unused) { + pfsync_pointers_uninit(); + if_clone_detach(V_pfsync_cloner); swi_remove(V_pfsync_swi_cookie); } @@ -2378,7 +2382,6 @@ pfsync_init() return (error); } #endif - pfsync_pointers_init(); return (0); } @@ -2386,8 +2389,6 @@ pfsync_init() static void pfsync_uninit() { - - pfsync_pointers_uninit(); #ifdef INET ipproto_unregister(IPPROTO_PFSYNC); Modified: stable/11/sys/netpfil/pf/pf.c ============================================================================== --- stable/11/sys/netpfil/pf/pf.c Sun Nov 18 11:55:56 2018 (r340565) +++ stable/11/sys/netpfil/pf/pf.c Sun Nov 18 11:55:58 2018 (r340566) @@ -1259,8 +1259,8 @@ pf_state_insert(struct pfi_kif *kif, struct pf_state_k refcount_init(&s->refs, 2); counter_u64_add(V_pf_status.fcounters[FCNT_STATE_INSERT], 1); - if (pfsync_insert_state_ptr != NULL) - pfsync_insert_state_ptr(s); + if (V_pfsync_insert_state_ptr != NULL) + V_pfsync_insert_state_ptr(s); /* Returns locked. */ return (0); @@ -1662,8 +1662,8 @@ pf_unlink_state(struct pf_state *s, u_int flags) LIST_REMOVE(s, entry); pf_src_tree_remove_state(s); - if (pfsync_delete_state_ptr != NULL) - pfsync_delete_state_ptr(s); + if (V_pfsync_delete_state_ptr != NULL) + V_pfsync_delete_state_ptr(s); STATE_DEC_COUNTERS(s); @@ -3570,7 +3570,7 @@ pf_test_rule(struct pf_rule **rm, struct pf_state **sm if (*sm != NULL && !((*sm)->state_flags & PFSTATE_NOSYNC) && direction == PF_OUT && - pfsync_defer_ptr != NULL && pfsync_defer_ptr(*sm, m)) + V_pfsync_defer_ptr != NULL && V_pfsync_defer_ptr(*sm, m)) /* * We want the state created, but we dont * want to send this in case a partner @@ -6012,8 +6012,8 @@ pf_test(int dir, int pflags, struct ifnet *ifp, struct action = pf_test_state_tcp(&s, dir, kif, m, off, h, &pd, &reason); if (action == PF_PASS) { - if (pfsync_update_state_ptr != NULL) - pfsync_update_state_ptr(s); + if (V_pfsync_update_state_ptr != NULL) + V_pfsync_update_state_ptr(s); r = s->rule.ptr; a = s->anchor.ptr; log = s->log; @@ -6041,8 +6041,8 @@ pf_test(int dir, int pflags, struct ifnet *ifp, struct } action = pf_test_state_udp(&s, dir, kif, m, off, h, &pd); if (action == PF_PASS) { - if (pfsync_update_state_ptr != NULL) - pfsync_update_state_ptr(s); + if (V_pfsync_update_state_ptr != NULL) + V_pfsync_update_state_ptr(s); r = s->rule.ptr; a = s->anchor.ptr; log = s->log; @@ -6064,8 +6064,8 @@ pf_test(int dir, int pflags, struct ifnet *ifp, struct action = pf_test_state_icmp(&s, dir, kif, m, off, h, &pd, &reason); if (action == PF_PASS) { - if (pfsync_update_state_ptr != NULL) - pfsync_update_state_ptr(s); + if (V_pfsync_update_state_ptr != NULL) + V_pfsync_update_state_ptr(s); r = s->rule.ptr; a = s->anchor.ptr; log = s->log; @@ -6087,8 +6087,8 @@ pf_test(int dir, int pflags, struct ifnet *ifp, struct default: action = pf_test_state_other(&s, dir, kif, m, &pd); if (action == PF_PASS) { - if (pfsync_update_state_ptr != NULL) - pfsync_update_state_ptr(s); + if (V_pfsync_update_state_ptr != NULL) + V_pfsync_update_state_ptr(s); r = s->rule.ptr; a = s->anchor.ptr; log = s->log; @@ -6451,8 +6451,8 @@ pf_test6(int dir, int pflags, struct ifnet *ifp, struc action = pf_test_state_tcp(&s, dir, kif, m, off, h, &pd, &reason); if (action == PF_PASS) { - if (pfsync_update_state_ptr != NULL) - pfsync_update_state_ptr(s); + if (V_pfsync_update_state_ptr != NULL) + V_pfsync_update_state_ptr(s); r = s->rule.ptr; a = s->anchor.ptr; log = s->log; @@ -6480,8 +6480,8 @@ pf_test6(int dir, int pflags, struct ifnet *ifp, struc } action = pf_test_state_udp(&s, dir, kif, m, off, h, &pd); if (action == PF_PASS) { - if (pfsync_update_state_ptr != NULL) - pfsync_update_state_ptr(s); + if (V_pfsync_update_state_ptr != NULL) + V_pfsync_update_state_ptr(s); r = s->rule.ptr; a = s->anchor.ptr; log = s->log; @@ -6510,8 +6510,8 @@ pf_test6(int dir, int pflags, struct ifnet *ifp, struc action = pf_test_state_icmp(&s, dir, kif, m, off, h, &pd, &reason); if (action == PF_PASS) { - if (pfsync_update_state_ptr != NULL) - pfsync_update_state_ptr(s); + if (V_pfsync_update_state_ptr != NULL) + V_pfsync_update_state_ptr(s); r = s->rule.ptr; a = s->anchor.ptr; log = s->log; @@ -6524,8 +6524,8 @@ pf_test6(int dir, int pflags, struct ifnet *ifp, struc default: action = pf_test_state_other(&s, dir, kif, m, &pd); if (action == PF_PASS) { - if (pfsync_update_state_ptr != NULL) - pfsync_update_state_ptr(s); + if (V_pfsync_update_state_ptr != NULL) + V_pfsync_update_state_ptr(s); r = s->rule.ptr; a = s->anchor.ptr; log = s->log; Modified: stable/11/sys/netpfil/pf/pf_ioctl.c ============================================================================== --- stable/11/sys/netpfil/pf/pf_ioctl.c Sun Nov 18 11:55:56 2018 (r340565) +++ stable/11/sys/netpfil/pf/pf_ioctl.c Sun Nov 18 11:55:58 2018 (r340566) @@ -204,12 +204,13 @@ struct rmlock pf_rules_lock; struct sx pf_ioctl_lock; /* pfsync */ -pfsync_state_import_t *pfsync_state_import_ptr = NULL; -pfsync_insert_state_t *pfsync_insert_state_ptr = NULL; -pfsync_update_state_t *pfsync_update_state_ptr = NULL; -pfsync_delete_state_t *pfsync_delete_state_ptr = NULL; -pfsync_clear_states_t *pfsync_clear_states_ptr = NULL; -pfsync_defer_t *pfsync_defer_ptr = NULL; +VNET_DEFINE(pfsync_state_import_t *, pfsync_state_import_ptr); +VNET_DEFINE(pfsync_insert_state_t *, pfsync_insert_state_ptr); +VNET_DEFINE(pfsync_update_state_t *, pfsync_update_state_ptr); +VNET_DEFINE(pfsync_delete_state_t *, pfsync_delete_state_ptr); +VNET_DEFINE(pfsync_clear_states_t *, pfsync_clear_states_ptr); +VNET_DEFINE(pfsync_defer_t *, pfsync_defer_ptr); + /* pflog */ pflog_packet_t *pflog_packet_ptr = NULL; @@ -1639,8 +1640,8 @@ relock_DIOCCLRSTATES: PF_HASHROW_UNLOCK(ih); } psk->psk_killed = killed; - if (pfsync_clear_states_ptr != NULL) - pfsync_clear_states_ptr(V_pf_status.hostid, psk->psk_ifname); + if (V_pfsync_clear_states_ptr != NULL) + V_pfsync_clear_states_ptr(V_pf_status.hostid, psk->psk_ifname); break; } @@ -1727,9 +1728,9 @@ relock_DIOCKILLSTATES: error = EINVAL; break; } - if (pfsync_state_import_ptr != NULL) { + if (V_pfsync_state_import_ptr != NULL) { PF_RULES_RLOCK(); - error = pfsync_state_import_ptr(sp, PFSYNC_SI_IOCTL); + error = V_pfsync_state_import_ptr(sp, PFSYNC_SI_IOCTL); PF_RULES_RUNLOCK(); } else error = EOPNOTSUPP; From owner-svn-src-all@freebsd.org Sun Nov 18 12:09:28 2018 Return-Path: Delivered-To: svn-src-all@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 8F6D71137D5E; Sun, 18 Nov 2018 12:09:28 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 326097A4B4; Sun, 18 Nov 2018 12:09:28 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 13F48131AC; Sun, 18 Nov 2018 12:09:28 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAIC9RKQ048465; Sun, 18 Nov 2018 12:09:27 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAIC9Rmc048464; Sun, 18 Nov 2018 12:09:27 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201811181209.wAIC9Rmc048464@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Sun, 18 Nov 2018 12:09:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r340571 - stable/11/sys/netpfil/pf X-SVN-Group: stable-11 X-SVN-Commit-Author: kp X-SVN-Commit-Paths: stable/11/sys/netpfil/pf X-SVN-Commit-Revision: 340571 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 326097A4B4 X-Spamd-Result: default: False [0.05 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.05)[0.051,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Nov 2018 12:09:28 -0000 Author: kp Date: Sun Nov 18 12:09:27 2018 New Revision: 340571 URL: https://svnweb.freebsd.org/changeset/base/340571 Log: MFC r340067: pfsync: Ensure uninit is done before pf pfsync touches pf memory (for pf_state and the pfsync callback pointers), not the other way around. We need to ensure that pfsync is torn down before pf. Sponsored by: Orange Business Services Modified: stable/11/sys/netpfil/pf/if_pfsync.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/netpfil/pf/if_pfsync.c ============================================================================== --- stable/11/sys/netpfil/pf/if_pfsync.c Sun Nov 18 12:09:26 2018 (r340570) +++ stable/11/sys/netpfil/pf/if_pfsync.c Sun Nov 18 12:09:27 2018 (r340571) @@ -2360,11 +2360,8 @@ vnet_pfsync_uninit(const void *unused __unused) if_clone_detach(V_pfsync_cloner); swi_remove(V_pfsync_swi_cookie); } -/* - * Detach after pf is gone; otherwise we might touch pfsync memory - * from within pf after freeing pfsync. - */ -VNET_SYSUNINIT(vnet_pfsync_uninit, SI_SUB_INIT_IF, SI_ORDER_SECOND, + +VNET_SYSUNINIT(vnet_pfsync_uninit, SI_SUB_PROTO_FIREWALL, SI_ORDER_FOURTH, vnet_pfsync_uninit, NULL); static int From owner-svn-src-all@freebsd.org Sun Nov 18 12:04:26 2018 Return-Path: Delivered-To: svn-src-all@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 91F9F1137AAC; Sun, 18 Nov 2018 12:04:26 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 33B6679FED; Sun, 18 Nov 2018 12:04:26 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 08184131A5; Sun, 18 Nov 2018 12:04:26 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAIC4PNp048150; Sun, 18 Nov 2018 12:04:25 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAIC4P05048149; Sun, 18 Nov 2018 12:04:25 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201811181204.wAIC4P05048149@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Sun, 18 Nov 2018 12:04:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r340569 - stable/11/sys/net X-SVN-Group: stable-11 X-SVN-Commit-Author: kp X-SVN-Commit-Paths: stable/11/sys/net X-SVN-Commit-Revision: 340569 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 33B6679FED X-Spamd-Result: default: False [0.05 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.05)[0.051,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Nov 2018 12:04:26 -0000 Author: kp Date: Sun Nov 18 12:04:25 2018 New Revision: 340569 URL: https://svnweb.freebsd.org/changeset/base/340569 Log: MFC r340066: Notify that the ifnet will go away, even on vnet shutdown pf subscribes to ifnet_departure_event events, so it can clean up the ifg_pf_kif and if_pf_kif pointers in the ifnet. During vnet shutdown interfaces could go away without sending the event, so pf ends up cleaning these up as part of its shutdown sequence, which happens after the ifnet has already been freed. Send the ifnet_departure_event during vnet shutdown, allowing pf to clean up correctly. Sponsored by: Orange Business Services Modified: stable/11/sys/net/if.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/net/if.c ============================================================================== --- stable/11/sys/net/if.c Sun Nov 18 12:04:24 2018 (r340568) +++ stable/11/sys/net/if.c Sun Nov 18 12:04:25 2018 (r340569) @@ -1085,6 +1085,9 @@ if_detach_internal(struct ifnet *ifp, int vmove, struc * the work top-down for us. */ if (shutdown) { + /* Give interface users the chance to clean up. */ + EVENTHANDLER_INVOKE(ifnet_departure_event, ifp); + /* * In case of a vmove we are done here without error. * If we would signal an error it would lead to the same From owner-svn-src-all@freebsd.org Sun Nov 18 12:04:25 2018 Return-Path: Delivered-To: svn-src-all@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 A53651137AA7; Sun, 18 Nov 2018 12:04:25 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4391079FE9; Sun, 18 Nov 2018 12:04:25 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1CBB5131A4; Sun, 18 Nov 2018 12:04:25 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAIC4OMN048106; Sun, 18 Nov 2018 12:04:24 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAIC4OQV048105; Sun, 18 Nov 2018 12:04:24 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201811181204.wAIC4OQV048105@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Sun, 18 Nov 2018 12:04:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r340568 - stable/12/sys/net X-SVN-Group: stable-12 X-SVN-Commit-Author: kp X-SVN-Commit-Paths: stable/12/sys/net X-SVN-Commit-Revision: 340568 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4391079FE9 X-Spamd-Result: default: False [0.05 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.05)[0.051,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Nov 2018 12:04:25 -0000 Author: kp Date: Sun Nov 18 12:04:24 2018 New Revision: 340568 URL: https://svnweb.freebsd.org/changeset/base/340568 Log: MFC r340066: Notify that the ifnet will go away, even on vnet shutdown pf subscribes to ifnet_departure_event events, so it can clean up the ifg_pf_kif and if_pf_kif pointers in the ifnet. During vnet shutdown interfaces could go away without sending the event, so pf ends up cleaning these up as part of its shutdown sequence, which happens after the ifnet has already been freed. Send the ifnet_departure_event during vnet shutdown, allowing pf to clean up correctly. Sponsored by: Orange Business Services Modified: stable/12/sys/net/if.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/net/if.c ============================================================================== --- stable/12/sys/net/if.c Sun Nov 18 12:03:12 2018 (r340567) +++ stable/12/sys/net/if.c Sun Nov 18 12:04:24 2018 (r340568) @@ -1122,6 +1122,9 @@ if_detach_internal(struct ifnet *ifp, int vmove, struc * the work top-down for us. */ if (shutdown) { + /* Give interface users the chance to clean up. */ + EVENTHANDLER_INVOKE(ifnet_departure_event, ifp); + /* * In case of a vmove we are done here without error. * If we would signal an error it would lead to the same From owner-svn-src-all@freebsd.org Sun Nov 18 10:47:37 2018 Return-Path: Delivered-To: svn-src-all@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 CB5741134D1C; Sun, 18 Nov 2018 10:47:37 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6644976A56; Sun, 18 Nov 2018 10:47:37 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 428A412449; Sun, 18 Nov 2018 10:47:37 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAIAlb0C006660; Sun, 18 Nov 2018 10:47:37 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAIAlbx9006659; Sun, 18 Nov 2018 10:47:37 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201811181047.wAIAlbx9006659@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Sun, 18 Nov 2018 10:47:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r340558 - stable/12/sys/netpfil/pf X-SVN-Group: stable-12 X-SVN-Commit-Author: kp X-SVN-Commit-Paths: stable/12/sys/netpfil/pf X-SVN-Commit-Revision: 340558 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 6644976A56 X-Spamd-Result: default: False [-0.05 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.05)[-0.052,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Nov 2018 10:47:38 -0000 Author: kp Date: Sun Nov 18 10:47:36 2018 New Revision: 340558 URL: https://svnweb.freebsd.org/changeset/base/340558 Log: MFC r339470: pf synproxy will do the 3WHS on behalf of the target machine, and once the 3WHS is completed, establish the backend connection. The trigger for "3WHS completed" is the reception of the first ACK. However, we should not proceed if that ACK also has RST or FIN set. PR: 197484 Obtained from: OpenBSD Modified: stable/12/sys/netpfil/pf/pf.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/netpfil/pf/pf.c ============================================================================== --- stable/12/sys/netpfil/pf/pf.c Sun Nov 18 10:22:42 2018 (r340557) +++ stable/12/sys/netpfil/pf/pf.c Sun Nov 18 10:47:36 2018 (r340558) @@ -4401,7 +4401,7 @@ pf_test_state_tcp(struct pf_state **state, int directi TH_SYN|TH_ACK, 0, (*state)->src.mss, 0, 1, 0, NULL); REASON_SET(reason, PFRES_SYNPROXY); return (PF_SYNPROXY_DROP); - } else if (!(th->th_flags & TH_ACK) || + } else if ((th->th_flags & (TH_ACK|TH_RST|TH_FIN)) != TH_ACK || (ntohl(th->th_ack) != (*state)->src.seqhi + 1) || (ntohl(th->th_seq) != (*state)->src.seqlo + 1)) { REASON_SET(reason, PFRES_SYNPROXY); From owner-svn-src-all@freebsd.org Sun Nov 18 12:03:13 2018 Return-Path: Delivered-To: svn-src-all@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 53FAD11379E4; Sun, 18 Nov 2018 12:03:13 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EBE8F79E6E; Sun, 18 Nov 2018 12:03:12 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CC4311319C; Sun, 18 Nov 2018 12:03:12 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAIC3CFx048012; Sun, 18 Nov 2018 12:03:12 GMT (envelope-from oshogbo@FreeBSD.org) Received: (from oshogbo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAIC3Cre048011; Sun, 18 Nov 2018 12:03:12 GMT (envelope-from oshogbo@FreeBSD.org) Message-Id: <201811181203.wAIC3Cre048011@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: oshogbo set sender to oshogbo@FreeBSD.org using -f From: Mariusz Zaborski Date: Sun, 18 Nov 2018 12:03:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340567 - head/usr.bin/brandelf X-SVN-Group: head X-SVN-Commit-Author: oshogbo X-SVN-Commit-Paths: head/usr.bin/brandelf X-SVN-Commit-Revision: 340567 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: EBE8F79E6E X-Spamd-Result: default: False [0.04 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.04)[0.039,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Nov 2018 12:03:13 -0000 Author: oshogbo Date: Sun Nov 18 12:03:12 2018 New Revision: 340567 URL: https://svnweb.freebsd.org/changeset/base/340567 Log: brandelf: fix style nits No functional change intended. Reviewed by: emaste, markj Differential Revision: https://reviews.freebsd.org/D17966 Modified: head/usr.bin/brandelf/brandelf.c Modified: head/usr.bin/brandelf/brandelf.c ============================================================================== --- head/usr.bin/brandelf/brandelf.c Sun Nov 18 11:55:58 2018 (r340566) +++ head/usr.bin/brandelf/brandelf.c Sun Nov 18 12:03:12 2018 (r340567) @@ -32,11 +32,13 @@ #include __FBSDID("$FreeBSD$"); -#include +#include #include #include + #include #include +#include #include #include #include @@ -64,16 +66,21 @@ main(int argc, char **argv) { const char *strtype = "FreeBSD"; - int type = ELFOSABI_FREEBSD; - int retval = 0; - int ch, change = 0, force = 0, listed = 0; + int ch, retval, type; + bool change, force, listed; + type = ELFOSABI_FREEBSD; + retval = 0; + change = false; + force = false; + listed = false; + while ((ch = getopt(argc, argv, "f:lt:v")) != -1) switch (ch) { case 'f': if (change) errx(1, "f option incompatible with t option"); - force = 1; + force = true; type = atoi(optarg); if (errno == ERANGE || type < 0 || type > 255) { warnx("invalid argument to option f: %s", @@ -83,7 +90,7 @@ main(int argc, char **argv) break; case 'l': printelftypes(); - listed = 1; + listed = true; break; case 'v': /* does nothing */ @@ -91,7 +98,7 @@ main(int argc, char **argv) case 't': if (force) errx(1, "t option incompatible with f option"); - change = 1; + change = true; strtype = optarg; break; default: @@ -99,7 +106,7 @@ main(int argc, char **argv) } argc -= optind; argv += optind; - if (!argc) { + if (argc == 0) { if (listed) exit(0); else { @@ -114,7 +121,7 @@ main(int argc, char **argv) usage(); } - while (argc) { + while (argc != 0) { int fd; char buffer[EI_NIDENT]; @@ -160,7 +167,7 @@ fail: argv++; } - return retval; + return (retval); } static void @@ -176,12 +183,10 @@ iselftype(int etype) { size_t elfwalk; - for (elfwalk = 0; - elfwalk < sizeof(elftypes)/sizeof(elftypes[0]); - elfwalk++) + for (elfwalk = 0; elfwalk < nitems(elftypes); elfwalk++) if (etype == elftypes[elfwalk].value) - return elftypes[elfwalk].str; - return 0; + return (elftypes[elfwalk].str); + return (0); } static int @@ -189,12 +194,10 @@ elftype(const char *elfstrtype) { size_t elfwalk; - for (elfwalk = 0; - elfwalk < sizeof(elftypes)/sizeof(elftypes[0]); - elfwalk++) + for (elfwalk = 0; elfwalk < nitems(elftypes); elfwalk++) if (strcasecmp(elfstrtype, elftypes[elfwalk].str) == 0) - return elftypes[elfwalk].value; - return -1; + return (elftypes[elfwalk].value); + return (-1); } static void @@ -203,10 +206,8 @@ printelftypes(void) size_t elfwalk; fprintf(stderr, "known ELF types are: "); - for (elfwalk = 0; - elfwalk < sizeof(elftypes)/sizeof(elftypes[0]); - elfwalk++) - fprintf(stderr, "%s(%u) ", elftypes[elfwalk].str, - elftypes[elfwalk].value); + for (elfwalk = 0; elfwalk < nitems(elftypes); elfwalk++) + fprintf(stderr, "%s(%u) ", elftypes[elfwalk].str, + elftypes[elfwalk].value); fprintf(stderr, "\n"); } From owner-svn-src-all@freebsd.org Sun Nov 18 12:09:27 2018 Return-Path: Delivered-To: svn-src-all@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 7EC4A1137D56; Sun, 18 Nov 2018 12:09:27 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 225BD7A4B3; Sun, 18 Nov 2018 12:09:27 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F41D3131AB; Sun, 18 Nov 2018 12:09:26 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAIC9QON048421; Sun, 18 Nov 2018 12:09:26 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAIC9QI0048420; Sun, 18 Nov 2018 12:09:26 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201811181209.wAIC9QI0048420@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Sun, 18 Nov 2018 12:09:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r340570 - stable/12/sys/netpfil/pf X-SVN-Group: stable-12 X-SVN-Commit-Author: kp X-SVN-Commit-Paths: stable/12/sys/netpfil/pf X-SVN-Commit-Revision: 340570 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 225BD7A4B3 X-Spamd-Result: default: False [0.05 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.05)[0.051,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Nov 2018 12:09:27 -0000 Author: kp Date: Sun Nov 18 12:09:26 2018 New Revision: 340570 URL: https://svnweb.freebsd.org/changeset/base/340570 Log: MFC r340067: pfsync: Ensure uninit is done before pf pfsync touches pf memory (for pf_state and the pfsync callback pointers), not the other way around. We need to ensure that pfsync is torn down before pf. Sponsored by: Orange Business Services Modified: stable/12/sys/netpfil/pf/if_pfsync.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/netpfil/pf/if_pfsync.c ============================================================================== --- stable/12/sys/netpfil/pf/if_pfsync.c Sun Nov 18 12:04:25 2018 (r340569) +++ stable/12/sys/netpfil/pf/if_pfsync.c Sun Nov 18 12:09:26 2018 (r340570) @@ -2362,11 +2362,8 @@ vnet_pfsync_uninit(const void *unused __unused) if_clone_detach(V_pfsync_cloner); swi_remove(V_pfsync_swi_cookie); } -/* - * Detach after pf is gone; otherwise we might touch pfsync memory - * from within pf after freeing pfsync. - */ -VNET_SYSUNINIT(vnet_pfsync_uninit, SI_SUB_INIT_IF, SI_ORDER_SECOND, + +VNET_SYSUNINIT(vnet_pfsync_uninit, SI_SUB_PROTO_FIREWALL, SI_ORDER_FOURTH, vnet_pfsync_uninit, NULL); static int From owner-svn-src-all@freebsd.org Sun Nov 18 12:30:20 2018 Return-Path: Delivered-To: svn-src-all@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 659D411388AF; Sun, 18 Nov 2018 12:30:20 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E4CB27B4AF; Sun, 18 Nov 2018 12:30:19 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C5A9D1351A; Sun, 18 Nov 2018 12:30:19 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAICUJAO058930; Sun, 18 Nov 2018 12:30:19 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAICUICa058926; Sun, 18 Nov 2018 12:30:18 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201811181230.wAICUICa058926@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Sun, 18 Nov 2018 12:30:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r340574 - in stable/11/sys: net netpfil/pf X-SVN-Group: stable-11 X-SVN-Commit-Author: kp X-SVN-Commit-Paths: in stable/11/sys: net netpfil/pf X-SVN-Commit-Revision: 340574 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E4CB27B4AF X-Spamd-Result: default: False [0.06 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.06)[0.058,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Nov 2018 12:30:20 -0000 Author: kp Date: Sun Nov 18 12:30:18 2018 New Revision: 340574 URL: https://svnweb.freebsd.org/changeset/base/340574 Log: MFC r340068: pfsync: Handle syncdev going away If the syncdev is removed we no longer need to clean up the multicast entry we've got set up for that device. Pass the ifnet detach event through pf to pfsync, and remove our multicast handle, and mark us as no longer having a syncdev. Note that this callback is always installed, even if the pfsync interface is disabled (and thus it's not a per-vnet callback pointer). Sponsored by: Orange Business Services Modified: stable/11/sys/net/pfvar.h stable/11/sys/netpfil/pf/if_pfsync.c stable/11/sys/netpfil/pf/pf_if.c stable/11/sys/netpfil/pf/pf_ioctl.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/net/pfvar.h ============================================================================== --- stable/11/sys/net/pfvar.h Sun Nov 18 12:30:16 2018 (r340573) +++ stable/11/sys/net/pfvar.h Sun Nov 18 12:30:18 2018 (r340574) @@ -820,6 +820,7 @@ typedef void pfsync_update_state_t(struct pf_state *) typedef void pfsync_delete_state_t(struct pf_state *); typedef void pfsync_clear_states_t(u_int32_t, const char *); typedef int pfsync_defer_t(struct pf_state *, struct mbuf *); +typedef void pfsync_detach_ifnet_t(struct ifnet *); VNET_DECLARE(pfsync_state_import_t *, pfsync_state_import_ptr); #define V_pfsync_state_import_ptr VNET(pfsync_state_import_ptr) @@ -833,6 +834,7 @@ VNET_DECLARE(pfsync_clear_states_t *, pfsync_clear_sta #define V_pfsync_clear_states_ptr VNET(pfsync_clear_states_ptr) VNET_DECLARE(pfsync_defer_t *, pfsync_defer_ptr); #define V_pfsync_defer_ptr VNET(pfsync_defer_ptr) +extern pfsync_detach_ifnet_t *pfsync_detach_ifnet_ptr; void pfsync_state_export(struct pfsync_state *, struct pf_state *); Modified: stable/11/sys/netpfil/pf/if_pfsync.c ============================================================================== --- stable/11/sys/netpfil/pf/if_pfsync.c Sun Nov 18 12:30:16 2018 (r340573) +++ stable/11/sys/netpfil/pf/if_pfsync.c Sun Nov 18 12:30:18 2018 (r340574) @@ -279,6 +279,7 @@ static void pfsync_bulk_status(u_int8_t); static void pfsync_bulk_update(void *); static void pfsync_bulk_fail(void *); +static void pfsync_detach_ifnet(struct ifnet *); #ifdef IPSEC static void pfsync_update_net_tdb(struct pfsync_tdb *); #endif @@ -2290,6 +2291,29 @@ pfsync_multicast_cleanup(struct pfsync_softc *sc) imo->imo_multicast_ifp = NULL; } +void +pfsync_detach_ifnet(struct ifnet *ifp) +{ + struct pfsync_softc *sc = V_pfsyncif; + + if (sc == NULL) + return; + + PFSYNC_LOCK(sc); + + if (sc->sc_sync_if == ifp) { + /* We don't need mutlicast cleanup here, because the interface + * is going away. We do need to ensure we don't try to do + * cleanup later. + */ + sc->sc_imo.imo_membership = NULL; + sc->sc_imo.imo_multicast_ifp = NULL; + sc->sc_sync_if = NULL; + } + + PFSYNC_UNLOCK(sc); +} + #ifdef INET extern struct domain inetdomain; static struct protosw in_pfsync_protosw = { @@ -2370,6 +2394,8 @@ pfsync_init() #ifdef INET int error; + pfsync_detach_ifnet_ptr = pfsync_detach_ifnet; + error = pf_proto_register(PF_INET, &in_pfsync_protosw); if (error) return (error); @@ -2386,6 +2412,7 @@ pfsync_init() static void pfsync_uninit() { + pfsync_detach_ifnet_ptr = NULL; #ifdef INET ipproto_unregister(IPPROTO_PFSYNC); Modified: stable/11/sys/netpfil/pf/pf_if.c ============================================================================== --- stable/11/sys/netpfil/pf/pf_if.c Sun Nov 18 12:30:16 2018 (r340573) +++ stable/11/sys/netpfil/pf/pf_if.c Sun Nov 18 12:30:18 2018 (r340574) @@ -829,6 +829,9 @@ pfi_detach_ifnet_event(void *arg __unused, struct ifne { struct pfi_kif *kif = (struct pfi_kif *)ifp->if_pf_kif; + if (pfsync_detach_ifnet_ptr) + pfsync_detach_ifnet_ptr(ifp); + if (kif == NULL) return; @@ -838,6 +841,7 @@ pfi_detach_ifnet_event(void *arg __unused, struct ifne CURVNET_RESTORE(); return; } + PF_RULES_WLOCK(); V_pfi_update++; pfi_kif_update(kif); Modified: stable/11/sys/netpfil/pf/pf_ioctl.c ============================================================================== --- stable/11/sys/netpfil/pf/pf_ioctl.c Sun Nov 18 12:30:16 2018 (r340573) +++ stable/11/sys/netpfil/pf/pf_ioctl.c Sun Nov 18 12:30:18 2018 (r340574) @@ -210,6 +210,7 @@ VNET_DEFINE(pfsync_update_state_t *, pfsync_update_sta VNET_DEFINE(pfsync_delete_state_t *, pfsync_delete_state_ptr); VNET_DEFINE(pfsync_clear_states_t *, pfsync_clear_states_ptr); VNET_DEFINE(pfsync_defer_t *, pfsync_defer_ptr); +pfsync_detach_ifnet_t *pfsync_detach_ifnet_ptr; /* pflog */ pflog_packet_t *pflog_packet_ptr = NULL; From owner-svn-src-all@freebsd.org Sun Nov 18 12:23:04 2018 Return-Path: Delivered-To: svn-src-all@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 C13821138501; Sun, 18 Nov 2018 12:23:04 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6311C7AE83; Sun, 18 Nov 2018 12:23:04 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3F23413503; Sun, 18 Nov 2018 12:23:04 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAICN47c058519; Sun, 18 Nov 2018 12:23:04 GMT (envelope-from oshogbo@FreeBSD.org) Received: (from oshogbo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAICN3co058518; Sun, 18 Nov 2018 12:23:03 GMT (envelope-from oshogbo@FreeBSD.org) Message-Id: <201811181223.wAICN3co058518@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: oshogbo set sender to oshogbo@FreeBSD.org using -f From: Mariusz Zaborski Date: Sun, 18 Nov 2018 12:23:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340572 - head/usr.bin/brandelf X-SVN-Group: head X-SVN-Commit-Author: oshogbo X-SVN-Commit-Paths: head/usr.bin/brandelf X-SVN-Commit-Revision: 340572 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 6311C7AE83 X-Spamd-Result: default: False [0.03 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.03)[0.033,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Nov 2018 12:23:05 -0000 Author: oshogbo Date: Sun Nov 18 12:23:03 2018 New Revision: 340572 URL: https://svnweb.freebsd.org/changeset/base/340572 Log: brandelf: capsicumize it Modified: head/usr.bin/brandelf/Makefile head/usr.bin/brandelf/brandelf.c Modified: head/usr.bin/brandelf/Makefile ============================================================================== --- head/usr.bin/brandelf/Makefile Sun Nov 18 12:09:27 2018 (r340571) +++ head/usr.bin/brandelf/Makefile Sun Nov 18 12:23:03 2018 (r340572) @@ -1,5 +1,13 @@ # $FreeBSD$ +.include + PROG= brandelf + +.if ${MK_CASPER} != "no" +LIBADD+= casper +LIBADD+= cap_fileargs +CFLAGS+= -DWITH_CASPER +.endif .include Modified: head/usr.bin/brandelf/brandelf.c ============================================================================== --- head/usr.bin/brandelf/brandelf.c Sun Nov 18 12:09:27 2018 (r340571) +++ head/usr.bin/brandelf/brandelf.c Sun Nov 18 12:23:03 2018 (r340572) @@ -33,9 +33,11 @@ __FBSDID("$FreeBSD$"); #include +#include #include #include +#include #include #include #include @@ -44,6 +46,9 @@ __FBSDID("$FreeBSD$"); #include #include +#include +#include + static int elftype(const char *); static const char *iselftype(int); static void printelftypes(void); @@ -66,8 +71,10 @@ main(int argc, char **argv) { const char *strtype = "FreeBSD"; - int ch, retval, type; + int ch, flags, retval, type; bool change, force, listed; + fileargs_t *fa; + cap_rights_t rights; type = ELFOSABI_FREEBSD; retval = 0; @@ -121,11 +128,24 @@ main(int argc, char **argv) usage(); } + flags = change || force ? O_RDWR : O_RDONLY; + cap_rights_init(&rights, CAP_READ, CAP_SEEK); + if (flags == O_RDWR) + cap_rights_set(&rights, CAP_WRITE); + + fa = fileargs_init(argc, argv, flags, 0, &rights); + if (fa == NULL) + errx(1, "unable to init casper"); + + caph_cache_catpages(); + if (caph_limit_stdio() < 0 || caph_enter_casper() < 0) + err(1, "unable to enter capability mode"); + while (argc != 0) { int fd; char buffer[EI_NIDENT]; - if ((fd = open(argv[0], change || force ? O_RDWR : O_RDONLY, 0)) < 0) { + if ((fd = fileargs_open(fa, argv[0])) < 0) { warn("error opening file %s", argv[0]); retval = 1; goto fail; @@ -167,6 +187,7 @@ fail: argv++; } + fileargs_free(fa); return (retval); } From owner-svn-src-all@freebsd.org Sun Nov 18 12:25:13 2018 Return-Path: Delivered-To: svn-src-all@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 CCC501138651; Sun, 18 Nov 2018 12:25:13 +0000 (UTC) (envelope-from oshogbo.vx@gmail.com) Received: from mail-pl1-f181.google.com (mail-pl1-f181.google.com [209.85.214.181]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1902F7B04F; Sun, 18 Nov 2018 12:25:13 +0000 (UTC) (envelope-from oshogbo.vx@gmail.com) Received: by mail-pl1-f181.google.com with SMTP id t13so10286093ply.13; Sun, 18 Nov 2018 04:25:13 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=zm67hAfiltA3xmqiIx+t0QwQPvS4140QtBBlrORR9Ls=; b=amJKMjNHRibX+YgJB0ufatGZsr57HaAEr4chHWmG2Clgx2jt3+Swi9y4Vcxvu8sPLx Np25/cZTqtFW3eN2hmR2Whi8Z8uFt7KSd5n3MWjk2Apl6Cb62dSEVkQSrFXdGQjNm9A4 HKTiEUbwKmhDfadrG6iH2oq0YxGjmyIHqtdgMf7NfGHzqnkOzPbkseDwFRSqiv5g5siM 0Qyy4eq1GqYbA/YN+ReG2nDWVwnQPlqoULb+2fnqoniAJhKSx7gkkUaJBeD2k0c89/Uf 0bjkQx3QlP0hGOKrgOEUjWMZ4xO5CEuccnI1WGdDtXqK2CIADeNPVjRwFBt+QlpIdZ1s cbIQ== X-Gm-Message-State: AGRZ1gJRrelojc0smz2QZg0RAEBvws5qJSgHtBK15rSv5VV7TeJE8kMW u57L35avgsBRY+Aq6NlJ0QlJr4fsjC5CvMDKE0ga6X9Y X-Google-Smtp-Source: AJdET5cEQcg7+deqHqfSyjJZE8t+5aOP1KlvqEQvBxCNtqAdkRRhnQEr/p+YBNpDiMUJnKxaBB/J37nZ76r8eeJtmZM= X-Received: by 2002:a17:902:bb0a:: with SMTP id l10-v6mr18631463pls.230.1542543905845; Sun, 18 Nov 2018 04:25:05 -0800 (PST) MIME-Version: 1.0 References: <201811181223.wAICN3co058518@repo.freebsd.org> In-Reply-To: <201811181223.wAICN3co058518@repo.freebsd.org> From: Mariusz Zaborski Date: Sun, 18 Nov 2018 13:25:02 +0100 Message-ID: Subject: Re: svn commit: r340572 - head/usr.bin/brandelf To: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 1902F7B04F X-Spamd-Result: default: False [-1.91 / 15.00]; ARC_NA(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; RCVD_TLS_LAST(0.00)[]; DMARC_NA(0.00)[freebsd.org]; TO_DN_SOME(0.00)[]; RWL_MAILSPIKE_GOOD(0.00)[181.214.85.209.rep.mailspike.net : 127.0.0.18]; MX_GOOD(-0.01)[cached: alt3.gmail-smtp-in.l.google.com]; NEURAL_HAM_SHORT(-0.84)[-0.836,0]; RCVD_IN_DNSWL_NONE(0.00)[181.214.85.209.list.dnswl.org : 127.0.5.0]; IP_SCORE(-1.06)[ipnet: 209.85.128.0/17(-3.47), asn: 15169(-1.74), country: US(-0.09)]; FORGED_SENDER(0.30)[oshogbo@freebsd.org,oshogbovx@gmail.com]; R_DKIM_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; TAGGED_FROM(0.00)[]; FROM_NEQ_ENVFROM(0.00)[oshogbo@freebsd.org,oshogbovx@gmail.com]; RCVD_COUNT_TWO(0.00)[2] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Nov 2018 12:25:14 -0000 Reviewed by: emaste, markj, allanjude Differential Revision: https://reviews.freebsd.org/D17967 On Sun, 18 Nov 2018 at 13:23, Mariusz Zaborski wrote: > > Author: oshogbo > Date: Sun Nov 18 12:23:03 2018 > New Revision: 340572 > URL: https://svnweb.freebsd.org/changeset/base/340572 > > Log: > brandelf: capsicumize it > > Modified: > head/usr.bin/brandelf/Makefile > head/usr.bin/brandelf/brandelf.c > > Modified: head/usr.bin/brandelf/Makefile > ============================================================================== > --- head/usr.bin/brandelf/Makefile Sun Nov 18 12:09:27 2018 (r340571) > +++ head/usr.bin/brandelf/Makefile Sun Nov 18 12:23:03 2018 (r340572) > @@ -1,5 +1,13 @@ > # $FreeBSD$ > > +.include > + > PROG= brandelf > + > +.if ${MK_CASPER} != "no" > +LIBADD+= casper > +LIBADD+= cap_fileargs > +CFLAGS+= -DWITH_CASPER > +.endif > > .include > > Modified: head/usr.bin/brandelf/brandelf.c > ============================================================================== > --- head/usr.bin/brandelf/brandelf.c Sun Nov 18 12:09:27 2018 (r340571) > +++ head/usr.bin/brandelf/brandelf.c Sun Nov 18 12:23:03 2018 (r340572) > @@ -33,9 +33,11 @@ > __FBSDID("$FreeBSD$"); > > #include > +#include > #include > #include > > +#include > #include > #include > #include > @@ -44,6 +46,9 @@ __FBSDID("$FreeBSD$"); > #include > #include > > +#include > +#include > + > static int elftype(const char *); > static const char *iselftype(int); > static void printelftypes(void); > @@ -66,8 +71,10 @@ main(int argc, char **argv) > { > > const char *strtype = "FreeBSD"; > - int ch, retval, type; > + int ch, flags, retval, type; > bool change, force, listed; > + fileargs_t *fa; > + cap_rights_t rights; > > type = ELFOSABI_FREEBSD; > retval = 0; > @@ -121,11 +128,24 @@ main(int argc, char **argv) > usage(); > } > > + flags = change || force ? O_RDWR : O_RDONLY; > + cap_rights_init(&rights, CAP_READ, CAP_SEEK); > + if (flags == O_RDWR) > + cap_rights_set(&rights, CAP_WRITE); > + > + fa = fileargs_init(argc, argv, flags, 0, &rights); > + if (fa == NULL) > + errx(1, "unable to init casper"); > + > + caph_cache_catpages(); > + if (caph_limit_stdio() < 0 || caph_enter_casper() < 0) > + err(1, "unable to enter capability mode"); > + > while (argc != 0) { > int fd; > char buffer[EI_NIDENT]; > > - if ((fd = open(argv[0], change || force ? O_RDWR : O_RDONLY, 0)) < 0) { > + if ((fd = fileargs_open(fa, argv[0])) < 0) { > warn("error opening file %s", argv[0]); > retval = 1; > goto fail; > @@ -167,6 +187,7 @@ fail: > argv++; > } > > + fileargs_free(fa); > return (retval); > } > > _______________________________________________ > svn-src-head@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/svn-src-head > To unsubscribe, send any mail to "svn-src-head-unsubscribe@freebsd.org" From owner-svn-src-all@freebsd.org Sun Nov 18 12:30:18 2018 Return-Path: Delivered-To: svn-src-all@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 E9F6811388A6; Sun, 18 Nov 2018 12:30:17 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8DC917B4AA; Sun, 18 Nov 2018 12:30:17 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6EB4E13519; Sun, 18 Nov 2018 12:30:17 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAICUHT9058882; Sun, 18 Nov 2018 12:30:17 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAICUGW6058878; Sun, 18 Nov 2018 12:30:16 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201811181230.wAICUGW6058878@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Sun, 18 Nov 2018 12:30:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r340573 - in stable/12/sys: net netpfil/pf X-SVN-Group: stable-12 X-SVN-Commit-Author: kp X-SVN-Commit-Paths: in stable/12/sys: net netpfil/pf X-SVN-Commit-Revision: 340573 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 8DC917B4AA X-Spamd-Result: default: False [0.06 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.06)[0.058,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Nov 2018 12:30:18 -0000 Author: kp Date: Sun Nov 18 12:30:16 2018 New Revision: 340573 URL: https://svnweb.freebsd.org/changeset/base/340573 Log: MFC r340068: pfsync: Handle syncdev going away If the syncdev is removed we no longer need to clean up the multicast entry we've got set up for that device. Pass the ifnet detach event through pf to pfsync, and remove our multicast handle, and mark us as no longer having a syncdev. Note that this callback is always installed, even if the pfsync interface is disabled (and thus it's not a per-vnet callback pointer). Sponsored by: Orange Business Services Modified: stable/12/sys/net/pfvar.h stable/12/sys/netpfil/pf/if_pfsync.c stable/12/sys/netpfil/pf/pf_if.c stable/12/sys/netpfil/pf/pf_ioctl.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/net/pfvar.h ============================================================================== --- stable/12/sys/net/pfvar.h Sun Nov 18 12:23:03 2018 (r340572) +++ stable/12/sys/net/pfvar.h Sun Nov 18 12:30:16 2018 (r340573) @@ -824,6 +824,7 @@ typedef void pfsync_update_state_t(struct pf_state *) typedef void pfsync_delete_state_t(struct pf_state *); typedef void pfsync_clear_states_t(u_int32_t, const char *); typedef int pfsync_defer_t(struct pf_state *, struct mbuf *); +typedef void pfsync_detach_ifnet_t(struct ifnet *); VNET_DECLARE(pfsync_state_import_t *, pfsync_state_import_ptr); #define V_pfsync_state_import_ptr VNET(pfsync_state_import_ptr) @@ -837,6 +838,7 @@ VNET_DECLARE(pfsync_clear_states_t *, pfsync_clear_sta #define V_pfsync_clear_states_ptr VNET(pfsync_clear_states_ptr) VNET_DECLARE(pfsync_defer_t *, pfsync_defer_ptr); #define V_pfsync_defer_ptr VNET(pfsync_defer_ptr) +extern pfsync_detach_ifnet_t *pfsync_detach_ifnet_ptr; void pfsync_state_export(struct pfsync_state *, struct pf_state *); Modified: stable/12/sys/netpfil/pf/if_pfsync.c ============================================================================== --- stable/12/sys/netpfil/pf/if_pfsync.c Sun Nov 18 12:23:03 2018 (r340572) +++ stable/12/sys/netpfil/pf/if_pfsync.c Sun Nov 18 12:30:16 2018 (r340573) @@ -281,6 +281,7 @@ static void pfsync_bulk_status(u_int8_t); static void pfsync_bulk_update(void *); static void pfsync_bulk_fail(void *); +static void pfsync_detach_ifnet(struct ifnet *); #ifdef IPSEC static void pfsync_update_net_tdb(struct pfsync_tdb *); #endif @@ -2292,6 +2293,29 @@ pfsync_multicast_cleanup(struct pfsync_softc *sc) imo->imo_multicast_ifp = NULL; } +void +pfsync_detach_ifnet(struct ifnet *ifp) +{ + struct pfsync_softc *sc = V_pfsyncif; + + if (sc == NULL) + return; + + PFSYNC_LOCK(sc); + + if (sc->sc_sync_if == ifp) { + /* We don't need mutlicast cleanup here, because the interface + * is going away. We do need to ensure we don't try to do + * cleanup later. + */ + sc->sc_imo.imo_membership = NULL; + sc->sc_imo.imo_multicast_ifp = NULL; + sc->sc_sync_if = NULL; + } + + PFSYNC_UNLOCK(sc); +} + #ifdef INET extern struct domain inetdomain; static struct protosw in_pfsync_protosw = { @@ -2372,6 +2396,8 @@ pfsync_init() #ifdef INET int error; + pfsync_detach_ifnet_ptr = pfsync_detach_ifnet; + error = pf_proto_register(PF_INET, &in_pfsync_protosw); if (error) return (error); @@ -2388,6 +2414,7 @@ pfsync_init() static void pfsync_uninit() { + pfsync_detach_ifnet_ptr = NULL; #ifdef INET ipproto_unregister(IPPROTO_PFSYNC); Modified: stable/12/sys/netpfil/pf/pf_if.c ============================================================================== --- stable/12/sys/netpfil/pf/pf_if.c Sun Nov 18 12:23:03 2018 (r340572) +++ stable/12/sys/netpfil/pf/pf_if.c Sun Nov 18 12:30:16 2018 (r340573) @@ -833,6 +833,9 @@ pfi_detach_ifnet_event(void *arg __unused, struct ifne { struct pfi_kif *kif = (struct pfi_kif *)ifp->if_pf_kif; + if (pfsync_detach_ifnet_ptr) + pfsync_detach_ifnet_ptr(ifp); + if (kif == NULL) return; @@ -840,6 +843,7 @@ pfi_detach_ifnet_event(void *arg __unused, struct ifne /* Avoid teardown race in the least expensive way. */ return; } + PF_RULES_WLOCK(); V_pfi_update++; pfi_kif_update(kif); Modified: stable/12/sys/netpfil/pf/pf_ioctl.c ============================================================================== --- stable/12/sys/netpfil/pf/pf_ioctl.c Sun Nov 18 12:23:03 2018 (r340572) +++ stable/12/sys/netpfil/pf/pf_ioctl.c Sun Nov 18 12:30:16 2018 (r340573) @@ -218,6 +218,7 @@ VNET_DEFINE(pfsync_update_state_t *, pfsync_update_sta VNET_DEFINE(pfsync_delete_state_t *, pfsync_delete_state_ptr); VNET_DEFINE(pfsync_clear_states_t *, pfsync_clear_states_ptr); VNET_DEFINE(pfsync_defer_t *, pfsync_defer_ptr); +pfsync_detach_ifnet_t *pfsync_detach_ifnet_ptr; /* pflog */ pflog_packet_t *pflog_packet_ptr = NULL; From owner-svn-src-all@freebsd.org Sun Nov 18 12:31:42 2018 Return-Path: Delivered-To: svn-src-all@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 43E3E1138A3C; Sun, 18 Nov 2018 12:31:42 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DD9F17B8EC; Sun, 18 Nov 2018 12:31:41 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BD85F13583; Sun, 18 Nov 2018 12:31:41 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAICVfLE061968; Sun, 18 Nov 2018 12:31:41 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAICVfXc061965; Sun, 18 Nov 2018 12:31:41 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201811181231.wAICVfXc061965@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Sun, 18 Nov 2018 12:31:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r340575 - stable/12/tests/sys/netpfil/pf X-SVN-Group: stable-12 X-SVN-Commit-Author: kp X-SVN-Commit-Paths: stable/12/tests/sys/netpfil/pf X-SVN-Commit-Revision: 340575 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: DD9F17B8EC X-Spamd-Result: default: False [0.06 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.06)[0.058,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Nov 2018 12:31:42 -0000 Author: kp Date: Sun Nov 18 12:31:40 2018 New Revision: 340575 URL: https://svnweb.freebsd.org/changeset/base/340575 Log: MFC r340069: pf tests: Basic pfsync test Set up two jails, configure pfsync between them and create state in one of them, verify that this state is copied to the other jail. Sponsored by: Orange Business Services Added: stable/12/tests/sys/netpfil/pf/pfsync.sh - copied unchanged from r340069, head/tests/sys/netpfil/pf/pfsync.sh Modified: stable/12/tests/sys/netpfil/pf/Makefile stable/12/tests/sys/netpfil/pf/utils.subr Directory Properties: stable/12/ (props changed) Modified: stable/12/tests/sys/netpfil/pf/Makefile ============================================================================== --- stable/12/tests/sys/netpfil/pf/Makefile Sun Nov 18 12:30:18 2018 (r340574) +++ stable/12/tests/sys/netpfil/pf/Makefile Sun Nov 18 12:31:40 2018 (r340575) @@ -11,7 +11,8 @@ ATF_TESTS_SH+= pass_block \ set_tos \ route_to \ synproxy \ - set_skip + set_skip \ + pfsync ${PACKAGE}FILES+= utils.subr \ echo_inetd.conf \ Copied: stable/12/tests/sys/netpfil/pf/pfsync.sh (from r340069, head/tests/sys/netpfil/pf/pfsync.sh) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/12/tests/sys/netpfil/pf/pfsync.sh Sun Nov 18 12:31:40 2018 (r340575, copy of r340069, head/tests/sys/netpfil/pf/pfsync.sh) @@ -0,0 +1,70 @@ +# $FreeBSD$ + +. $(atf_get_srcdir)/utils.subr + +atf_test_case "basic" "cleanup" +basic_head() +{ + atf_set descr 'Basic pfsync test' + atf_set require.user root + + atf_set require.progs scapy +} + +basic_body() +{ + pfsynct_init + + epair_sync=$(pft_mkepair) + epair_one=$(pft_mkepair) + epair_two=$(pft_mkepair) + + pft_mkjail one ${epair_one}a ${epair_sync}a + pft_mkjail two ${epair_two}a ${epair_sync}b + + # pfsync interface + jexec one ifconfig ${epair_sync}a 192.0.2.1/24 up + jexec one ifconfig ${epair_one}a 198.51.100.1/24 up + jexec one ifconfig pfsync0 \ + syncdev ${epair_sync}a \ + maxupd 1 \ + up + jexec two ifconfig ${epair_two}a 198.51.100.2/24 up + jexec two ifconfig ${epair_sync}b 192.0.2.2/24 up + jexec two ifconfig pfsync0 \ + syncdev ${epair_sync}b \ + maxupd 1 \ + up + + # Enable pf! + jexec one pfctl -e + pft_set_rules one \ + "set skip on ${epair_sync}a" \ + "pass keep state" + jexec two pfctl -e + pft_set_rules two \ + "set skip on ${epair_sync}b" \ + "pass keep state" + + ifconfig ${epair_one}b 198.51.100.254/24 up + + ping -c 1 -S 198.51.100.254 198.51.100.1 + + # Give pfsync time to do its thing + sleep 2 + + if ! jexec two pfctl -s states | grep icmp | grep 198.51.100.1 | \ + grep 198.51.100.2 ; then + atf_fail "state not found on synced host" + fi +} + +basic_cleanup() +{ + pfsynct_cleanup +} + +atf_init_test_cases() +{ + atf_add_test_case "basic" +} Modified: stable/12/tests/sys/netpfil/pf/utils.subr ============================================================================== --- stable/12/tests/sys/netpfil/pf/utils.subr Sun Nov 18 12:30:18 2018 (r340574) +++ stable/12/tests/sys/netpfil/pf/utils.subr Sun Nov 18 12:31:40 2018 (r340575) @@ -13,6 +13,15 @@ pft_init() fi } +pfsynct_init() +{ + pft_init + + if ! kldstat -q -m pfsync; then + atf_skip "This test requires pfsync" + fi +} + pft_mkepair() { ifname=$(ifconfig epair create) @@ -66,4 +75,9 @@ pft_cleanup() done rm created_interfaces.lst fi +} + +pfsynct_cleanup() +{ + pft_cleanup } From owner-svn-src-all@freebsd.org Sun Nov 18 12:59:11 2018 Return-Path: Delivered-To: svn-src-all@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 1B9381100F59; Sun, 18 Nov 2018 12:59:11 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B30937C9BF; Sun, 18 Nov 2018 12:59:10 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9403F139FB; Sun, 18 Nov 2018 12:59:10 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAICxADH074420; Sun, 18 Nov 2018 12:59:10 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAICxA4v074419; Sun, 18 Nov 2018 12:59:10 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201811181259.wAICxA4v074419@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Sun, 18 Nov 2018 12:59:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r340577 - stable/11/sys/netpfil/pf X-SVN-Group: stable-11 X-SVN-Commit-Author: kp X-SVN-Commit-Paths: stable/11/sys/netpfil/pf X-SVN-Commit-Revision: 340577 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B30937C9BF X-Spamd-Result: default: False [0.26 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.26)[0.263,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Nov 2018 12:59:11 -0000 Author: kp Date: Sun Nov 18 12:59:10 2018 New Revision: 340577 URL: https://svnweb.freebsd.org/changeset/base/340577 Log: MFC r340070: pfsync: Allow module to be unloaded Sponsored by: Orange Business Services Modified: stable/11/sys/netpfil/pf/if_pfsync.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/netpfil/pf/if_pfsync.c ============================================================================== --- stable/11/sys/netpfil/pf/if_pfsync.c Sun Nov 18 12:59:09 2018 (r340576) +++ stable/11/sys/netpfil/pf/if_pfsync.c Sun Nov 18 12:59:10 2018 (r340577) @@ -2429,12 +2429,6 @@ pfsync_modevent(module_t mod, int type, void *data) case MOD_LOAD: error = pfsync_init(); break; - case MOD_QUIESCE: - /* - * Module should not be unloaded due to race conditions. - */ - error = EBUSY; - break; case MOD_UNLOAD: pfsync_uninit(); break; From owner-svn-src-all@freebsd.org Sun Nov 18 12:59:10 2018 Return-Path: Delivered-To: svn-src-all@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 1C10F1100F51; Sun, 18 Nov 2018 12:59:10 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B1D5C7C9BE; Sun, 18 Nov 2018 12:59:09 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8AB96139FA; Sun, 18 Nov 2018 12:59:09 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAICx9vQ074376; Sun, 18 Nov 2018 12:59:09 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAICx9xa074374; Sun, 18 Nov 2018 12:59:09 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201811181259.wAICx9xa074374@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Sun, 18 Nov 2018 12:59:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r340576 - stable/12/sys/netpfil/pf X-SVN-Group: stable-12 X-SVN-Commit-Author: kp X-SVN-Commit-Paths: stable/12/sys/netpfil/pf X-SVN-Commit-Revision: 340576 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B1D5C7C9BE X-Spamd-Result: default: False [0.26 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.26)[0.263,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Nov 2018 12:59:10 -0000 Author: kp Date: Sun Nov 18 12:59:09 2018 New Revision: 340576 URL: https://svnweb.freebsd.org/changeset/base/340576 Log: MFC r340070: pfsync: Allow module to be unloaded Sponsored by: Orange Business Services Modified: stable/12/sys/netpfil/pf/if_pfsync.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/netpfil/pf/if_pfsync.c ============================================================================== --- stable/12/sys/netpfil/pf/if_pfsync.c Sun Nov 18 12:31:40 2018 (r340575) +++ stable/12/sys/netpfil/pf/if_pfsync.c Sun Nov 18 12:59:09 2018 (r340576) @@ -2431,12 +2431,6 @@ pfsync_modevent(module_t mod, int type, void *data) case MOD_LOAD: error = pfsync_init(); break; - case MOD_QUIESCE: - /* - * Module should not be unloaded due to race conditions. - */ - error = EBUSY; - break; case MOD_UNLOAD: pfsync_uninit(); break; From owner-svn-src-all@freebsd.org Sun Nov 18 13:03:49 2018 Return-Path: Delivered-To: svn-src-all@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 BF00211012C5; Sun, 18 Nov 2018 13:03:49 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5FBBA7CEC0; Sun, 18 Nov 2018 13:03:49 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2ECDE13B9F; Sun, 18 Nov 2018 13:03:49 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAID3mr1079413; Sun, 18 Nov 2018 13:03:48 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAID3meX079412; Sun, 18 Nov 2018 13:03:48 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201811181303.wAID3meX079412@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Sun, 18 Nov 2018 13:03:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r340578 - stable/11/sys/netpfil/pf X-SVN-Group: stable-11 X-SVN-Commit-Author: kp X-SVN-Commit-Paths: stable/11/sys/netpfil/pf X-SVN-Commit-Revision: 340578 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 5FBBA7CEC0 X-Spamd-Result: default: False [0.26 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.26)[0.263,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Nov 2018 13:03:49 -0000 Author: kp Date: Sun Nov 18 13:03:48 2018 New Revision: 340578 URL: https://svnweb.freebsd.org/changeset/base/340578 Log: MFC r340072: pfsync: Add missing unlock If we fail to set up the multicast entry for pfsync and return an error we must release the pfsync lock first. Sponsored by: Orange Business Services Modified: stable/11/sys/netpfil/pf/if_pfsync.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/netpfil/pf/if_pfsync.c ============================================================================== --- stable/11/sys/netpfil/pf/if_pfsync.c Sun Nov 18 12:59:10 2018 (r340577) +++ stable/11/sys/netpfil/pf/if_pfsync.c Sun Nov 18 13:03:48 2018 (r340578) @@ -1392,6 +1392,7 @@ pfsyncioctl(struct ifnet *ifp, u_long cmd, caddr_t dat if (error) { if_rele(sifp); free(mship, M_PFSYNC); + PFSYNC_UNLOCK(sc); return (error); } } From owner-svn-src-all@freebsd.org Sun Nov 18 13:03:50 2018 Return-Path: Delivered-To: svn-src-all@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 7742B11012C9; Sun, 18 Nov 2018 13:03:50 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 18C317CEC1; Sun, 18 Nov 2018 13:03:50 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EC13113BA0; Sun, 18 Nov 2018 13:03:49 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAID3n9s079457; Sun, 18 Nov 2018 13:03:49 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAID3ns5079456; Sun, 18 Nov 2018 13:03:49 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201811181303.wAID3ns5079456@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Sun, 18 Nov 2018 13:03:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r340579 - stable/12/sys/netpfil/pf X-SVN-Group: stable-12 X-SVN-Commit-Author: kp X-SVN-Commit-Paths: stable/12/sys/netpfil/pf X-SVN-Commit-Revision: 340579 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 18C317CEC1 X-Spamd-Result: default: False [0.26 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.26)[0.263,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Nov 2018 13:03:50 -0000 Author: kp Date: Sun Nov 18 13:03:49 2018 New Revision: 340579 URL: https://svnweb.freebsd.org/changeset/base/340579 Log: MFC r340072: pfsync: Add missing unlock If we fail to set up the multicast entry for pfsync and return an error we must release the pfsync lock first. Sponsored by: Orange Business Services Modified: stable/12/sys/netpfil/pf/if_pfsync.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/netpfil/pf/if_pfsync.c ============================================================================== --- stable/12/sys/netpfil/pf/if_pfsync.c Sun Nov 18 13:03:48 2018 (r340578) +++ stable/12/sys/netpfil/pf/if_pfsync.c Sun Nov 18 13:03:49 2018 (r340579) @@ -1394,6 +1394,7 @@ pfsyncioctl(struct ifnet *ifp, u_long cmd, caddr_t dat if (error) { if_rele(sifp); free(mship, M_PFSYNC); + PFSYNC_UNLOCK(sc); return (error); } } From owner-svn-src-all@freebsd.org Sun Nov 18 14:52:18 2018 Return-Path: Delivered-To: svn-src-all@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 E0DC311041F8; Sun, 18 Nov 2018 14:52:17 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7FB3280B98; Sun, 18 Nov 2018 14:52:17 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 60C5914C45; Sun, 18 Nov 2018 14:52:17 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAIEqHwp035339; Sun, 18 Nov 2018 14:52:17 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAIEqHMT035338; Sun, 18 Nov 2018 14:52:17 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201811181452.wAIEqHMT035338@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Sun, 18 Nov 2018 14:52:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r340580 - stable/12/share/man/man7 X-SVN-Group: stable-12 X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: stable/12/share/man/man7 X-SVN-Commit-Revision: 340580 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 7FB3280B98 X-Spamd-Result: default: False [0.20 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.20)[0.195,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Nov 2018 14:52:18 -0000 Author: emaste Date: Sun Nov 18 14:52:16 2018 New Revision: 340580 URL: https://svnweb.freebsd.org/changeset/base/340580 Log: MFC r340329: build(7): clarify buildenv target can be used for non-cross builds make buildenv can be used for building for the same architecture as the host (perhaps this is a degenerate case of cross-building). TARGET and TARGET_ARCH do not need to be set in this case. Sponsored by: The FreeBSD Foundation Modified: stable/12/share/man/man7/build.7 Directory Properties: stable/12/ (props changed) Modified: stable/12/share/man/man7/build.7 ============================================================================== --- stable/12/share/man/man7/build.7 Sun Nov 18 13:03:49 2018 (r340579) +++ stable/12/share/man/man7/build.7 Sun Nov 18 14:52:16 2018 (r340580) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 16, 2018 +.Dd November 10, 2018 .Dt BUILD 7 .Os .Sh NAME @@ -168,16 +168,16 @@ are: .Bl -tag -width ".Cm distributeworld" .It Cm buildenv Spawn an interactive shell with environment variables set up for -cross-building the system. -The target architecture needs to be specified with +building the system or individual components. +For cross-building the target architecture needs to be specified with .Xr make 1 variables .Va TARGET_ARCH and .Va TARGET . .Pp -This target is only useful after a complete cross-toolchain including -the compiler, linker, assembler, headers and libraries has been +This target is only useful after a complete toolchain (including +the compiler, linker, assembler, headers and libraries) has been built; see the .Cm toolchain target below. From owner-svn-src-all@freebsd.org Sun Nov 18 14:53:30 2018 Return-Path: Delivered-To: svn-src-all@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 A4082110433C; Sun, 18 Nov 2018 14:53:30 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.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 3D8D580E2B; Sun, 18 Nov 2018 14:53:30 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1FD3614D6A; Sun, 18 Nov 2018 14:53:30 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAIErUv0035813; Sun, 18 Nov 2018 14:53:30 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAIErUYU035812; Sun, 18 Nov 2018 14:53:30 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201811181453.wAIErUYU035812@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Sun, 18 Nov 2018 14:53:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r340581 - stable/11/share/man/man7 X-SVN-Group: stable-11 X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: stable/11/share/man/man7 X-SVN-Commit-Revision: 340581 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 3D8D580E2B X-Spamd-Result: default: False [0.20 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.20)[0.195,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Nov 2018 14:53:30 -0000 Author: emaste Date: Sun Nov 18 14:53:29 2018 New Revision: 340581 URL: https://svnweb.freebsd.org/changeset/base/340581 Log: MFC r340329: build(7): clarify buildenv target can be used for non-cross builds make buildenv can be used for building for the same architecture as the host (perhaps this is a degenerate case of cross-building). TARGET and TARGET_ARCH do not need to be set in this case. Sponsored by: The FreeBSD Foundation Modified: stable/11/share/man/man7/build.7 Directory Properties: stable/11/ (props changed) Modified: stable/11/share/man/man7/build.7 ============================================================================== --- stable/11/share/man/man7/build.7 Sun Nov 18 14:52:16 2018 (r340580) +++ stable/11/share/man/man7/build.7 Sun Nov 18 14:53:29 2018 (r340581) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 16, 2018 +.Dd November 10, 2018 .Dt BUILD 7 .Os .Sh NAME @@ -177,16 +177,16 @@ are: .Bl -tag -width ".Cm distributeworld" .It Cm buildenv Spawn an interactive shell with environment variables set up for -cross-building the system. -The target architecture needs to be specified with +building the system or individual components. +For cross-building the target architecture needs to be specified with .Xr make 1 variables .Va TARGET_ARCH and .Va TARGET . .Pp -This target is only useful after a complete cross-toolchain including -the compiler, linker, assembler, headers and libraries has been +This target is only useful after a complete toolchain (including +the compiler, linker, assembler, headers and libraries) has been built; see the .Cm toolchain target below. From owner-svn-src-all@freebsd.org Sun Nov 18 14:54:46 2018 Return-Path: Delivered-To: svn-src-all@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 2C08D1104445; Sun, 18 Nov 2018 14:54:46 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BEF6080FA7; Sun, 18 Nov 2018 14:54:45 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9FE7C14D6D; Sun, 18 Nov 2018 14:54:45 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAIEsjoc035933; Sun, 18 Nov 2018 14:54:45 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAIEsj5i035932; Sun, 18 Nov 2018 14:54:45 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201811181454.wAIEsj5i035932@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Sun, 18 Nov 2018 14:54:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r340582 - stable/12/contrib/nvi/vi X-SVN-Group: stable-12 X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: stable/12/contrib/nvi/vi X-SVN-Commit-Revision: 340582 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: BEF6080FA7 X-Spamd-Result: default: False [0.20 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.20)[0.195,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Nov 2018 14:54:46 -0000 Author: emaste Date: Sun Nov 18 14:54:45 2018 New Revision: 340582 URL: https://svnweb.freebsd.org/changeset/base/340582 Log: MFC r340288: nvi: remove superfluous space before ^\ This fixes alignment in vi's 'viusage' command and has been fixed upstream and in OpenBSD. Submitted by: Raf Czlonka (github:rjc) Modified: stable/12/contrib/nvi/vi/v_cmd.c Directory Properties: stable/12/ (props changed) Modified: stable/12/contrib/nvi/vi/v_cmd.c ============================================================================== --- stable/12/contrib/nvi/vi/v_cmd.c Sun Nov 18 14:53:29 2018 (r340581) +++ stable/12/contrib/nvi/vi/v_cmd.c Sun Nov 18 14:54:45 2018 (r340582) @@ -130,7 +130,7 @@ VIKEYS const vikeys [MAXVIKEY + 1] = { /* 034 ^\ */ {v_exmode, 0, "^\\", - " ^\\ switch to ex mode"}, + "^\\ switch to ex mode"}, /* 035 ^] */ {v_tagpush, V_ABS|V_KEYW|VM_RCM_SET, "^]", From owner-svn-src-all@freebsd.org Sun Nov 18 14:55:05 2018 Return-Path: Delivered-To: svn-src-all@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 17C871104487; Sun, 18 Nov 2018 14:55:05 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AB9F9810B8; Sun, 18 Nov 2018 14:55:04 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8C65214D6E; Sun, 18 Nov 2018 14:55:04 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAIEt4LT036022; Sun, 18 Nov 2018 14:55:04 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAIEt4We036021; Sun, 18 Nov 2018 14:55:04 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201811181455.wAIEt4We036021@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Sun, 18 Nov 2018 14:55:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r340583 - stable/11/contrib/nvi/vi X-SVN-Group: stable-11 X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: stable/11/contrib/nvi/vi X-SVN-Commit-Revision: 340583 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: AB9F9810B8 X-Spamd-Result: default: False [0.20 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.20)[0.195,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Nov 2018 14:55:05 -0000 Author: emaste Date: Sun Nov 18 14:55:04 2018 New Revision: 340583 URL: https://svnweb.freebsd.org/changeset/base/340583 Log: MFC r340288: nvi: remove superfluous space before ^\ This fixes alignment in vi's 'viusage' command and has been fixed upstream and in OpenBSD. Submitted by: Raf Czlonka (github:rjc) Modified: stable/11/contrib/nvi/vi/v_cmd.c Directory Properties: stable/11/ (props changed) Modified: stable/11/contrib/nvi/vi/v_cmd.c ============================================================================== --- stable/11/contrib/nvi/vi/v_cmd.c Sun Nov 18 14:54:45 2018 (r340582) +++ stable/11/contrib/nvi/vi/v_cmd.c Sun Nov 18 14:55:04 2018 (r340583) @@ -130,7 +130,7 @@ VIKEYS const vikeys [MAXVIKEY + 1] = { /* 034 ^\ */ {v_exmode, 0, "^\\", - " ^\\ switch to ex mode"}, + "^\\ switch to ex mode"}, /* 035 ^] */ {v_tagpush, V_ABS|V_KEYW|VM_RCM_SET, "^]", From owner-svn-src-all@freebsd.org Sun Nov 18 14:56:09 2018 Return-Path: Delivered-To: svn-src-all@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 9334811045D4; Sun, 18 Nov 2018 14:56:09 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1A2688132A; Sun, 18 Nov 2018 14:56:09 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EE8F614D70; Sun, 18 Nov 2018 14:56:08 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAIEu8YV036132; Sun, 18 Nov 2018 14:56:08 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAIEu8us036131; Sun, 18 Nov 2018 14:56:08 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201811181456.wAIEu8us036131@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Sun, 18 Nov 2018 14:56:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r340584 - stable/12/sys/contrib/octeon-sdk X-SVN-Group: stable-12 X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: stable/12/sys/contrib/octeon-sdk X-SVN-Commit-Revision: 340584 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 1A2688132A X-Spamd-Result: default: False [0.20 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.20)[0.195,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Nov 2018 14:56:09 -0000 Author: emaste Date: Sun Nov 18 14:56:08 2018 New Revision: 340584 URL: https://svnweb.freebsd.org/changeset/base/340584 Log: MFC r340299: Octeon SDK: avoid use of uninitialized variable Reported by: Clang Modified: stable/12/sys/contrib/octeon-sdk/cvmx-pip.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/contrib/octeon-sdk/cvmx-pip.h ============================================================================== --- stable/12/sys/contrib/octeon-sdk/cvmx-pip.h Sun Nov 18 14:55:04 2018 (r340583) +++ stable/12/sys/contrib/octeon-sdk/cvmx-pip.h Sun Nov 18 14:56:08 2018 (r340584) @@ -684,6 +684,7 @@ static inline int cvmx_pip_get_bsel_table_index(cvmx_w bsel_cfg.u64 = cvmx_read_csr(CVMX_PIP_BSEL_EXT_CFGX(bit)); bsel_pos.u64 = cvmx_read_csr(CVMX_PIP_BSEL_EXT_POSX(bit)); + index = 0; for (y = 0; y < 8; y++) { char *ptr = (char *)cvmx_phys_to_ptr(work->packet_ptr.s.addr); From owner-svn-src-all@freebsd.org Sun Nov 18 14:56:27 2018 Return-Path: Delivered-To: svn-src-all@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 859C5110463B; Sun, 18 Nov 2018 14:56:27 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2A8EE8145B; Sun, 18 Nov 2018 14:56:27 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0728414D71; Sun, 18 Nov 2018 14:56:27 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAIEuQge036188; Sun, 18 Nov 2018 14:56:26 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAIEuQge036187; Sun, 18 Nov 2018 14:56:26 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201811181456.wAIEuQge036187@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Sun, 18 Nov 2018 14:56:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r340585 - stable/11/sys/contrib/octeon-sdk X-SVN-Group: stable-11 X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: stable/11/sys/contrib/octeon-sdk X-SVN-Commit-Revision: 340585 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 2A8EE8145B X-Spamd-Result: default: False [0.20 / 15.00]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.20)[0.195,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Nov 2018 14:56:27 -0000 Author: emaste Date: Sun Nov 18 14:56:26 2018 New Revision: 340585 URL: https://svnweb.freebsd.org/changeset/base/340585 Log: MFC r340299: Octeon SDK: avoid use of uninitialized variable Reported by: Clang Modified: stable/11/sys/contrib/octeon-sdk/cvmx-pip.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/contrib/octeon-sdk/cvmx-pip.h ============================================================================== --- stable/11/sys/contrib/octeon-sdk/cvmx-pip.h Sun Nov 18 14:56:08 2018 (r340584) +++ stable/11/sys/contrib/octeon-sdk/cvmx-pip.h Sun Nov 18 14:56:26 2018 (r340585) @@ -684,6 +684,7 @@ static inline int cvmx_pip_get_bsel_table_index(cvmx_w bsel_cfg.u64 = cvmx_read_csr(CVMX_PIP_BSEL_EXT_CFGX(bit)); bsel_pos.u64 = cvmx_read_csr(CVMX_PIP_BSEL_EXT_POSX(bit)); + index = 0; for (y = 0; y < 8; y++) { char *ptr = (char *)cvmx_phys_to_ptr(work->packet_ptr.s.addr); From owner-svn-src-all@freebsd.org Sun Nov 18 14:58:02 2018 Return-Path: Delivered-To: svn-src-all@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 CBA0C11047C4; Sun, 18 Nov 2018 14:58:02 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6BB8B81648; Sun, 18 Nov 2018 14:58:02 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4CA4B14D76; Sun, 18 Nov 2018 14:58:02 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAIEw2o9036311; Sun, 18 Nov 2018 14:58:02 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAIEw2ig036310; Sun, 18 Nov 2018 14:58:02 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201811181458.wAIEw2ig036310@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Sun, 18 Nov 2018 14:58:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r340586 - stable/12/sys/sys X-SVN-Group: stable-12 X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: stable/12/sys/sys X-SVN-Commit-Revision: 340586 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 6BB8B81648 X-Spamd-Result: default: False [0.20 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.20)[0.195,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Nov 2018 14:58:03 -0000 Author: emaste Date: Sun Nov 18 14:58:01 2018 New Revision: 340586 URL: https://svnweb.freebsd.org/changeset/base/340586 Log: MFC r340171: capability.h: add comment about planned removal timeline PR: 228878 Modified: stable/12/sys/sys/capability.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/sys/capability.h ============================================================================== --- stable/12/sys/sys/capability.h Sun Nov 18 14:56:26 2018 (r340585) +++ stable/12/sys/sys/capability.h Sun Nov 18 14:58:01 2018 (r340586) @@ -35,7 +35,8 @@ * Historically, the key userspace and kernel Capsicum definitions were found * in this file. However, it conflicted with POSIX.1e's capability.h, so has * been renamed capsicum.h. The file remains for backwards compatibility - * reasons as a nested include. + * reasons as a nested include. It is expected to be removed before + * FreeBSD 13. */ #ifndef _SYS_CAPABILITY_H_ #define _SYS_CAPABILITY_H_ From owner-svn-src-all@freebsd.org Sun Nov 18 19:55:04 2018 Return-Path: Delivered-To: svn-src-all@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 17F5D110D534; Sun, 18 Nov 2018 19:55:04 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.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 AF7106D166; Sun, 18 Nov 2018 19:55:03 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8E15017E23; Sun, 18 Nov 2018 19:55:03 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAIJt3Sh091774; Sun, 18 Nov 2018 19:55:03 GMT (envelope-from arichardson@FreeBSD.org) Received: (from arichardson@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAIJt3ib091773; Sun, 18 Nov 2018 19:55:03 GMT (envelope-from arichardson@FreeBSD.org) Message-Id: <201811181955.wAIJt3ib091773@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arichardson set sender to arichardson@FreeBSD.org using -f From: Alex Richardson Date: Sun, 18 Nov 2018 19:55:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340587 - head X-SVN-Group: head X-SVN-Commit-Author: arichardson X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 340587 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: AF7106D166 X-Spamd-Result: default: False [0.19 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.05)[0.047,0]; NEURAL_SPAM_MEDIUM(0.14)[0.139,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Nov 2018 19:55:04 -0000 Author: arichardson Date: Sun Nov 18 19:55:03 2018 New Revision: 340587 URL: https://svnweb.freebsd.org/changeset/base/340587 Log: Fix -DNO_CLEAN amd64 build after r340463 Without this change I got the following error: clang-7: error: no such file or directory: '..../lib/libc/amd64/string/bzero.S' Reviewed By: mjg Differential Revision: https://reviews.freebsd.org/D18031 Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Sun Nov 18 14:58:01 2018 (r340586) +++ head/Makefile.inc1 Sun Nov 18 19:55:03 2018 (r340587) @@ -962,6 +962,13 @@ _cleanobj_fast_depend_hack: .PHONY ${LIBCOMPAT:D${LIBCOMPAT_OBJTOP}/lib/libc/.depend.${f}.*}; \ fi .endfor +# 20181115 r340463 bzero reimplemented as .c + @if [ -e "${OBJTOP}/lib/libc/.depend.bzero.o" ] && \ + egrep -qw 'bzero\.[sS]' ${OBJTOP}/lib/libc/.depend.bzero.o; then \ + echo "Removing stale dependencies for bzero"; \ + rm -f ${OBJTOP}/lib/libc/.depend.bzero.* \ + ${LIBCOMPAT:D${LIBCOMPAT_OBJTOP}/lib/libc/.depend.bzero.*}; \ + fi # 20181009 track migration from ntp's embedded libevent to updated one @if [ -e "${OBJTOP}/usr.sbin/ntp/libntpevent/.depend.bufferevent_openssl.o" ] && \ egrep -q 'contrib/ntp/sntp/libevent/bufferevent_openssl.c' \ From owner-svn-src-all@freebsd.org Sun Nov 18 19:56:26 2018 Return-Path: Delivered-To: svn-src-all@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 686F8110D954; Sun, 18 Nov 2018 19:56:26 +0000 (UTC) (envelope-from allanjude@freebsd.org) Received: from mx1.scaleengine.net (mx1.scaleengine.net [209.51.186.6]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CE2556D411; Sun, 18 Nov 2018 19:56:25 +0000 (UTC) (envelope-from allanjude@freebsd.org) Received: from [10.1.1.2] (Seawolf.HML3.ScaleEngine.net [209.51.186.28]) (Authenticated sender: allanjude.freebsd@scaleengine.com) by mx1.scaleengine.net (Postfix) with ESMTPSA id B640E1DCC9; Sun, 18 Nov 2018 19:56:19 +0000 (UTC) To: Warner Losh , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201811151602.wAFG2E4w040161@repo.freebsd.org> From: Allan Jude Openpgp: preference=signencrypt Autocrypt: addr=allanjude@freebsd.org; prefer-encrypt=mutual; keydata= xsFNBFVwZcYBEADwrZDH0xe0ZVjc9ORCc6PcBLwS/RTXA6NkvpD6ea02pZ8lPOVgteuuugFc D34LdDbiWr+479vfrKBh+Y38GL0oZ0/13j10tIlDMHSa5BU0y6ACtnhupFvVlQ57+XaJAb/q 7qkfSiuxVwQ3FY3PL3cl1RrIP5eGHLA9hu4eVbu+FOX/q/XVKz49HaeIaxzo2Q54572VzIo6 C28McX9m65UL5fXMUGJDDLCItLmehZlHsQQ+uBxvODLFpVV2lUgDR/0rDa0B9zHZX8jY8qQ7 ZdCSy7CwClXI054CkXZCaBzgxYh/CotdI8ezmaw7NLs5vWNTxaDEFXaFMQtMVhvqQBpHkfOD 7rjjOmFw00nJL4FuPE5Yut0CPyx8vLjVmNJSt/Y8WxxmhutsqJYFgYfWl/vaWkrFLur/Zcmz IklwLw35HLsCZytCN5A3rGKdRbQjD6QPXOTJu0JPrJF6t2xFkWAT7oxnSV0ELhl2g+JfMMz2 Z1PDmS3NRnyEdqEm7NoRGXJJ7bgxDbN+9SXTyOletqGNXj/bSrBvhvZ0RQrzdHAPwQUfVSU2 qBhQEi2apSZstgVNMan0GUPqCdbE2zpysg+zT7Yhvf9EUQbzPL4LpdK1llT9fZbrdMzEXvEF oSvwJFdV3sqKmZc7b+E3PuxK6GTsKqaukd/3Cj8aLHG1T1im1QARAQABzSJBbGxhbiBKdWRl IDxhbGxhbmp1ZGVAZnJlZWJzZC5vcmc+wsF/BBMBAgApBQJVcGXGAhsjBQkSzAMABwsJCAcD AgEGFQgCCQoLBBYCAwECHgECF4AACgkQGZU1PhKYC34Muw/+JOKpSfhhysWFYiRXynGRDe07 Z6pVsn7DzrPUMRNZfHu8Uujmmy3p2nx9FelIY9yjd2UKHhug+whM54MiIFs90eCRVa4XEsPR 4FFAm0DAWrrb7qhZFcE/GhHdRWpZ341WAElWf6Puj2devtRjfYbikvj5+1V1QmDbju7cEw5D mEET44pTuD2VMRJpu2yZZzkM0i+wKFuPxlhqreufA1VNkZXI/rIfkYWK+nkXd9Efw3YdCyCQ zUgTUCb88ttSqcyhik/li1CDbXBpkzDCKI6I/8fAb7jjOC9LAtrZJrdgONywcVFoyK9ZN7EN AVA+xvYCmuYhR/3zHWH1g4hAm1v1+gIsufhajhfo8/wY1SetlzPaYkSkVQLqD8T6zZyhf+AN bC7ci44UsiKGAplB3phAXrtSPUEqM86kbnHg3fSx37kWKUiYNOnx4AC2VXvEiKsOBlpyt3dw WQbOtOYM+vkfbBwDtoGOOPYAKxc4LOIt9r+J8aD+gTooi9Eo5tvphATf9WkCpl9+aaGbSixB tUpvQMRnSMqTqq4Z7DeiG6VMRQIjsXDSLJEUqcfhnLFo0Ko/RiaHd5xyAQ4DhQ9QpkyQjjNf /3f/dYG7JAtoD30txaQ5V8uHrz210/77DRRX+HJjEj6xCxWUGvQgvEZf5XXyxeePvqZ+zQyT DX61bYw6w6bOwU0EVXBlxgEQAMy7YVnCCLN4oAOBVLZ5nUbVPvpUhsdA94/0/P+uqCIh28Cz ar56OCX0X19N/nAWecxL4H32zFbIRyDB2V/MEh4p9Qvyu/j4i1r3Ex5GhOT2hnit43Ng46z5 29Es4TijrHJP4/l/rB2VOqMKBS7Cq8zk1cWqaI9XZ59imxDNjtLLPPM+zQ1yE3OAMb475QwN UgWxTMw8rkA7CEaqeIn4sqpTSD5C7kT1Bh26+rbgJDZ77D6Uv1LaCZZOaW52okW3bFbdozV8 yM2u+xz2Qs8bHz67p+s+BlygryiOyYytpkiK6Iy4N7FTolyj5EIwCuqzfk0SaRHeOKX2ZRjC qatkgoD/t13PNT38V9tw3qZVOJDS0W6WM8VSg+F+bkM9LgJ8CmKV+Hj0k3pfGfYPOZJ/v18i +SmZmL/Uw2RghnwDWGAsPCKu4uZR777iw7n9Io6Vfxndw2dcS0e9klvFYoaGS6H2F13Asygr WBzFNGFQscN4mUW+ZYBzpTOcHkdT7w8WS55BmXYLna+dYer9/HaAuUrONjujukN4SPS1fMJ2 /CS/idAUKyyVVX5vozoNK2JVC1h1zUAVsdnmhEzNPsvBoqcVNfyqBFROEVLIPwq+lQMGNVjH ekLTKRWf59MEhUC2ztjSKkGmwdg73d6xSXMuq45EgIJV2wPvOgWQonoHH/kxABEBAAHCwWUE GAECAA8FAlVwZcYCGwwFCRLMAwAACgkQGZU1PhKYC34w5A//YViBtZyDV5O+SJT9FFO3lb9x Zdxf0trA3ooCt7gdBkdnBM6T5EmjgVZ3KYYyFfwXZVkteuCCycMF/zVw5eE9FL1+zz9gg663 nY9q2F77TZTKXVWOLlOV2bY+xaK94U4ytogOGhh9b4UnQ/Ct3+6aviCF78Go608BXbmF/GVT 7uhddemk7ItxM1gE5Hscx3saxGKlayaOsdPKeGTVJCDEtHDuOc7/+jGh5Zxpk/Hpi+DUt1ot 8e6hPYLIQa4uVx4f1xxxV858PQ7QysSLr9pTV7FAQ18JclCaMc7JWIa3homZQL/MNKOfST0S 2e+msuRwQo7AnnfFKBUtb02KwpA4GhWryhkjUh/kbVc1wmGxaU3DgXYQ5GV5+Zf4kk/wqr/7 KG0dkTz6NLCVLyDlmAzuFhf66DJ3zzz4yIo3pbDYi3HB/BwJXVSKB3Ko0oUo+6/qMrOIS02L s++QE/z7K12CCcs7WwOjfCYHK7VtE0Sr/PfybBdTbuDncOuAyAIeIKxdI2nmQHzl035hhvQX s4CSghsP319jAOQiIolCeSbTMD4QWMK8RL/Pe1FI1jC3Nw9s+jq8Dudtbcj2UwAP/STUEbJ9 5rznzuuhPjE0e++EU/RpWmcaIMK/z1zZDMN+ce2v1qzgV936ZhJ3iaVzyqbEE81gDxg3P+IM kiYh4ZtPB4Q= Subject: Re: svn commit: r340450 - head/sys/sys Message-ID: <595ff2c5-64ea-509d-481e-635499ab173d@freebsd.org> Date: Sun, 18 Nov 2018 14:56:13 -0500 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.3.0 MIME-Version: 1.0 In-Reply-To: <201811151602.wAFG2E4w040161@repo.freebsd.org> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="9ArUz8p4sPUVZlrBUe4qfoizrtxJ54BmJ" X-Rspamd-Queue-Id: CE2556D411 X-Spamd-Result: default: False [-0.13 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_HAM_MEDIUM(-0.23)[-0.233,0]; NEURAL_SPAM_SHORT(0.11)[0.107,0]; ASN(0.00)[asn:6939, ipnet:209.51.160.0/19, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Nov 2018 19:56:26 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --9ArUz8p4sPUVZlrBUe4qfoizrtxJ54BmJ Content-Type: multipart/mixed; boundary="hFooTVtU2E9Nogpig7yGvGeTI8dkfAzAG"; protected-headers="v1" From: Allan Jude To: Warner Losh , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: <595ff2c5-64ea-509d-481e-635499ab173d@freebsd.org> Subject: Re: svn commit: r340450 - head/sys/sys References: <201811151602.wAFG2E4w040161@repo.freebsd.org> In-Reply-To: <201811151602.wAFG2E4w040161@repo.freebsd.org> --hFooTVtU2E9Nogpig7yGvGeTI8dkfAzAG Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable On 2018-11-15 11:02, Warner Losh wrote: > Author: imp > Date: Thu Nov 15 16:02:13 2018 > New Revision: 340450 > URL: https://svnweb.freebsd.org/changeset/base/340450 >=20 > Log: > When converting ns,us,ms to sbt, return the ceil() of the result > rather than the floor(). Returning the floor means that > sbttoX(Xtosbt(y)) !=3D y for almost all values of y. In practice, th= is > results in a difference of at most 1 in the lsb of the sbintime_t. > This difference is meaningless for all current users of these > functions, but is important for the newly introduced sysctl conversio= n > routines which implicitly rely on the transformation being idempotent= =2E > =20 > Sponsored by: Netflix, Inc >=20 This seems to break attaching for my mlxen(4), with or without r340451 I don't understand why at this point. Nov 18 19:28:12 CA-HML3-09 kernel: mlx4_core0: mem 0xfbe00000-0xfbefffff,0xfa800000-0xfaffffff irq 48 at device 0.0 numa-domain 1 on pci11 Nov 18 19:28:12 CA-HML3-09 kernel: mlx4_core: Initializing mlx4_core Nov 18 19:29:12 CA-HML3-09 kernel: mlx4_core0: command 0x4 timed out (go bit not cleared) Nov 18 19:29:12 CA-HML3-09 kernel: mlx4_core0: device is going to be rese= t Nov 18 19:29:12 CA-HML3-09 kernel: mlx4_core0: device was reset successfu= lly Nov 18 19:29:13 CA-HML3-09 kernel: mlx4_core0: QUERY_FW command failed, aborting Nov 18 19:29:13 CA-HML3-09 kernel: mlx4_core0: Failed to init fw, abortin= g. Nov 18 19:29:13 CA-HML3-09 kernel: device_attach: mlx4_core0 attach returned 5 It works fine under r340449: Nov 18 19:46:07 CA-HML3-09 kernel: mlx4_core0: mem 0xfbe00000-0xfbefffff,0xfa800000-0xfaffffff irq 48 at device 0.0 numa-domain 1 on pci11 Nov 18 19:46:07 CA-HML3-09 kernel: mlx4_core: Mellanox ConnectX core driver v3.4.1 (October 2017) Nov 18 19:46:07 CA-HML3-09 kernel: mlx4_core: Initializing mlx4_core Nov 18 19:46:07 CA-HML3-09 kernel: mlx4_core0: Unable to determine PCI device chain minimum BW Nov 18 19:46:07 CA-HML3-09 kernel: mlx4_en mlx4_core0: Activating port:1 Nov 18 19:46:07 CA-HML3-09 kernel: mlxen0: Ethernet address: 00:02:c9:4d:6a:e8 Nov 18 19:46:07 CA-HML3-09 kernel: mlx4_en: mlx4_core0: Port 1: Using 32 TX rings Nov 18 19:46:07 CA-HML3-09 kernel: mlxen0: link state changed to DOWN Nov 18 19:46:07 CA-HML3-09 kernel: mlx4_en: mlx4_core0: Port 1: Using 16 RX rings Nov 18 19:46:07 CA-HML3-09 kernel: mlx4_en: mlxen0: Using 32 TX rings Nov 18 19:46:07 CA-HML3-09 kernel: mlx4_en: mlxen0: Using 16 RX rings Nov 18 19:46:07 CA-HML3-09 kernel: mlx4_en: mlxen0: Initializing port Nov 18 19:46:07 CA-HML3-09 kernel: mlx4_en: mlxen0: Link Down Nov 18 19:46:07 CA-HML3-09 kernel: mlxen0: link state changed to UP > Modified: > head/sys/sys/time.h >=20 > Modified: head/sys/sys/time.h > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/sys/time.h Thu Nov 15 08:43:17 2018 (r340449) > +++ head/sys/sys/time.h Thu Nov 15 16:02:13 2018 (r340450) > @@ -161,6 +161,10 @@ sbttobt(sbintime_t _sbt) > * Decimal<->sbt conversions. Multiplying or dividing by SBT_1NS resu= lts in > * large roundoff errors which sbttons() and nstosbt() avoid. Millise= cond and > * microsecond functions are also provided for completeness. > + * > + * These functions return the smallest sbt larger or equal to the numb= er of > + * seconds requested so that sbttoX(Xtosbt(y)) =3D=3D y. The 1 << 32 -= 1 term added > + * transforms the >> 32 from floor() to ceil(). > */ > static __inline int64_t > sbttons(sbintime_t _sbt) > @@ -173,7 +177,7 @@ static __inline sbintime_t > nstosbt(int64_t _ns) > { > =20 > - return ((_ns * (((uint64_t)1 << 63) / 500000000)) >> 32); > + return ((_ns * (((uint64_t)1 << 63) / 500000000) + (1ull << 32) - 1) = >> 32); > } > =20 > static __inline int64_t > @@ -187,7 +191,7 @@ static __inline sbintime_t > ustosbt(int64_t _us) > { > =20 > - return ((_us * (((uint64_t)1 << 63) / 500000)) >> 32); > + return ((_us * (((uint64_t)1 << 63) / 500000) + (1ull << 32) - 1) >> = 32); > } > =20 > static __inline int64_t > @@ -201,7 +205,7 @@ static __inline sbintime_t > mstosbt(int64_t _ms) > { > =20 > - return ((_ms * (((uint64_t)1 << 63) / 500)) >> 32); > + return ((_ms * (((uint64_t)1 << 63) / 500) + (1ull << 32) - 1) >> 32)= ; > } > =20 > /*- >=20 --=20 Allan Jude --hFooTVtU2E9Nogpig7yGvGeTI8dkfAzAG-- --9ArUz8p4sPUVZlrBUe4qfoizrtxJ54BmJ Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (MingW32) iQIcBAEBAgAGBQJb8cPiAAoJEBmVNT4SmAt+q7MQAIXh2bOocq8BWdYJHzRpPTwq gnhVO2nznkZecoq5BDDMDqkRPsH8X+AiCGvU79aX7TzwjwmTWpgJosP7fgH+gSaK X3S2BfFjjvqT5wpE1bS4QfV4pvyWU2xVZKMwodYdXorxKpDTN/JNtVXMxwVSus0J 2fTVzOAy1o25cxu7v9WOuydZ9hQ79LkkGKMLmSrCSQlNKgKvrxoi/+UmrTv6COBr xrkb8S3Q/yLSTVwdhFJVDq62yHb/N5bTaZ0PrHhLJHuiRXGEfVjS+NbXTO4XEGuu yUQrOmbf/OBcXVUSRe10KjgAwzDHNwrPThwX+JPRxwloCQelf2hhuuCRSJtDexZN rjbSMkCtbVa0FFLRfwmlHgmeXrTXusalXDI+ZxW+PrsB6MajJgYRkW+pEtbFqhR6 yjSmVFHDrcqRMg1RhL6v1KTTyF5fQy3RKl0Kx5QszfQShe4QvesAlmNAYcN7+TOp 2A7Y3HM4h2HKh6cNATtWFnnBfgahBb9wywg/Jc+uva1uERM+TB76gK+vuM297qPn w3N8Layfy9G4vnLK8Q6tNV2gyqzXxCmx5VlGAmQ39H0L++z1IdJptXf7j4GV1GFh /6+6/w8y4lPdb0ekR3buQGAy8LHqR/xst3km+oD4ejbKeXjH9YO8AHXBDbpDWxk5 U8oGL7G83dzV4kovhTXF =NYD6 -----END PGP SIGNATURE----- --9ArUz8p4sPUVZlrBUe4qfoizrtxJ54BmJ-- From owner-svn-src-all@freebsd.org Sun Nov 18 20:10:39 2018 Return-Path: Delivered-To: svn-src-all@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 306A2110F060; Sun, 18 Nov 2018 20:10:39 +0000 (UTC) (envelope-from mat.macy@gmail.com) Received: from mail-io1-xd35.google.com (mail-io1-xd35.google.com [IPv6:2607:f8b0:4864:20::d35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5BF466DE9C; Sun, 18 Nov 2018 20:10:38 +0000 (UTC) (envelope-from mat.macy@gmail.com) Received: by mail-io1-xd35.google.com with SMTP id m19so15117130ioh.3; Sun, 18 Nov 2018 12:10:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=p/r+aLHpMxaDAX9cDT4ecBZX66MXZFcRNCPWuTKPtTs=; b=Tvmp64NcMBzJPJIgu1U+CE/6bvvrc4+bEwY5rqky0hFfpVbqY8AFi+/R4qtu6kICsp IPF2pFWCq3gXQpCGm9CXol7+ltzdWOc2qAfilc+KLbPzgg9rgKfTuP9/x5UY0iEjueT4 bOyLyr/sEIEY0cZjFvSgenwTqewFfNc9Vx/dIGKi91kXFXe7uNUb0yBUMbKePdfGunt7 pbGtYbaNYouyjIvqQRe40Ic7Z7xgTPB4llZCgTLU9aAaZ+pEl7ATLkE0sd/Z3/9nY6bt FhKP5/fJibV5zTUcpQ5SCZOwPIFA1QNf2iLAMUWG2+QPhxJKy2mfmi75B70MTTBFfmV8 ZMqA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=p/r+aLHpMxaDAX9cDT4ecBZX66MXZFcRNCPWuTKPtTs=; b=W9glt2Szb+otueKrO+zcUoXUwztieqhNbrCqN3bZmXUbFCW/xjTYViGfsQge89fdQk XJ/K4Jeoeebl+TrL8qO2ofkdVFpCIVTm4GMkEBp6d72sbJBdcFgSgwnCM1/+P5FyzXZd QoF6oaYwg63zex4cKWACHRRY6aAFgaS+e58JRzEgrT1HqnLr/Zk2a1erGeAeoPrmLcUO 1jEwPaShIMz5btYvVd7jb+1GiJqcLD/QRuPrEtvRUyHjp7f4EBRmz0R0Z2dzZ22dCkgh hUYGeJHHP7SK/jce+pc1ETKnqZPOSLCe2+0G3rpcsNe+Z68JWiKOLGPIm9BoMVFRGl5U DbdA== X-Gm-Message-State: AGRZ1gJ25WbQBjz2h5UmMKClOazWK3yaoxRMBzDOV2GuGhCILi9amdQD 0Nb9nNnE6eQienoQeETEpd1beSmnBCAvUA6M2G2+BMEu X-Google-Smtp-Source: AJdET5e/tZHEetNKIoi220ndM8vE+gsfbnqiwPRbYmrFGQd5D7pe1z//Rbs2bEoEoTTL7lCnE4u50wvfUxQgO2IO8xg= X-Received: by 2002:a6b:8f8d:: with SMTP id r135mr15645182iod.5.1542571836984; Sun, 18 Nov 2018 12:10:36 -0800 (PST) MIME-Version: 1.0 References: <201810222055.w9MKtZPt013627@repo.freebsd.org> <20181118114538.546a4fab@kalimero.tijl.coosemans.org> In-Reply-To: <20181118114538.546a4fab@kalimero.tijl.coosemans.org> From: Matthew Macy Date: Sun, 18 Nov 2018 12:10:25 -0800 Message-ID: Subject: Re: svn commit: r339618 - head/sys/compat/linuxkpi/common/include/linux To: Tijl Coosemans Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 5BF466DE9C X-Spamd-Result: default: False [-3.85 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-0.995,0]; R_DKIM_ALLOW(-0.20)[gmail.com]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36]; FREEMAIL_FROM(0.00)[gmail.com]; MIME_GOOD(-0.10)[text/plain]; TO_MATCH_ENVRCPT_ALL(0.00)[]; TO_DN_SOME(0.00)[]; IP_SCORE(-0.88)[ipnet: 2607:f8b0::/32(-2.56), asn: 15169(-1.73), country: US(-0.09)]; DKIM_TRACE(0.00)[gmail.com:+]; MX_GOOD(-0.01)[cached: alt3.gmail-smtp-in.l.google.com]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; RCVD_IN_DNSWL_NONE(0.00)[5.3.d.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.0]; NEURAL_HAM_SHORT(-0.96)[-0.964,0]; FROM_EQ_ENVFROM(0.00)[]; RCVD_TLS_LAST(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; TAGGED_FROM(0.00)[]; RCVD_COUNT_TWO(0.00)[2] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Nov 2018 20:10:39 -0000 > Note that these functions are normally used on uncacheable memory which > is strongly ordered on x86. There should be no reordering at all. On > PowerPC barrier instructions are needed to prevent reordering. Correct. The current lkpi implementation also assumes that device endian == host endian. The Linux generic accessors will do use endian macros to byte swap where necessary. The following change fixes radeon attach issues: https://github.com/POWER9BSD/freebsd/commit/be6c98f5c2e2ed9a4935ac5b67c468b75f3b4457 From owner-svn-src-all@freebsd.org Sun Nov 18 21:09:56 2018 Return-Path: Delivered-To: svn-src-all@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 DCA9B1122B05; Sun, 18 Nov 2018 21:09:55 +0000 (UTC) (envelope-from tijl@freebsd.org) Received: from mailrelay115.isp.belgacom.be (mailrelay115.isp.belgacom.be [195.238.20.142]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "relay.skynet.be", Issuer "GlobalSign Organization Validation CA - SHA256 - G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0DA5B71087; Sun, 18 Nov 2018 21:09:54 +0000 (UTC) (envelope-from tijl@freebsd.org) X-Belgacom-Dynamic: yes IronPort-PHdr: =?us-ascii?q?9a23=3AkAG+MBWcc3B02DK0w7Ecx/1I4KfV8LGtZVwlr6?= =?us-ascii?q?E/grcLSJyIuqrYYx2At8tkgFKBZ4jH8fUM07OQ7/iwHzRYqb+681k6OKRWUB?= =?us-ascii?q?EEjchE1ycBO+WiTXPBEfjxciYhF95DXlI2t1uyMExSBdqsLwaK+i764jEdAA?= =?us-ascii?q?jwOhRoLerpBIHSk9631+ev8JHPfglEnjWwba9xIRmssQndqtQdjJd/JKo21h?= =?us-ascii?q?bHuGZDdf5MxWNvK1KTnhL86dm18ZV+7SleuO8v+tBZX6nicKs2UbJXDDI9M2?= =?us-ascii?q?Ao/8LrrgXMTRGO5nQHTGoblAdDDhXf4xH7WpfxtTb6tvZ41SKHM8D6Uaw4VD?= =?us-ascii?q?K/5KpwVhTmlDkIOCI48GHPi8x/kqRboA66pxdix4LYeZyZOOZicq/Ye94RWG?= =?us-ascii?q?hPUdtLVyFZDI2yb5UBAfcCM+laoYnyqEcBoxSlCAmwBu7j1iNEimPq0aEk1e?= =?us-ascii?q?kqDAHI3BYnH9ILqHnastD3NKMPWu2ry6nIyi7DYO1T2Tjn7ojIaQ0qrPaQXb?= =?us-ascii?q?Jxc8rRzVIiGQPfjlqOt4PoIi6b2OoXv2ic9epgWvuihmg6oA9/pTivw90jio?= =?us-ascii?q?jPho8NxVDE9Dl5wIYoJdKjUkJ0fdmkEJ5WuiqHNIV2WtsvTmJqtSogy7ALto?= =?us-ascii?q?S3cDUOxZko3RLTdeGLfoeO7xn+TuieOy14i2hgeL+nghay9lWvxfPkW8mv1V?= =?us-ascii?q?ZKsjJFkt7RtnARzxDT6taISv96/kq52jaAzQTT6uBBIU8qj6rbLIQtwqIxlp?= =?us-ascii?q?oRtUTPBDP5mELxjK+NaEok//Kn6+L8Yrn8oZ+cLYB0hhn/MqQohMO/Hfw1Pw?= =?us-ascii?q?sMUmSB+Omx26fv8VD9TbhFlPE6jLTVvZ/CKcQevKG5AgtV0og56xa4CjeryM?= =?us-ascii?q?gYnXgFLFJBYx+HgZLpNE/QL//jFvewnk6gkDBxx/DJJrHhGInCLmDfkLf9er?= =?us-ascii?q?Zw80tcxxAvzdxF4pJbEK0OIfLoV0/+sdzXFB45Mwiuz+n7D9V909BWZWXaJ6?= =?us-ascii?q?aFLKPfrhet7+k+a72JbZNTvT/2OtAq4vfviTkynlpLLoez2p5CVJe8Vt9hJF?= =?us-ascii?q?6UZHPqmZ9VDWYIuiIQVuHnomauFzlJaCDhDOoH+jgnBdf+Xs/4TYe3jenEhX?= =?us-ascii?q?/jEw=3D=3D?= X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: =?us-ascii?q?A2AMAAD20/Fb/9bCQFdiGQEBAQEBAQE?= =?us-ascii?q?BAQEBAQcBAQEBAQGBUwIBAQEBAQsBAYICZoECJ4xvixsBAYIMNQGIUXaNOYF?= =?us-ascii?q?6MoQBRgKDUyM2Bw0BAwEBAgEBAgFsHAxCAQ4BgWQkAYJhAQEBAQIBOhwjBQs?= =?us-ascii?q?LDgoJJQ8SGB4GE4MigWkDDQwLp2SELQGDRQ2BC4EJBYwcgX+EI4JWRQKHPAK?= =?us-ascii?q?PUo9vLgmGeocCgyAjgViIK4Z6jTmBCIsiCyaBVU0wCIMngicXg0qKUz4DMAq?= =?us-ascii?q?DRYocAQE?= X-IPAS-Result: =?us-ascii?q?A2AMAAD20/Fb/9bCQFdiGQEBAQEBAQEBAQEBAQcBAQEBA?= =?us-ascii?q?QGBUwIBAQEBAQsBAYICZoECJ4xvixsBAYIMNQGIUXaNOYF6MoQBRgKDUyM2B?= =?us-ascii?q?w0BAwEBAgEBAgFsHAxCAQ4BgWQkAYJhAQEBAQIBOhwjBQsLDgoJJQ8SGB4GE?= =?us-ascii?q?4MigWkDDQwLp2SELQGDRQ2BC4EJBYwcgX+EI4JWRQKHPAKPUo9vLgmGeocCg?= =?us-ascii?q?yAjgViIK4Z6jTmBCIsiCyaBVU0wCIMngicXg0qKUz4DMAqDRYocAQE?= Received: from 214.194-64-87.adsl-dyn.isp.belgacom.be (HELO kalimero.tijl.coosemans.org) ([87.64.194.214]) by relay.skynet.be with ESMTP; 18 Nov 2018 22:08:44 +0100 Received: from kalimero.tijl.coosemans.org (kalimero.tijl.coosemans.org [127.0.0.1]) by kalimero.tijl.coosemans.org (8.15.2/8.15.2) with ESMTP id wAIL8hgV002342; Sun, 18 Nov 2018 22:08:43 +0100 (CET) (envelope-from tijl@FreeBSD.org) Date: Sun, 18 Nov 2018 22:08:42 +0100 From: =?UTF-8?B?VMSzbA==?= Coosemans To: Matthew Macy Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r339618 - head/sys/compat/linuxkpi/common/include/linux Message-ID: <20181118220842.4c995b5a@kalimero.tijl.coosemans.org> In-Reply-To: References: <201810222055.w9MKtZPt013627@repo.freebsd.org> <20181118114538.546a4fab@kalimero.tijl.coosemans.org> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 0DA5B71087 X-Spamd-Result: default: False [-0.24 / 15.00]; TAGGED_RCPT(0.00)[]; local_wl_from(0.00)[freebsd.org]; NEURAL_HAM_SHORT(-0.21)[-0.205,0]; NEURAL_HAM_MEDIUM(-0.03)[-0.033,0]; ASN(0.00)[asn:5432, ipnet:195.238.0.0/19, country:BE] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Nov 2018 21:09:56 -0000 On Sun, 18 Nov 2018 12:10:25 -0800 Matthew Macy wrote: >> Note that these functions are normally used on uncacheable memory which >> is strongly ordered on x86. There should be no reordering at all. On >> PowerPC barrier instructions are needed to prevent reordering. > > Correct. The current lkpi implementation also assumes that device > endian == host endian. The Linux generic accessors will do use endian > macros to byte swap where necessary. Yes, these functions are used to access little-endian registers so byte swapping is needed on big-endian machines. For PowerPC Linux also defines functions to access big-endian registers, but we probably don't need those. > The following change fixes radeon attach issues: > https://github.com/POWER9BSD/freebsd/commit/be6c98f5c2e2ed9a4935ac5b67c468b75f3b4457 +/* prevent prefetching of coherent DMA data ahead of a dma-complete */ +#ifndef __io_ar +#ifdef rmb +#define __io_ar() rmb() +#else +#define __io_ar() __compiler_membar(); +#endif +#endif + +/* flush writes to coherent DMA data before possibly triggering a DMA read */ +#ifndef __io_bw +#ifdef wmb +#define __io_bw() wmb() +#else +#define __io_bw() __compiler_membar(); +#endif +#endif ... static inline uint16_t readw(const volatile void *addr) { uint16_t v; - __compiler_membar(); - v = *(const volatile uint16_t *)addr; - __compiler_membar(); + __io_br(); + v = le16toh(__raw_readw(addr)); + __io_ar(); return (v); } For x86 rmb and wmb are defined as lfence and sfence instructions which shouldn't be necessary here. From owner-svn-src-all@freebsd.org Sun Nov 18 22:16:08 2018 Return-Path: Delivered-To: svn-src-all@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 66C251126243; Sun, 18 Nov 2018 22:16:08 +0000 (UTC) (envelope-from mat.macy@gmail.com) Received: from mail-it1-x144.google.com (mail-it1-x144.google.com [IPv6:2607:f8b0:4864:20::144]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id ACD1F73C59; Sun, 18 Nov 2018 22:16:07 +0000 (UTC) (envelope-from mat.macy@gmail.com) Received: by mail-it1-x144.google.com with SMTP id x124so5832233itd.1; Sun, 18 Nov 2018 14:16:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=QoAKkEiCKm0EyvXUUGf9QoED9EeLIeyx9izfQ6rDkAE=; b=OHxU2odQaKive24Eb2B5jq7tSyEHyERgX6+JioQMGTPjyiHPYwSe46Yi29SdFgV4z8 WTvCYpMW4jnB1X3wScmHrQtYU6U8Wvmy3GOTjWuqFzb0xoFhYYCYeqwd4hJTXnx77u6v 17IqT5/+lcBV6ciZe9gKUycBYsqdNRbtgWpvZwYQMkzbrvFBLuYpr0K5ITTVzEkWwPRm mGAH5BHfynDMwrmB0cF7o9Q1PFD19z/8XQLEJO1QoF8ijXtNDkGhaQUpzYHV1iPEKyL1 amwT/NergljX3yrf4vdYG6MTJlZDTqWQBW3aTryuKYQ8QIWZV85d059eqaNucqFX2a2z IhhA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=QoAKkEiCKm0EyvXUUGf9QoED9EeLIeyx9izfQ6rDkAE=; b=VXAzZ/5fyRoEKhVVNvGZmN211vxv9QU+Qhtpi5ujEJ3seZsfS2/lBiEYa/gjoIBjlt TwHkn8h5aE6/FdW/lpUsMGgb+p876pVm9oDIzLGa+She45ctLZi1zKiNI7NFVrWjhkWW GuoxtilqUGXWBDwtgBmT7Yl2h5J7JQHo4NadPdZYQXjvUC1nCKP42r5G3ABUkVP9V8sN swzHZpypxS8QMNSxr7od72fV2qNCuv9dOr9X/C2M9kAIp9ojCQNc0Sp1n1Ec2YrrAnwM vGl7aHNzAaloj+MDfHbZLGEqvHJ+xTcT1UiPXw3KY0/Lhta54kdBn5FFm9Lu32Erlkxs OVzQ== X-Gm-Message-State: AA+aEWbO2+gijXa3H3D0YHVoN/BF/8KtWH/x6dFVMXC/f27jeH8hvFEs MFmlNJxuX7TOeILBaUA0XLSzcBlRXTWef7PSWvoh1w== X-Google-Smtp-Source: AFSGD/VxyclcOWFmDpcokJioL5Afk8oPpug37yWSHdyK71iwUHtf38+WzpLKd4ON7dNmMqLKCH+oLALRVwSmfihzDOo= X-Received: by 2002:a24:9005:: with SMTP id x5mr5949774itd.102.1542579366919; Sun, 18 Nov 2018 14:16:06 -0800 (PST) MIME-Version: 1.0 References: <201810222055.w9MKtZPt013627@repo.freebsd.org> <20181118114538.546a4fab@kalimero.tijl.coosemans.org> <20181118220842.4c995b5a@kalimero.tijl.coosemans.org> In-Reply-To: <20181118220842.4c995b5a@kalimero.tijl.coosemans.org> From: Matthew Macy Date: Sun, 18 Nov 2018 14:15:56 -0800 Message-ID: Subject: Re: svn commit: r339618 - head/sys/compat/linuxkpi/common/include/linux To: =?UTF-8?Q?T=C4=B3l_Coosemans?= Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org X-Rspamd-Queue-Id: ACD1F73C59 X-Spamd-Result: default: False [-3.26 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.98)[-0.980,0]; R_DKIM_ALLOW(-0.20)[gmail.com]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36]; FREEMAIL_FROM(0.00)[gmail.com]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; TO_MATCH_ENVRCPT_ALL(0.00)[]; TO_DN_SOME(0.00)[]; IP_SCORE(-0.47)[ip: (2.05), ipnet: 2607:f8b0::/32(-2.56), asn: 15169(-1.73), country: US(-0.09)]; MX_GOOD(-0.01)[cached: alt3.gmail-smtp-in.l.google.com]; DKIM_TRACE(0.00)[gmail.com:+]; RCVD_IN_DNSWL_NONE(0.00)[4.4.1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.0]; NEURAL_HAM_SHORT(-0.81)[-0.806,0]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; FROM_EQ_ENVFROM(0.00)[]; RCVD_TLS_LAST(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; TAGGED_FROM(0.00)[]; RCVD_COUNT_TWO(0.00)[2] X-Rspamd-Server: mx1.freebsd.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Nov 2018 22:16:08 -0000 Correct. This is just the generic case. We just need to define the __io macros as __compiler_membar in x86/io.h Cheers. -M On Sun, Nov 18, 2018 at 13:08 T=C4=B3l Coosemans wrote: > On Sun, 18 Nov 2018 12:10:25 -0800 Matthew Macy > wrote: > >> Note that these functions are normally used on uncacheable memory whic= h > >> is strongly ordered on x86. There should be no reordering at all. On > >> PowerPC barrier instructions are needed to prevent reordering. > > > > Correct. The current lkpi implementation also assumes that device > > endian =3D=3D host endian. The Linux generic accessors will do use endi= an > > macros to byte swap where necessary. > > Yes, these functions are used to access little-endian registers so byte > swapping is needed on big-endian machines. For PowerPC Linux also define= s > functions to access big-endian registers, but we probably don't need thos= e. > > > The following change fixes radeon attach issues: > > > https://github.com/POWER9BSD/freebsd/commit/be6c98f5c2e2ed9a4935ac5b67c46= 8b75f3b4457 > > +/* prevent prefetching of coherent DMA data ahead of a dma-complete */ > +#ifndef __io_ar > +#ifdef rmb > +#define __io_ar() rmb() > +#else > +#define __io_ar() __compiler_membar(); > +#endif > +#endif > + > +/* flush writes to coherent DMA data before possibly triggering a DMA > read */ > +#ifndef __io_bw > +#ifdef wmb > +#define __io_bw() wmb() > +#else > +#define __io_bw() __compiler_membar(); > +#endif > +#endif > > ... > > static inline uint16_t > readw(const volatile void *addr) > { > uint16_t v; > > - __compiler_membar(); > - v =3D *(const volatile uint16_t *)addr; > - __compiler_membar(); > + __io_br(); > + v =3D le16toh(__raw_readw(addr)); > + __io_ar(); > return (v); > } > > For x86 rmb and wmb are defined as lfence and sfence instructions which > shouldn't be necessary here. > From owner-svn-src-all@freebsd.org Sun Nov 18 22:17:49 2018 Return-Path: Delivered-To: svn-src-all@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 0EC6E1126472; Sun, 18 Nov 2018 22:17:49 +0000 (UTC) (envelope-from mat.macy@gmail.com) Received: from mail-io1-xd35.google.com (mail-io1-xd35.google.com [IPv6:2607:f8b0:4864:20::d35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 57EC173EF1; Sun, 18 Nov 2018 22:17:48 +0000 (UTC) (envelope-from mat.macy@gmail.com) Received: by mail-io1-xd35.google.com with SMTP id f12-v6so20924780iog.0; Sun, 18 Nov 2018 14:17:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=k/EyIZwcc1HVGNDnFOFIrm52qmKvs/wwaZZPH4TmwIg=; b=Y8ML4B+H7Z+y6ZXNXKx9MoYhzM0JeCICPNnuaKRtB5TxYqtI9eL53QO99ngTPawtYg j3KvYnvB+Rntt5yvjh7aUFvzMS1eYdMEsIIphExy8ZqI6or+4VndZL1A4ldEg/a8i4D8 4IKYR2mS0TMClfg6gdj7TPTay0LvA9oqKAsGu3h4LWbyH9Whox639elDpxVxP7PPNK2w bkIxrEkb8uuLfHcUI+3KOmjit05Vm2AXNd+/cINidKZ4VP+djMxBHIljLfbLuGfn2luK fMHpdAZ91nRicpjBuwhEFXcX+N3IBn6u/qJO8zg7z9OLkvDYrUZMNTLvFVCoRRGRpF3U 1x3w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=k/EyIZwcc1HVGNDnFOFIrm52qmKvs/wwaZZPH4TmwIg=; b=QBTptKeTA2vZfop3Niy9R5AV6zBVFdBSijIflcYtDsTn4sDBccKvWqp1eaw9TqLYn3 pfdWNf/KnJxZooIbtG4MFdthbBL0NUIglzrC0XuCl2iJP12Fb/biwzS3IaN0d4qqG+3+ fyaYzHmqvydBYmeyqCPsfe2Uy36/iyhYE+LEXzqxtWgXKqETw7d4aw2W+xn1TT0ao4Od c7BJCHDSk8x4a7l11246x4l9sJEkBFbkQKRsCuzMKWTUfW+uE/wJRJAq1IoccySiX8Lh sHhFwwR6NjSoB+CuwSKMdQ3odYTe3/UWb1gbTsHIt4fUKnwv6MOTesPhSiG7h/AGS2AE b7KA== X-Gm-Message-State: AGRZ1gL8wRcHRO5+FGlmlLy3JWXtBpvTZmntNGmHJGFfYcrFE2X/IJbD quOamI/YRey+3uVvxMCa00sko/Hjb79lSVtUzijbvA== X-Google-Smtp-Source: AJdET5eh49wfEq65xBpkCEWlox+retlnoPQGsOLfCeGpPBoyLiZJ0SBTfxsGBaLLAiEmCA4YDlij36gVO9qvtLozZDw= X-Received: by 2002:a5e:dc0b:: with SMTP id b11mr14968087iok.237.1542579467309; Sun, 18 Nov 2018 14:17:47 -0800 (PST) MIME-Version: 1.0 References: <201810222055.w9MKtZPt013627@repo.freebsd.org> <20181118114538.546a4fab@kalimero.tijl.coosemans.org> <20181118220842.4c995b5a@kalimero.tijl.coosemans.org> In-Reply-To: <20181118220842.4c995b5a@kalimero.tijl.coosemans.org> From: Matthew Macy Date: Sun, 18 Nov 2018 14:17:36 -0800 Message-ID: Subject: Re: svn commit: r339618 - head/sys/compat/linuxkpi/common/include/linux To: =?UTF-8?Q?T=C4=B3l_Coosemans?= Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org X-Rspamd-Queue-Id: 57EC173EF1 X-Spamd-Result: default: False [-3.83 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-0.995,0]; R_DKIM_ALLOW(-0.20)[gmail.com]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36]; FREEMAIL_FROM(0.00)[gmail.com]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; TO_MATCH_ENVRCPT_ALL(0.00)[]; TO_DN_SOME(0.00)[]; IP_SCORE(-0.88)[ipnet: 2607:f8b0::/32(-2.57), asn: 15169(-1.73), country: US(-0.09)]; DKIM_TRACE(0.00)[gmail.com:+]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; RCVD_IN_DNSWL_NONE(0.00)[5.3.d.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.0]; MX_GOOD(-0.01)[cached: alt3.gmail-smtp-in.l.google.com]; NEURAL_HAM_SHORT(-0.95)[-0.952,0]; FROM_EQ_ENVFROM(0.00)[]; RCVD_TLS_LAST(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; TAGGED_FROM(0.00)[]; RCVD_COUNT_TWO(0.00)[2] X-Rspamd-Server: mx1.freebsd.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Nov 2018 22:17:49 -0000 > > > > PowerPC barrier instructions are needed to prevent reordering. > > > > Correct. The current lkpi implementation also assumes that device > > endian =3D=3D host endian. The Linux generic accessors will do use endi= an > > macros to byte swap where necessary. > > Yes, these functions are used to access little-endian registers so byte > swapping is needed on big-endian machines. For PowerPC Linux also define= s > functions to access big-endian registers, but we probably don't need thos= e. > None of our currently supported drivers use those macros (most devices are LE) so I=E2=80=99ve omitted them. -M > > The following change fixes radeon attach issues: > > > https://github.com/POWER9BSD/freebsd/commit/be6c98f5c2e2ed9a4935ac5b67c46= 8b75f3b4457 > > +/* prevent prefetching of coherent DMA data ahead of a dma-complete */ > +#ifndef __io_ar > +#ifdef rmb > +#define __io_ar() rmb() > +#else > +#define __io_ar() __compiler_membar(); > +#endif > +#endif > + > +/* flush writes to coherent DMA data before possibly triggering a DMA > read */ > +#ifndef __io_bw > +#ifdef wmb > +#define __io_bw() wmb() > +#else > +#define __io_bw() __compiler_membar(); > +#endif > +#endif > > ... > > static inline uint16_t > readw(const volatile void *addr) > { > uint16_t v; > > - __compiler_membar(); > - v =3D *(const volatile uint16_t *)addr; > - __compiler_membar(); > + __io_br(); > + v =3D le16toh(__raw_readw(addr)); > + __io_ar(); > return (v); > } > > For x86 rmb and wmb are defined as lfence and sfence instructions which > shouldn't be necessary here. > From owner-svn-src-all@freebsd.org Sun Nov 18 22:59:56 2018 Return-Path: Delivered-To: svn-src-all@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 EA6C51127294; Sun, 18 Nov 2018 22:59:55 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.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 89B5C74F8C; Sun, 18 Nov 2018 22:59:55 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6AA2C19BC8; Sun, 18 Nov 2018 22:59:55 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAIMxtHf088638; Sun, 18 Nov 2018 22:59:55 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAIMxtFo088637; Sun, 18 Nov 2018 22:59:55 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201811182259.wAIMxtFo088637@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Sun, 18 Nov 2018 22:59:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r340588 - stable/11/sys/fs/nfsclient X-SVN-Group: stable-11 X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: stable/11/sys/fs/nfsclient X-SVN-Commit-Revision: 340588 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 89B5C74F8C X-Spamd-Result: default: False [0.07 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.05)[-0.047,0]; NEURAL_SPAM_MEDIUM(0.12)[0.116,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Nov 2018 22:59:56 -0000 Author: rmacklem Date: Sun Nov 18 22:59:54 2018 New Revision: 340588 URL: https://svnweb.freebsd.org/changeset/base/340588 Log: MFC: r339999 Fix NFS client vnode locking to avoid a crash during forced dismount. A crash was reported where the crash occurred in nfs_advlock() when the NFS_ISV4(vp) macro was being executed. This was caused by the vnode being VI_DOOMED due to a forced dismount in progress. This patch fixes the problem by locking the vnode before executing the NFS_ISV4() macro. PR: 232673 Modified: stable/11/sys/fs/nfsclient/nfs_clvnops.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/fs/nfsclient/nfs_clvnops.c ============================================================================== --- stable/11/sys/fs/nfsclient/nfs_clvnops.c Sun Nov 18 19:55:03 2018 (r340587) +++ stable/11/sys/fs/nfsclient/nfs_clvnops.c Sun Nov 18 22:59:54 2018 (r340588) @@ -3008,14 +3008,19 @@ nfs_advlock(struct vop_advlock_args *ap) int ret, error = EOPNOTSUPP; u_quad_t size; + ret = NFSVOPLOCK(vp, LK_SHARED); + if (ret != 0) + return (EBADF); if (NFS_ISV4(vp) && (ap->a_flags & (F_POSIX | F_FLOCK)) != 0) { - if (vp->v_type != VREG) + if (vp->v_type != VREG) { + NFSVOPUNLOCK(vp, 0); return (EINVAL); + } if ((ap->a_flags & F_POSIX) != 0) cred = p->p_ucred; else cred = td->td_ucred; - NFSVOPLOCK(vp, LK_EXCLUSIVE | LK_RETRY); + NFSVOPLOCK(vp, LK_UPGRADE | LK_RETRY); if (vp->v_iflag & VI_DOOMED) { NFSVOPUNLOCK(vp, 0); return (EBADF); @@ -3094,9 +3099,6 @@ nfs_advlock(struct vop_advlock_args *ap) NFSVOPUNLOCK(vp, 0); return (0); } else if (!NFS_ISV4(vp)) { - error = NFSVOPLOCK(vp, LK_SHARED); - if (error) - return (error); if ((VFSTONFS(vp->v_mount)->nm_flag & NFSMNT_NOLOCKD) != 0) { size = VTONFS(vp)->n_size; NFSVOPUNLOCK(vp, 0); @@ -3119,7 +3121,8 @@ nfs_advlock(struct vop_advlock_args *ap) NFSVOPUNLOCK(vp, 0); } } - } + } else + NFSVOPUNLOCK(vp, 0); return (error); } From owner-svn-src-all@freebsd.org Sun Nov 18 23:48:17 2018 Return-Path: Delivered-To: svn-src-all@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 DBE481129025; Sun, 18 Nov 2018 23:48:16 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.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 7D74676C45; Sun, 18 Nov 2018 23:48:16 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5B8C31A3EF; Sun, 18 Nov 2018 23:48:16 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAINmGuI014386; Sun, 18 Nov 2018 23:48:16 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAINmG40014385; Sun, 18 Nov 2018 23:48:16 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201811182348.wAINmG40014385@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Sun, 18 Nov 2018 23:48:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r340589 - stable/10/sys/fs/nfsclient X-SVN-Group: stable-10 X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: stable/10/sys/fs/nfsclient X-SVN-Commit-Revision: 340589 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 7D74676C45 X-Spamd-Result: default: False [0.07 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_MEDIUM(0.12)[0.116,0]; NEURAL_HAM_SHORT(-0.05)[-0.047,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Nov 2018 23:48:17 -0000 Author: rmacklem Date: Sun Nov 18 23:48:15 2018 New Revision: 340589 URL: https://svnweb.freebsd.org/changeset/base/340589 Log: MFC: r339999 Fix NFS client vnode locking to avoid a crash during forced dismount. A crash was reported where the crash occurred in nfs_advlock() when the NFS_ISV4(vp) macro was being executed. This was caused by the vnode being VI_DOOMED due to a forced dismount in progress. This patch fixes the problem by locking the vnode before executing the NFS_ISV4() macro. PR: 232673 Modified: stable/10/sys/fs/nfsclient/nfs_clvnops.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/fs/nfsclient/nfs_clvnops.c ============================================================================== --- stable/10/sys/fs/nfsclient/nfs_clvnops.c Sun Nov 18 22:59:54 2018 (r340588) +++ stable/10/sys/fs/nfsclient/nfs_clvnops.c Sun Nov 18 23:48:15 2018 (r340589) @@ -3019,14 +3019,19 @@ nfs_advlock(struct vop_advlock_args *ap) int ret, error = EOPNOTSUPP; u_quad_t size; + ret = NFSVOPLOCK(vp, LK_SHARED); + if (ret != 0) + return (EBADF); if (NFS_ISV4(vp) && (ap->a_flags & (F_POSIX | F_FLOCK)) != 0) { - if (vp->v_type != VREG) + if (vp->v_type != VREG) { + NFSVOPUNLOCK(vp, 0); return (EINVAL); + } if ((ap->a_flags & F_POSIX) != 0) cred = p->p_ucred; else cred = td->td_ucred; - NFSVOPLOCK(vp, LK_EXCLUSIVE | LK_RETRY); + NFSVOPLOCK(vp, LK_UPGRADE | LK_RETRY); if (vp->v_iflag & VI_DOOMED) { NFSVOPUNLOCK(vp, 0); return (EBADF); @@ -3105,9 +3110,6 @@ nfs_advlock(struct vop_advlock_args *ap) NFSVOPUNLOCK(vp, 0); return (0); } else if (!NFS_ISV4(vp)) { - error = NFSVOPLOCK(vp, LK_SHARED); - if (error) - return (error); if ((VFSTONFS(vp->v_mount)->nm_flag & NFSMNT_NOLOCKD) != 0) { size = VTONFS(vp)->n_size; NFSVOPUNLOCK(vp, 0); @@ -3130,7 +3132,8 @@ nfs_advlock(struct vop_advlock_args *ap) NFSVOPUNLOCK(vp, 0); } } - } + } else + NFSVOPUNLOCK(vp, 0); return (error); } From owner-svn-src-all@freebsd.org Mon Nov 19 00:17:06 2018 Return-Path: Delivered-To: svn-src-all@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 82CC5112C1FB for ; Mon, 19 Nov 2018 00:17:06 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-it1-x132.google.com (mail-it1-x132.google.com [IPv6:2607:f8b0:4864:20::132]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 87A3477A5F for ; Mon, 19 Nov 2018 00:17:05 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-it1-x132.google.com with SMTP id c9so5138323itj.1 for ; Sun, 18 Nov 2018 16:17:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=lqyV1C+HVhjkZ1x5bKP3XBTA6rGWzb+UFHR7ckaAO/c=; b=0+sXn07VsjNdLNTgT2ECmOc5zf6pj91dcQ3DoqxDfp+dYYfQmo28A6S9qJ5Fb+YFjR G/iucMOgGQ28DTNnhxGK/MlZkDb11XU3TkIJG8TExijxnwpzRersCrkM25BePjnV2stM qpSAaBTKKMMB1GM6C939gmfBH+5gMSlc5uHAvHM49fkP67JDpX9hVnLlE1vrl+RC0EBJ unAQXM53Oghk/MV08JQHjRcKAqbCzvkekY5uyJBSq5wf8mmuUNa+EEu1Epqa4w6ARYTe qNEFfOLLn5PfzMRopXtEgJ9G7/2B/LWNrYpE+/X9YQpZ+TycKGLT88ek8LZ/j/f2487w O8vg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=lqyV1C+HVhjkZ1x5bKP3XBTA6rGWzb+UFHR7ckaAO/c=; b=WuAT2wJs3hDSt4EbDCY4jrvVnU7VHegiqAKkEIzQXhYHyhrbMWLNPH+oVn6WMA9EtY ExhZZQoFRwU+Dij2822L2r1hHHsDWTp0HjwkLdWvzjeaUCeF+qX+CpigvI/vZN824fo4 Q/UaA5hLXFt4U2iFD3hXaM4dTnWuXW/o78m5FHVu/yfqxgumZSIAXcmVZigZPPS91REo wvts8xTPSqhWhneKxMODJaGdrePYy4A/+Us9KAd25x4hEqnV1X6dY6Cr9MSLIT0pTloh DIL+4ozPo1oVxwqy2NU5HjhuH1Ycz1sde1JEJbA/7j9rv4kFB+tRbgizSHbRI3gasfhr I7NA== X-Gm-Message-State: AA+aEWYVwpOyzOJ06kb7wSVrRB7olAt7tmS/VOogYDnsmHuItlBARnYc TsbBI6PmGwU0knwLasLxrg4HAWdz2K89roxM8oA2Fg== X-Google-Smtp-Source: AJdET5c/GAlpZasFVc6U+VBTUE5gRlUDpFWiHUIULUDEN2aOFGOlrReL5ValK/JM4IXxDeTHr52ElraMhkgvrvHXACc= X-Received: by 2002:a24:5f94:: with SMTP id r142-v6mr6704199itb.171.1542586624557; Sun, 18 Nov 2018 16:17:04 -0800 (PST) MIME-Version: 1.0 References: <201811151602.wAFG2E4w040161@repo.freebsd.org> <595ff2c5-64ea-509d-481e-635499ab173d@freebsd.org> In-Reply-To: <595ff2c5-64ea-509d-481e-635499ab173d@freebsd.org> From: Warner Losh Date: Sun, 18 Nov 2018 17:16:53 -0700 Message-ID: Subject: Re: svn commit: r340450 - head/sys/sys To: Allan Jude Cc: Warner Losh , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org X-Rspamd-Queue-Id: 87A3477A5F X-Spamd-Result: default: False [-4.00 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.99)[-0.994,0]; R_DKIM_ALLOW(-0.20)[bsdimp-com.20150623.gappssmtp.com]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[svn-src-all@freebsd.org]; DMARC_NA(0.00)[bsdimp.com]; RCPT_COUNT_FIVE(0.00)[5]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[bsdimp-com.20150623.gappssmtp.com:+]; MX_GOOD(-0.01)[cached: ALT1.aspmx.l.google.com]; RCVD_IN_DNSWL_NONE(0.00)[2.3.1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.0]; NEURAL_HAM_SHORT(-0.98)[-0.977,0]; R_SPF_NA(0.00)[]; FORGED_SENDER(0.30)[imp@bsdimp.com,wlosh@bsdimp.com]; RCVD_TLS_LAST(0.00)[]; IP_SCORE(-2.02)[ip: (-5.74), ipnet: 2607:f8b0::/32(-2.56), asn: 15169(-1.72), country: US(-0.09)]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; FROM_NEQ_ENVFROM(0.00)[imp@bsdimp.com,wlosh@bsdimp.com]; RCVD_COUNT_TWO(0.00)[2] X-Rspamd-Server: mx1.freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Nov 2018 00:17:06 -0000 I don't see how this could possibly have changed things. The changes will change the least significant bit by one for fractional results. I've looked at all the functions that use it and get called by the mlx driver and have trouble seeing where it could be relevant... Can you do an experiment to let me know which of the three functions I changed breaks things? Warner On Sun, Nov 18, 2018 at 12:56 PM Allan Jude wrote: > On 2018-11-15 11:02, Warner Losh wrote: > > Author: imp > > Date: Thu Nov 15 16:02:13 2018 > > New Revision: 340450 > > URL: https://svnweb.freebsd.org/changeset/base/340450 > > > > Log: > > When converting ns,us,ms to sbt, return the ceil() of the result > > rather than the floor(). Returning the floor means that > > sbttoX(Xtosbt(y)) != y for almost all values of y. In practice, this > > results in a difference of at most 1 in the lsb of the sbintime_t. > > This difference is meaningless for all current users of these > > functions, but is important for the newly introduced sysctl conversion > > routines which implicitly rely on the transformation being idempotent. > > > > Sponsored by: Netflix, Inc > > > > This seems to break attaching for my mlxen(4), with or without r340451 > > I don't understand why at this point. > > Nov 18 19:28:12 CA-HML3-09 kernel: mlx4_core0: mem > 0xfbe00000-0xfbefffff,0xfa800000-0xfaffffff irq 48 at device 0.0 > numa-domain 1 on pci11 > Nov 18 19:28:12 CA-HML3-09 kernel: mlx4_core: Initializing mlx4_core > Nov 18 19:29:12 CA-HML3-09 kernel: mlx4_core0: command 0x4 timed out (go > bit not cleared) > Nov 18 19:29:12 CA-HML3-09 kernel: mlx4_core0: device is going to be reset > Nov 18 19:29:12 CA-HML3-09 kernel: mlx4_core0: device was reset > successfully > Nov 18 19:29:13 CA-HML3-09 kernel: mlx4_core0: QUERY_FW command failed, > aborting > Nov 18 19:29:13 CA-HML3-09 kernel: mlx4_core0: Failed to init fw, aborting. > Nov 18 19:29:13 CA-HML3-09 kernel: device_attach: mlx4_core0 attach > returned 5 > > It works fine under r340449: > > Nov 18 19:46:07 CA-HML3-09 kernel: mlx4_core0: mem > 0xfbe00000-0xfbefffff,0xfa800000-0xfaffffff irq 48 at device 0.0 > numa-domain 1 on pci11 > Nov 18 19:46:07 CA-HML3-09 kernel: mlx4_core: Mellanox ConnectX core > driver v3.4.1 (October 2017) > Nov 18 19:46:07 CA-HML3-09 kernel: mlx4_core: Initializing mlx4_core > Nov 18 19:46:07 CA-HML3-09 kernel: mlx4_core0: Unable to determine PCI > device chain minimum BW > Nov 18 19:46:07 CA-HML3-09 kernel: mlx4_en mlx4_core0: Activating port:1 > Nov 18 19:46:07 CA-HML3-09 kernel: mlxen0: Ethernet address: > 00:02:c9:4d:6a:e8 > Nov 18 19:46:07 CA-HML3-09 kernel: mlx4_en: mlx4_core0: Port 1: Using 32 > TX rings > Nov 18 19:46:07 CA-HML3-09 kernel: mlxen0: link state changed to DOWN > Nov 18 19:46:07 CA-HML3-09 kernel: mlx4_en: mlx4_core0: Port 1: Using 16 > RX rings > Nov 18 19:46:07 CA-HML3-09 kernel: mlx4_en: mlxen0: Using 32 TX rings > Nov 18 19:46:07 CA-HML3-09 kernel: mlx4_en: mlxen0: Using 16 RX rings > Nov 18 19:46:07 CA-HML3-09 kernel: mlx4_en: mlxen0: Initializing port > Nov 18 19:46:07 CA-HML3-09 kernel: mlx4_en: mlxen0: Link Down > Nov 18 19:46:07 CA-HML3-09 kernel: mlxen0: link state changed to UP > > > > > Modified: > > head/sys/sys/time.h > > > > Modified: head/sys/sys/time.h > > > ============================================================================== > > --- head/sys/sys/time.h Thu Nov 15 08:43:17 2018 (r340449) > > +++ head/sys/sys/time.h Thu Nov 15 16:02:13 2018 (r340450) > > @@ -161,6 +161,10 @@ sbttobt(sbintime_t _sbt) > > * Decimal<->sbt conversions. Multiplying or dividing by SBT_1NS > results in > > * large roundoff errors which sbttons() and nstosbt() avoid. > Millisecond and > > * microsecond functions are also provided for completeness. > > + * > > + * These functions return the smallest sbt larger or equal to the > number of > > + * seconds requested so that sbttoX(Xtosbt(y)) == y. The 1 << 32 - 1 > term added > > + * transforms the >> 32 from floor() to ceil(). > > */ > > static __inline int64_t > > sbttons(sbintime_t _sbt) > > @@ -173,7 +177,7 @@ static __inline sbintime_t > > nstosbt(int64_t _ns) > > { > > > > - return ((_ns * (((uint64_t)1 << 63) / 500000000)) >> 32); > > + return ((_ns * (((uint64_t)1 << 63) / 500000000) + (1ull << 32) - > 1) >> 32); > > } > > > > static __inline int64_t > > @@ -187,7 +191,7 @@ static __inline sbintime_t > > ustosbt(int64_t _us) > > { > > > > - return ((_us * (((uint64_t)1 << 63) / 500000)) >> 32); > > + return ((_us * (((uint64_t)1 << 63) / 500000) + (1ull << 32) - 1) > >> 32); > > } > > > > static __inline int64_t > > @@ -201,7 +205,7 @@ static __inline sbintime_t > > mstosbt(int64_t _ms) > > { > > > > - return ((_ms * (((uint64_t)1 << 63) / 500)) >> 32); > > + return ((_ms * (((uint64_t)1 << 63) / 500) + (1ull << 32) - 1) >> > 32); > > } > > > > /*- > > > > > -- > Allan Jude > > From owner-svn-src-all@freebsd.org Mon Nov 19 00:49:09 2018 Return-Path: Delivered-To: svn-src-all@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 1BD2B112D406; Mon, 19 Nov 2018 00:49:09 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.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 B08A978E01; Mon, 19 Nov 2018 00:49:08 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8E7B31ADBD; Mon, 19 Nov 2018 00:49:08 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAJ0n8wk045260; Mon, 19 Nov 2018 00:49:08 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAJ0n8TG045259; Mon, 19 Nov 2018 00:49:08 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201811190049.wAJ0n8TG045259@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Mon, 19 Nov 2018 00:49:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r340590 - stable/12/sys/fs/nfsclient X-SVN-Group: stable-12 X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: stable/12/sys/fs/nfsclient X-SVN-Commit-Revision: 340590 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B08A978E01 X-Spamd-Result: default: False [0.35 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_MEDIUM(0.12)[0.116,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.24)[0.236,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Nov 2018 00:49:09 -0000 Author: rmacklem Date: Mon Nov 19 00:49:08 2018 New Revision: 340590 URL: https://svnweb.freebsd.org/changeset/base/340590 Log: MFC: r339999 Fix NFS client vnode locking to avoid a crash during forced dismount. A crash was reported where the crash occurred in nfs_advlock() when the NFS_ISV4(vp) macro was being executed. This was caused by the vnode being VI_DOOMED due to a forced dismount in progress. This patch fixes the problem by locking the vnode before executing the NFS_ISV4() macro. PR: 232673 Modified: stable/12/sys/fs/nfsclient/nfs_clvnops.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/fs/nfsclient/nfs_clvnops.c ============================================================================== --- stable/12/sys/fs/nfsclient/nfs_clvnops.c Sun Nov 18 23:48:15 2018 (r340589) +++ stable/12/sys/fs/nfsclient/nfs_clvnops.c Mon Nov 19 00:49:08 2018 (r340590) @@ -3008,14 +3008,19 @@ nfs_advlock(struct vop_advlock_args *ap) int ret, error = EOPNOTSUPP; u_quad_t size; + ret = NFSVOPLOCK(vp, LK_SHARED); + if (ret != 0) + return (EBADF); if (NFS_ISV4(vp) && (ap->a_flags & (F_POSIX | F_FLOCK)) != 0) { - if (vp->v_type != VREG) + if (vp->v_type != VREG) { + NFSVOPUNLOCK(vp, 0); return (EINVAL); + } if ((ap->a_flags & F_POSIX) != 0) cred = p->p_ucred; else cred = td->td_ucred; - NFSVOPLOCK(vp, LK_EXCLUSIVE | LK_RETRY); + NFSVOPLOCK(vp, LK_UPGRADE | LK_RETRY); if (vp->v_iflag & VI_DOOMED) { NFSVOPUNLOCK(vp, 0); return (EBADF); @@ -3094,9 +3099,6 @@ nfs_advlock(struct vop_advlock_args *ap) NFSVOPUNLOCK(vp, 0); return (0); } else if (!NFS_ISV4(vp)) { - error = NFSVOPLOCK(vp, LK_SHARED); - if (error) - return (error); if ((VFSTONFS(vp->v_mount)->nm_flag & NFSMNT_NOLOCKD) != 0) { size = VTONFS(vp)->n_size; NFSVOPUNLOCK(vp, 0); @@ -3119,7 +3121,8 @@ nfs_advlock(struct vop_advlock_args *ap) NFSVOPUNLOCK(vp, 0); } } - } + } else + NFSVOPUNLOCK(vp, 0); return (error); } From owner-svn-src-all@freebsd.org Mon Nov 19 00:54:33 2018 Return-Path: Delivered-To: svn-src-all@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 088BE112D78E; Mon, 19 Nov 2018 00:54:33 +0000 (UTC) (envelope-from kbowling@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 995837928C; Mon, 19 Nov 2018 00:54:32 +0000 (UTC) (envelope-from kbowling@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7B5561AF54; Mon, 19 Nov 2018 00:54:32 +0000 (UTC) (envelope-from kbowling@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAJ0sWe7049979; Mon, 19 Nov 2018 00:54:32 GMT (envelope-from kbowling@FreeBSD.org) Received: (from kbowling@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAJ0sW80049978; Mon, 19 Nov 2018 00:54:32 GMT (envelope-from kbowling@FreeBSD.org) Message-Id: <201811190054.wAJ0sW80049978@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kbowling set sender to kbowling@FreeBSD.org using -f From: Kevin Bowling Date: Mon, 19 Nov 2018 00:54:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340591 - in head/sys: kern sys X-SVN-Group: head X-SVN-Commit-Author: kbowling X-SVN-Commit-Paths: in head/sys: kern sys X-SVN-Commit-Revision: 340591 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 995837928C X-Spamd-Result: default: False [0.41 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.26)[0.260,0]; NEURAL_SPAM_MEDIUM(0.15)[0.147,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Nov 2018 00:54:33 -0000 Author: kbowling (ports committer) Date: Mon Nov 19 00:54:31 2018 New Revision: 340591 URL: https://svnweb.freebsd.org/changeset/base/340591 Log: Retire sbsndptr() KPI As of r340465 all consumers use sbsndptr_adv and sbsndptr_noadv Reviewed by: gallatin Approved by: krion (mentor) Differential Revision: https://reviews.freebsd.org/D17998 Modified: head/sys/kern/uipc_sockbuf.c head/sys/sys/sockbuf.h Modified: head/sys/kern/uipc_sockbuf.c ============================================================================== --- head/sys/kern/uipc_sockbuf.c Mon Nov 19 00:49:08 2018 (r340590) +++ head/sys/kern/uipc_sockbuf.c Mon Nov 19 00:54:31 2018 (r340591) @@ -1224,53 +1224,6 @@ sbdrop(struct sockbuf *sb, int len) m_freem(mfree); } -/* - * Maintain a pointer and offset pair into the socket buffer mbuf chain to - * avoid traversal of the entire socket buffer for larger offsets. - */ -struct mbuf * -sbsndptr(struct sockbuf *sb, u_int off, u_int len, u_int *moff) -{ - struct mbuf *m, *ret; - - KASSERT(sb->sb_mb != NULL, ("%s: sb_mb is NULL", __func__)); - KASSERT(off + len <= sb->sb_acc, ("%s: beyond sb", __func__)); - KASSERT(sb->sb_sndptroff <= sb->sb_acc, ("%s: sndptroff broken", __func__)); - - /* - * Is off below stored offset? Happens on retransmits. - * Just return, we can't help here. - */ - if (sb->sb_sndptroff > off) { - *moff = off; - return (sb->sb_mb); - } - - /* Return closest mbuf in chain for current offset. */ - *moff = off - sb->sb_sndptroff; - m = ret = sb->sb_sndptr ? sb->sb_sndptr : sb->sb_mb; - if (*moff == m->m_len) { - *moff = 0; - sb->sb_sndptroff += m->m_len; - m = ret = m->m_next; - KASSERT(ret->m_len > 0, - ("mbuf %p in sockbuf %p chain has no valid data", ret, sb)); - } - - /* Advance by len to be as close as possible for the next transmit. */ - for (off = off - sb->sb_sndptroff + len - 1; - off > 0 && m != NULL && off >= m->m_len; - m = m->m_next) { - sb->sb_sndptroff += m->m_len; - off -= m->m_len; - } - if (off > 0 && m == NULL) - panic("%s: sockbuf %p and mbuf %p clashing", __func__, sb, ret); - sb->sb_sndptr = m; - - return (ret); -} - struct mbuf * sbsndptr_noadv(struct sockbuf *sb, uint32_t off, uint32_t *moff) { Modified: head/sys/sys/sockbuf.h ============================================================================== --- head/sys/sys/sockbuf.h Mon Nov 19 00:49:08 2018 (r340590) +++ head/sys/sys/sockbuf.h Mon Nov 19 00:54:31 2018 (r340591) @@ -163,8 +163,6 @@ void sbrelease_locked(struct sockbuf *sb, struct socke int sbsetopt(struct socket *so, int cmd, u_long cc); int sbreserve_locked(struct sockbuf *sb, u_long cc, struct socket *so, struct thread *td); -struct mbuf * - sbsndptr(struct sockbuf *sb, u_int off, u_int len, u_int *moff); void sbsndptr_adv(struct sockbuf *sb, struct mbuf *mb, u_int len); struct mbuf * sbsndptr_noadv(struct sockbuf *sb, u_int off, u_int *moff); From owner-svn-src-all@freebsd.org Mon Nov 19 01:04:16 2018 Return-Path: Delivered-To: svn-src-all@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 D89F1112DDC8; Mon, 19 Nov 2018 01:04:15 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0C7CB7992F; Mon, 19 Nov 2018 01:04:14 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id wAJ14C0K059063; Sun, 18 Nov 2018 17:04:12 -0800 (PST) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id wAJ14CaE059062; Sun, 18 Nov 2018 17:04:12 -0800 (PST) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201811190104.wAJ14CaE059062@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r340450 - head/sys/sys In-Reply-To: To: Warner Losh Date: Sun, 18 Nov 2018 17:04:12 -0800 (PST) CC: Allan Jude , Warner Losh , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Rspamd-Queue-Id: 0C7CB7992F X-Spamd-Result: default: False [1.50 / 15.00]; ARC_NA(0.00)[]; HAS_REPLYTO(0.00)[rgrimes@freebsd.org]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; NEURAL_SPAM_SHORT(0.45)[0.446,0]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[dnsmgr.net]; REPLYTO_DOM_NEQ_FROM_DOM(0.00)[]; AUTH_NA(1.00)[]; RCPT_COUNT_FIVE(0.00)[6]; RCVD_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; MX_GOOD(-0.01)[cached: pdx.rh.CN85.dnsmgr.net]; NEURAL_SPAM_MEDIUM(0.18)[0.179,0]; R_SPF_NA(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:13868, ipnet:69.59.192.0/19, country:US]; MID_RHS_MATCH_FROM(0.00)[]; IP_SCORE(-0.02)[country: US(-0.09)] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Nov 2018 01:04:16 -0000 [ Charset UTF-8 unsupported, converting... ] > I don't see how this could possibly have changed things. The changes will > change the least significant bit by one for fractional results. I've looked > at all the functions that use it and get called by the mlx driver and have > trouble seeing where it could be relevant... > > Can you do an experiment to let me know which of the three functions I > changed breaks things? Alan well have to answer on that. I keep stairing at this code change and I wonder.. has clang done something odd with the - 1? What I read you trying to do is to remove a LSB from a left shifted by 32 value, but what has clang decided to do? Has it somehow gotten this wrong? Is there some promottion of the type of the bare 1 causing an issue? Could you look at the assmbler output for your expression and see that it does infact do what you expected it to do? Thanks, Rod Scratching my head as much as anyone on this. > > Warner > > On Sun, Nov 18, 2018 at 12:56 PM Allan Jude wrote: > > > On 2018-11-15 11:02, Warner Losh wrote: > > > Author: imp > > > Date: Thu Nov 15 16:02:13 2018 > > > New Revision: 340450 > > > URL: https://svnweb.freebsd.org/changeset/base/340450 > > > > > > Log: > > > When converting ns,us,ms to sbt, return the ceil() of the result > > > rather than the floor(). Returning the floor means that > > > sbttoX(Xtosbt(y)) != y for almost all values of y. In practice, this > > > results in a difference of at most 1 in the lsb of the sbintime_t. > > > This difference is meaningless for all current users of these > > > functions, but is important for the newly introduced sysctl conversion > > > routines which implicitly rely on the transformation being idempotent. > > > > > > Sponsored by: Netflix, Inc > > > > > > > This seems to break attaching for my mlxen(4), with or without r340451 > > > > I don't understand why at this point. > > > > Nov 18 19:28:12 CA-HML3-09 kernel: mlx4_core0: mem > > 0xfbe00000-0xfbefffff,0xfa800000-0xfaffffff irq 48 at device 0.0 > > numa-domain 1 on pci11 > > Nov 18 19:28:12 CA-HML3-09 kernel: mlx4_core: Initializing mlx4_core > > Nov 18 19:29:12 CA-HML3-09 kernel: mlx4_core0: command 0x4 timed out (go > > bit not cleared) > > Nov 18 19:29:12 CA-HML3-09 kernel: mlx4_core0: device is going to be reset > > Nov 18 19:29:12 CA-HML3-09 kernel: mlx4_core0: device was reset > > successfully > > Nov 18 19:29:13 CA-HML3-09 kernel: mlx4_core0: QUERY_FW command failed, > > aborting > > Nov 18 19:29:13 CA-HML3-09 kernel: mlx4_core0: Failed to init fw, aborting. > > Nov 18 19:29:13 CA-HML3-09 kernel: device_attach: mlx4_core0 attach > > returned 5 > > > > It works fine under r340449: > > > > Nov 18 19:46:07 CA-HML3-09 kernel: mlx4_core0: mem > > 0xfbe00000-0xfbefffff,0xfa800000-0xfaffffff irq 48 at device 0.0 > > numa-domain 1 on pci11 > > Nov 18 19:46:07 CA-HML3-09 kernel: mlx4_core: Mellanox ConnectX core > > driver v3.4.1 (October 2017) > > Nov 18 19:46:07 CA-HML3-09 kernel: mlx4_core: Initializing mlx4_core > > Nov 18 19:46:07 CA-HML3-09 kernel: mlx4_core0: Unable to determine PCI > > device chain minimum BW > > Nov 18 19:46:07 CA-HML3-09 kernel: mlx4_en mlx4_core0: Activating port:1 > > Nov 18 19:46:07 CA-HML3-09 kernel: mlxen0: Ethernet address: > > 00:02:c9:4d:6a:e8 > > Nov 18 19:46:07 CA-HML3-09 kernel: mlx4_en: mlx4_core0: Port 1: Using 32 > > TX rings > > Nov 18 19:46:07 CA-HML3-09 kernel: mlxen0: link state changed to DOWN > > Nov 18 19:46:07 CA-HML3-09 kernel: mlx4_en: mlx4_core0: Port 1: Using 16 > > RX rings > > Nov 18 19:46:07 CA-HML3-09 kernel: mlx4_en: mlxen0: Using 32 TX rings > > Nov 18 19:46:07 CA-HML3-09 kernel: mlx4_en: mlxen0: Using 16 RX rings > > Nov 18 19:46:07 CA-HML3-09 kernel: mlx4_en: mlxen0: Initializing port > > Nov 18 19:46:07 CA-HML3-09 kernel: mlx4_en: mlxen0: Link Down > > Nov 18 19:46:07 CA-HML3-09 kernel: mlxen0: link state changed to UP > > > > > > > > > Modified: > > > head/sys/sys/time.h > > > > > > Modified: head/sys/sys/time.h > > > > > ============================================================================== > > > --- head/sys/sys/time.h Thu Nov 15 08:43:17 2018 (r340449) > > > +++ head/sys/sys/time.h Thu Nov 15 16:02:13 2018 (r340450) > > > @@ -161,6 +161,10 @@ sbttobt(sbintime_t _sbt) > > > * Decimal<->sbt conversions. Multiplying or dividing by SBT_1NS > > results in > > > * large roundoff errors which sbttons() and nstosbt() avoid. > > Millisecond and > > > * microsecond functions are also provided for completeness. > > > + * > > > + * These functions return the smallest sbt larger or equal to the > > number of > > > + * seconds requested so that sbttoX(Xtosbt(y)) == y. The 1 << 32 - 1 > > term added > > > + * transforms the >> 32 from floor() to ceil(). > > > */ > > > static __inline int64_t > > > sbttons(sbintime_t _sbt) > > > @@ -173,7 +177,7 @@ static __inline sbintime_t > > > nstosbt(int64_t _ns) > > > { > > > > > > - return ((_ns * (((uint64_t)1 << 63) / 500000000)) >> 32); > > > + return ((_ns * (((uint64_t)1 << 63) / 500000000) + (1ull << 32) - > > 1) >> 32); > > > } > > > > > > static __inline int64_t > > > @@ -187,7 +191,7 @@ static __inline sbintime_t > > > ustosbt(int64_t _us) > > > { > > > > > > - return ((_us * (((uint64_t)1 << 63) / 500000)) >> 32); > > > + return ((_us * (((uint64_t)1 << 63) / 500000) + (1ull << 32) - 1) > > >> 32); > > > } > > > > > > static __inline int64_t > > > @@ -201,7 +205,7 @@ static __inline sbintime_t > > > mstosbt(int64_t _ms) > > > { > > > > > > - return ((_ms * (((uint64_t)1 << 63) / 500)) >> 32); > > > + return ((_ms * (((uint64_t)1 << 63) / 500) + (1ull << 32) - 1) >> > > 32); > > > } > > > > > > /*- > > > > > > > > > -- > > Allan Jude > > > > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Mon Nov 19 01:39:02 2018 Return-Path: Delivered-To: svn-src-all@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 CB9FC112EE1C for ; Mon, 19 Nov 2018 01:39:01 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-it1-x133.google.com (mail-it1-x133.google.com [IPv6:2607:f8b0:4864:20::133]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1E3517A9FD for ; Mon, 19 Nov 2018 01:39:01 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-it1-x133.google.com with SMTP id v11so5302609itj.0 for ; Sun, 18 Nov 2018 17:39:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=HBcHhq/KmKRdZD8yY5f1Kjh8ICRJfUrUIYZizap95Y4=; b=m/PmqiSzBEHGv91yc5mwd40Hj6NY7r3eGHzE9snrjh+GPYCjA5PX2pjGv/gN2scVW9 1V+dMYzyIYRO4RYm3hSg4lS2oZTBe7wNeijHL2x0i2q3Cr0gUSvfvfW0hHil4XhTof2v 0MN20p79yJi3PG9+WCtEcShzIyQ2oKLAk5dZFfuo2Rue0tapF/GFwTNyC+Jf5FabykVj c9mxKHyP+QZeSvudAU9uFJDdkZC0YJx1NOSA9A79Grxmkk05ULO+y1aQjSM0kZoJKwW7 qzgESzeg8+eGFSg7K0IRqqu5lCOyjDQXZgVijUqefeOHCPQz2VzFnIsonVPT73F14bFh JiNw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=HBcHhq/KmKRdZD8yY5f1Kjh8ICRJfUrUIYZizap95Y4=; b=uW9iBpQSM8WqRUtbEsRXx4lztsKIhGFtsGtMHkZUp1kYhB8kWgVpOTxVcTsQn6UO26 bLasZI2jSIIzRreyJtLP4XQ5IkCox0m9DeE3evIzApeRsXzjPnoFKu3VTcAapBXwZGan On5O6kWvYHywO2uBpFff3KU5LmfylOPFeRnZYTP6nbZrFxOUvv6m5woAOwDivyLBB8bx a8jyvoGrjA9FXKvjvxHfzy9s6tumXSntu344hSjqdGjA72HLKtOY60j+08yXjaMv1ekI aMLMGIwpVgFFFhDXHwvR9/DL2imsybZSW7tGQf371U7pAu3znkbCkIspmdZGdcZE0NDI Plrg== X-Gm-Message-State: AA+aEWYBOgj/+Mo61LMs7WRxavtIPzvVX3wkopAH+Y1fQOBdbAYXeozM lUw176C9i1uRSrIG8UsgMNb8NE6Pn+BC4izpTNzOIg== X-Google-Smtp-Source: AFSGD/VdHFYgypdktNmadSKZfLqb06i96m4hJQ4Fq/322DOP6BYBuLJGxL2Hylts8XQb0qDgpfjAIGFzN7l3T4yjZgE= X-Received: by 2002:a24:3796:: with SMTP id r144-v6mr6544701itr.79.1542591540291; Sun, 18 Nov 2018 17:39:00 -0800 (PST) MIME-Version: 1.0 References: <201811190104.wAJ14CaE059062@pdx.rh.CN85.dnsmgr.net> In-Reply-To: <201811190104.wAJ14CaE059062@pdx.rh.CN85.dnsmgr.net> From: Warner Losh Date: Sun, 18 Nov 2018 18:38:49 -0700 Message-ID: Subject: Re: svn commit: r340450 - head/sys/sys To: "Rodney W. Grimes" Cc: Allan Jude , Warner Losh , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org X-Rspamd-Queue-Id: 1E3517A9FD X-Spamd-Result: default: False [-4.54 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.99)[-0.994,0]; R_DKIM_ALLOW(-0.20)[bsdimp-com.20150623.gappssmtp.com]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[svn-src-all@freebsd.org]; DMARC_NA(0.00)[bsdimp.com]; RCPT_COUNT_FIVE(0.00)[6]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[bsdimp-com.20150623.gappssmtp.com:+]; MX_GOOD(-0.01)[cached: ALT1.aspmx.l.google.com]; RCVD_IN_DNSWL_NONE(0.00)[3.3.1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.0]; NEURAL_HAM_SHORT(-0.97)[-0.965,0]; R_SPF_NA(0.00)[]; FORGED_SENDER(0.30)[imp@bsdimp.com,wlosh@bsdimp.com]; RCVD_TLS_LAST(0.00)[]; IP_SCORE(-2.57)[ip: (-8.50), ipnet: 2607:f8b0::/32(-2.55), asn: 15169(-1.71), country: US(-0.09)]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; FROM_NEQ_ENVFROM(0.00)[imp@bsdimp.com,wlosh@bsdimp.com]; RCVD_COUNT_TWO(0.00)[2] X-Rspamd-Server: mx1.freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Nov 2018 01:39:02 -0000 On Sun, Nov 18, 2018 at 6:04 PM Rodney W. Grimes < freebsd@pdx.rh.cn85.dnsmgr.net> wrote: > [ Charset UTF-8 unsupported, converting... ] > > I don't see how this could possibly have changed things. The changes will > > change the least significant bit by one for fractional results. I've > looked > > at all the functions that use it and get called by the mlx driver and > have > > trouble seeing where it could be relevant... > > > > Can you do an experiment to let me know which of the three functions I > > changed breaks things? > > Alan well have to answer on that. I keep stairing at this > code change and I wonder.. has clang done something odd > with the - 1? What I read you trying to do is to remove > a LSB from a left shifted by 32 value, but what has clang > decided to do? Has it somehow gotten this wrong? Is there > some promottion of the type of the bare 1 causing an issue? > I'll talk to Allan to see if he can test that. the bare 1 should be handled properly because of C's promotion rules. 1ull << 32 is an unsigned long long. What I really wanted was "~(uint32_t)0" but that construct has bit me in the past. > Could you look at the assmbler output for your expression > and see that it does infact do what you expected it to do? > I haven't, but that's kinda hard since these are inline functions... I have some of this hardware at work, but don't think I have any machines with it assigned to me. If I can't work it out by the end of Tuesday, I'll back it out until I can get to the bottom of it (since I'll be out most of Wed->Sun). Warner > Thanks, > Rod > Scratching my head as much as anyone on this. > > > > > Warner > > > > On Sun, Nov 18, 2018 at 12:56 PM Allan Jude > wrote: > > > > > On 2018-11-15 11:02, Warner Losh wrote: > > > > Author: imp > > > > Date: Thu Nov 15 16:02:13 2018 > > > > New Revision: 340450 > > > > URL: https://svnweb.freebsd.org/changeset/base/340450 > > > > > > > > Log: > > > > When converting ns,us,ms to sbt, return the ceil() of the result > > > > rather than the floor(). Returning the floor means that > > > > sbttoX(Xtosbt(y)) != y for almost all values of y. In practice, > this > > > > results in a difference of at most 1 in the lsb of the sbintime_t. > > > > This difference is meaningless for all current users of these > > > > functions, but is important for the newly introduced sysctl > conversion > > > > routines which implicitly rely on the transformation being > idempotent. > > > > > > > > Sponsored by: Netflix, Inc > > > > > > > > > > This seems to break attaching for my mlxen(4), with or without r340451 > > > > > > I don't understand why at this point. > > > > > > Nov 18 19:28:12 CA-HML3-09 kernel: mlx4_core0: mem > > > 0xfbe00000-0xfbefffff,0xfa800000-0xfaffffff irq 48 at device 0.0 > > > numa-domain 1 on pci11 > > > Nov 18 19:28:12 CA-HML3-09 kernel: mlx4_core: Initializing mlx4_core > > > Nov 18 19:29:12 CA-HML3-09 kernel: mlx4_core0: command 0x4 timed out > (go > > > bit not cleared) > > > Nov 18 19:29:12 CA-HML3-09 kernel: mlx4_core0: device is going to be > reset > > > Nov 18 19:29:12 CA-HML3-09 kernel: mlx4_core0: device was reset > > > successfully > > > Nov 18 19:29:13 CA-HML3-09 kernel: mlx4_core0: QUERY_FW command failed, > > > aborting > > > Nov 18 19:29:13 CA-HML3-09 kernel: mlx4_core0: Failed to init fw, > aborting. > > > Nov 18 19:29:13 CA-HML3-09 kernel: device_attach: mlx4_core0 attach > > > returned 5 > > > > > > It works fine under r340449: > > > > > > Nov 18 19:46:07 CA-HML3-09 kernel: mlx4_core0: mem > > > 0xfbe00000-0xfbefffff,0xfa800000-0xfaffffff irq 48 at device 0.0 > > > numa-domain 1 on pci11 > > > Nov 18 19:46:07 CA-HML3-09 kernel: mlx4_core: Mellanox ConnectX core > > > driver v3.4.1 (October 2017) > > > Nov 18 19:46:07 CA-HML3-09 kernel: mlx4_core: Initializing mlx4_core > > > Nov 18 19:46:07 CA-HML3-09 kernel: mlx4_core0: Unable to determine PCI > > > device chain minimum BW > > > Nov 18 19:46:07 CA-HML3-09 kernel: mlx4_en mlx4_core0: Activating > port:1 > > > Nov 18 19:46:07 CA-HML3-09 kernel: mlxen0: Ethernet address: > > > 00:02:c9:4d:6a:e8 > > > Nov 18 19:46:07 CA-HML3-09 kernel: mlx4_en: mlx4_core0: Port 1: Using > 32 > > > TX rings > > > Nov 18 19:46:07 CA-HML3-09 kernel: mlxen0: link state changed to DOWN > > > Nov 18 19:46:07 CA-HML3-09 kernel: mlx4_en: mlx4_core0: Port 1: Using > 16 > > > RX rings > > > Nov 18 19:46:07 CA-HML3-09 kernel: mlx4_en: mlxen0: Using 32 TX rings > > > Nov 18 19:46:07 CA-HML3-09 kernel: mlx4_en: mlxen0: Using 16 RX rings > > > Nov 18 19:46:07 CA-HML3-09 kernel: mlx4_en: mlxen0: Initializing port > > > Nov 18 19:46:07 CA-HML3-09 kernel: mlx4_en: mlxen0: Link Down > > > Nov 18 19:46:07 CA-HML3-09 kernel: mlxen0: link state changed to UP > > > > > > > > > > > > > Modified: > > > > head/sys/sys/time.h > > > > > > > > Modified: head/sys/sys/time.h > > > > > > > > ============================================================================== > > > > --- head/sys/sys/time.h Thu Nov 15 08:43:17 2018 > (r340449) > > > > +++ head/sys/sys/time.h Thu Nov 15 16:02:13 2018 > (r340450) > > > > @@ -161,6 +161,10 @@ sbttobt(sbintime_t _sbt) > > > > * Decimal<->sbt conversions. Multiplying or dividing by SBT_1NS > > > results in > > > > * large roundoff errors which sbttons() and nstosbt() avoid. > > > Millisecond and > > > > * microsecond functions are also provided for completeness. > > > > + * > > > > + * These functions return the smallest sbt larger or equal to the > > > number of > > > > + * seconds requested so that sbttoX(Xtosbt(y)) == y. The 1 << 32 - 1 > > > term added > > > > + * transforms the >> 32 from floor() to ceil(). > > > > */ > > > > static __inline int64_t > > > > sbttons(sbintime_t _sbt) > > > > @@ -173,7 +177,7 @@ static __inline sbintime_t > > > > nstosbt(int64_t _ns) > > > > { > > > > > > > > - return ((_ns * (((uint64_t)1 << 63) / 500000000)) >> 32); > > > > + return ((_ns * (((uint64_t)1 << 63) / 500000000) + (1ull << > 32) - > > > 1) >> 32); > > > > } > > > > > > > > static __inline int64_t > > > > @@ -187,7 +191,7 @@ static __inline sbintime_t > > > > ustosbt(int64_t _us) > > > > { > > > > > > > > - return ((_us * (((uint64_t)1 << 63) / 500000)) >> 32); > > > > + return ((_us * (((uint64_t)1 << 63) / 500000) + (1ull << 32) - > 1) > > > >> 32); > > > > } > > > > > > > > static __inline int64_t > > > > @@ -201,7 +205,7 @@ static __inline sbintime_t > > > > mstosbt(int64_t _ms) > > > > { > > > > > > > > - return ((_ms * (((uint64_t)1 << 63) / 500)) >> 32); > > > > + return ((_ms * (((uint64_t)1 << 63) / 500) + (1ull << 32) - 1) > >> > > > 32); > > > > } > > > > > > > > /*- > > > > > > > > > > > > > -- > > > Allan Jude > > > > > > > > -- > Rod Grimes > rgrimes@freebsd.org > From owner-svn-src-all@freebsd.org Mon Nov 19 02:12:10 2018 Return-Path: Delivered-To: svn-src-all@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 416381130081; Mon, 19 Nov 2018 02:12:10 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DA60B7BE61; Mon, 19 Nov 2018 02:12:09 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BB7EE1BC66; Mon, 19 Nov 2018 02:12:09 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAJ2C9gH090076; Mon, 19 Nov 2018 02:12:09 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAJ2C8NI090071; Mon, 19 Nov 2018 02:12:08 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201811190212.wAJ2C8NI090071@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Mon, 19 Nov 2018 02:12:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340592 - in head: lib/libbe sbin/bectl X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in head: lib/libbe sbin/bectl X-SVN-Commit-Revision: 340592 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: DA60B7BE61 X-Spamd-Result: default: False [0.39 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_MEDIUM(0.15)[0.147,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.25)[0.245,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Nov 2018 02:12:10 -0000 Author: kevans Date: Mon Nov 19 02:12:08 2018 New Revision: 340592 URL: https://svnweb.freebsd.org/changeset/base/340592 Log: bectl(3)/libbe(3): Allow BE root to be specified Add an undocumented -r option preceding the bectl subcommand to specify a BE root to operate out of. This will remain undocumented for now, as some caveats apply: - BEs cannot be activated in the pool that doesn't contain the rootfs - bectl create cannot work out of the box without the -e option right now, since it defaults to the rootfs and cross-pool cloning doesn't work like that (IIRC) Plumb the BE root through to libbe(3) so that some things -can- be done to it, e.g. bectl -r tank/ROOT create -e default upgrade bectl -r tank/ROOT mount upgrade /mnt this aides in some upgrade setups where rootfs is not necessarily ZFS, and also makes it easier/possible to regression-test bectl when combined with a file-backed zpool. MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D18029 Modified: head/lib/libbe/be.c head/lib/libbe/be.h head/lib/libbe/be_info.c head/lib/libbe/libbe.3 head/sbin/bectl/bectl.c Modified: head/lib/libbe/be.c ============================================================================== --- head/lib/libbe/be.c Mon Nov 19 00:54:31 2018 (r340591) +++ head/lib/libbe/be.c Mon Nov 19 02:12:08 2018 (r340592) @@ -74,7 +74,7 @@ be_locate_rootfs(libbe_handle_t *lbh) * dataset, for example, zroot/ROOT. */ libbe_handle_t * -libbe_init(void) +libbe_init(const char *root) { libbe_handle_t *lbh; char *poolname, *pos; @@ -89,16 +89,21 @@ libbe_init(void) if ((lbh->lzh = libzfs_init()) == NULL) goto err; - /* Grab rootfs, we'll work backwards from there */ + /* + * Grab rootfs, we'll work backwards from there if an optional BE root + * has not been passed in. + */ if (be_locate_rootfs(lbh) != 0) goto err; - - /* Strip off the final slash from the rootfs to get the be root */ - strlcpy(lbh->root, lbh->rootfs, sizeof(lbh->root)); - pos = strrchr(lbh->root, '/'); - if (pos == NULL) - goto err; - *pos = '\0'; + if (root == NULL) { + /* Strip off the final slash from rootfs to get the be root */ + strlcpy(lbh->root, lbh->rootfs, sizeof(lbh->root)); + pos = strrchr(lbh->root, '/'); + if (pos == NULL) + goto err; + *pos = '\0'; + } else + strlcpy(lbh->root, root, sizeof(lbh->root)); if ((pos = strchr(lbh->root, '/')) == NULL) goto err; Modified: head/lib/libbe/be.h ============================================================================== --- head/lib/libbe/be.h Mon Nov 19 00:54:31 2018 (r340591) +++ head/lib/libbe/be.h Mon Nov 19 02:12:08 2018 (r340592) @@ -63,7 +63,7 @@ typedef enum be_error { /* Library handling functions: be.c */ -libbe_handle_t *libbe_init(void); +libbe_handle_t *libbe_init(const char *root); void libbe_close(libbe_handle_t *); /* Bootenv information functions: be_info.c */ Modified: head/lib/libbe/be_info.c ============================================================================== --- head/lib/libbe/be_info.c Mon Nov 19 00:54:31 2018 (r340591) +++ head/lib/libbe/be_info.c Mon Nov 19 02:12:08 2018 (r340592) @@ -42,7 +42,10 @@ const char * be_active_name(libbe_handle_t *lbh) { - return (strrchr(lbh->rootfs, '/') + sizeof(char)); + if (*lbh->rootfs != '\0') + return (strrchr(lbh->rootfs, '/') + sizeof(char)); + else + return (lbh->rootfs); } @@ -63,7 +66,10 @@ const char * be_nextboot_name(libbe_handle_t *lbh) { - return (strrchr(lbh->bootfs, '/') + sizeof(char)); + if (*lbh->bootfs != '\0') + return (strrchr(lbh->bootfs, '/') + sizeof(char)); + else + return (lbh->bootfs); } Modified: head/lib/libbe/libbe.3 ============================================================================== --- head/lib/libbe/libbe.3 Mon Nov 19 00:54:31 2018 (r340591) +++ head/lib/libbe/libbe.3 Mon Nov 19 02:12:08 2018 (r340592) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 31, 2018 +.Dd November 17, 2018 .Dt LIBBE 3 .Os .Sh NAME @@ -39,7 +39,7 @@ .Sh SYNOPSIS .In be.h .Ft "libbe_handle_t *hdl" Ns -.Fn libbe_init void +.Fn libbe_init "const char *be_root" .Pp .Ft void .Fn libbe_close "libbe_handle_t *hdl" @@ -157,13 +157,16 @@ errno otherwise as described in .Pp The .Fn libbe_init -function initializes +function takes an optional BE root and initializes .Nm , returning a .Vt "libbe_handle_t *" on success, or .Dv NULL on error. +If a BE root is supplied, +.Nm +will only operate out of that pool and BE root. An error may occur if: .Bl -column .It /boot and / are not on the same filesystem and device, @@ -184,11 +187,15 @@ invalidating the handle in the process. .Pp The .Fn be_active_name -function returns the name of the currently booted boot environment, +function returns the name of the currently booted boot environment. +This boot environment may not belong to the same BE root as the root libbe +is operating on! .Pp The .Fn be_active_path function returns the full path of the currently booted boot environment. +This boot environment may not belong to the same BE root as the root libbe +is operating on! .Pp The .Fn be_nextboot_name Modified: head/sbin/bectl/bectl.c ============================================================================== --- head/sbin/bectl/bectl.c Mon Nov 19 00:54:31 2018 (r340591) +++ head/sbin/bectl/bectl.c Mon Nov 19 02:12:08 2018 (r340592) @@ -489,12 +489,25 @@ int main(int argc, char *argv[]) { const char *command; + char *root; int command_index, rc; + root = NULL; if (argc < 2) return (usage(false)); - command = argv[1]; + if (strcmp(argv[1], "-r") == 0) { + if (argc < 4) + return (usage(false)); + root = strdup(argv[2]); + command = argv[3]; + argc -= 3; + argv += 3; + } else { + command = argv[1]; + argc -= 1; + argv += 1; + } /* Handle command aliases */ if (strcmp(command, "umount") == 0) @@ -512,13 +525,12 @@ main(int argc, char *argv[]) } - if ((be = libbe_init()) == NULL) + if ((be = libbe_init(root)) == NULL) return (-1); libbe_print_on_error(be, true); - /* XXX TODO: can be simplified if offset by 2 instead of one */ - rc = command_map[command_index].fn(argc-1, argv+1); + rc = command_map[command_index].fn(argc, argv); libbe_close(be); return (rc); From owner-svn-src-all@freebsd.org Mon Nov 19 02:16:21 2018 Return-Path: Delivered-To: svn-src-all@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 AA96E1130276; Mon, 19 Nov 2018 02:16:21 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 471897C127; Mon, 19 Nov 2018 02:16:21 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 267A91BC9D; Mon, 19 Nov 2018 02:16:21 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAJ2GLD2092153; Mon, 19 Nov 2018 02:16:21 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAJ2GKpS092150; Mon, 19 Nov 2018 02:16:20 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201811190216.wAJ2GKpS092150@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Mon, 19 Nov 2018 02:16:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340593 - head/lib/libbe X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/lib/libbe X-SVN-Commit-Revision: 340593 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 471897C127 X-Spamd-Result: default: False [0.38 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.24)[0.244,0]; NEURAL_SPAM_MEDIUM(0.14)[0.139,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Nov 2018 02:16:21 -0000 Author: kevans Date: Mon Nov 19 02:16:20 2018 New Revision: 340593 URL: https://svnweb.freebsd.org/changeset/base/340593 Log: libbe(3): Properly account for altroot when creating new BEs Previously we would blindly copy the 'mountpoint' property, which includes the altroot. The altroot needs to be snipped off prior to setting it on the new BE, though, or you'll end up with a new BE and a mountpoint of /mnt with altroot=/mnt MFC after: 3 days Modified: head/lib/libbe/be.c head/lib/libbe/be_impl.h Modified: head/lib/libbe/be.c ============================================================================== --- head/lib/libbe/be.c Mon Nov 19 02:12:08 2018 (r340592) +++ head/lib/libbe/be.c Mon Nov 19 02:16:20 2018 (r340593) @@ -305,6 +305,7 @@ be_deep_clone_prop(int prop, void *cb) zprop_source_t src; char pval[BE_MAXPATHLEN]; char source[BE_MAXPATHLEN]; + char *val; dccb = cb; /* Skip some properties we don't want to touch */ @@ -324,7 +325,15 @@ be_deep_clone_prop(int prop, void *cb) if (src != ZPROP_SRC_LOCAL) return (ZPROP_CONT); - nvlist_add_string(dccb->props, zfs_prop_to_name(prop), (char *)pval); + /* Augment mountpoint with altroot, if needed */ + val = pval; + if (prop == ZFS_PROP_MOUNTPOINT && *dccb->altroot != '\0') { + if (pval[strlen(dccb->altroot)] == '\0') + strlcpy(pval, "/", sizeof(pval)); + else + val = pval + strlen(dccb->altroot); + } + nvlist_add_string(dccb->props, zfs_prop_to_name(prop), val); return (ZPROP_CONT); } @@ -367,6 +376,10 @@ be_deep_clone(zfs_handle_t *ds, void *data) dccb.zhp = ds; dccb.props = props; + if (zpool_get_prop(isdc->lbh->active_phandle, ZPOOL_PROP_ALTROOT, + dccb.altroot, sizeof(dccb.altroot), NULL, true) != 0 || + strcmp(dccb.altroot, "-") == 0) + *dccb.altroot = '\0'; if (zprop_iter(be_deep_clone_prop, &dccb, B_FALSE, B_FALSE, ZFS_TYPE_FILESYSTEM) == ZPROP_INVAL) return (-1); Modified: head/lib/libbe/be_impl.h ============================================================================== --- head/lib/libbe/be_impl.h Mon Nov 19 02:12:08 2018 (r340592) +++ head/lib/libbe/be_impl.h Mon Nov 19 02:16:20 2018 (r340593) @@ -55,6 +55,7 @@ struct libbe_deep_clone { struct libbe_dccb { zfs_handle_t *zhp; nvlist_t *props; + char altroot[MAXPATHLEN]; }; typedef struct prop_data { From owner-svn-src-all@freebsd.org Mon Nov 19 02:30:14 2018 Return-Path: Delivered-To: svn-src-all@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 CE8AB11307DD; Mon, 19 Nov 2018 02:30:13 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 570A67C6ED; Mon, 19 Nov 2018 02:30:13 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 337991BE51; Mon, 19 Nov 2018 02:30:13 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAJ2UDHO097433; Mon, 19 Nov 2018 02:30:13 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAJ2UCjA097429; Mon, 19 Nov 2018 02:30:12 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201811190230.wAJ2UCjA097429@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Mon, 19 Nov 2018 02:30:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340594 - in head: etc/mtree sbin/bectl sbin/bectl/tests X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in head: etc/mtree sbin/bectl sbin/bectl/tests X-SVN-Commit-Revision: 340594 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 570A67C6ED X-Spamd-Result: default: False [0.41 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.25)[0.252,0]; NEURAL_SPAM_MEDIUM(0.15)[0.154,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Nov 2018 02:30:14 -0000 Author: kevans Date: Mon Nov 19 02:30:12 2018 New Revision: 340594 URL: https://svnweb.freebsd.org/changeset/base/340594 Log: bectl(8): Add some regression tests These tests operate on a file-backed zpool that gets created in the kyua temp dir. root and ZFS support are both required for these tests. Current tests cover create, destroy, export/import, jail, list (kind of), mount, rename, and jail. List tests should later be extended to cover formatting and the different list flags, but for now only covers basic "are create/destroy actually reflected properly" MFC after: 3 days Added: head/sbin/bectl/tests/ head/sbin/bectl/tests/Makefile (contents, props changed) head/sbin/bectl/tests/bectl_test.sh (contents, props changed) Modified: head/etc/mtree/BSD.tests.dist head/sbin/bectl/Makefile Modified: head/etc/mtree/BSD.tests.dist ============================================================================== --- head/etc/mtree/BSD.tests.dist Mon Nov 19 02:16:20 2018 (r340593) +++ head/etc/mtree/BSD.tests.dist Mon Nov 19 02:30:12 2018 (r340594) @@ -398,6 +398,8 @@ .. .. sbin + bectl + .. dhclient .. devd Modified: head/sbin/bectl/Makefile ============================================================================== --- head/sbin/bectl/Makefile Mon Nov 19 02:16:20 2018 (r340593) +++ head/sbin/bectl/Makefile Mon Nov 19 02:30:12 2018 (r340594) @@ -1,5 +1,7 @@ # $FreeBSD$ +.include + PROG= bectl MAN= bectl.8 @@ -15,5 +17,8 @@ CFLAGS+= -I${SRCTOP}/sys/cddl/compat/opensolaris CFLAGS+= -I${SRCTOP}/sys/cddl/contrib/opensolaris/uts/common CFLAGS+= -DNEED_SOLARIS_BOOLEAN + +HAS_TESTS= yes +SUBDIR.${MK_TESTS}+= tests .include Added: head/sbin/bectl/tests/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sbin/bectl/tests/Makefile Mon Nov 19 02:30:12 2018 (r340594) @@ -0,0 +1,7 @@ +# $FreeBSD$ + +PACKAGE= tests + +ATF_TESTS_SH+= bectl_test + +.include Added: head/sbin/bectl/tests/bectl_test.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sbin/bectl/tests/bectl_test.sh Mon Nov 19 02:30:12 2018 (r340594) @@ -0,0 +1,299 @@ +# +# SPDX-License-Identifier: BSD-2-Clause-FreeBSD +# +# Copyright (c) 2018 Kyle Evans +# +# 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$ + +# Establishes a bectl_create zpool that can be used for some light testing; contains +# a 'default' BE and not much else. +bectl_create_setup() +{ + zpool=$1 + disk=$2 + mnt=$3 + + kldstat -qm zfs || atf_skip "ZFS module not loaded on the current system" + atf_check mkdir -p ${mnt} + atf_check truncate -s 1G ${disk} + atf_check zpool create -o altroot=${mnt} ${zpool} ${disk} + atf_check zfs create -o mountpoint=none ${zpool}/ROOT + atf_check zfs create -o mountpoint=/ -o canmount=noauto \ + ${zpool}/ROOT/default +} + +bectl_cleanup() +{ + zpool=$1 + + if zpool get health ${zpool} >/dev/null 2>&1; then + zpool destroy ${zpool} + fi +} + +atf_test_case bectl_create cleanup +bectl_create_head() +{ + + atf_set "descr" "Check the various forms of bectl create" + atf_set "require.user" root +} +bectl_create_body() +{ + cwd=$(realpath .) + zpool=bectl_test + disk=${cwd}/disk.img + mount=${cwd}/mnt + + bectl_create_setup ${zpool} ${disk} ${mount} + # Test standard creation, creation of a snapshot, and creation from a + # snapshot. + atf_check bectl -r ${zpool}/ROOT create -e default default2 + atf_check bectl -r ${zpool}/ROOT create default2@test_snap + atf_check bectl -r ${zpool}/ROOT create -e default2@test_snap default3 +} +bectl_create_cleanup() +{ + + bectl_cleanup bectl_test +} + +atf_test_case bectl_destroy cleanup +bectl_destroy_head() +{ + + atf_set "descr" "Check bectl destroy" + atf_set "require.user" root +} +bectl_destroy_body() +{ + cwd=$(realpath .) + zpool=bectl_test + disk=${cwd}/disk.img + mount=${cwd}/mnt + + bectl_create_setup ${zpool} ${disk} ${mount} + atf_check bectl -r ${zpool}/ROOT create -e default default2 + atf_check -o not-empty zfs get mountpoint ${zpool}/ROOT/default2 + atf_check bectl -r ${zpool}/ROOT destroy default2 + atf_check -e not-empty -s not-exit:0 zfs get mountpoint ${zpool}/ROOT/default2 +} +bectl_destroy_cleanup() +{ + + bectl_cleanup bectl_test +} + +atf_test_case bectl_export_import cleanup +bectl_export_import_head() +{ + + atf_set "descr" "Check bectl export and import" + atf_set "require.user" root +} +bectl_export_import_body() +{ + cwd=$(realpath .) + zpool=bectl_test + disk=${cwd}/disk.img + mount=${cwd}/mnt + + bectl_create_setup ${zpool} ${disk} ${mount} + atf_check -o save:exported bectl -r ${zpool}/ROOT export default + atf_check -x "bectl -r ${zpool}/ROOT import default2 < exported" + atf_check -o not-empty zfs get mountpoint ${zpool}/ROOT/default2 + atf_check bectl -r ${zpool}/ROOT destroy default2 + atf_check -e not-empty -s not-exit:0 zfs get mountpoint \ + ${zpool}/ROOT/default2 +} +bectl_export_import_cleanup() +{ + + bectl_cleanup bectl_test +} + +atf_test_case bectl_list cleanup +bectl_list_head() +{ + + atf_set "descr" "Check bectl list" + atf_set "require.user" root +} +bectl_list_body() +{ + cwd=$(realpath .) + zpool=bectl_test + disk=${cwd}/disk.img + mount=${cwd}/mnt + + bectl_create_setup ${zpool} ${disk} ${mount} + # Test the list functionality, including that BEs come and go away + # as they're created and destroyed. Creation and destruction tests + # use the 'zfs' utility to verify that they're actually created, so + # these are just light tests that 'list' is picking them up. + atf_check -o save:list.out bectl -r ${zpool}/ROOT list + atf_check -o not-empty grep 'default' list.out + atf_check bectl -r ${zpool}/ROOT create -e default default2 + atf_check -o save:list.out bectl -r ${zpool}/ROOT list + atf_check -o not-empty grep 'default2' list.out + atf_check bectl -r ${zpool}/ROOT destroy default2 + atf_check -o save:list.out bectl -r ${zpool}/ROOT list + atf_check -s not-exit:0 grep 'default2' list.out + # XXX TODO: Formatting checks +} +bectl_list_cleanup() +{ + + bectl_cleanup bectl_test +} + +atf_test_case bectl_mount cleanup +bectl_mount_head() +{ + + atf_set "descr" "Check bectl mount/unmount" + atf_set "require.user" root +} +bectl_mount_body() +{ + cwd=$(realpath .) + zpool=bectl_test + disk=${cwd}/disk.img + mount=${cwd}/mnt + root=${mount}/root + + bectl_create_setup ${zpool} ${disk} ${mount} + atf_check mkdir -p ${root} + # Test unmount first... + atf_check -o not-empty bectl -r ${zpool}/ROOT mount default ${root} + atf_check -o not-empty -x "mount | grep '^${zpool}/ROOT/default'" + atf_check bectl -r ${zpool}/ROOT unmount default + atf_check -s not-exit:0 -x "mount | grep '^${zpool}/ROOT/default'" + # Then umount! + atf_check -o not-empty bectl -r ${zpool}/ROOT mount default ${root} + atf_check -o not-empty -x "mount | grep '^${zpool}/ROOT/default'" + atf_check bectl -r ${zpool}/ROOT umount default + atf_check -s not-exit:0 -x "mount | grep '^${zpool}/ROOT/default'" +} +bectl_mount_cleanup() +{ + + bectl_cleanup bectl_test +} + +atf_test_case bectl_rename cleanup +bectl_rename_head() +{ + + atf_set "descr" "Check bectl rename" + atf_set "require.user" root +} +bectl_rename_body() +{ + cwd=$(realpath .) + zpool=bectl_test + disk=${cwd}/disk.img + mount=${cwd}/mnt + + bectl_create_setup ${zpool} ${disk} ${mount} + atf_check bectl -r ${zpool}/ROOT rename default default2 + atf_check -o not-empty zfs get mountpoint ${zpool}/ROOT/default2 + atf_check -e not-empty -s not-exit:0 zfs get mountpoint \ + ${zpool}/ROOT/default +} +bectl_rename_cleanup() +{ + + bectl_cleanup bectl_test +} + +atf_test_case bectl_jail cleanup +bectl_jail_head() +{ + + atf_set "descr" "Check bectl rename" + atf_set "require.user" root +} +bectl_jail_body() +{ + cwd=$(realpath .) + zpool=bectl_test + disk=${cwd}/disk.img + mount=${cwd}/mnt + root=${mount}/root + + if [ ! -f /rescue/rescue ]; then + atf_skip "This test requires a rescue binary" + fi + bectl_create_setup ${zpool} ${disk} ${mount} + # Prepare our minimal BE... plop a rescue binary into it + atf_check mkdir -p ${root} + atf_check -o ignore bectl -r ${zpool}/ROOT mount default ${root} + atf_check mkdir -p ${root}/rescue + atf_check cp /rescue/rescue ${root}/rescue/rescue + atf_check bectl -r ${zpool}/ROOT umount default + + # Basic command-mode tests, with and without jail cleanup + atf_check -o inline:"rescue\n" bectl -r ${zpool}/ROOT \ + jail default /rescue/rescue ls -1 + atf_check -o inline:"rescue\n" bectl -r ${zpool}/ROOT \ + jail -Uo path=${root} default /rescue/rescue ls -1 + atf_check [ -f ${root}/rescue/rescue ] + atf_check bectl -r ${zpool}/ROOT ujail default + + # Batch mode tests + atf_check bectl -r ${zpool}/ROOT jail -bo path=${root} default + atf_check -o not-empty -x "jls | grep -F \"${root}\"" + atf_check bectl -r ${zpool}/ROOT ujail default + atf_check -s not-exit:0 -x "jls | grep -F \"${root}\"" + # 'unjail' naming + atf_check bectl -r ${zpool}/ROOT jail -b default + atf_check bectl -r ${zpool}/ROOT unjail default + atf_check -s not-exit:0 -x "jls | grep -F \"${root}\"" + # cannot unjail an unjailed BE (by either command name) + atf_check -e ignore -s not-exit:0 bectl -r ${zpool}/ROOT ujail default + atf_check -e ignore -s not-exit:0 bectl -r ${zpool}/ROOT unjail default + + # set+unset + atf_check bectl -r ${zpool}/ROOT jail -b -o path=${root} -u path default + # Ensure that it didn't mount at ${root} + atf_check -s not-exit:0 -x "mount | grep -F '${root}'" + atf_check bectl -r ${zpool}/ROOT ujail default +} +bectl_jail_cleanup() +{ + + bectl_cleanup bectl_test +} + +atf_init_test_cases() +{ + atf_add_test_case bectl_create + atf_add_test_case bectl_destroy + atf_add_test_case bectl_export_import + atf_add_test_case bectl_list + atf_add_test_case bectl_mount + atf_add_test_case bectl_rename + atf_add_test_case bectl_jail +} From owner-svn-src-all@freebsd.org Mon Nov 19 02:38:03 2018 Return-Path: Delivered-To: svn-src-all@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 BFCA31130D2F; Mon, 19 Nov 2018 02:38:03 +0000 (UTC) (envelope-from jchandra@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 2BFBD7CBED; Mon, 19 Nov 2018 02:38:03 +0000 (UTC) (envelope-from jchandra@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0CF401BFE5; Mon, 19 Nov 2018 02:38:03 +0000 (UTC) (envelope-from jchandra@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAJ2c2x6002324; Mon, 19 Nov 2018 02:38:02 GMT (envelope-from jchandra@FreeBSD.org) Received: (from jchandra@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAJ2c2ad002323; Mon, 19 Nov 2018 02:38:02 GMT (envelope-from jchandra@FreeBSD.org) Message-Id: <201811190238.wAJ2c2ad002323@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jchandra set sender to jchandra@FreeBSD.org using -f From: "Jayachandran C." Date: Mon, 19 Nov 2018 02:38:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340595 - head/sys/dev/pci X-SVN-Group: head X-SVN-Commit-Author: jchandra X-SVN-Commit-Paths: head/sys/dev/pci X-SVN-Commit-Revision: 340595 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 2BFBD7CBED X-Spamd-Result: default: False [0.39 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.25)[0.248,0]; NEURAL_SPAM_MEDIUM(0.15)[0.147,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Nov 2018 02:38:04 -0000 Author: jchandra Date: Mon Nov 19 02:38:02 2018 New Revision: 340595 URL: https://svnweb.freebsd.org/changeset/base/340595 Log: pci_host_generic: remove unneeded ThunderX2 quirk The current quirk implementation writes a fixed address to the PCI BAR to fix a firmware bug. The PCI BARs are allocated by firmware and will change depending on PCI devices present. So using a fixed address here is not correct. This quirk worked around a firmware bug that programmed the MSI-X bar of the SATA controller incorrectly. The newer firmware does not have this issue, so it is better to drop this quirk altogether. Reviewed by: andrew Differential Revision: https://reviews.freebsd.org/D17655 Modified: head/sys/dev/pci/pci_host_generic.c Modified: head/sys/dev/pci/pci_host_generic.c ============================================================================== --- head/sys/dev/pci/pci_host_generic.c Mon Nov 19 02:30:12 2018 (r340594) +++ head/sys/dev/pci/pci_host_generic.c Mon Nov 19 02:38:02 2018 (r340595) @@ -69,25 +69,6 @@ __FBSDID("$FreeBSD$"); (((func) & PCIE_FUNC_MASK) << PCIE_FUNC_SHIFT) | \ ((reg) & PCIE_REG_MASK)) -typedef void (*pci_host_generic_quirk_function)(device_t); - -struct pci_host_generic_quirk_entry { - int impl; - int part; - int var; - int rev; - pci_host_generic_quirk_function func; -}; - -struct pci_host_generic_block_entry { - int impl; - int part; - int var; - int rev; - int bus; - int slot; -}; - /* Forward prototypes */ static uint32_t generic_pcie_read_config(device_t dev, u_int bus, u_int slot, @@ -100,24 +81,6 @@ static int generic_pcie_read_ivar(device_t dev, device static int generic_pcie_write_ivar(device_t dev, device_t child, int index, uintptr_t value); -#if defined(__aarch64__) -static void pci_host_generic_apply_quirks(device_t); -static void thunderx2_ahci_bar_quirk(device_t); - -struct pci_host_generic_quirk_entry pci_host_generic_quirks[] = -{ - {CPU_IMPL_CAVIUM, CPU_PART_THUNDERX2, 0, 0, thunderx2_ahci_bar_quirk}, - {0, 0, 0, 0, NULL} -}; - -struct pci_host_generic_block_entry pci_host_generic_blocked[] = -{ - /* ThunderX2 AHCI on second socket */ - {CPU_IMPL_CAVIUM, CPU_PART_THUNDERX2, 0, 0, 0x80, 0x10}, - {0, 0, 0, 0, 0, 0} -}; -#endif - int pci_host_generic_core_attach(device_t dev) { @@ -171,34 +134,9 @@ pci_host_generic_core_attach(device_t dev) return (error); } -#if defined(__aarch64__) - pci_host_generic_apply_quirks(dev); -#endif - return (0); } -#if defined(__aarch64__) -static void -pci_host_generic_apply_quirks(device_t dev) -{ - struct pci_host_generic_quirk_entry *quirk; - - quirk = pci_host_generic_quirks; - while (1) { - if (quirk->impl == 0) - break; - - if (CPU_MATCH(CPU_IMPL_MASK | CPU_PART_MASK, - quirk->impl, quirk->part, quirk->var, quirk->rev) && - quirk->func != NULL) - quirk->func(dev); - - quirk++; - } -} -#endif - static uint32_t generic_pcie_read_config(device_t dev, u_int bus, u_int slot, u_int func, u_int reg, int bytes) @@ -208,29 +146,11 @@ generic_pcie_read_config(device_t dev, u_int bus, u_in bus_space_tag_t t; uint64_t offset; uint32_t data; -#if defined(__aarch64__) - struct pci_host_generic_block_entry *block; -#endif if ((bus > PCI_BUSMAX) || (slot > PCI_SLOTMAX) || (func > PCI_FUNCMAX) || (reg > PCIE_REGMAX)) return (~0U); -#if defined(__aarch64__) - block = pci_host_generic_blocked; - while (1) { - if (block->impl == 0) - break; - - if (CPU_MATCH(CPU_IMPL_MASK | CPU_PART_MASK, - block->impl, block->part, block->var, block->rev) && - block->bus == bus && block->slot == slot) - return (~0); - - block++; - } -#endif - sc = device_get_softc(dev); offset = PCIE_ADDR_OFFSET(bus, slot, func, reg); @@ -472,22 +392,3 @@ static device_method_t generic_pcie_methods[] = { DEFINE_CLASS_0(pcib, generic_pcie_core_driver, generic_pcie_methods, sizeof(struct generic_pcie_core_softc)); - -#if defined(__aarch64__) -static void thunderx2_ahci_bar_quirk(device_t dev) -{ - - /* - * XXX: - * On ThunderX2, AHCI BAR2 address is wrong. It needs to precisely - * match the one described in datasheet. Fixup it unconditionally. - */ - if (device_get_unit(dev) == 0) { - device_printf(dev, "running AHCI BAR fixup\n"); - PCIB_WRITE_CONFIG(dev, 0, 16, 0, 0x18, 0x01440000, 4); - PCIB_WRITE_CONFIG(dev, 0, 16, 0, 0x1c, 0x40, 4); - PCIB_WRITE_CONFIG(dev, 0, 16, 1, 0x18, 0x01450000, 4); - PCIB_WRITE_CONFIG(dev, 0, 16, 1, 0x1c, 0x40, 4); - } -} -#endif From owner-svn-src-all@freebsd.org Mon Nov 19 02:43:35 2018 Return-Path: Delivered-To: svn-src-all@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 80BBD1131162; Mon, 19 Nov 2018 02:43:35 +0000 (UTC) (envelope-from jchandra@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 1F3837D106; Mon, 19 Nov 2018 02:43:35 +0000 (UTC) (envelope-from jchandra@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EEDF11C17F; Mon, 19 Nov 2018 02:43:34 +0000 (UTC) (envelope-from jchandra@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAJ2hYvw007233; Mon, 19 Nov 2018 02:43:34 GMT (envelope-from jchandra@FreeBSD.org) Received: (from jchandra@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAJ2hYio007230; Mon, 19 Nov 2018 02:43:34 GMT (envelope-from jchandra@FreeBSD.org) Message-Id: <201811190243.wAJ2hYio007230@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jchandra set sender to jchandra@FreeBSD.org using -f From: "Jayachandran C." Date: Mon, 19 Nov 2018 02:43:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340596 - head/sys/dev/pci X-SVN-Group: head X-SVN-Commit-Author: jchandra X-SVN-Commit-Paths: head/sys/dev/pci X-SVN-Commit-Revision: 340596 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 1F3837D106 X-Spamd-Result: default: False [0.38 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.24)[0.244,0]; NEURAL_SPAM_MEDIUM(0.14)[0.139,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Nov 2018 02:43:35 -0000 Author: jchandra Date: Mon Nov 19 02:43:34 2018 New Revision: 340596 URL: https://svnweb.freebsd.org/changeset/base/340596 Log: pci_host_generic: allocate resources against devices Fix up pci_host_generic.c and pci_host_generic_fdt.c to allocate resources against devices that requested them. Currently the allocation happens against the pcib, which is incorrect. This is needed for the upcoming changes for fixing up pci_host_generic_acpi.c Reviewed by: andrew Differential Revision: https://reviews.freebsd.org/D17656 Modified: head/sys/dev/pci/pci_host_generic.c head/sys/dev/pci/pci_host_generic_fdt.c Modified: head/sys/dev/pci/pci_host_generic.c ============================================================================== --- head/sys/dev/pci/pci_host_generic.c Mon Nov 19 02:38:02 2018 (r340595) +++ head/sys/dev/pci/pci_host_generic.c Mon Nov 19 02:43:34 2018 (r340596) @@ -310,7 +310,7 @@ pci_host_generic_core_alloc_resource(device_t dev, dev rm = generic_pcie_rman(sc, type); if (rm == NULL) - return (BUS_ALLOC_RESOURCE(device_get_parent(dev), dev, + return (BUS_ALLOC_RESOURCE(device_get_parent(dev), child, type, rid, start, end, count, flags)); if (bootverbose) { Modified: head/sys/dev/pci/pci_host_generic_fdt.c ============================================================================== --- head/sys/dev/pci/pci_host_generic_fdt.c Mon Nov 19 02:38:02 2018 (r340595) +++ head/sys/dev/pci/pci_host_generic_fdt.c Mon Nov 19 02:43:34 2018 (r340596) @@ -423,6 +423,7 @@ generic_pcie_fdt_activate_resource(device_t dev, devic } break; case SYS_RES_MEMORY: + case SYS_RES_IRQ: res = BUS_ACTIVATE_RESOURCE(device_get_parent(dev), child, type, rid, r); break; @@ -445,6 +446,7 @@ generic_pcie_fdt_deactivate_resource(device_t dev, dev switch(type) { case SYS_RES_IOPORT: case SYS_RES_MEMORY: + case SYS_RES_IRQ: res = BUS_DEACTIVATE_RESOURCE(device_get_parent(dev), child, type, rid, r); break; From owner-svn-src-all@freebsd.org Mon Nov 19 02:55:20 2018 Return-Path: Delivered-To: svn-src-all@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 679201131470; Mon, 19 Nov 2018 02:55:20 +0000 (UTC) (envelope-from jchandra@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 098307D58D; Mon, 19 Nov 2018 02:55:20 +0000 (UTC) (envelope-from jchandra@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DA8D21C31C; Mon, 19 Nov 2018 02:55:19 +0000 (UTC) (envelope-from jchandra@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAJ2tJVa012671; Mon, 19 Nov 2018 02:55:19 GMT (envelope-from jchandra@FreeBSD.org) Received: (from jchandra@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAJ2tJ4O012668; Mon, 19 Nov 2018 02:55:19 GMT (envelope-from jchandra@FreeBSD.org) Message-Id: <201811190255.wAJ2tJ4O012668@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jchandra set sender to jchandra@FreeBSD.org using -f From: "Jayachandran C." Date: Mon, 19 Nov 2018 02:55:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340597 - head/sys/dev/pci X-SVN-Group: head X-SVN-Commit-Author: jchandra X-SVN-Commit-Paths: head/sys/dev/pci X-SVN-Commit-Revision: 340597 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 098307D58D X-Spamd-Result: default: False [0.39 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.25)[0.248,0]; NEURAL_SPAM_MEDIUM(0.15)[0.147,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Nov 2018 02:55:20 -0000 Author: jchandra Date: Mon Nov 19 02:55:18 2018 New Revision: 340597 URL: https://svnweb.freebsd.org/changeset/base/340597 Log: pci_host_generic*: basic implementation of bus range Both ACPI and FDT support bus ranges for pci host bridges. Update pci_host_generic*.[ch] with a default implementation to support this. This will be used in the next set of changes for ACPI based host bridge. No functional changes in this commit. Reviewed by: andrew Differential Revision: https://reviews.freebsd.org/D17657 Modified: head/sys/dev/pci/pci_host_generic.c head/sys/dev/pci/pci_host_generic.h head/sys/dev/pci/pci_host_generic_acpi.c head/sys/dev/pci/pci_host_generic_fdt.c Modified: head/sys/dev/pci/pci_host_generic.c ============================================================================== --- head/sys/dev/pci/pci_host_generic.c Mon Nov 19 02:43:34 2018 (r340596) +++ head/sys/dev/pci/pci_host_generic.c Mon Nov 19 02:55:18 2018 (r340597) @@ -147,13 +147,14 @@ generic_pcie_read_config(device_t dev, u_int bus, u_in uint64_t offset; uint32_t data; - if ((bus > PCI_BUSMAX) || (slot > PCI_SLOTMAX) || - (func > PCI_FUNCMAX) || (reg > PCIE_REGMAX)) + sc = device_get_softc(dev); + if ((bus < sc->bus_start) || (bus > sc->bus_end)) return (~0U); + if ((slot > PCI_SLOTMAX) || (func > PCI_FUNCMAX) || + (reg > PCIE_REGMAX)) + return (~0U); - sc = device_get_softc(dev); - - offset = PCIE_ADDR_OFFSET(bus, slot, func, reg); + offset = PCIE_ADDR_OFFSET(bus - sc->bus_start, slot, func, reg); t = sc->bst; h = sc->bsh; @@ -183,14 +184,15 @@ generic_pcie_write_config(device_t dev, u_int bus, u_i bus_space_tag_t t; uint64_t offset; - if ((bus > PCI_BUSMAX) || (slot > PCI_SLOTMAX) || - (func > PCI_FUNCMAX) || (reg > PCIE_REGMAX)) + sc = device_get_softc(dev); + if ((bus < sc->bus_start) || (bus > sc->bus_end)) return; + if ((slot > PCI_SLOTMAX) || (func > PCI_FUNCMAX) || + (reg > PCIE_REGMAX)) + return; - sc = device_get_softc(dev); + offset = PCIE_ADDR_OFFSET(bus - sc->bus_start, slot, func, reg); - offset = PCIE_ADDR_OFFSET(bus, slot, func, reg); - t = sc->bst; h = sc->bsh; @@ -221,14 +223,11 @@ generic_pcie_read_ivar(device_t dev, device_t child, i uintptr_t *result) { struct generic_pcie_core_softc *sc; - int secondary_bus; sc = device_get_softc(dev); if (index == PCIB_IVAR_BUS) { - /* this pcib adds only pci bus 0 as child */ - secondary_bus = 0; - *result = secondary_bus; + *result = sc->bus_start; return (0); } Modified: head/sys/dev/pci/pci_host_generic.h ============================================================================== --- head/sys/dev/pci/pci_host_generic.h Mon Nov 19 02:43:34 2018 (r340596) +++ head/sys/dev/pci/pci_host_generic.h Mon Nov 19 02:55:18 2018 (r340597) @@ -56,6 +56,8 @@ struct generic_pcie_core_softc { struct rman io_rman; struct resource *res; struct resource *res1; + int bus_start; + int bus_end; int ecam; bus_space_tag_t bst; bus_space_handle_t bsh; Modified: head/sys/dev/pci/pci_host_generic_acpi.c ============================================================================== --- head/sys/dev/pci/pci_host_generic_acpi.c Mon Nov 19 02:43:34 2018 (r340596) +++ head/sys/dev/pci/pci_host_generic_acpi.c Mon Nov 19 02:55:18 2018 (r340597) @@ -125,7 +125,7 @@ pci_host_generic_acpi_attach(device_t dev) struct generic_pcie_acpi_softc *sc; ACPI_HANDLE handle; ACPI_STATUS status; - int error; + int error, bus_start; sc = device_get_softc(dev); @@ -136,10 +136,14 @@ pci_host_generic_acpi_attach(device_t dev) device_printf(dev, "Bus is%s cache-coherent\n", sc->base.coherent ? "" : " not"); - if (!ACPI_FAILURE(acpi_GetInteger(handle, "_BBN", &sc->base.ecam))) - sc->base.ecam >>= 7; - else + if (!ACPI_FAILURE(acpi_GetInteger(handle, "_BBN", &bus_start))) { + sc->base.ecam = bus_start >> 7; + sc->base.bus_start = bus_start & 0x7F; + } else { sc->base.ecam = 0; + sc->base.bus_start = 0; + } + sc->base.bus_end = 0xFF; acpi_pcib_fetch_prt(dev, &sc->ap_prt); @@ -194,17 +198,12 @@ static int generic_pcie_acpi_read_ivar(device_t dev, device_t child, int index, uintptr_t *result) { - ACPI_HANDLE handle; struct generic_pcie_acpi_softc *sc; - int secondary_bus; sc = device_get_softc(dev); if (index == PCIB_IVAR_BUS) { - handle = acpi_get_handle(dev); - if (ACPI_FAILURE(acpi_GetInteger(handle, "_BBN", &secondary_bus))) - secondary_bus = sc->base.ecam * 0x80; - *result = secondary_bus; + *result = sc->base.ecam * 0x80 + sc->base.bus_start; return (0); } Modified: head/sys/dev/pci/pci_host_generic_fdt.c ============================================================================== --- head/sys/dev/pci/pci_host_generic_fdt.c Mon Nov 19 02:43:34 2018 (r340596) +++ head/sys/dev/pci/pci_host_generic_fdt.c Mon Nov 19 02:55:18 2018 (r340597) @@ -152,6 +152,9 @@ pci_host_generic_attach(device_t dev) device_printf(dev, "Bus is%s cache-coherent\n", sc->base.coherent ? "" : " not"); + /* TODO parse FDT bus ranges */ + sc->base.bus_start = 0; + sc->base.bus_end = 0xFF; error = pci_host_generic_core_attach(dev); if (error != 0) return (error); From owner-svn-src-all@freebsd.org Mon Nov 19 03:02:52 2018 Return-Path: Delivered-To: svn-src-all@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 D373E1131C64; Mon, 19 Nov 2018 03:02:51 +0000 (UTC) (envelope-from jchandra@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 73B597DF34; Mon, 19 Nov 2018 03:02:49 +0000 (UTC) (envelope-from jchandra@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4EE6A1C543; Mon, 19 Nov 2018 03:02:49 +0000 (UTC) (envelope-from jchandra@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAJ32nBi018554; Mon, 19 Nov 2018 03:02:49 GMT (envelope-from jchandra@FreeBSD.org) Received: (from jchandra@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAJ32mfk018549; Mon, 19 Nov 2018 03:02:48 GMT (envelope-from jchandra@FreeBSD.org) Message-Id: <201811190302.wAJ32mfk018549@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jchandra set sender to jchandra@FreeBSD.org using -f From: "Jayachandran C." Date: Mon, 19 Nov 2018 03:02:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340598 - in head/sys: arm/arm dev/acpica X-SVN-Group: head X-SVN-Commit-Author: jchandra X-SVN-Commit-Paths: in head/sys: arm/arm dev/acpica X-SVN-Commit-Revision: 340598 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 73B597DF34 X-Spamd-Result: default: False [0.41 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.25)[0.252,0]; NEURAL_SPAM_MEDIUM(0.15)[0.154,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Nov 2018 03:02:52 -0000 Author: jchandra Date: Mon Nov 19 03:02:47 2018 New Revision: 340598 URL: https://svnweb.freebsd.org/changeset/base/340598 Log: acpica: rework INTRNG interrupts On arm64 (where INTRNG is enabled), the interrupts have to be mapped with ACPI_BUS_MAP_INTR() before adding them as resources to devices. The earlier code did the mapping before calling acpi_set_resource(), which bypassed code that checked for PCI link interrupts. To fix this, move the call to map interrupts into acpi_set_resource() and that requires additional work to lookup interrupt properties. The changes here are to: * extend acpi_lookup_irq_handler() to lookup an irq in the ACPI resources * create a helper function acpi_map_intr() which uses the updated acpi_lookup_irq_handler() to look up an irq, and then map it with ACPI_BUS_MAP_INTR() * use acpi_map_intr() in acpi_pcib_route_interrupt() to map pci link interrupts. With these changes, we can drop the ifdefs in acpi_resource.c, and we can also drop the call for mapping interrupts in generic_timer.c Reviewed by: andrew Differential Revision: https://reviews.freebsd.org/D17790 Modified: head/sys/arm/arm/generic_timer.c head/sys/dev/acpica/acpi.c head/sys/dev/acpica/acpi_pcib.c head/sys/dev/acpica/acpi_resource.c head/sys/dev/acpica/acpivar.h Modified: head/sys/arm/arm/generic_timer.c ============================================================================== --- head/sys/arm/arm/generic_timer.c Mon Nov 19 02:55:18 2018 (r340597) +++ head/sys/arm/arm/generic_timer.c Mon Nov 19 03:02:47 2018 (r340598) @@ -72,7 +72,6 @@ __FBSDID("$FreeBSD$"); #ifdef DEV_ACPI #include #include -#include "acpi_bus_if.h" #endif #define GT_CTRL_ENABLE (1 << 0) @@ -340,8 +339,6 @@ static void arm_tmr_acpi_add_irq(device_t parent, device_t dev, int rid, u_int irq) { - irq = ACPI_BUS_MAP_INTR(parent, dev, irq, - INTR_TRIGGER_LEVEL, INTR_POLARITY_HIGH); BUS_SET_RESOURCE(parent, dev, SYS_RES_IRQ, rid, irq, 1); } Modified: head/sys/dev/acpica/acpi.c ============================================================================== --- head/sys/dev/acpica/acpi.c Mon Nov 19 02:55:18 2018 (r340597) +++ head/sys/dev/acpica/acpi.c Mon Nov 19 03:02:47 2018 (r340598) @@ -1319,6 +1319,13 @@ acpi_set_resource(device_t dev, device_t child, int ty } #endif +#ifdef INTRNG + /* map with default for now */ + if (type == SYS_RES_IRQ) + start = (rman_res_t)acpi_map_intr(child, (u_int)start, + acpi_get_handle(child)); +#endif + /* If the resource is already allocated, fail. */ if (resource_list_busy(rl, type, rid)) return (EBUSY); Modified: head/sys/dev/acpica/acpi_pcib.c ============================================================================== --- head/sys/dev/acpica/acpi_pcib.c Mon Nov 19 02:55:18 2018 (r340597) +++ head/sys/dev/acpica/acpi_pcib.c Mon Nov 19 03:02:47 2018 (r340598) @@ -188,6 +188,7 @@ acpi_pcib_route_interrupt(device_t pcib, device_t dev, ACPI_FUNCTION_TRACE((char *)(uintptr_t)__func__); + lnkdev = NULL; interrupt = PCI_INVALID_IRQ; /* ACPI numbers pins 0-3, not 1-4 like the BIOS. */ @@ -252,7 +253,12 @@ acpi_pcib_route_interrupt(device_t pcib, device_t dev, out: ACPI_SERIAL_END(pcib); - +#ifdef INTRNG + if (PCI_INTERRUPT_VALID(interrupt)) { + interrupt = acpi_map_intr(dev, interrupt, lnkdev); + KASSERT(PCI_INTERRUPT_VALID(interrupt), ("mapping fail")); + } +#endif return_VALUE(interrupt); } Modified: head/sys/dev/acpica/acpi_resource.c ============================================================================== --- head/sys/dev/acpica/acpi_resource.c Mon Nov 19 02:55:18 2018 (r340597) +++ head/sys/dev/acpica/acpi_resource.c Mon Nov 19 03:02:47 2018 (r340598) @@ -55,10 +55,13 @@ ACPI_MODULE_NAME("RESOURCE") struct lookup_irq_request { ACPI_RESOURCE *acpi_res; - struct resource *res; + u_int irq; int counter; int rid; int found; + int checkrid; + int trig; + int pol; }; static ACPI_STATUS @@ -66,18 +69,22 @@ acpi_lookup_irq_handler(ACPI_RESOURCE *res, void *cont { struct lookup_irq_request *req; size_t len; - u_int irqnum, irq; + u_int irqnum, irq, trig, pol; switch (res->Type) { case ACPI_RESOURCE_TYPE_IRQ: irqnum = res->Data.Irq.InterruptCount; irq = res->Data.Irq.Interrupts[0]; len = ACPI_RS_SIZE(ACPI_RESOURCE_IRQ); + trig = res->Data.Irq.Triggering; + pol = res->Data.Irq.Polarity; break; case ACPI_RESOURCE_TYPE_EXTENDED_IRQ: irqnum = res->Data.ExtendedIrq.InterruptCount; irq = res->Data.ExtendedIrq.Interrupts[0]; len = ACPI_RS_SIZE(ACPI_RESOURCE_EXTENDED_IRQ); + trig = res->Data.ExtendedIrq.Triggering; + pol = res->Data.ExtendedIrq.Polarity; break; default: return (AE_OK); @@ -85,14 +92,21 @@ acpi_lookup_irq_handler(ACPI_RESOURCE *res, void *cont if (irqnum != 1) return (AE_OK); req = (struct lookup_irq_request *)context; - if (req->counter != req->rid) { - req->counter++; - return (AE_OK); + if (req->checkrid) { + if (req->counter != req->rid) { + req->counter++; + return (AE_OK); + } + KASSERT(irq == req->irq, ("IRQ resources do not match")); + } else { + if (req->irq != irq) + return (AE_OK); } req->found = 1; - KASSERT(irq == rman_get_start(req->res), - ("IRQ resources do not match")); - bcopy(res, req->acpi_res, len); + req->pol = pol; + req->trig = trig; + if (req->acpi_res != NULL) + bcopy(res, req->acpi_res, len); return (AE_CTRL_TERMINATE); } @@ -104,10 +118,11 @@ acpi_lookup_irq_resource(device_t dev, int rid, struct ACPI_STATUS status; req.acpi_res = acpi_res; - req.res = res; + req.irq = rman_get_start(res); req.counter = 0; req.rid = rid; req.found = 0; + req.checkrid = 1; status = AcpiWalkResources(acpi_get_handle(dev), "_CRS", acpi_lookup_irq_handler, &req); if (ACPI_SUCCESS(status) && req.found == 0) @@ -155,6 +170,34 @@ acpi_config_intr(device_t dev, ACPI_RESOURCE *res) INTR_POLARITY_HIGH : INTR_POLARITY_LOW); } +#ifdef INTRNG +int +acpi_map_intr(device_t dev, u_int irq, ACPI_HANDLE handle) +{ + struct lookup_irq_request req; + int trig, pol; + + trig = ACPI_LEVEL_SENSITIVE; + pol = ACPI_ACTIVE_HIGH; + if (handle != NULL) { + req.found = 0; + req.acpi_res = NULL; + req.irq = irq; + req.counter = 0; + req.rid = 0; + req.checkrid = 0; + AcpiWalkResources(handle, "_CRS", acpi_lookup_irq_handler, &req); + if (req.found != 0) { + trig = req.trig; + pol = req.pol; + } + } + return ACPI_BUS_MAP_INTR(device_get_parent(dev), dev, irq, + (trig == ACPI_EDGE_SENSITIVE) ? INTR_TRIGGER_EDGE : INTR_TRIGGER_LEVEL, + (pol == ACPI_ACTIVE_HIGH) ? INTR_POLARITY_HIGH : INTR_POLARITY_LOW); +} +#endif + struct acpi_resource_context { struct acpi_parse_resource_set *set; device_t dev; @@ -591,13 +634,7 @@ acpi_res_set_irq(device_t dev, void *context, uint8_t if (count != 1) return; -#ifdef INTRNG - intr = ACPI_BUS_MAP_INTR(device_get_parent(dev), dev, *irq, - (trig == ACPI_EDGE_SENSITIVE) ? INTR_TRIGGER_EDGE : INTR_TRIGGER_LEVEL, - (pol == ACPI_ACTIVE_HIGH) ? INTR_POLARITY_HIGH : INTR_POLARITY_LOW); -#else intr = *irq; -#endif bus_set_resource(dev, SYS_RES_IRQ, cp->ar_nirq++, intr, 1); } @@ -615,13 +652,7 @@ acpi_res_set_ext_irq(device_t dev, void *context, uint if (count != 1) return; -#ifdef INTRNG - intr = ACPI_BUS_MAP_INTR(device_get_parent(dev), dev, *irq, - (trig == ACPI_EDGE_SENSITIVE) ? INTR_TRIGGER_EDGE : INTR_TRIGGER_LEVEL, - (pol == ACPI_ACTIVE_HIGH) ? INTR_POLARITY_HIGH : INTR_POLARITY_LOW); -#else intr = *irq; -#endif bus_set_resource(dev, SYS_RES_IRQ, cp->ar_nirq++, intr, 1); } Modified: head/sys/dev/acpica/acpivar.h ============================================================================== --- head/sys/dev/acpica/acpivar.h Mon Nov 19 02:55:18 2018 (r340597) +++ head/sys/dev/acpica/acpivar.h Mon Nov 19 03:02:47 2018 (r340598) @@ -403,6 +403,9 @@ extern struct acpi_parse_resource_set acpi_res_parse_s int acpi_identify(void); void acpi_config_intr(device_t dev, ACPI_RESOURCE *res); +#ifdef INTRNG +int acpi_map_intr(device_t dev, u_int irq, ACPI_HANDLE handle); +#endif ACPI_STATUS acpi_lookup_irq_resource(device_t dev, int rid, struct resource *res, ACPI_RESOURCE *acpi_res); ACPI_STATUS acpi_parse_resources(device_t dev, ACPI_HANDLE handle, From owner-svn-src-all@freebsd.org Mon Nov 19 03:16:17 2018 Return-Path: Delivered-To: svn-src-all@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 A107A11320BC; Mon, 19 Nov 2018 03:16:17 +0000 (UTC) (envelope-from jchandra@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 42AA57E664; Mon, 19 Nov 2018 03:16:17 +0000 (UTC) (envelope-from jchandra@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 15EA31C6EC; Mon, 19 Nov 2018 03:16:17 +0000 (UTC) (envelope-from jchandra@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAJ3GGwo023823; Mon, 19 Nov 2018 03:16:16 GMT (envelope-from jchandra@FreeBSD.org) Received: (from jchandra@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAJ3GG7s023821; Mon, 19 Nov 2018 03:16:16 GMT (envelope-from jchandra@FreeBSD.org) Message-Id: <201811190316.wAJ3GG7s023821@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jchandra set sender to jchandra@FreeBSD.org using -f From: "Jayachandran C." Date: Mon, 19 Nov 2018 03:16:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340599 - in head/sys/dev: acpica pci X-SVN-Group: head X-SVN-Commit-Author: jchandra X-SVN-Commit-Paths: in head/sys/dev: acpica pci X-SVN-Commit-Revision: 340599 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 42AA57E664 X-Spamd-Result: default: False [0.42 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.26)[0.256,0]; NEURAL_SPAM_MEDIUM(0.16)[0.162,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Nov 2018 03:16:17 -0000 Author: jchandra Date: Mon Nov 19 03:16:16 2018 New Revision: 340599 URL: https://svnweb.freebsd.org/changeset/base/340599 Log: acpica, pci_host_generic_acpi: redo pci_host_generic_acpi.c This is a major update for pci_host_generic_acpi.c, the current implementation has some gaps that are better fixed up in one go. The changes are to: * Follow x86 method of not adding PCI resources to PCI host bridge in ACPI code. This has been moved to pci_host_generic_acpi.c, where we walk thru its resources of the host bridge and add them. * Fixup code in pci_host_generic_acpi.c to read all decoded ranges and update the 'ranges' property. This allows us to share most of the code with generic implementation (and the FDT one). * Parse and setup IO ranges and bus ranges when walking the resources above. Drop most of the changes related to this from acpica code. * Add the ECAM memory area as mem resource 0. Implement the logic to get the ECAM area from MCFG (using bus range which we now decode), or from _CBA (using _BBN/bus range). Drop aarch64 ifdefs from acpica code which did part of this. * Switch resource activation to similar code as FDT implementation, this can be moved into generic implementation in a later pass. * Drop the mechanism of using the 7th bit of bus number as the domain, this is not correct and will work only in very specific cases. Use _SEG as PCI domain and use the bus ranges of the host bridge to provide start bus number. This commit should not make any functional change to dev/acpica/acpi.c for other architectures, almost all the changes there are to revert earlier additions in this file done for aarch64. Reviewed by: andrew Differential Revision: https://reviews.freebsd.org/D17791 Modified: head/sys/dev/acpica/acpi.c head/sys/dev/pci/pci_host_generic_acpi.c Modified: head/sys/dev/acpica/acpi.c ============================================================================== --- head/sys/dev/acpica/acpi.c Mon Nov 19 03:02:47 2018 (r340598) +++ head/sys/dev/acpica/acpi.c Mon Nov 19 03:16:16 2018 (r340599) @@ -179,9 +179,7 @@ static int acpi_child_location_str_method(device_t acd char *buf, size_t buflen); static int acpi_child_pnpinfo_str_method(device_t acdev, device_t child, char *buf, size_t buflen); -#if defined(__i386__) || defined(__amd64__) static void acpi_enable_pcie(void); -#endif static void acpi_hint_device_unit(device_t acdev, device_t child, const char *name, int *unitp); static void acpi_reset_interfaces(device_t dev); @@ -502,10 +500,8 @@ acpi_attach(device_t dev) goto out; } -#if defined(__i386__) || defined(__amd64__) /* Handle MCFG table if present. */ acpi_enable_pcie(); -#endif /* * Note that some systems (specifically, those with namespace evaluation @@ -1286,11 +1282,10 @@ acpi_set_resource(device_t dev, device_t child, int ty struct acpi_softc *sc = device_get_softc(dev); struct acpi_device *ad = device_get_ivars(child); struct resource_list *rl = &ad->ad_rl; -#if defined(__i386__) || defined(__amd64__) ACPI_DEVICE_INFO *devinfo; -#endif rman_res_t end; - + int allow; + /* Ignore IRQ resources for PCI link devices. */ if (type == SYS_RES_IRQ && ACPI_ID_PROBE(dev, child, pcilink_ids, NULL) <= 0) @@ -1305,11 +1300,15 @@ acpi_set_resource(device_t dev, device_t child, int ty * x86 of a PCI bridge claiming the I/O ports used for PCI config * access. */ -#if defined(__i386__) || defined(__amd64__) if (type == SYS_RES_MEMORY || type == SYS_RES_IOPORT) { if (ACPI_SUCCESS(AcpiGetObjectInfo(ad->ad_handle, &devinfo))) { if ((devinfo->Flags & ACPI_PCI_ROOT_BRIDGE) != 0) { - if (!(type == SYS_RES_IOPORT && start == CONF1_ADDR_PORT)) { +#if defined(__i386__) || defined(__amd64__) + allow = (type == SYS_RES_IOPORT && start == CONF1_ADDR_PORT); +#else + allow = 0; +#endif + if (!allow) { AcpiOsFree(devinfo); return (0); } @@ -1317,7 +1316,6 @@ acpi_set_resource(device_t dev, device_t child, int ty AcpiOsFree(devinfo); } } -#endif #ifdef INTRNG /* map with default for now */ @@ -1874,15 +1872,18 @@ acpi_isa_pnp_probe(device_t bus, device_t child, struc return_VALUE (result); } -#if defined(__i386__) || defined(__amd64__) /* * Look for a MCFG table. If it is present, use the settings for * domain (segment) 0 to setup PCI config space access via the memory * map. + * + * On non-x86 architectures (arm64 for now), this will be done from the + * PCI host bridge driver. */ static void acpi_enable_pcie(void) { +#if defined(__i386__) || defined(__amd64__) ACPI_TABLE_HEADER *hdr; ACPI_MCFG_ALLOCATION *alloc, *end; ACPI_STATUS status; @@ -1901,32 +1902,9 @@ acpi_enable_pcie(void) } alloc++; } +#endif } -#elif defined(__aarch64__) -static void -acpi_enable_pcie(device_t child, int segment) -{ - ACPI_TABLE_HEADER *hdr; - ACPI_MCFG_ALLOCATION *alloc, *end; - ACPI_STATUS status; - status = AcpiGetTable(ACPI_SIG_MCFG, 1, &hdr); - if (ACPI_FAILURE(status)) - return; - - end = (ACPI_MCFG_ALLOCATION *)((char *)hdr + hdr->Length); - alloc = (ACPI_MCFG_ALLOCATION *)((ACPI_TABLE_MCFG *)hdr + 1); - while (alloc < end) { - if (alloc->PciSegment == segment) { - bus_set_resource(child, SYS_RES_MEMORY, 0, - alloc->Address, 0x10000000); - return; - } - alloc++; - } -} -#endif - /* * Scan all of the ACPI namespace and attach child devices. * @@ -2016,9 +1994,6 @@ acpi_probe_child(ACPI_HANDLE handle, UINT32 level, voi { ACPI_DEVICE_INFO *devinfo; struct acpi_device *ad; -#ifdef __aarch64__ - int segment; -#endif struct acpi_prw_data prw; ACPI_OBJECT_TYPE type; ACPI_HANDLE h; @@ -2121,13 +2096,6 @@ acpi_probe_child(ACPI_HANDLE handle, UINT32 level, voi ad->ad_cls_class = strtoul(devinfo->ClassCode.String, NULL, 16); } -#ifdef __aarch64__ - if ((devinfo->Flags & ACPI_PCI_ROOT_BRIDGE) != 0) { - if (ACPI_SUCCESS(acpi_GetInteger(handle, "_SEG", &segment))) { - acpi_enable_pcie(child, segment); - } - } -#endif AcpiOsFree(devinfo); } break; Modified: head/sys/dev/pci/pci_host_generic_acpi.c ============================================================================== --- head/sys/dev/pci/pci_host_generic_acpi.c Mon Nov 19 03:02:47 2018 (r340598) +++ head/sys/dev/pci/pci_host_generic_acpi.c Mon Nov 19 03:16:16 2018 (r340599) @@ -63,9 +63,8 @@ __FBSDID("$FreeBSD$"); #include #include "pcib_if.h" +#include "acpi_bus_if.h" -int pci_host_generic_acpi_attach(device_t); - /* Assembling ECAM Configuration Address */ #define PCIE_BUS_SHIFT 20 #define PCIE_SLOT_SHIFT 15 @@ -100,6 +99,9 @@ static int generic_pcie_acpi_probe(device_t dev); static ACPI_STATUS pci_host_generic_acpi_parse_resource(ACPI_RESOURCE *, void *); static int generic_pcie_acpi_read_ivar(device_t, device_t, int, uintptr_t *); +/* + * generic_pcie_acpi_probe - look for root bridge flag + */ static int generic_pcie_acpi_probe(device_t dev) { @@ -119,81 +121,201 @@ generic_pcie_acpi_probe(device_t dev) return (BUS_PROBE_GENERIC); } -int -pci_host_generic_acpi_attach(device_t dev) +/* + * pci_host_generic_acpi_parse_resource - parse PCI memory, IO and bus spaces + * 'produced' by this bridge + */ +static ACPI_STATUS +pci_host_generic_acpi_parse_resource(ACPI_RESOURCE *res, void *arg) { + device_t dev = (device_t)arg; struct generic_pcie_acpi_softc *sc; + struct rman *rm; + rman_res_t min, max, off; + int r; + + rm = NULL; + sc = device_get_softc(dev); + r = sc->base.nranges; + switch (res->Type) { + case ACPI_RESOURCE_TYPE_ADDRESS16: + min = res->Data.Address16.Address.Minimum; + max = res->Data.Address16.Address.Maximum; + break; + case ACPI_RESOURCE_TYPE_ADDRESS32: + min = res->Data.Address32.Address.Minimum; + max = res->Data.Address32.Address.Maximum; + off = res->Data.Address32.Address.TranslationOffset; + break; + case ACPI_RESOURCE_TYPE_ADDRESS64: + if (res->Data.Address.ResourceType != ACPI_MEMORY_RANGE) + break; + min = res->Data.Address64.Address.Minimum; + max = res->Data.Address64.Address.Maximum; + off = res->Data.Address64.Address.TranslationOffset; + break; + default: + return (AE_OK); + } + + /* Save detected ranges */ + if (res->Data.Address.ResourceType == ACPI_MEMORY_RANGE || + res->Data.Address.ResourceType == ACPI_IO_RANGE) { + sc->base.ranges[r].pci_base = min; + sc->base.ranges[r].phys_base = min + off; + sc->base.ranges[r].size = max - min + 1; + if (res->Data.Address.ResourceType == ACPI_MEMORY_RANGE) + sc->base.ranges[r].flags |= FLAG_MEM; + else if (res->Data.Address.ResourceType == ACPI_IO_RANGE) + sc->base.ranges[r].flags |= FLAG_IO; + sc->base.nranges++; + } else if (res->Data.Address.ResourceType == ACPI_BUS_NUMBER_RANGE) { + sc->base.bus_start = min; + sc->base.bus_end = max; + } + return (AE_OK); +} + +static int +pci_host_acpi_get_ecam_resource(device_t dev) +{ + struct generic_pcie_acpi_softc *sc; + struct acpi_device *ad; + struct resource_list *rl; + ACPI_TABLE_HEADER *hdr; + ACPI_MCFG_ALLOCATION *mcfg_entry, *mcfg_end; ACPI_HANDLE handle; ACPI_STATUS status; - int error, bus_start; + rman_res_t base, start, end; + int found, val; sc = device_get_softc(dev); + handle = acpi_get_handle(dev); + /* Try MCFG first */ + status = AcpiGetTable(ACPI_SIG_MCFG, 1, &hdr); + if (ACPI_SUCCESS(status)) { + found = FALSE; + mcfg_end = (ACPI_MCFG_ALLOCATION *)((char *)hdr + hdr->Length); + mcfg_entry = (ACPI_MCFG_ALLOCATION *)((ACPI_TABLE_MCFG *)hdr + 1); + while (mcfg_entry < mcfg_end && !found) { + if (mcfg_entry->PciSegment == sc->base.ecam && + mcfg_entry->StartBusNumber <= sc->base.bus_start && + mcfg_entry->EndBusNumber >= sc->base.bus_start) + found = TRUE; + else + mcfg_entry++; + } + if (found) { + if (mcfg_entry->EndBusNumber < sc->base.bus_end) { + device_printf(dev, "bus end mismatch! expected %d found %d.\n", + sc->base.bus_end, (int)mcfg_entry->EndBusNumber); + sc->base.bus_end = mcfg_entry->EndBusNumber; + } + base = mcfg_entry->Address; + } else { + device_printf(dev, "MCFG exists, but does not have bus %d-%d\n", + sc->base.bus_start, sc->base.bus_end); + return (ENXIO); + } + } else { + status = acpi_GetInteger(handle, "_CBA", &val); + if (ACPI_SUCCESS(status)) + base = val; + else + return (ENXIO); + } + + /* add as MEM rid 0 */ + ad = device_get_ivars(dev); + rl = &ad->ad_rl; + start = base + (sc->base.bus_start << PCIE_BUS_SHIFT); + end = base + ((sc->base.bus_end + 1) << PCIE_BUS_SHIFT) - 1; + resource_list_add(rl, SYS_RES_MEMORY, 0, start, end, end - start + 1); + if (bootverbose) + device_printf(dev, "ECAM for bus %d-%d at mem %jx-%jx\n", + sc->base.bus_start, sc->base.bus_end, start, end); + return (0); +} + +static int +pci_host_generic_acpi_attach(device_t dev) +{ + struct generic_pcie_acpi_softc *sc; + ACPI_HANDLE handle; + uint64_t phys_base; + uint64_t pci_base; + uint64_t size; + ACPI_STATUS status; + int error; + int tuple; + + sc = device_get_softc(dev); handle = acpi_get_handle(dev); + + /* Get Start bus number for the PCI host bus is from _BBN method */ + status = acpi_GetInteger(handle, "_BBN", &sc->base.bus_start); + if (ACPI_FAILURE(status)) { + device_printf(dev, "No _BBN, using start bus 0\n"); + sc->base.bus_start = 0; + } + sc->base.bus_end = 255; + + /* Get PCI Segment (domain) needed for MCFG lookup */ + status = acpi_GetInteger(handle, "_SEG", &sc->base.ecam); + if (ACPI_FAILURE(status)) { + device_printf(dev, "No _SEG for PCI Bus, using segment 0\n"); + sc->base.ecam = 0; + } + + /* Bus decode ranges */ + status = AcpiWalkResources(handle, "_CRS", + pci_host_generic_acpi_parse_resource, (void *)dev); + if (ACPI_FAILURE(status)) + return (ENXIO); + + /* Coherency attribute */ if (ACPI_FAILURE(acpi_GetInteger(handle, "_CCA", &sc->base.coherent))) sc->base.coherent = 0; if (bootverbose) device_printf(dev, "Bus is%s cache-coherent\n", sc->base.coherent ? "" : " not"); - if (!ACPI_FAILURE(acpi_GetInteger(handle, "_BBN", &bus_start))) { - sc->base.ecam = bus_start >> 7; - sc->base.bus_start = bus_start & 0x7F; - } else { - sc->base.ecam = 0; - sc->base.bus_start = 0; - } - sc->base.bus_end = 0xFF; - + /* add config space resource */ + pci_host_acpi_get_ecam_resource(dev); acpi_pcib_fetch_prt(dev, &sc->ap_prt); error = pci_host_generic_core_attach(dev); if (error != 0) return (error); - status = AcpiWalkResources(handle, "_CRS", - pci_host_generic_acpi_parse_resource, (void *)dev); + for (tuple = 0; tuple < MAX_RANGES_TUPLES; tuple++) { + phys_base = sc->base.ranges[tuple].phys_base; + pci_base = sc->base.ranges[tuple].pci_base; + size = sc->base.ranges[tuple].size; + if (phys_base == 0 || size == 0) + continue; /* empty range element */ + if (sc->base.ranges[tuple].flags & FLAG_MEM) { + error = rman_manage_region(&sc->base.mem_rman, + phys_base, phys_base + size - 1); + } else if (sc->base.ranges[tuple].flags & FLAG_IO) { + error = rman_manage_region(&sc->base.io_rman, + pci_base + PCI_IO_WINDOW_OFFSET, + pci_base + PCI_IO_WINDOW_OFFSET + size - 1); + } else + continue; + if (error) { + device_printf(dev, "rman_manage_region() failed." + "error = %d\n", error); + rman_fini(&sc->base.mem_rman); + return (error); + } + } - if (ACPI_FAILURE(status)) - return (ENXIO); - device_add_child(dev, "pci", -1); return (bus_generic_attach(dev)); } -static ACPI_STATUS -pci_host_generic_acpi_parse_resource(ACPI_RESOURCE *res, void *arg) -{ - device_t dev = (device_t)arg; - struct generic_pcie_acpi_softc *sc; - rman_res_t min, max; - int error; - - switch (res->Type) { - case ACPI_RESOURCE_TYPE_ADDRESS32: - min = (rman_res_t)res->Data.Address32.Address.Minimum; - max = (rman_res_t)res->Data.Address32.Address.Maximum; - break; - case ACPI_RESOURCE_TYPE_ADDRESS64: - min = (rman_res_t)res->Data.Address64.Address.Minimum; - max = (rman_res_t)res->Data.Address64.Address.Maximum; - break; - default: - return (AE_OK); - } - - sc = device_get_softc(dev); - - error = rman_manage_region(&sc->base.mem_rman, min, max); - if (error) { - device_printf(dev, "unable to allocate %lx-%lx range\n", min, max); - return (AE_NOT_FOUND); - } - device_printf(dev, "allocating %lx-%lx range\n", min, max); - - return (AE_OK); -} - static int generic_pcie_acpi_read_ivar(device_t dev, device_t child, int index, uintptr_t *result) @@ -203,7 +325,7 @@ generic_pcie_acpi_read_ivar(device_t dev, device_t chi sc = device_get_softc(dev); if (index == PCIB_IVAR_BUS) { - *result = sc->base.ecam * 0x80 + sc->base.bus_start; + *result = sc->base.bus_start; return (0); } @@ -223,50 +345,62 @@ generic_pcie_acpi_route_interrupt(device_t bus, device struct generic_pcie_acpi_softc *sc; sc = device_get_softc(bus); - return (acpi_pcib_route_interrupt(bus, dev, pin, &sc->ap_prt)); } -static struct resource * -pci_host_generic_acpi_alloc_resource(device_t dev, device_t child, int type, - int *rid, rman_res_t start, rman_res_t end, rman_res_t count, u_int flags) -{ - struct resource *res = NULL; - -#if defined(NEW_PCIB) && defined(PCI_RES_BUS) - struct generic_pcie_acpi_softc *sc; - - if (type == PCI_RES_BUS) { - sc = device_get_softc(dev); - return (pci_domain_alloc_bus(sc->base.ecam, child, rid, start, - end, count, flags)); - } -#endif - - if (type == SYS_RES_MEMORY) - res = pci_host_generic_core_alloc_resource(dev, child, type, - rid, start, end, count, flags); - - if (res == NULL) - res = bus_generic_alloc_resource(dev, child, type, rid, start, end, - count, flags); - - return (res); -} - +/* + * Follow logic of FDT activate + */ static int generic_pcie_acpi_activate_resource(device_t dev, device_t child, int type, int rid, struct resource *r) { struct generic_pcie_acpi_softc *sc; + uint64_t phys_base; + uint64_t pci_base; + uint64_t size; + int found; int res; + int i; sc = device_get_softc(dev); if ((res = rman_activate_resource(r)) != 0) return (res); - res = BUS_ACTIVATE_RESOURCE(device_get_parent(dev), child, type, rid,r); + switch (type) { + case SYS_RES_IOPORT: + found = 0; + for (i = 0; i < MAX_RANGES_TUPLES; i++) { + pci_base = sc->base.ranges[i].pci_base; + phys_base = sc->base.ranges[i].phys_base; + size = sc->base.ranges[i].size; + + if ((rid > pci_base) && (rid < (pci_base + size))) { + found = 1; + break; + } + } + if (found) { + rman_set_start(r, rman_get_start(r) + phys_base); + rman_set_end(r, rman_get_end(r) + phys_base); + res = BUS_ACTIVATE_RESOURCE(device_get_parent(dev), + child, type, rid, r); + } else { + device_printf(dev, + "Failed to activate IOPORT resource\n"); + res = 0; + } + break; + case SYS_RES_MEMORY: + case SYS_RES_IRQ: + res = BUS_ACTIVATE_RESOURCE(device_get_parent(dev), child, + type, rid, r); + break; + default: + break; + } + return (res); } @@ -279,8 +413,17 @@ generic_pcie_acpi_deactivate_resource(device_t dev, de if ((res = rman_deactivate_resource(r)) != 0) return (res); - res = BUS_DEACTIVATE_RESOURCE(device_get_parent(dev), child, type, - rid, r); + switch (type) { + case SYS_RES_IOPORT: + case SYS_RES_MEMORY: + case SYS_RES_IRQ: + res = BUS_DEACTIVATE_RESOURCE(device_get_parent(dev), child, + type, rid, r); + break; + default: + break; + } + return (res); } @@ -347,30 +490,25 @@ static int generic_pcie_acpi_get_id(device_t pci, device_t child, enum pci_id_type type, uintptr_t *id) { - struct generic_pcie_acpi_softc *sc; - int err; - /* Use the PCI RID to find the MSI ID */ - if (type == PCI_ID_MSI) { - sc = device_get_softc(pci); - type = PCI_ID_RID; - err = pcib_get_id(pci, child, type, id); - if (err != 0) - return (err); - *id |= sc->base.ecam << 16; - return (0); - } - - return (pcib_get_id(pci, child, type, id)); + /* + * Use the PCI RID to find the MSI ID for now, we support only 1:1 + * mapping + * + * On aarch64, more complex mapping would come from IORT table + */ + if (type == PCI_ID_MSI) + return (pcib_get_id(pci, child, PCI_ID_RID, id)); + else + return (pcib_get_id(pci, child, type, id)); } static device_method_t generic_pcie_acpi_methods[] = { DEVMETHOD(device_probe, generic_pcie_acpi_probe), DEVMETHOD(device_attach, pci_host_generic_acpi_attach), - DEVMETHOD(bus_alloc_resource, pci_host_generic_acpi_alloc_resource), - DEVMETHOD(bus_activate_resource, generic_pcie_acpi_activate_resource), - DEVMETHOD(bus_deactivate_resource, generic_pcie_acpi_deactivate_resource), DEVMETHOD(bus_read_ivar, generic_pcie_acpi_read_ivar), + DEVMETHOD(bus_activate_resource, generic_pcie_acpi_activate_resource), + DEVMETHOD(bus_deactivate_resource,generic_pcie_acpi_deactivate_resource), /* pcib interface */ DEVMETHOD(pcib_route_interrupt, generic_pcie_acpi_route_interrupt), From owner-svn-src-all@freebsd.org Mon Nov 19 03:34:16 2018 Return-Path: Delivered-To: svn-src-all@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 3882E11325B5; Mon, 19 Nov 2018 03:34:16 +0000 (UTC) (envelope-from jchandra@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 CC4E37F32E; Mon, 19 Nov 2018 03:34:15 +0000 (UTC) (envelope-from jchandra@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AD6DA1CA2D; Mon, 19 Nov 2018 03:34:15 +0000 (UTC) (envelope-from jchandra@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAJ3YFRc033921; Mon, 19 Nov 2018 03:34:15 GMT (envelope-from jchandra@FreeBSD.org) Received: (from jchandra@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAJ3YFMY033919; Mon, 19 Nov 2018 03:34:15 GMT (envelope-from jchandra@FreeBSD.org) Message-Id: <201811190334.wAJ3YFMY033919@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jchandra set sender to jchandra@FreeBSD.org using -f From: "Jayachandran C." Date: Mon, 19 Nov 2018 03:34:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340600 - in head/sys/dev: acpica pci X-SVN-Group: head X-SVN-Commit-Author: jchandra X-SVN-Commit-Paths: in head/sys/dev: acpica pci X-SVN-Commit-Revision: 340600 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: CC4E37F32E X-Spamd-Result: default: False [0.38 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_MEDIUM(0.14)[0.139,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.24)[0.244,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Nov 2018 03:34:16 -0000 Author: jchandra Date: Mon Nov 19 03:34:15 2018 New Revision: 340600 URL: https://svnweb.freebsd.org/changeset/base/340600 Log: pci_host_generic, acpi_resource: drop unneeded code Now that we are handling PCI resources in pci_host_generic_acpi.c, we don't need these change (made by r336129) Reviewed by: andrew Differential Revision: https://reviews.freebsd.org/D17792 Modified: head/sys/dev/acpica/acpi_resource.c head/sys/dev/pci/pci_host_generic.c Modified: head/sys/dev/acpica/acpi_resource.c ============================================================================== --- head/sys/dev/acpica/acpi_resource.c Mon Nov 19 03:16:16 2018 (r340599) +++ head/sys/dev/acpica/acpi_resource.c Mon Nov 19 03:34:15 2018 (r340600) @@ -602,10 +602,6 @@ acpi_res_set_memory(device_t dev, void *context, uint6 if (cp == NULL) return; - - while (bus_get_resource_start(dev, SYS_RES_MEMORY, cp->ar_nmem)) - cp->ar_nmem++; - bus_set_resource(dev, SYS_RES_MEMORY, cp->ar_nmem++, base, length); } Modified: head/sys/dev/pci/pci_host_generic.c ============================================================================== --- head/sys/dev/pci/pci_host_generic.c Mon Nov 19 03:16:16 2018 (r340599) +++ head/sys/dev/pci/pci_host_generic.c Mon Nov 19 03:34:15 2018 (r340600) @@ -107,7 +107,7 @@ pci_host_generic_core_attach(device_t dev) return (error); rid = 0; - sc->res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, RF_ACTIVE | RF_SHAREABLE); + sc->res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, RF_ACTIVE); if (sc->res == NULL) { device_printf(dev, "could not map memory.\n"); return (ENXIO); From owner-svn-src-all@freebsd.org Mon Nov 19 03:43:12 2018 Return-Path: Delivered-To: svn-src-all@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 1DAA111328EA; Mon, 19 Nov 2018 03:43:12 +0000 (UTC) (envelope-from jchandra@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 A3EEC7F883; Mon, 19 Nov 2018 03:43:11 +0000 (UTC) (envelope-from jchandra@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 652FA1CBE6; Mon, 19 Nov 2018 03:43:11 +0000 (UTC) (envelope-from jchandra@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAJ3hBaX039230; Mon, 19 Nov 2018 03:43:11 GMT (envelope-from jchandra@FreeBSD.org) Received: (from jchandra@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAJ3hAdN039226; Mon, 19 Nov 2018 03:43:10 GMT (envelope-from jchandra@FreeBSD.org) Message-Id: <201811190343.wAJ3hAdN039226@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jchandra set sender to jchandra@FreeBSD.org using -f From: "Jayachandran C." Date: Mon, 19 Nov 2018 03:43:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340601 - head/sys/dev/pci X-SVN-Group: head X-SVN-Commit-Author: jchandra X-SVN-Commit-Paths: head/sys/dev/pci X-SVN-Commit-Revision: 340601 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A3EEC7F883 X-Spamd-Result: default: False [0.41 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.25)[0.252,0]; NEURAL_SPAM_MEDIUM(0.15)[0.154,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Nov 2018 03:43:12 -0000 Author: jchandra Date: Mon Nov 19 03:43:10 2018 New Revision: 340601 URL: https://svnweb.freebsd.org/changeset/base/340601 Log: pci_host_generic : move activate/release to generic code Now that the ACPI and FDT implementations for activating and deactivating resources are the same, we can move it to pci_host_generic.c. No functional changes. Reviewed by: andrew Differential Revision: https://reviews.freebsd.org/D17793 Modified: head/sys/dev/pci/pci_host_generic.c head/sys/dev/pci/pci_host_generic_acpi.c head/sys/dev/pci/pci_host_generic_fdt.c Modified: head/sys/dev/pci/pci_host_generic.c ============================================================================== --- head/sys/dev/pci/pci_host_generic.c Mon Nov 19 03:34:15 2018 (r340600) +++ head/sys/dev/pci/pci_host_generic.c Mon Nov 19 03:43:10 2018 (r340601) @@ -341,6 +341,82 @@ fail: } static int +generic_pcie_activate_resource(device_t dev, device_t child, int type, + int rid, struct resource *r) +{ + struct generic_pcie_core_softc *sc; + uint64_t phys_base; + uint64_t pci_base; + uint64_t size; + int found; + int res; + int i; + + sc = device_get_softc(dev); + + if ((res = rman_activate_resource(r)) != 0) + return (res); + + switch (type) { + case SYS_RES_IOPORT: + found = 0; + for (i = 0; i < MAX_RANGES_TUPLES; i++) { + pci_base = sc->ranges[i].pci_base; + phys_base = sc->ranges[i].phys_base; + size = sc->ranges[i].size; + + if ((rid > pci_base) && (rid < (pci_base + size))) { + found = 1; + break; + } + } + if (found) { + rman_set_start(r, rman_get_start(r) + phys_base); + rman_set_end(r, rman_get_end(r) + phys_base); + res = BUS_ACTIVATE_RESOURCE(device_get_parent(dev), + child, type, rid, r); + } else { + device_printf(dev, + "Failed to activate IOPORT resource\n"); + res = 0; + } + break; + case SYS_RES_MEMORY: + case SYS_RES_IRQ: + res = BUS_ACTIVATE_RESOURCE(device_get_parent(dev), child, + type, rid, r); + break; + default: + break; + } + + return (res); +} + +static int +generic_pcie_deactivate_resource(device_t dev, device_t child, int type, + int rid, struct resource *r) +{ + int res; + + if ((res = rman_deactivate_resource(r)) != 0) + return (res); + + switch (type) { + case SYS_RES_IOPORT: + case SYS_RES_MEMORY: + case SYS_RES_IRQ: + res = BUS_DEACTIVATE_RESOURCE(device_get_parent(dev), child, + type, rid, r); + break; + default: + break; + } + + return (res); +} + +static int generic_pcie_adjust_resource(device_t dev, device_t child, int type, struct resource *res, rman_res_t start, rman_res_t end) { @@ -375,6 +451,8 @@ static device_method_t generic_pcie_methods[] = { DEVMETHOD(bus_write_ivar, generic_pcie_write_ivar), DEVMETHOD(bus_alloc_resource, pci_host_generic_core_alloc_resource), DEVMETHOD(bus_adjust_resource, generic_pcie_adjust_resource), + DEVMETHOD(bus_activate_resource, generic_pcie_activate_resource), + DEVMETHOD(bus_deactivate_resource, generic_pcie_deactivate_resource), DEVMETHOD(bus_release_resource, pci_host_generic_core_release_resource), DEVMETHOD(bus_setup_intr, bus_generic_setup_intr), DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr), Modified: head/sys/dev/pci/pci_host_generic_acpi.c ============================================================================== --- head/sys/dev/pci/pci_host_generic_acpi.c Mon Nov 19 03:34:15 2018 (r340600) +++ head/sys/dev/pci/pci_host_generic_acpi.c Mon Nov 19 03:43:10 2018 (r340601) @@ -348,86 +348,7 @@ generic_pcie_acpi_route_interrupt(device_t bus, device return (acpi_pcib_route_interrupt(bus, dev, pin, &sc->ap_prt)); } -/* - * Follow logic of FDT activate - */ static int -generic_pcie_acpi_activate_resource(device_t dev, device_t child, int type, - int rid, struct resource *r) -{ - struct generic_pcie_acpi_softc *sc; - uint64_t phys_base; - uint64_t pci_base; - uint64_t size; - int found; - int res; - int i; - - sc = device_get_softc(dev); - - if ((res = rman_activate_resource(r)) != 0) - return (res); - - switch (type) { - case SYS_RES_IOPORT: - found = 0; - for (i = 0; i < MAX_RANGES_TUPLES; i++) { - pci_base = sc->base.ranges[i].pci_base; - phys_base = sc->base.ranges[i].phys_base; - size = sc->base.ranges[i].size; - - if ((rid > pci_base) && (rid < (pci_base + size))) { - found = 1; - break; - } - } - if (found) { - rman_set_start(r, rman_get_start(r) + phys_base); - rman_set_end(r, rman_get_end(r) + phys_base); - res = BUS_ACTIVATE_RESOURCE(device_get_parent(dev), - child, type, rid, r); - } else { - device_printf(dev, - "Failed to activate IOPORT resource\n"); - res = 0; - } - break; - case SYS_RES_MEMORY: - case SYS_RES_IRQ: - res = BUS_ACTIVATE_RESOURCE(device_get_parent(dev), child, - type, rid, r); - break; - default: - break; - } - - return (res); -} - -static int -generic_pcie_acpi_deactivate_resource(device_t dev, device_t child, int type, - int rid, struct resource *r) -{ - int res; - - if ((res = rman_deactivate_resource(r)) != 0) - return (res); - - switch (type) { - case SYS_RES_IOPORT: - case SYS_RES_MEMORY: - case SYS_RES_IRQ: - res = BUS_DEACTIVATE_RESOURCE(device_get_parent(dev), child, - type, rid, r); - break; - default: - break; - } - - return (res); -} - -static int generic_pcie_acpi_alloc_msi(device_t pci, device_t child, int count, int maxcount, int *irqs) { @@ -507,8 +428,6 @@ static device_method_t generic_pcie_acpi_methods[] = { DEVMETHOD(device_probe, generic_pcie_acpi_probe), DEVMETHOD(device_attach, pci_host_generic_acpi_attach), DEVMETHOD(bus_read_ivar, generic_pcie_acpi_read_ivar), - DEVMETHOD(bus_activate_resource, generic_pcie_acpi_activate_resource), - DEVMETHOD(bus_deactivate_resource,generic_pcie_acpi_deactivate_resource), /* pcib interface */ DEVMETHOD(pcib_route_interrupt, generic_pcie_acpi_route_interrupt), Modified: head/sys/dev/pci/pci_host_generic_fdt.c ============================================================================== --- head/sys/dev/pci/pci_host_generic_fdt.c Mon Nov 19 03:34:15 2018 (r340600) +++ head/sys/dev/pci/pci_host_generic_fdt.c Mon Nov 19 03:43:10 2018 (r340601) @@ -385,82 +385,6 @@ pci_host_generic_alloc_resource(device_t dev, device_t } static int -generic_pcie_fdt_activate_resource(device_t dev, device_t child, int type, - int rid, struct resource *r) -{ - struct generic_pcie_fdt_softc *sc; - uint64_t phys_base; - uint64_t pci_base; - uint64_t size; - int found; - int res; - int i; - - sc = device_get_softc(dev); - - if ((res = rman_activate_resource(r)) != 0) - return (res); - - switch(type) { - case SYS_RES_IOPORT: - found = 0; - for (i = 0; i < MAX_RANGES_TUPLES; i++) { - pci_base = sc->base.ranges[i].pci_base; - phys_base = sc->base.ranges[i].phys_base; - size = sc->base.ranges[i].size; - - if ((rid > pci_base) && (rid < (pci_base + size))) { - found = 1; - break; - } - } - if (found) { - rman_set_start(r, rman_get_start(r) + phys_base); - rman_set_end(r, rman_get_end(r) + phys_base); - res = BUS_ACTIVATE_RESOURCE(device_get_parent(dev), - child, type, rid, r); - } else { - device_printf(dev, - "Failed to activate IOPORT resource\n"); - res = 0; - } - break; - case SYS_RES_MEMORY: - case SYS_RES_IRQ: - res = BUS_ACTIVATE_RESOURCE(device_get_parent(dev), child, - type, rid, r); - break; - default: - break; - } - - return (res); -} - -static int -generic_pcie_fdt_deactivate_resource(device_t dev, device_t child, int type, - int rid, struct resource *r) -{ - int res; - - if ((res = rman_deactivate_resource(r)) != 0) - return (res); - - switch(type) { - case SYS_RES_IOPORT: - case SYS_RES_MEMORY: - case SYS_RES_IRQ: - res = BUS_DEACTIVATE_RESOURCE(device_get_parent(dev), child, - type, rid, r); - break; - default: - break; - } - - return (res); -} - -static int generic_pcie_fdt_alloc_msi(device_t pci, device_t child, int count, int maxcount, int *irqs) { @@ -630,8 +554,6 @@ static device_method_t generic_pcie_fdt_methods[] = { DEVMETHOD(device_attach, pci_host_generic_attach), DEVMETHOD(bus_alloc_resource, pci_host_generic_alloc_resource), DEVMETHOD(bus_release_resource, generic_pcie_fdt_release_resource), - DEVMETHOD(bus_activate_resource, generic_pcie_fdt_activate_resource), - DEVMETHOD(bus_deactivate_resource,generic_pcie_fdt_deactivate_resource), /* pcib interface */ DEVMETHOD(pcib_route_interrupt, generic_pcie_fdt_route_interrupt), From owner-svn-src-all@freebsd.org Mon Nov 19 03:52:58 2018 Return-Path: Delivered-To: svn-src-all@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 DE5531132B78; Mon, 19 Nov 2018 03:52:57 +0000 (UTC) (envelope-from jchandra@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 7721B7FD0F; Mon, 19 Nov 2018 03:52:57 +0000 (UTC) (envelope-from jchandra@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 52DBA1CD89; Mon, 19 Nov 2018 03:52:57 +0000 (UTC) (envelope-from jchandra@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAJ3qveK044097; Mon, 19 Nov 2018 03:52:57 GMT (envelope-from jchandra@FreeBSD.org) Received: (from jchandra@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAJ3qvwv044096; Mon, 19 Nov 2018 03:52:57 GMT (envelope-from jchandra@FreeBSD.org) Message-Id: <201811190352.wAJ3qvwv044096@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jchandra set sender to jchandra@FreeBSD.org using -f From: "Jayachandran C." Date: Mon, 19 Nov 2018 03:52:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340602 - head/sys/arm64/arm64 X-SVN-Group: head X-SVN-Commit-Author: jchandra X-SVN-Commit-Paths: head/sys/arm64/arm64 X-SVN-Commit-Revision: 340602 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 7721B7FD0F X-Spamd-Result: default: False [0.39 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_MEDIUM(0.15)[0.147,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.25)[0.248,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Nov 2018 03:52:58 -0000 Author: jchandra Date: Mon Nov 19 03:52:56 2018 New Revision: 340602 URL: https://svnweb.freebsd.org/changeset/base/340602 Log: gitv3_its: fixes for multiple GIC ITS blocks First pass of support for multiple GIC ITS blocks with ACPI. Changes are to: * register the correct subset of interrupts with pic_register in case of ACPI. * initialize just the cpu interface for the first ITS, when domain information is not avialable. This has to be done until we split the per-CPU init to do LPI setup just once. * remove duplicate check for the GIC ITS domain, the sc_cpus are setup from domain, so the check again in per-CPU init seems unnecessary. Reviewed by: andrew Differential Revision: https://reviews.freebsd.org/D17841 Modified: head/sys/arm64/arm64/gicv3_its.c Modified: head/sys/arm64/arm64/gicv3_its.c ============================================================================== --- head/sys/arm64/arm64/gicv3_its.c Mon Nov 19 03:43:10 2018 (r340601) +++ head/sys/arm64/arm64/gicv3_its.c Mon Nov 19 03:52:56 2018 (r340602) @@ -580,18 +580,11 @@ its_init_cpu(device_t dev, struct gicv3_its_softc *sc) uint64_t xbaser, tmp; uint32_t ctlr; u_int cpuid; - int domain; - if (!CPU_ISSET(PCPU_GET(cpuid), &sc->sc_cpus)) - return (0); - - if (bus_get_domain(dev, &domain) == 0) { - if (PCPU_GET(domain) != domain) - return (0); - } - gicv3 = device_get_parent(dev); cpuid = PCPU_GET(cpuid); + if (!CPU_ISSET(cpuid, &sc->sc_cpus)) + return (0); /* Check if the ITS is enabled on this CPU */ if ((gic_r_read_4(gicv3, GICR_TYPER) & GICR_TYPER_PLPIS) == 0) { @@ -729,12 +722,14 @@ gicv3_its_attach(device_t dev) /* Protects access to the ITS command circular buffer. */ mtx_init(&sc->sc_its_cmd_lock, "ITS cmd lock", NULL, MTX_SPIN); + CPU_ZERO(&sc->sc_cpus); if (bus_get_domain(dev, &domain) == 0) { - CPU_ZERO(&sc->sc_cpus); if (domain < MAXMEMDOM) CPU_COPY(&cpuset_domain[domain], &sc->sc_cpus); } else { - CPU_COPY(&all_cpus, &sc->sc_cpus); + /* XXX : cannot handle more than one ITS per cpu */ + if (device_get_unit(dev) == 0) + CPU_COPY(&all_cpus, &sc->sc_cpus); } /* Allocate the command circular buffer */ @@ -1737,7 +1732,7 @@ gicv3_its_acpi_attach(device_t dev) sc->sc_pic = intr_pic_register(dev, device_get_unit(dev) + ACPI_MSI_XREF); intr_pic_add_handler(device_get_parent(dev), sc->sc_pic, - gicv3_its_intr, sc, GIC_FIRST_LPI, LPI_NIRQS); + gicv3_its_intr, sc, sc->sc_irq_base, sc->sc_irq_length); /* Register this device to handle MSI interrupts */ intr_msi_register(dev, device_get_unit(dev) + ACPI_MSI_XREF); From owner-svn-src-all@freebsd.org Mon Nov 19 05:40:38 2018 Return-Path: Delivered-To: svn-src-all@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 B68351134FA4; Mon, 19 Nov 2018 05:40:38 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.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 5AE318337D; Mon, 19 Nov 2018 05:40:38 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3AF1B1DE97; Mon, 19 Nov 2018 05:40:38 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAJ5ecY3096464; Mon, 19 Nov 2018 05:40:38 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAJ5ecsH096463; Mon, 19 Nov 2018 05:40:38 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201811190540.wAJ5ecsH096463@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 19 Nov 2018 05:40:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r340603 - stable/12/sys/kern X-SVN-Group: stable-12 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/12/sys/kern X-SVN-Commit-Revision: 340603 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 5AE318337D X-Spamd-Result: default: False [0.64 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_MEDIUM(0.12)[0.116,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.52)[0.522,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Nov 2018 05:40:38 -0000 Author: kib Date: Mon Nov 19 05:40:37 2018 New Revision: 340603 URL: https://svnweb.freebsd.org/changeset/base/340603 Log: MFC r340364: Allow set ether/vlan PCP operation from the VNET jails. Modified: stable/12/sys/kern/kern_jail.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/kern/kern_jail.c ============================================================================== --- stable/12/sys/kern/kern_jail.c Mon Nov 19 03:52:56 2018 (r340602) +++ stable/12/sys/kern/kern_jail.c Mon Nov 19 05:40:37 2018 (r340603) @@ -3062,6 +3062,7 @@ prison_priv_check(struct ucred *cred, int priv) case PRIV_NET_SETIFMETRIC: case PRIV_NET_SETIFPHYS: case PRIV_NET_SETIFMAC: + case PRIV_NET_SETLANPCP: case PRIV_NET_ADDMULTI: case PRIV_NET_DELMULTI: case PRIV_NET_HWIOCTL: From owner-svn-src-all@freebsd.org Mon Nov 19 05:42:01 2018 Return-Path: Delivered-To: svn-src-all@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 C4C1B11351C2; Mon, 19 Nov 2018 05:42:01 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 693BF836E1; Mon, 19 Nov 2018 05:42:01 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4BB841DEFA; Mon, 19 Nov 2018 05:42:01 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAJ5g1LH098441; Mon, 19 Nov 2018 05:42:01 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAJ5g0ca098439; Mon, 19 Nov 2018 05:42:00 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201811190542.wAJ5g0ca098439@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 19 Nov 2018 05:42:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r340604 - in stable/12/sys: amd64/amd64 x86/include x86/x86 X-SVN-Group: stable-12 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in stable/12/sys: amd64/amd64 x86/include x86/x86 X-SVN-Commit-Revision: 340604 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 693BF836E1 X-Spamd-Result: default: False [0.64 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_MEDIUM(0.12)[0.116,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.52)[0.522,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Nov 2018 05:42:02 -0000 Author: kib Date: Mon Nov 19 05:42:00 2018 New Revision: 340604 URL: https://svnweb.freebsd.org/changeset/base/340604 Log: MFC r340384: Apply fix to un-cripple max cpu id on BSP earlier. Modified: stable/12/sys/amd64/amd64/machdep.c stable/12/sys/x86/include/x86_var.h stable/12/sys/x86/x86/identcpu.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/amd64/amd64/machdep.c ============================================================================== --- stable/12/sys/amd64/amd64/machdep.c Mon Nov 19 05:40:37 2018 (r340603) +++ stable/12/sys/amd64/amd64/machdep.c Mon Nov 19 05:42:00 2018 (r340604) @@ -1581,6 +1581,7 @@ hammer_time(u_int64_t modulep, u_int64_t physfree) identify_cpu1(); identify_hypervisor(); + identify_cpu_fixup_bsp(); identify_cpu2(); initializecpucache(); Modified: stable/12/sys/x86/include/x86_var.h ============================================================================== --- stable/12/sys/x86/include/x86_var.h Mon Nov 19 05:40:37 2018 (r340603) +++ stable/12/sys/x86/include/x86_var.h Mon Nov 19 05:42:00 2018 (r340604) @@ -129,6 +129,7 @@ void dump_drop_page(vm_paddr_t); void finishidentcpu(void); void identify_cpu1(void); void identify_cpu2(void); +void identify_cpu_fixup_bsp(void); void identify_hypervisor(void); void initializecpu(void); void initializecpucache(void); Modified: stable/12/sys/x86/x86/identcpu.c ============================================================================== --- stable/12/sys/x86/x86/identcpu.c Mon Nov 19 05:40:37 2018 (r340603) +++ stable/12/sys/x86/x86/identcpu.c Mon Nov 19 05:42:00 2018 (r340604) @@ -1467,6 +1467,19 @@ identify_cpu2(void) } } +void +identify_cpu_fixup_bsp(void) +{ + u_int regs[4]; + + cpu_vendor_id = find_cpu_vendor_id(); + + if (fix_cpuid()) { + do_cpuid(0, regs); + cpu_high = regs[0]; + } +} + /* * Final stage of CPU identification. */ @@ -1478,12 +1491,7 @@ finishidentcpu(void) u_char ccr3; #endif - cpu_vendor_id = find_cpu_vendor_id(); - - if (fix_cpuid()) { - do_cpuid(0, regs); - cpu_high = regs[0]; - } + identify_cpu_fixup_bsp(); if (cpu_high >= 5 && (cpu_feature2 & CPUID2_MON) != 0) { do_cpuid(5, regs); From owner-svn-src-all@freebsd.org Mon Nov 19 05:43:43 2018 Return-Path: Delivered-To: svn-src-all@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 83AB7113528D; Mon, 19 Nov 2018 05:43:43 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 276CF83918; Mon, 19 Nov 2018 05:43:43 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0856D1DF2C; Mon, 19 Nov 2018 05:43:43 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAJ5hgHs000881; Mon, 19 Nov 2018 05:43:42 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAJ5hgMj000876; Mon, 19 Nov 2018 05:43:42 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201811190543.wAJ5hgMj000876@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 19 Nov 2018 05:43:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r340605 - in stable/12/sys: amd64/vmm/intel x86/include x86/x86 X-SVN-Group: stable-12 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in stable/12/sys: amd64/vmm/intel x86/include x86/x86 X-SVN-Commit-Revision: 340605 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 276CF83918 X-Spamd-Result: default: False [0.66 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.53)[0.534,0]; NEURAL_SPAM_MEDIUM(0.12)[0.123,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Nov 2018 05:43:43 -0000 Author: kib Date: Mon Nov 19 05:43:41 2018 New Revision: 340605 URL: https://svnweb.freebsd.org/changeset/base/340605 Log: MFC r340487: Align IA32_ARCH_CAP MSR definitions and use with SDM rev. 068. Modified: stable/12/sys/amd64/vmm/intel/vmx.c stable/12/sys/x86/include/specialreg.h stable/12/sys/x86/x86/cpu_machdep.c stable/12/sys/x86/x86/identcpu.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/amd64/vmm/intel/vmx.c ============================================================================== --- stable/12/sys/amd64/vmm/intel/vmx.c Mon Nov 19 05:42:00 2018 (r340604) +++ stable/12/sys/amd64/vmm/intel/vmx.c Mon Nov 19 05:43:41 2018 (r340605) @@ -814,7 +814,8 @@ vmx_init(int ipinum) return (error); } - guest_l1d_flush = (cpu_ia32_arch_caps & IA32_ARCH_CAP_RDCL_NO) == 0; + guest_l1d_flush = (cpu_ia32_arch_caps & + IA32_ARCH_CAP_SKIP_L1DFL_VMENTRY) == 0; TUNABLE_INT_FETCH("hw.vmm.l1d_flush", &guest_l1d_flush); /* Modified: stable/12/sys/x86/include/specialreg.h ============================================================================== --- stable/12/sys/x86/include/specialreg.h Mon Nov 19 05:42:00 2018 (r340604) +++ stable/12/sys/x86/include/specialreg.h Mon Nov 19 05:43:41 2018 (r340605) @@ -434,7 +434,9 @@ /* MSR IA32_ARCH_CAP(ABILITIES) bits */ #define IA32_ARCH_CAP_RDCL_NO 0x00000001 #define IA32_ARCH_CAP_IBRS_ALL 0x00000002 -#define IA32_ARCH_CAP_SSBD_NO 0x00000004 +#define IA32_ARCH_CAP_RSBA 0x00000004 +#define IA32_ARCH_CAP_SKIP_L1DFL_VMENTRY 0x00000008 +#define IA32_ARCH_CAP_SSB_NO 0x00000010 /* * CPUID manufacturers identifiers Modified: stable/12/sys/x86/x86/cpu_machdep.c ============================================================================== --- stable/12/sys/x86/x86/cpu_machdep.c Mon Nov 19 05:42:00 2018 (r340604) +++ stable/12/sys/x86/x86/cpu_machdep.c Mon Nov 19 05:43:41 2018 (r340605) @@ -891,7 +891,7 @@ hw_ssb_recalculate(bool all_cpus) hw_ssb_set(true, all_cpus); break; case 2: /* auto */ - hw_ssb_set((cpu_ia32_arch_caps & IA32_ARCH_CAP_SSBD_NO) != 0 ? + hw_ssb_set((cpu_ia32_arch_caps & IA32_ARCH_CAP_SSB_NO) != 0 ? false : true, all_cpus); break; } Modified: stable/12/sys/x86/x86/identcpu.c ============================================================================== --- stable/12/sys/x86/x86/identcpu.c Mon Nov 19 05:42:00 2018 (r340604) +++ stable/12/sys/x86/x86/identcpu.c Mon Nov 19 05:43:41 2018 (r340605) @@ -1014,6 +1014,9 @@ printcpuinfo(void) "\020" "\001RDCL_NO" "\002IBRS_ALL" + "\003RSBA" + "\004SKIP_L1DFL_VME" + "\005SSB_NO" ); } From owner-svn-src-all@freebsd.org Mon Nov 19 05:45:48 2018 Return-Path: Delivered-To: svn-src-all@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 3495E11353B8; Mon, 19 Nov 2018 05:45:48 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C546D83AED; Mon, 19 Nov 2018 05:45:47 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A546D1DF2F; Mon, 19 Nov 2018 05:45:47 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAJ5jlsR001048; Mon, 19 Nov 2018 05:45:47 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAJ5jlfj001047; Mon, 19 Nov 2018 05:45:47 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201811190545.wAJ5jlfj001047@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 19 Nov 2018 05:45:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r340606 - stable/12/sys/amd64/amd64 X-SVN-Group: stable-12 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/12/sys/amd64/amd64 X-SVN-Commit-Revision: 340606 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C546D83AED X-Spamd-Result: default: False [0.64 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.52)[0.522,0]; NEURAL_SPAM_MEDIUM(0.12)[0.116,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Nov 2018 05:45:48 -0000 Author: kib Date: Mon Nov 19 05:45:47 2018 New Revision: 340606 URL: https://svnweb.freebsd.org/changeset/base/340606 Log: MFC r339895: amd64: Use ifuncs to select suitable implementation of set_pcb_flags(). Modified: stable/12/sys/amd64/amd64/machdep.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/amd64/amd64/machdep.c ============================================================================== --- stable/12/sys/amd64/amd64/machdep.c Mon Nov 19 05:43:41 2018 (r340605) +++ stable/12/sys/amd64/amd64/machdep.c Mon Nov 19 05:45:47 2018 (r340606) @@ -2628,15 +2628,14 @@ set_pcb_flags_raw(struct pcb *pcb, const u_int flags) * the PCB_FULL_IRET flag is set. We disable interrupts to sync with * context switches. */ -void -set_pcb_flags(struct pcb *pcb, const u_int flags) +static void +set_pcb_flags_fsgsbase(struct pcb *pcb, const u_int flags) { register_t r; if (curpcb == pcb && (flags & PCB_FULL_IRET) != 0 && - (pcb->pcb_flags & PCB_FULL_IRET) == 0 && - (cpu_stdext_feature & CPUID_STDEXT_FSGSBASE) != 0) { + (pcb->pcb_flags & PCB_FULL_IRET) == 0) { r = intr_disable(); if ((pcb->pcb_flags & PCB_FULL_IRET) == 0) { if (rfs() == _ufssel) @@ -2649,6 +2648,13 @@ set_pcb_flags(struct pcb *pcb, const u_int flags) } else { set_pcb_flags_raw(pcb, flags); } +} + +DEFINE_IFUNC(, void, set_pcb_flags, (struct pcb *, const u_int), static) +{ + + return ((cpu_stdext_feature & CPUID_STDEXT_FSGSBASE) != 0 ? + set_pcb_flags_fsgsbase : set_pcb_flags_raw); } void From owner-svn-src-all@freebsd.org Mon Nov 19 05:47:33 2018 Return-Path: Delivered-To: svn-src-all@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 E6A331135487; Mon, 19 Nov 2018 05:47:32 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8555E83C4A; Mon, 19 Nov 2018 05:47:32 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 616EC1DF31; Mon, 19 Nov 2018 05:47:32 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAJ5lWQZ001180; Mon, 19 Nov 2018 05:47:32 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAJ5lWT5001179; Mon, 19 Nov 2018 05:47:32 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201811190547.wAJ5lWT5001179@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 19 Nov 2018 05:47:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r340607 - stable/12/lib/libc X-SVN-Group: stable-12 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/12/lib/libc X-SVN-Commit-Revision: 340607 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 8555E83C4A X-Spamd-Result: default: False [0.64 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.52)[0.522,0]; NEURAL_SPAM_MEDIUM(0.12)[0.116,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Nov 2018 05:47:33 -0000 Author: kib Date: Mon Nov 19 05:47:31 2018 New Revision: 340607 URL: https://svnweb.freebsd.org/changeset/base/340607 Log: MFC r340383: Create namespace for the symbols added during 13-CURRENT cycle. Modified: stable/12/lib/libc/Versions.def Directory Properties: stable/12/ (props changed) Modified: stable/12/lib/libc/Versions.def ============================================================================== --- stable/12/lib/libc/Versions.def Mon Nov 19 05:45:47 2018 (r340606) +++ stable/12/lib/libc/Versions.def Mon Nov 19 05:47:31 2018 (r340607) @@ -31,6 +31,9 @@ FBSD_1.4 { FBSD_1.5 { } FBSD_1.4; +# This version was first added to 13.0-current. +FBSD_1.6 { +} FBSD_1.5; # This is our private namespace. Any global interfaces that are # strictly for use only by other FreeBSD applications and libraries @@ -39,4 +42,4 @@ FBSD_1.5 { # # Please do NOT increment the version of this namespace. FBSDprivate_1.0 { -} FBSD_1.5; +} FBSD_1.6; From owner-svn-src-all@freebsd.org Mon Nov 19 05:56:48 2018 Return-Path: Delivered-To: svn-src-all@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 B21F4113576D; Mon, 19 Nov 2018 05:56:48 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4EDA584058; Mon, 19 Nov 2018 05:56:48 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 11B6B1E0D8; Mon, 19 Nov 2018 05:56:48 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAJ5ulI4006051; Mon, 19 Nov 2018 05:56:47 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAJ5ul0Z006046; Mon, 19 Nov 2018 05:56:47 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201811190556.wAJ5ul0Z006046@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 19 Nov 2018 05:56:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r340608 - stable/12/lib/libc/amd64/sys X-SVN-Group: stable-12 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/12/lib/libc/amd64/sys X-SVN-Commit-Revision: 340608 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4EDA584058 X-Spamd-Result: default: False [0.66 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.53)[0.534,0]; NEURAL_SPAM_MEDIUM(0.12)[0.123,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Nov 2018 05:56:49 -0000 Author: kib Date: Mon Nov 19 05:56:46 2018 New Revision: 340608 URL: https://svnweb.freebsd.org/changeset/base/340608 Log: MFC r339898: Convert amd64_get/set_fs/gsbase to ifunc. Deleted: stable/12/lib/libc/amd64/sys/amd64_detect_rdfsgsbase.c stable/12/lib/libc/amd64/sys/amd64_detect_rdfsgsbase.h Modified: stable/12/lib/libc/amd64/sys/Makefile.inc stable/12/lib/libc/amd64/sys/amd64_get_fsbase.c stable/12/lib/libc/amd64/sys/amd64_get_gsbase.c stable/12/lib/libc/amd64/sys/amd64_set_fsbase.c stable/12/lib/libc/amd64/sys/amd64_set_gsbase.c Directory Properties: stable/12/ (props changed) Modified: stable/12/lib/libc/amd64/sys/Makefile.inc ============================================================================== --- stable/12/lib/libc/amd64/sys/Makefile.inc Mon Nov 19 05:47:31 2018 (r340607) +++ stable/12/lib/libc/amd64/sys/Makefile.inc Mon Nov 19 05:56:46 2018 (r340608) @@ -2,7 +2,6 @@ # $FreeBSD$ SRCS+= \ - amd64_detect_rdfsgsbase.c \ amd64_get_fsbase.c \ amd64_get_gsbase.c \ amd64_set_fsbase.c \ Modified: stable/12/lib/libc/amd64/sys/amd64_get_fsbase.c ============================================================================== --- stable/12/lib/libc/amd64/sys/amd64_get_fsbase.c Mon Nov 19 05:47:31 2018 (r340607) +++ stable/12/lib/libc/amd64/sys/amd64_get_fsbase.c Mon Nov 19 05:56:46 2018 (r340608) @@ -2,7 +2,7 @@ * SPDX-License-Identifier: BSD-2-Clause-FreeBSD * * Copyright (c) 2003 Peter Wemm - * Copyright (c) 2017 The FreeBSD Foundation + * Copyright (c) 2017, 2018 The FreeBSD Foundation * All rights reserved. * * Portions of this software were developed by Konstantin Belousov @@ -33,18 +33,35 @@ #include __FBSDID("$FreeBSD$"); -#include +#define IN_RTLD 1 +#include +#undef IN_RTLD #include +#include #include -#include "amd64_detect_rdfsgsbase.h" +#include +#include "libc_private.h" -int -amd64_get_fsbase(void **addr) +static int +amd64_get_fsbase_cpu(void **addr) { - if (amd64_detect_rdfsgsbase() == RDFSGS_SUPPORTED) { - *addr = (void *)rdfsbase(); - return (0); - } + *addr = (void *)rdfsbase(); + return (0); +} + +static int +amd64_get_fsbase_syscall(void **addr) +{ + return (sysarch(AMD64_GET_FSBASE, addr)); +} + +DEFINE_UIFUNC(, int, amd64_get_fsbase, (void **), static) +{ + + if (__getosreldate() >= P_OSREL_WRFSBASE && + (cpu_stdext_feature & CPUID_STDEXT_FSGSBASE) != 0) + return (amd64_get_fsbase_cpu); + return (amd64_get_fsbase_syscall); } Modified: stable/12/lib/libc/amd64/sys/amd64_get_gsbase.c ============================================================================== --- stable/12/lib/libc/amd64/sys/amd64_get_gsbase.c Mon Nov 19 05:47:31 2018 (r340607) +++ stable/12/lib/libc/amd64/sys/amd64_get_gsbase.c Mon Nov 19 05:56:46 2018 (r340608) @@ -2,7 +2,7 @@ * SPDX-License-Identifier: BSD-2-Clause-FreeBSD * * Copyright (c) 2003 Peter Wemm - * Copyright (c) 2017 The FreeBSD Foundation + * Copyright (c) 2017, 2018 The FreeBSD Foundation * All rights reserved. * * Portions of this software were developed by Konstantin Belousov @@ -33,18 +33,35 @@ #include __FBSDID("$FreeBSD$"); -#include +#define IN_RTLD 1 +#include +#undef IN_RTLD #include +#include #include -#include "amd64_detect_rdfsgsbase.h" +#include +#include "libc_private.h" -int -amd64_get_gsbase(void **addr) +static int +amd64_get_gsbase_cpu(void **addr) { - if (amd64_detect_rdfsgsbase() == RDFSGS_SUPPORTED) { - *addr = (void *)rdgsbase(); - return (0); - } + *addr = (void *)rdgsbase(); + return (0); +} + +static int +amd64_get_gsbase_syscall(void **addr) +{ + return (sysarch(AMD64_GET_GSBASE, addr)); +} + +DEFINE_UIFUNC(, int, amd64_get_gsbase, (void **), static) +{ + + if (__getosreldate() >= P_OSREL_WRFSBASE && + (cpu_stdext_feature & CPUID_STDEXT_FSGSBASE) != 0) + return (amd64_get_gsbase_cpu); + return (amd64_get_gsbase_syscall); } Modified: stable/12/lib/libc/amd64/sys/amd64_set_fsbase.c ============================================================================== --- stable/12/lib/libc/amd64/sys/amd64_set_fsbase.c Mon Nov 19 05:47:31 2018 (r340607) +++ stable/12/lib/libc/amd64/sys/amd64_set_fsbase.c Mon Nov 19 05:56:46 2018 (r340608) @@ -2,7 +2,7 @@ * SPDX-License-Identifier: BSD-2-Clause-FreeBSD * * Copyright (c) 2003 Peter Wemm - * Copyright (c) 2017 The FreeBSD Foundation + * Copyright (c) 2017, 2018 The FreeBSD Foundation * All rights reserved. * * Portions of this software were developed by Konstantin Belousov @@ -33,18 +33,35 @@ #include __FBSDID("$FreeBSD$"); -#include +#define IN_RTLD 1 +#include +#undef IN_RTLD #include +#include #include -#include "amd64_detect_rdfsgsbase.h" +#include +#include "libc_private.h" -int -amd64_set_fsbase(void *addr) +static int +amd64_set_fsbase_cpu(void *addr) { - if (amd64_detect_rdfsgsbase() == RDFSGS_SUPPORTED) { - wrfsbase((uintptr_t)addr); - return (0); - } + wrfsbase((uintptr_t)addr); + return (0); +} + +static int +amd64_set_fsbase_syscall(void *addr) +{ + return (sysarch(AMD64_SET_FSBASE, &addr)); +} + +DEFINE_UIFUNC(, int, amd64_set_fsbase, (void *), static) +{ + + if (__getosreldate() >= P_OSREL_WRFSBASE && + (cpu_stdext_feature & CPUID_STDEXT_FSGSBASE) != 0) + return (amd64_set_fsbase_cpu); + return (amd64_set_fsbase_syscall); } Modified: stable/12/lib/libc/amd64/sys/amd64_set_gsbase.c ============================================================================== --- stable/12/lib/libc/amd64/sys/amd64_set_gsbase.c Mon Nov 19 05:47:31 2018 (r340607) +++ stable/12/lib/libc/amd64/sys/amd64_set_gsbase.c Mon Nov 19 05:56:46 2018 (r340608) @@ -2,7 +2,7 @@ * SPDX-License-Identifier: BSD-2-Clause-FreeBSD * * Copyright (c) 2003 Peter Wemm - * Copyright (c) 2017 The FreeBSD Foundation + * Copyright (c) 2017, 2018 The FreeBSD Foundation * All rights reserved. * * Portions of this software were developed by Konstantin Belousov @@ -33,18 +33,35 @@ #include __FBSDID("$FreeBSD$"); -#include +#define IN_RTLD 1 +#include +#undef IN_RTLD #include +#include #include -#include "amd64_detect_rdfsgsbase.h" +#include +#include "libc_private.h" -int -amd64_set_gsbase(void *addr) +static int +amd64_set_gsbase_cpu(void *addr) { - if (amd64_detect_rdfsgsbase() == RDFSGS_SUPPORTED) { - wrgsbase((uintptr_t)addr); - return (0); - } + wrgsbase((uintptr_t)addr); + return (0); +} + +static int +amd64_set_gsbase_syscall(void *addr) +{ + return (sysarch(AMD64_SET_GSBASE, &addr)); +} + +DEFINE_UIFUNC(, int, amd64_set_gsbase, (void *), static) +{ + + if (__getosreldate() >= P_OSREL_WRFSBASE && + (cpu_stdext_feature & CPUID_STDEXT_FSGSBASE) != 0) + return (amd64_set_gsbase_cpu); + return (amd64_set_gsbase_syscall); } From owner-svn-src-all@freebsd.org Mon Nov 19 06:07:19 2018 Return-Path: Delivered-To: svn-src-all@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 D4F7F1135A6B; Mon, 19 Nov 2018 06:07:18 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7171B84482; Mon, 19 Nov 2018 06:07:18 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 519191E26C; Mon, 19 Nov 2018 06:07:18 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAJ67IPp011301; Mon, 19 Nov 2018 06:07:18 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAJ67HQH011297; Mon, 19 Nov 2018 06:07:17 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201811190607.wAJ67HQH011297@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 19 Nov 2018 06:07:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r340609 - in stable/11/sys: amd64/vmm/intel x86/include x86/x86 X-SVN-Group: stable-11 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in stable/11/sys: amd64/vmm/intel x86/include x86/x86 X-SVN-Commit-Revision: 340609 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 7171B84482 X-Spamd-Result: default: False [0.66 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.53)[0.534,0]; NEURAL_SPAM_MEDIUM(0.12)[0.123,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Nov 2018 06:07:19 -0000 Author: kib Date: Mon Nov 19 06:07:17 2018 New Revision: 340609 URL: https://svnweb.freebsd.org/changeset/base/340609 Log: MFC r340487: Align IA32_ARCH_CAP MSR definitions and use with SDM rev. 068. Modified: stable/11/sys/amd64/vmm/intel/vmx.c stable/11/sys/x86/include/specialreg.h stable/11/sys/x86/x86/cpu_machdep.c stable/11/sys/x86/x86/identcpu.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/amd64/vmm/intel/vmx.c ============================================================================== --- stable/11/sys/amd64/vmm/intel/vmx.c Mon Nov 19 05:56:46 2018 (r340608) +++ stable/11/sys/amd64/vmm/intel/vmx.c Mon Nov 19 06:07:17 2018 (r340609) @@ -733,7 +733,8 @@ vmx_init(int ipinum) return (error); } - guest_l1d_flush = (cpu_ia32_arch_caps & IA32_ARCH_CAP_RDCL_NO) == 0; + guest_l1d_flush = (cpu_ia32_arch_caps & + IA32_ARCH_CAP_SKIP_L1DFL_VMENTRY) == 0; TUNABLE_INT_FETCH("hw.vmm.l1d_flush", &guest_l1d_flush); /* Modified: stable/11/sys/x86/include/specialreg.h ============================================================================== --- stable/11/sys/x86/include/specialreg.h Mon Nov 19 05:56:46 2018 (r340608) +++ stable/11/sys/x86/include/specialreg.h Mon Nov 19 06:07:17 2018 (r340609) @@ -394,7 +394,9 @@ /* MSR IA32_ARCH_CAP(ABILITIES) bits */ #define IA32_ARCH_CAP_RDCL_NO 0x00000001 #define IA32_ARCH_CAP_IBRS_ALL 0x00000002 -#define IA32_ARCH_CAP_SSBD_NO 0x00000004 +#define IA32_ARCH_CAP_RSBA 0x00000004 +#define IA32_ARCH_CAP_SKIP_L1DFL_VMENTRY 0x00000008 +#define IA32_ARCH_CAP_SSB_NO 0x00000010 /* * CPUID manufacturers identifiers Modified: stable/11/sys/x86/x86/cpu_machdep.c ============================================================================== --- stable/11/sys/x86/x86/cpu_machdep.c Mon Nov 19 05:56:46 2018 (r340608) +++ stable/11/sys/x86/x86/cpu_machdep.c Mon Nov 19 06:07:17 2018 (r340609) @@ -921,7 +921,7 @@ hw_ssb_recalculate(bool all_cpus) hw_ssb_set(true, all_cpus); break; case 2: /* auto */ - hw_ssb_set((cpu_ia32_arch_caps & IA32_ARCH_CAP_SSBD_NO) != 0 ? + hw_ssb_set((cpu_ia32_arch_caps & IA32_ARCH_CAP_SSB_NO) != 0 ? false : true, all_cpus); break; } Modified: stable/11/sys/x86/x86/identcpu.c ============================================================================== --- stable/11/sys/x86/x86/identcpu.c Mon Nov 19 05:56:46 2018 (r340608) +++ stable/11/sys/x86/x86/identcpu.c Mon Nov 19 06:07:17 2018 (r340609) @@ -1013,6 +1013,9 @@ printcpuinfo(void) "\020" "\001RDCL_NO" "\002IBRS_ALL" + "\003RSBA" + "\004SKIP_L1DFL_VME" + "\005SSB_NO" ); } From owner-svn-src-all@freebsd.org Mon Nov 19 06:33:39 2018 Return-Path: Delivered-To: svn-src-all@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 22279113616A; Mon, 19 Nov 2018 06:33:39 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id ADD31850EA; Mon, 19 Nov 2018 06:33:38 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 76B801E744; Mon, 19 Nov 2018 06:33:38 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAJ6XcUO026195; Mon, 19 Nov 2018 06:33:38 GMT (envelope-from eugen@FreeBSD.org) Received: (from eugen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAJ6XcVq026194; Mon, 19 Nov 2018 06:33:38 GMT (envelope-from eugen@FreeBSD.org) Message-Id: <201811190633.wAJ6XcVq026194@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eugen set sender to eugen@FreeBSD.org using -f From: Eugene Grosbein Date: Mon, 19 Nov 2018 06:33:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r340610 - stable/12/libexec/rc X-SVN-Group: stable-12 X-SVN-Commit-Author: eugen X-SVN-Commit-Paths: stable/12/libexec/rc X-SVN-Commit-Revision: 340610 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: ADD31850EA X-Spamd-Result: default: False [0.66 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_MEDIUM(0.12)[0.123,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.53)[0.534,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Nov 2018 06:33:39 -0000 Author: eugen Date: Mon Nov 19 06:33:38 2018 New Revision: 340610 URL: https://svnweb.freebsd.org/changeset/base/340610 Log: MFC r339465: rc.initdiskless: add support for auxiliary NVRAM. Currently, rc.inidiskless assumes that local system configuration changes are kept in some mountable file system. For example, nanobsd uses dedicated partition mounted as /cfg for this. However, small embedded devices like MIPS routers may have no enough flash space to keep full-blown file system but have only one or couple small flash blocks to keep persistent local configuration overrides. This change extends rc.initdiskless and introduces ability to run auxiliary command /conf/T/M/extract that is supposed to extract configuration overrides from such local storage. For example, the command /conf/default/etc/extract may contain something like: cd "$1" && bsdcpio --quiet -idu < /dev/map/cfg bsdcpio command extracts compressed archive from the storage to /etc assuming the storage is exposed by the kernel as /dev/map/cfg to userland. PR: 204215 Modified: stable/12/libexec/rc/rc.initdiskless Directory Properties: stable/12/ (props changed) Modified: stable/12/libexec/rc/rc.initdiskless ============================================================================== --- stable/12/libexec/rc/rc.initdiskless Mon Nov 19 06:07:17 2018 (r340609) +++ stable/12/libexec/rc/rc.initdiskless Mon Nov 19 06:33:38 2018 (r340610) @@ -111,6 +111,15 @@ # created for /SUBDIR if necessary). The presence of this file # prevents the copy from /conf/T/SUBDIR/ # +# /conf/T/M/extract +# This is alternative to SUBDIR.cpio.gz and remount. +# Similar to remount case, a memory filesystem is created +# for /M and initialized from a template but no mounting +# performed. Instead, this file is run passing /M as singe +# argument. It is expected to extract template override to /M +# using auxiliary storage found in some embedded systems +# having NVRAM too small to hold mountable file system. +# # /conf/T/SUBDIR.remove # The list of paths contained in the file are rm -rf'd # relative to /SUBDIR. @@ -343,8 +352,8 @@ done # - Create all required MFS filesystems and populate them from # our templates. Support both a direct template and a dir.cpio.gz -# archive. Support dir.remove files containing a list of relative -# paths to remove. +# archive. Support for auxiliary NVRAM. Support dir.remove files containing +# a list of relative paths to remove. # # The dir.cpio.gz form is there to make the copy process more efficient, # so if the cpio archive is present, it prevents the files from dir/ @@ -365,6 +374,15 @@ for i in ${templates} ; do create_md $subdir echo "Loading /$subdir from cpio archive $j" (cd / ; /rescue/tar -xpf $j) + fi + done + for j in /conf/$i/*/extract ; do + if [ -x $j ]; then + subdir=${j%*/extract} + subdir=${subdir##*/} + create_md $subdir + echo "Loading /$subdir using auxiliary command $j" + $j /$subdir fi done for j in /conf/$i/*.remove ; do From owner-svn-src-all@freebsd.org Mon Nov 19 06:37:39 2018 Return-Path: Delivered-To: svn-src-all@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 A0F3011362C0; Mon, 19 Nov 2018 06:37:39 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 44A6885344; Mon, 19 Nov 2018 06:37:39 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0B3D51E755; Mon, 19 Nov 2018 06:37:39 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAJ6bcIt026414; Mon, 19 Nov 2018 06:37:38 GMT (envelope-from eugen@FreeBSD.org) Received: (from eugen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAJ6bcLL026413; Mon, 19 Nov 2018 06:37:38 GMT (envelope-from eugen@FreeBSD.org) Message-Id: <201811190637.wAJ6bcLL026413@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eugen set sender to eugen@FreeBSD.org using -f From: Eugene Grosbein Date: Mon, 19 Nov 2018 06:37:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r340611 - stable/11/etc X-SVN-Group: stable-11 X-SVN-Commit-Author: eugen X-SVN-Commit-Paths: stable/11/etc X-SVN-Commit-Revision: 340611 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 44A6885344 X-Spamd-Result: default: False [0.66 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_MEDIUM(0.12)[0.123,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.53)[0.534,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Nov 2018 06:37:39 -0000 Author: eugen Date: Mon Nov 19 06:37:38 2018 New Revision: 340611 URL: https://svnweb.freebsd.org/changeset/base/340611 Log: MFC r339465: rc.initdiskless: add support for auxiliary NVRAM. Currently, rc.inidiskless assumes that local system configuration changes are kept in some mountable file system. For example, nanobsd uses dedicated partition mounted as /cfg for this. However, small embedded devices like MIPS routers may have no enough flash space to keep full-blown file system but have only one or couple small flash blocks to keep persistent local configuration overrides. This change extends rc.initdiskless and introduces ability to run auxiliary command /conf/T/M/extract that is supposed to extract configuration overrides from such local storage. For example, the command /conf/default/etc/extract may contain something like: cd "$1" && bsdcpio --quiet -idu < /dev/map/cfg bsdcpio command extracts compressed archive from the storage to /etc assuming the storage is exposed by the kernel as /dev/map/cfg to userland. PR: 204215 Modified: stable/11/etc/rc.initdiskless Directory Properties: stable/11/ (props changed) Modified: stable/11/etc/rc.initdiskless ============================================================================== --- stable/11/etc/rc.initdiskless Mon Nov 19 06:33:38 2018 (r340610) +++ stable/11/etc/rc.initdiskless Mon Nov 19 06:37:38 2018 (r340611) @@ -111,6 +111,15 @@ # created for /SUBDIR if necessary). The presence of this file # prevents the copy from /conf/T/SUBDIR/ # +# /conf/T/M/extract +# This is alternative to SUBDIR.cpio.gz and remount. +# Similar to remount case, a memory filesystem is created +# for /M and initialized from a template but no mounting +# performed. Instead, this file is run passing /M as singe +# argument. It is expected to extract template override to /M +# using auxiliary storage found in some embedded systems +# having NVRAM too small to hold mountable file system. +# # /conf/T/SUBDIR.remove # The list of paths contained in the file are rm -rf'd # relative to /SUBDIR. @@ -343,8 +352,8 @@ done # - Create all required MFS filesystems and populate them from # our templates. Support both a direct template and a dir.cpio.gz -# archive. Support dir.remove files containing a list of relative -# paths to remove. +# archive. Support for auxiliary NVRAM. Support dir.remove files containing +# a list of relative paths to remove. # # The dir.cpio.gz form is there to make the copy process more efficient, # so if the cpio archive is present, it prevents the files from dir/ @@ -365,6 +374,15 @@ for i in ${templates} ; do create_md $subdir echo "Loading /$subdir from cpio archive $j" (cd / ; /rescue/tar -xpf $j) + fi + done + for j in /conf/$i/*/extract ; do + if [ -x $j ]; then + subdir=${j%*/extract} + subdir=${subdir##*/} + create_md $subdir + echo "Loading /$subdir using auxiliary command $j" + $j /$subdir fi done for j in /conf/$i/*.remove ; do From owner-svn-src-all@freebsd.org Mon Nov 19 06:39:01 2018 Return-Path: Delivered-To: svn-src-all@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 4456311363CA; Mon, 19 Nov 2018 06:39:01 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DC1F7854E9; Mon, 19 Nov 2018 06:39:00 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BC5701E757; Mon, 19 Nov 2018 06:39:00 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAJ6d0BG026525; Mon, 19 Nov 2018 06:39:00 GMT (envelope-from eugen@FreeBSD.org) Received: (from eugen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAJ6d0pT026524; Mon, 19 Nov 2018 06:39:00 GMT (envelope-from eugen@FreeBSD.org) Message-Id: <201811190639.wAJ6d0pT026524@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eugen set sender to eugen@FreeBSD.org using -f From: Eugene Grosbein Date: Mon, 19 Nov 2018 06:39:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r340612 - stable/10/etc X-SVN-Group: stable-10 X-SVN-Commit-Author: eugen X-SVN-Commit-Paths: stable/10/etc X-SVN-Commit-Revision: 340612 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: DC1F7854E9 X-Spamd-Result: default: False [0.66 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.53)[0.534,0]; NEURAL_SPAM_MEDIUM(0.12)[0.123,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Nov 2018 06:39:01 -0000 Author: eugen Date: Mon Nov 19 06:39:00 2018 New Revision: 340612 URL: https://svnweb.freebsd.org/changeset/base/340612 Log: MFC r339465: rc.initdiskless: add support for auxiliary NVRAM. Currently, rc.inidiskless assumes that local system configuration changes are kept in some mountable file system. For example, nanobsd uses dedicated partition mounted as /cfg for this. However, small embedded devices like MIPS routers may have no enough flash space to keep full-blown file system but have only one or couple small flash blocks to keep persistent local configuration overrides. This change extends rc.initdiskless and introduces ability to run auxiliary command /conf/T/M/extract that is supposed to extract configuration overrides from such local storage. For example, the command /conf/default/etc/extract may contain something like: cd "$1" && bsdcpio --quiet -idu < /dev/map/cfg bsdcpio command extracts compressed archive from the storage to /etc assuming the storage is exposed by the kernel as /dev/map/cfg to userland. PR: 204215 Modified: stable/10/etc/rc.initdiskless Modified: stable/10/etc/rc.initdiskless ============================================================================== --- stable/10/etc/rc.initdiskless Mon Nov 19 06:37:38 2018 (r340611) +++ stable/10/etc/rc.initdiskless Mon Nov 19 06:39:00 2018 (r340612) @@ -111,6 +111,15 @@ # created for /SUBDIR if necessary). The presence of this file # prevents the copy from /conf/T/SUBDIR/ # +# /conf/T/M/extract +# This is alternative to SUBDIR.cpio.gz and remount. +# Similar to remount case, a memory filesystem is created +# for /M and initialized from a template but no mounting +# performed. Instead, this file is run passing /M as singe +# argument. It is expected to extract template override to /M +# using auxiliary storage found in some embedded systems +# having NVRAM too small to hold mountable file system. +# # /conf/T/SUBDIR.remove # The list of paths contained in the file are rm -rf'd # relative to /SUBDIR. @@ -342,8 +351,8 @@ done # - Create all required MFS filesystems and populate them from # our templates. Support both a direct template and a dir.cpio.gz -# archive. Support dir.remove files containing a list of relative -# paths to remove. +# archive. Support for auxiliary NVRAM. Support dir.remove files containing +# a list of relative paths to remove. # # The dir.cpio.gz form is there to make the copy process more efficient, # so if the cpio archive is present, it prevents the files from dir/ @@ -364,6 +373,15 @@ for i in ${templates} ; do create_md $subdir echo "Loading /$subdir from cpio archive $j" (cd / ; /rescue/tar -xpf $j) + fi + done + for j in /conf/$i/*/extract ; do + if [ -x $j ]; then + subdir=${j%*/extract} + subdir=${subdir##*/} + create_md $subdir + echo "Loading /$subdir using auxiliary command $j" + $j /$subdir fi done for j in /conf/$i/*.remove ; do From owner-svn-src-all@freebsd.org Mon Nov 19 06:48:49 2018 Return-Path: Delivered-To: svn-src-all@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 633CD11366E1; Mon, 19 Nov 2018 06:48:49 +0000 (UTC) (envelope-from sgalabov@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 F212685B54; Mon, 19 Nov 2018 06:48:48 +0000 (UTC) (envelope-from sgalabov@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CD7C01E8F7; Mon, 19 Nov 2018 06:48:48 +0000 (UTC) (envelope-from sgalabov@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAJ6mmv9031961; Mon, 19 Nov 2018 06:48:48 GMT (envelope-from sgalabov@FreeBSD.org) Received: (from sgalabov@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAJ6mmxN031960; Mon, 19 Nov 2018 06:48:48 GMT (envelope-from sgalabov@FreeBSD.org) Message-Id: <201811190648.wAJ6mmxN031960@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sgalabov set sender to sgalabov@FreeBSD.org using -f From: Stanislav Galabov Date: Mon, 19 Nov 2018 06:48:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340613 - head/sys/mips/mediatek X-SVN-Group: head X-SVN-Commit-Author: sgalabov X-SVN-Commit-Paths: head/sys/mips/mediatek X-SVN-Commit-Revision: 340613 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: F212685B54 X-Spamd-Result: default: False [0.73 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.59)[0.588,0]; NEURAL_SPAM_MEDIUM(0.14)[0.139,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Nov 2018 06:48:49 -0000 Author: sgalabov Date: Mon Nov 19 06:48:48 2018 New Revision: 340613 URL: https://svnweb.freebsd.org/changeset/base/340613 Log: Fix access to cpu_model[] in mtk_soc_set_cpu_model() There may be cases where cpu_model[] may not be 32bit aligned, so it is better to not try to access it as such in order to avoid unaligned access. Sponsored by: Smartcom - Bulgaria AD Modified: head/sys/mips/mediatek/mtk_soc.c Modified: head/sys/mips/mediatek/mtk_soc.c ============================================================================== --- head/sys/mips/mediatek/mtk_soc.c Mon Nov 19 06:39:00 2018 (r340612) +++ head/sys/mips/mediatek/mtk_soc.c Mon Nov 19 06:48:48 2018 (r340613) @@ -401,7 +401,9 @@ extern char cpu_model[]; void mtk_soc_set_cpu_model(void) { - uint32_t *p_model = (uint32_t *)cpu_model; + int idx, offset = sizeof(mtk_soc_chipid0_3); + char *chipid0_3 = (char *)(&mtk_soc_chipid0_3); + char *chipid4_7 = (char *)(&mtk_soc_chipid4_7); /* * CHIPID is always 2x32 bit registers, containing the ASCII @@ -411,11 +413,13 @@ mtk_soc_set_cpu_model(void) * it is left at its default value of "unknown " if it could not be * obtained for some reason. */ - p_model[0] = mtk_soc_chipid0_3; - p_model[1] = mtk_soc_chipid4_7; + for (idx = 0; idx < offset; idx++) { + cpu_model[idx] = chipid0_3[idx]; + cpu_model[idx + offset] = chipid4_7[idx]; + } /* Null-terminate the string */ - cpu_model[8] = 0; + cpu_model[2 * offset] = 0; } uint32_t From owner-svn-src-all@freebsd.org Mon Nov 19 06:49:31 2018 Return-Path: Delivered-To: svn-src-all@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 7FBAE113671F; Mon, 19 Nov 2018 06:49:31 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2434685C74; Mon, 19 Nov 2018 06:49:31 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 04BA41E8F8; Mon, 19 Nov 2018 06:49:31 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAJ6nUsC032033; Mon, 19 Nov 2018 06:49:30 GMT (envelope-from eugen@FreeBSD.org) Received: (from eugen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAJ6nUm9032032; Mon, 19 Nov 2018 06:49:30 GMT (envelope-from eugen@FreeBSD.org) Message-Id: <201811190649.wAJ6nUm9032032@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eugen set sender to eugen@FreeBSD.org using -f From: Eugene Grosbein Date: Mon, 19 Nov 2018 06:49:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r340614 - stable/12/libexec/rc X-SVN-Group: stable-12 X-SVN-Commit-Author: eugen X-SVN-Commit-Paths: stable/12/libexec/rc X-SVN-Commit-Revision: 340614 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 2434685C74 X-Spamd-Result: default: False [0.64 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.52)[0.522,0]; NEURAL_SPAM_MEDIUM(0.12)[0.116,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Nov 2018 06:49:31 -0000 Author: eugen Date: Mon Nov 19 06:49:30 2018 New Revision: 340614 URL: https://svnweb.freebsd.org/changeset/base/340614 Log: MFC r339472: rc.initdiskless: fix commentary grammar after r339465 Modified: stable/12/libexec/rc/rc.initdiskless Directory Properties: stable/12/ (props changed) Modified: stable/12/libexec/rc/rc.initdiskless ============================================================================== --- stable/12/libexec/rc/rc.initdiskless Mon Nov 19 06:48:48 2018 (r340613) +++ stable/12/libexec/rc/rc.initdiskless Mon Nov 19 06:49:30 2018 (r340614) @@ -115,7 +115,7 @@ # This is alternative to SUBDIR.cpio.gz and remount. # Similar to remount case, a memory filesystem is created # for /M and initialized from a template but no mounting -# performed. Instead, this file is run passing /M as singe +# performed. Instead, this file is run passing /M as single # argument. It is expected to extract template override to /M # using auxiliary storage found in some embedded systems # having NVRAM too small to hold mountable file system. From owner-svn-src-all@freebsd.org Mon Nov 19 06:51:25 2018 Return-Path: Delivered-To: svn-src-all@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 A28371136914; Mon, 19 Nov 2018 06:51:25 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4425B85EB9; Mon, 19 Nov 2018 06:51:25 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 251D31EA37; Mon, 19 Nov 2018 06:51:25 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAJ6pPGU033891; Mon, 19 Nov 2018 06:51:25 GMT (envelope-from eugen@FreeBSD.org) Received: (from eugen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAJ6pPu3033890; Mon, 19 Nov 2018 06:51:25 GMT (envelope-from eugen@FreeBSD.org) Message-Id: <201811190651.wAJ6pPu3033890@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eugen set sender to eugen@FreeBSD.org using -f From: Eugene Grosbein Date: Mon, 19 Nov 2018 06:51:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r340615 - stable/11/etc X-SVN-Group: stable-11 X-SVN-Commit-Author: eugen X-SVN-Commit-Paths: stable/11/etc X-SVN-Commit-Revision: 340615 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4425B85EB9 X-Spamd-Result: default: False [0.64 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_MEDIUM(0.12)[0.116,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.52)[0.522,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Nov 2018 06:51:25 -0000 Author: eugen Date: Mon Nov 19 06:51:24 2018 New Revision: 340615 URL: https://svnweb.freebsd.org/changeset/base/340615 Log: MFC r339472: rc.initdiskless: fix commentary grammar after r339465 Modified: stable/11/etc/rc.initdiskless Directory Properties: stable/11/ (props changed) Modified: stable/11/etc/rc.initdiskless ============================================================================== --- stable/11/etc/rc.initdiskless Mon Nov 19 06:49:30 2018 (r340614) +++ stable/11/etc/rc.initdiskless Mon Nov 19 06:51:24 2018 (r340615) @@ -115,7 +115,7 @@ # This is alternative to SUBDIR.cpio.gz and remount. # Similar to remount case, a memory filesystem is created # for /M and initialized from a template but no mounting -# performed. Instead, this file is run passing /M as singe +# performed. Instead, this file is run passing /M as single # argument. It is expected to extract template override to /M # using auxiliary storage found in some embedded systems # having NVRAM too small to hold mountable file system. From owner-svn-src-all@freebsd.org Mon Nov 19 06:52:21 2018 Return-Path: Delivered-To: svn-src-all@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 02DCF1136996; Mon, 19 Nov 2018 06:52:21 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9B819861B2; Mon, 19 Nov 2018 06:52:20 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7E4421EA84; Mon, 19 Nov 2018 06:52:20 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAJ6qK02036905; Mon, 19 Nov 2018 06:52:20 GMT (envelope-from eugen@FreeBSD.org) Received: (from eugen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAJ6qKRD036904; Mon, 19 Nov 2018 06:52:20 GMT (envelope-from eugen@FreeBSD.org) Message-Id: <201811190652.wAJ6qKRD036904@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eugen set sender to eugen@FreeBSD.org using -f From: Eugene Grosbein Date: Mon, 19 Nov 2018 06:52:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r340616 - stable/10/etc X-SVN-Group: stable-10 X-SVN-Commit-Author: eugen X-SVN-Commit-Paths: stable/10/etc X-SVN-Commit-Revision: 340616 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 9B819861B2 X-Spamd-Result: default: False [0.64 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_MEDIUM(0.12)[0.116,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.52)[0.522,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Nov 2018 06:52:21 -0000 Author: eugen Date: Mon Nov 19 06:52:20 2018 New Revision: 340616 URL: https://svnweb.freebsd.org/changeset/base/340616 Log: MFC r339472: rc.initdiskless: fix commentary grammar after r339465 Modified: stable/10/etc/rc.initdiskless Directory Properties: stable/10/ (props changed) Modified: stable/10/etc/rc.initdiskless ============================================================================== --- stable/10/etc/rc.initdiskless Mon Nov 19 06:51:24 2018 (r340615) +++ stable/10/etc/rc.initdiskless Mon Nov 19 06:52:20 2018 (r340616) @@ -115,7 +115,7 @@ # This is alternative to SUBDIR.cpio.gz and remount. # Similar to remount case, a memory filesystem is created # for /M and initialized from a template but no mounting -# performed. Instead, this file is run passing /M as singe +# performed. Instead, this file is run passing /M as single # argument. It is expected to extract template override to /M # using auxiliary storage found in some embedded systems # having NVRAM too small to hold mountable file system. From owner-svn-src-all@freebsd.org Mon Nov 19 07:27:52 2018 Return-Path: Delivered-To: svn-src-all@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 0032611372D3; Mon, 19 Nov 2018 07:27:51 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 96CEC86E2E; Mon, 19 Nov 2018 07:27:51 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 756251EF6D; Mon, 19 Nov 2018 07:27:51 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAJ7Rpgf052166; Mon, 19 Nov 2018 07:27:51 GMT (envelope-from eugen@FreeBSD.org) Received: (from eugen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAJ7RpDN052165; Mon, 19 Nov 2018 07:27:51 GMT (envelope-from eugen@FreeBSD.org) Message-Id: <201811190727.wAJ7RpDN052165@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eugen set sender to eugen@FreeBSD.org using -f From: Eugene Grosbein Date: Mon, 19 Nov 2018 07:27:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340617 - head/sys/netgraph X-SVN-Group: head X-SVN-Commit-Author: eugen X-SVN-Commit-Paths: head/sys/netgraph X-SVN-Commit-Revision: 340617 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 96CEC86E2E X-Spamd-Result: default: False [0.47 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.33)[0.329,0]; NEURAL_SPAM_MEDIUM(0.14)[0.139,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Nov 2018 07:27:52 -0000 Author: eugen Date: Mon Nov 19 07:27:50 2018 New Revision: 340617 URL: https://svnweb.freebsd.org/changeset/base/340617 Log: Unbreak ng_source(4) for 64-bit platforms including amd64. Modified: head/sys/netgraph/ng_source.c Modified: head/sys/netgraph/ng_source.c ============================================================================== --- head/sys/netgraph/ng_source.c Mon Nov 19 06:52:20 2018 (r340616) +++ head/sys/netgraph/ng_source.c Mon Nov 19 07:27:50 2018 (r340617) @@ -125,8 +125,13 @@ static int ng_source_dup_mod(sc_p, struct mbuf *, /* Parse type for timeval */ static const struct ng_parse_struct_field ng_source_timeval_type_fields[] = { +#ifdef __LP64__ + { "tv_sec", &ng_parse_int64_type }, + { "tv_usec", &ng_parse_int64_type }, +#else { "tv_sec", &ng_parse_int32_type }, { "tv_usec", &ng_parse_int32_type }, +#endif { NULL } }; const struct ng_parse_type ng_source_timeval_type = { From owner-svn-src-all@freebsd.org Mon Nov 19 07:31:46 2018 Return-Path: Delivered-To: svn-src-all@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 CC4F911373DE; Mon, 19 Nov 2018 07:31:45 +0000 (UTC) (envelope-from agapon@gmail.com) Received: from mail-ed1-f41.google.com (mail-ed1-f41.google.com [209.85.208.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 13F408718D; Mon, 19 Nov 2018 07:31:45 +0000 (UTC) (envelope-from agapon@gmail.com) Received: by mail-ed1-f41.google.com with SMTP id j6so19454047edp.9; Sun, 18 Nov 2018 23:31:44 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:openpgp:autocrypt :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=MLv6W6Vq/EoR4anNW4+uR9siFfvN8Ds5v2tYxi2PyYE=; b=lk72UjbTNzAaGPYAzMcr7VseJigc3kU8ATF8XYR4VqB55AadCBnpgqzw3F4zVzBHkO f3riv+pR92jisqrpPx8OQ2lpdZlbx7edxpB2bAsDETG4CZbR2X15KzJvu2wX790dV3Cu cBCzn2IpFXZ8jAIrm4aiQzhzYHF0uWWBwbKBRVmNVhwI6eIuooIR1Job3xKz2qB4yM+V 9CyJ97Dsyw5JeeJq4GFWxS6OIAcmeUYb87rw9sutxqKN0G/RZgha385UXRndYU4ZbpKU RCCYUiyHCMdjbrWXfKjvvHugwk97ZIVdUj+pXYuKnOB7bpsIzS5hegphQcZou+mXU02d 3Qjw== X-Gm-Message-State: AGRZ1gKwDkYEntLHo+NYuOD8zRvV/G3HAjYIUNJ3wBMCqo/1irsTQIzd sly/X7ZPdiy5YsbSWr4qIZ+B0x01 X-Google-Smtp-Source: AJdET5eRQNgTbCUnGN1B6gfNYwe9UYKmoB7VHVLw4rL4ryxVjaU8obfno5QIHQlEla+HqhCz6OBsKA== X-Received: by 2002:a17:906:81cc:: with SMTP id e12-v6mr16254367ejx.138.1542612697903; Sun, 18 Nov 2018 23:31:37 -0800 (PST) Received: from [192.168.0.88] (east.meadow.volia.net. [93.72.151.96]) by smtp.googlemail.com with ESMTPSA id e26-v6sm3103655ejb.29.2018.11.18.23.31.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 18 Nov 2018 23:31:37 -0800 (PST) Subject: Re: svn commit: r340450 - head/sys/sys To: Warner Losh , "Rodney W. Grimes" Cc: Allan Jude , Warner Losh , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201811190104.wAJ14CaE059062@pdx.rh.CN85.dnsmgr.net> From: Andriy Gapon Openpgp: preference=signencrypt Autocrypt: addr=avg@FreeBSD.org; prefer-encrypt=mutual; keydata= xsFNBFm4LIgBEADNB/3lT7f15UKeQ52xCFQx/GqHkSxEdVyLFZTmY3KyNPQGBtyvVyBfprJ7 mAeXZWfhat6cKNRAGZcL5EmewdQuUfQfBdYmKjbw3a9GFDsDNuhDA2QwFt8BmkiVMRYyvI7l N0eVzszWCUgdc3qqM6qqcgBaqsVmJluwpvwp4ZBXmch5BgDDDb1MPO8AZ2QZfIQmplkj8Y6Z AiNMknkmgaekIINSJX8IzRzKD5WwMsin70psE8dpL/iBsA2cpJGzWMObVTtCxeDKlBCNqM1i gTXta1ukdUT7JgLEFZk9ceYQQMJJtUwzWu1UHfZn0Fs29HTqawfWPSZVbulbrnu5q55R4PlQ /xURkWQUTyDpqUvb4JK371zhepXiXDwrrpnyyZABm3SFLkk2bHlheeKU6Yql4pcmSVym1AS4 dV8y0oHAfdlSCF6tpOPf2+K9nW1CFA8b/tw4oJBTtfZ1kxXOMdyZU5fiG7xb1qDgpQKgHUX8 7Rd2T1UVLVeuhYlXNw2F+a2ucY+cMoqz3LtpksUiBppJhw099gEXehcN2JbUZ2TueJdt1FdS ztnZmsHUXLxrRBtGwqnFL7GSd6snpGIKuuL305iaOGODbb9c7ne1JqBbkw1wh8ci6vvwGlzx rexzimRaBzJxlkjNfMx8WpCvYebGMydNoeEtkWldtjTNVsUAtQARAQABzR5BbmRyaXkgR2Fw b24gPGF2Z0BGcmVlQlNELm9yZz7CwZQEEwEIAD4WIQS+LEO7ngQnXA4Bjr538m7TUc1yjwUC WbgsiAIbIwUJBaOagAULCQgHAgYVCAkKCwIEFgIDAQIeAQIXgAAKCRB38m7TUc1yj+JAEACV l9AK/nOWAt/9cufV2fRj0hdOqB1aCshtSrwHk/exXsDa4/FkmegxXQGY+3GWX3deIyesbVRL rYdtdK0dqJyT1SBqXK1h3/at9rxr9GQA6KWOxTjUFURsU7ok/6SIlm8uLRPNKO+yq0GDjgaO LzN+xykuBA0FlhQAXJnpZLcVfPJdWv7sSHGedL5ln8P8rxR+XnmsA5TUaaPcbhTB+mG+iKFj GghASDSfGqLWFPBlX/fpXikBDZ1gvOr8nyMY9nXhgfXpq3B6QCRYKPy58ChrZ5weeJZ29b7/ QdEO8NFNWHjSD9meiLdWQaqo9Y7uUxN3wySc/YUZxtS0bhAd8zJdNPsJYG8sXgKjeBQMVGuT eCAJFEYJqbwWvIXMfVWop4+O4xB+z2YE3jAbG/9tB/GSnQdVSj3G8MS80iLS58frnt+RSEw/ psahrfh0dh6SFHttE049xYiC+cM8J27Aaf0i9RflyITq57NuJm+AHJoU9SQUkIF0nc6lfA+o JRiyRlHZHKoRQkIg4aiKaZSWjQYRl5Txl0IZUP1dSWMX4s3XTMurC/pnja45dge/4ESOtJ9R 8XuIWg45Oq6MeIWdjKddGhRj3OohsltKgkEU3eLKYtB6qRTQypHHUawCXz88uYt5e3w4V16H lCpSTZV/EVHnNe45FVBlvK7k7HFfDDkryM7BTQRZuCyIARAAlq0slcsVboY/+IUJdcbEiJRW be9HKVz4SUchq0z9MZPX/0dcnvz/gkyYA+OuM78dNS7Mbby5dTvOqfpLJfCuhaNYOhlE0wY+ 1T6Tf1f4c/uA3U/YiadukQ3+6TJuYGAdRZD5EqYFIkreARTVWg87N9g0fT9BEqLw9lJtEGDY EWUE7L++B8o4uu3LQFEYxcrb4K/WKmgtmFcm77s0IKDrfcX4doV92QTIpLiRxcOmCC/OCYuO jB1oaaqXQzZrCutXRK0L5XN1Y1PYjIrEzHMIXmCDlLYnpFkK+itlXwlE2ZQxkfMruCWdQXye syl2fynAe8hvp7Mms9qU2r2K9EcJiR5N1t1C2/kTKNUhcRv7Yd/vwusK7BqJbhlng5ZgRx0m WxdntU/JLEntz3QBsBsWM9Y9wf2V4tLv6/DuDBta781RsCB/UrU2zNuOEkSixlUiHxw1dccI 6CVlaWkkJBxmHX22GdDFrcjvwMNIbbyfQLuBq6IOh8nvu9vuItup7qemDG3Ms6TVwA7BD3j+ 3fGprtyW8Fd/RR2bW2+LWkMrqHffAr6Y6V3h5kd2G9Q8ZWpEJk+LG6Mk3fhZhmCnHhDu6CwN MeUvxXDVO+fqc3JjFm5OxhmfVeJKrbCEUJyM8ESWLoNHLqjywdZga4Q7P12g8DUQ1mRxYg/L HgZY3zfKOqcAEQEAAcLBfAQYAQgAJhYhBL4sQ7ueBCdcDgGOvnfybtNRzXKPBQJZuCyIAhsM BQkFo5qAAAoJEHfybtNRzXKPBVwQAKfFy9P7N3OsLDMB56A4Kf+ZT+d5cIx0Yiaf4n6w7m3i ImHHHk9FIetI4Xe54a2IXh4Bq5UkAGY0667eIs+Z1Ea6I2i27Sdo7DxGwq09Qnm/Y65ADvXs 3aBvokCcm7FsM1wky395m8xUos1681oV5oxgqeRI8/76qy0hD9WR65UW+HQgZRIcIjSel9vR XDaD2HLGPTTGr7u4v00UeTMs6qvPsa2PJagogrKY8RXdFtXvweQFz78NbXhluwix2Tb9ETPk LIpDrtzV73CaE2aqBG/KrboXT2C67BgFtnk7T7Y7iKq4/XvEdDWscz2wws91BOXuMMd4c/c4 OmGW9m3RBLufFrOag1q5yUS9QbFfyqL6dftJP3Zq/xe+mr7sbWbhPVCQFrH3r26mpmy841ym dwQnNcsbIGiBASBSKksOvIDYKa2Wy8htPmWFTEOPRpFXdGQ27awcjjnB42nngyCK5ukZDHi6 w0qK5DNQQCkiweevCIC6wc3p67jl1EMFY5+z+zdTPb3h7LeVnGqW0qBQl99vVFgzLxchKcl0 R/paSFgwqXCZhAKMuUHncJuynDOP7z5LirUeFI8qsBAJi1rXpQoLJTVcW72swZ42IdPiboqx NbTMiNOiE36GqMcTPfKylCbF45JNX4nF9ElM0E+Y8gi4cizJYBRr2FBJgay0b9Cp Message-ID: <5e227743-6463-d395-f2ba-da8d4ba248ca@FreeBSD.org> Date: Mon, 19 Nov 2018 09:31:34 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 13F408718D X-Spamd-Result: default: False [-3.04 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; NEURAL_HAM_MEDIUM(-0.99)[-0.993,0]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17]; MIME_GOOD(-0.10)[text/plain]; RCVD_TLS_LAST(0.00)[]; DMARC_NA(0.00)[FreeBSD.org]; RCVD_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; MX_GOOD(-0.01)[cached: alt3.gmail-smtp-in.l.google.com]; NEURAL_HAM_SHORT(-0.97)[-0.974,0]; RCVD_IN_DNSWL_NONE(0.00)[41.208.85.209.list.dnswl.org : 127.0.5.0]; RCPT_COUNT_SEVEN(0.00)[7]; IP_SCORE(-1.06)[ipnet: 209.85.128.0/17(-3.51), asn: 15169(-1.71), country: US(-0.09)]; FORGED_SENDER(0.30)[avg@FreeBSD.org,agapon@gmail.com]; RWL_MAILSPIKE_POSSIBLE(0.00)[41.208.85.209.rep.mailspike.net : 127.0.0.17]; R_DKIM_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; FROM_NEQ_ENVFROM(0.00)[avg@FreeBSD.org,agapon@gmail.com]; MID_RHS_MATCH_FROM(0.00)[] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Nov 2018 07:31:46 -0000 On 19/11/2018 03:38, Warner Losh wrote: > I'll talk to Allan to see if he can test that. the bare 1 should be handled > properly because of C's promotion rules. 1ull << 32 is an unsigned long long. > What I really wanted was "~(uint32_t)0" but that construct has bit me in the past. I think that you could just do (unsigned int)-1 or UINT_MAX. As a side note, I wonder if those functions are ever used on negative values, given the type of the argument, and if anyone checked their correctness in that case. -- Andriy Gapon From owner-svn-src-all@freebsd.org Mon Nov 19 07:53:40 2018 Return-Path: Delivered-To: svn-src-all@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 1B5681137DFA for ; Mon, 19 Nov 2018 07:53:40 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-it1-x135.google.com (mail-it1-x135.google.com [IPv6:2607:f8b0:4864:20::135]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0D9B86A07D for ; Mon, 19 Nov 2018 07:53:39 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-it1-x135.google.com with SMTP id o19so6815545itg.5 for ; Sun, 18 Nov 2018 23:53:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=SRcFAQiEIPYSgeWigGLjI07QJmtsb6Cx4hSzo8mHQqs=; b=bdTTfiOtJLLfR80cqGx2Cq1t0gTdSW7VWzW1nHzP6JGuCgkhzvrs8Kl3xxlqx9+ZFA 3I8UeqkKBE5BOE2QEyQXSCu3OMQ2RVvVZKypR8p8GEKfPPl5tuMcvkf85l/kei+jO1/j PELcsx5UOfRuxS5jtjPrWznKekl14fYYELr64SWsw6V5YO7vN5LerLiUBswaVKjt2x00 HKaS9Z1oriEaUYwnfSgQl86XKj2X/voBzB5TtUshEhVGKZkzKMfYh+ZKRYXl+aDx4zxq pLTFF0eju1SqIlo2OWubKePzELvB8R0FjzFw7/A8W609OZnE2m4BO/oNrPUHxqtwmZ+G NYCg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=SRcFAQiEIPYSgeWigGLjI07QJmtsb6Cx4hSzo8mHQqs=; b=ZmqMqFuKtHoDHKdxUwbLpJ+N+VC9wYmKfLnZJJ2G0rL9IDdbZqkXhjYXNZDDWnVbYm it5SoznPZES0h4784irEavZ/ESuFMBfzzCDo/kiJFhwUwqJpA2XEWhvov84219WObMWz FjK3oWovqxZuosZum+3oQRh4REyCntq2yTVOWkNta9h0OR28kWnbyJmypjUgQxc2ACOQ 00PGCQ8VqJ8e/K4V3RX6Oljl7X7C92Oytx9jzDFXqA18w8gCDVp4x4KLTjbFTVntyCFu BDEd9XAd0sWzcK9o2ReSWalBdwwg2Zuh18O4O74sgNP9Irsw+TaVMRfzktb1s+c80Cg1 +uHg== X-Gm-Message-State: AGRZ1gJuzSmIRcUY2flHTIhVfQp4y1/E8XOwblXDqPuSQsGVIMXDDxcF F8XYR7tETGXl8bNYzrpvNolAsmrANruJtfmq/Eif7A== X-Google-Smtp-Source: AJdET5deYEpRCnoH7aU/8qRDsAVwKdmx0mfeQ2NvrqU1QI6uheg3oMq3ARwIJ6gF/rSXjlQz6RJa+1uMNu+4l0NT2lY= X-Received: by 2002:a24:4fcb:: with SMTP id c194mr7234019itb.47.1542614018232; Sun, 18 Nov 2018 23:53:38 -0800 (PST) MIME-Version: 1.0 References: <201811190104.wAJ14CaE059062@pdx.rh.CN85.dnsmgr.net> <5e227743-6463-d395-f2ba-da8d4ba248ca@FreeBSD.org> In-Reply-To: <5e227743-6463-d395-f2ba-da8d4ba248ca@FreeBSD.org> From: Warner Losh Date: Mon, 19 Nov 2018 00:53:27 -0700 Message-ID: Subject: Re: svn commit: r340450 - head/sys/sys To: Andriy Gapon Cc: "Rodney W. Grimes" , Allan Jude , Warner Losh , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org X-Rspamd-Queue-Id: 0D9B86A07D X-Spamd-Result: default: False [-4.27 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.99)[-0.992,0]; R_DKIM_ALLOW(-0.20)[bsdimp-com.20150623.gappssmtp.com]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; NEURAL_HAM_SHORT(-0.99)[-0.991,0]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[svn-src-all@freebsd.org]; DMARC_NA(0.00)[bsdimp.com]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[bsdimp-com.20150623.gappssmtp.com:+]; MX_GOOD(-0.01)[cached: ALT1.aspmx.l.google.com]; RCPT_COUNT_SEVEN(0.00)[7]; RCVD_IN_DNSWL_NONE(0.00)[5.3.1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.0]; R_SPF_NA(0.00)[]; FORGED_SENDER(0.30)[imp@bsdimp.com,wlosh@bsdimp.com]; RCVD_TLS_LAST(0.00)[]; IP_SCORE(-2.28)[ip: (-7.05), ipnet: 2607:f8b0::/32(-2.53), asn: 15169(-1.71), country: US(-0.09)]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; FROM_NEQ_ENVFROM(0.00)[imp@bsdimp.com,wlosh@bsdimp.com]; RCVD_COUNT_TWO(0.00)[2] X-Rspamd-Server: mx1.freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Nov 2018 07:53:40 -0000 On Mon, Nov 19, 2018 at 12:31 AM Andriy Gapon wrote: > On 19/11/2018 03:38, Warner Losh wrote: > > I'll talk to Allan to see if he can test that. the bare 1 should be > handled > > properly because of C's promotion rules. 1ull << 32 is an unsigned long > long. > > What I really wanted was "~(uint32_t)0" but that construct has bit me in > the past. > > I think that you could just do (unsigned int)-1 or UINT_MAX. > Perhaps. > As a side note, I wonder if those functions are ever used on negative > values, > given the type of the argument, and if anyone checked their correctness in > that > case. > I don't think so, but an assert would be good to make sure. But I think I understand the problem now. mstosbt(1000) is overflowing with my change, but not without because we're adding 2^32 to a number that's ~900 away from overflowing changing a very large sleep of 1 second to a tiny sleep of 0 (which is 1ms at the default Hz). I think we get this in the mlx code because there's a msleep(1000) in at least one place. msleep(1001) would have failed before my change. Now I think msleep(999) works, but msleep(1000) fails. Since the code is waiting a second for hardware to initialize, a 1ms instead is likely to catch the hardware before it's finished. I think this will cause problems no matter cold or not, since it's all pause_sbt() under the covers and a delay of 0 is still 0 either way. The fix I think is something like: diff --git a/sys/sys/time.h b/sys/sys/time.h index 2207767813f2..00c6bb4a20fb 100644 --- a/sys/sys/time.h +++ b/sys/sys/time.h @@ -204,8 +204,12 @@ sbttoms(sbintime_t _sbt) static __inline sbintime_t mstosbt(int64_t _ms) { + sbintime_t sb; - return ((_ms * (((uint64_t)1 << 63) / 500) + (1ull << 32) - 1) >> 32); + sb = (_ms / 1000) * SBT_1S; + _ms = _ms % 1000; + sb += (_ms * (((uint64_t)1 << 42) / 1000) + 1023) >> 10; + return (sb); } /*- so we add the whole number of seconds first, then with the remainder we do the math so we have enough precision to represent 1000 correctly. This lets us then do the math with plenty of bits to spare. I need to reevaluate this in the morning when I'm not so tired. It might be safe to not do the whole seconds first, and I might need 11 bits instead of 10 to be safe, so I'll hold off committing until I can probe the edge cases more thoroughly. I thought long and hard about the tiny part of the edge case and never stopped to think about what 1000ms would do... Warner From owner-svn-src-all@freebsd.org Mon Nov 19 08:53:54 2018 Return-Path: Delivered-To: svn-src-all@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 B1315113951A; Mon, 19 Nov 2018 08:53:54 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.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 5FF0C6C0F9; Mon, 19 Nov 2018 08:53:54 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 364011FE00; Mon, 19 Nov 2018 08:53:54 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAJ8rsTh097672; Mon, 19 Nov 2018 08:53:54 GMT (envelope-from vmaffione@FreeBSD.org) Received: (from vmaffione@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAJ8rqgB097664; Mon, 19 Nov 2018 08:53:52 GMT (envelope-from vmaffione@FreeBSD.org) Message-Id: <201811190853.wAJ8rqgB097664@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vmaffione set sender to vmaffione@FreeBSD.org using -f From: Vincenzo Maffione Date: Mon, 19 Nov 2018 08:53:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r340618 - in stable/12: share/man/man4 tools/tools/netmap X-SVN-Group: stable-12 X-SVN-Commit-Author: vmaffione X-SVN-Commit-Paths: in stable/12: share/man/man4 tools/tools/netmap X-SVN-Commit-Revision: 340618 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 5FF0C6C0F9 X-Spamd-Result: default: False [0.44 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_MEDIUM(0.15)[0.148,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.29)[0.290,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Nov 2018 08:53:55 -0000 Author: vmaffione Date: Mon Nov 19 08:53:52 2018 New Revision: 340618 URL: https://svnweb.freebsd.org/changeset/base/340618 Log: MFC r340279 netmap: add load balancer program Add the lb program, which is able to load-balance input traffic received from a netmap port over M groups, with N netmap pipes in each group. Each received packet is forwarded to one of the pipes chosen from each group (using an L3/L4 connection-consistent hash function). This also adds a man page for lb and some cross-references in related man pages. Differential Revision: https://reviews.freebsd.org/D17735 Added: stable/12/tools/tools/netmap/lb.8 - copied unchanged from r340279, head/tools/tools/netmap/lb.8 stable/12/tools/tools/netmap/lb.c - copied unchanged from r340279, head/tools/tools/netmap/lb.c stable/12/tools/tools/netmap/pkt_hash.c - copied unchanged from r340279, head/tools/tools/netmap/pkt_hash.c stable/12/tools/tools/netmap/pkt_hash.h - copied unchanged from r340279, head/tools/tools/netmap/pkt_hash.h Modified: stable/12/share/man/man4/netmap.4 stable/12/tools/tools/netmap/Makefile stable/12/tools/tools/netmap/README stable/12/tools/tools/netmap/bridge.8 stable/12/tools/tools/netmap/ctrs.h Directory Properties: stable/12/ (props changed) Modified: stable/12/share/man/man4/netmap.4 ============================================================================== --- stable/12/share/man/man4/netmap.4 Mon Nov 19 07:27:50 2018 (r340617) +++ stable/12/share/man/man4/netmap.4 Mon Nov 19 08:53:52 2018 (r340618) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 23, 2018 +.Dd October 28, 2018 .Dt NETMAP 4 .Os .Sh NAME @@ -1073,8 +1073,11 @@ Other clients attached to the same switch can now communicate with the network card or the host. .Sh SEE ALSO -.Xr pkt-gen 8 , -.Xr bridge 8 +.Xr vale 4 , +.Xr vale-ctl 4 , +.Xr bridge 8 , +.Xr lb 8 , +.Xr pkt-gen 8 .Pp .Pa http://info.iet.unipi.it/~luigi/netmap/ .Pp Modified: stable/12/tools/tools/netmap/Makefile ============================================================================== --- stable/12/tools/tools/netmap/Makefile Mon Nov 19 07:27:50 2018 (r340617) +++ stable/12/tools/tools/netmap/Makefile Mon Nov 19 08:53:52 2018 (r340618) @@ -3,7 +3,7 @@ # # For multiple programs using a single source file each, # we can just define 'progs' and create custom targets. -PROGS = pkt-gen nmreplay bridge vale-ctl +PROGS = pkt-gen nmreplay bridge vale-ctl lb CLEANFILES = $(PROGS) *.o MAN= @@ -34,3 +34,6 @@ nmreplay: nmreplay.o vale-ctl: vale-ctl.o $(CC) $(CFLAGS) -o vale-ctl vale-ctl.o + +lb: lb.o pkt_hash.o + $(CC) $(CFLAGS) -o lb lb.o pkt_hash.o $(LDFLAGS) Modified: stable/12/tools/tools/netmap/README ============================================================================== --- stable/12/tools/tools/netmap/README Mon Nov 19 07:27:50 2018 (r340617) +++ stable/12/tools/tools/netmap/README Mon Nov 19 08:53:52 2018 (r340618) @@ -1,9 +1,13 @@ $FreeBSD$ -This directory contains examples that use netmap +This directory contains applications that use the netmap API - pkt-gen a packet sink/source using the netmap API + pkt-gen a multi-function packet generator and traffic sink - bridge a two-port jumper wire, also using the native API + bridge a two-port jumper wire, also using the netmap API - vale-ctl the program to control VALE bridges + vale-ctl the program to control and inspect VALE switches + + lb an L3/L4 load balancer + + nmreplay a tool to playback a pcap file to a netmap port Modified: stable/12/tools/tools/netmap/bridge.8 ============================================================================== --- stable/12/tools/tools/netmap/bridge.8 Mon Nov 19 07:27:50 2018 (r340617) +++ stable/12/tools/tools/netmap/bridge.8 Mon Nov 19 08:53:52 2018 (r340618) @@ -23,7 +23,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 23, 2018 +.Dd October 28, 2018 .Dt BRIDGE 8 .Os .Sh NAME @@ -71,7 +71,8 @@ Disable zero-copy mode. .El .Sh SEE ALSO .Xr netmap 4 , -.Xr pkt-gen 8 +.Xr pkt-gen 8 , +.Xr lb 8 .Sh AUTHORS .An -nosplit .Nm Modified: stable/12/tools/tools/netmap/ctrs.h ============================================================================== --- stable/12/tools/tools/netmap/ctrs.h Mon Nov 19 07:27:50 2018 (r340617) +++ stable/12/tools/tools/netmap/ctrs.h Mon Nov 19 08:53:52 2018 (r340618) @@ -7,30 +7,37 @@ /* counters to accumulate statistics */ struct my_ctrs { - uint64_t pkts, bytes, events, drop; + uint64_t pkts, bytes, events; + uint64_t drop, drop_bytes; uint64_t min_space; struct timeval t; + uint32_t oq_n; /* number of elements in overflow queue (used in lb) */ }; /* very crude code to print a number in normalized form. * Caller has to make sure that the buffer is large enough. */ static const char * -norm2(char *buf, double val, char *fmt) +norm2(char *buf, double val, char *fmt, int normalize) { char *units[] = { "", "K", "M", "G", "T" }; u_int i; - - for (i = 0; val >=1000 && i < sizeof(units)/sizeof(char *) - 1; i++) - val /= 1000; + if (normalize) + for (i = 0; val >=1000 && i < sizeof(units)/sizeof(char *) - 1; i++) + val /= 1000; + else + i=0; sprintf(buf, fmt, val, units[i]); return buf; } static __inline const char * -norm(char *buf, double val) +norm(char *buf, double val, int normalize) { - return norm2(buf, val, "%.3f %s"); + if (normalize) + return norm2(buf, val, "%.3f %s", normalize); + else + return norm2(buf, val, "%.0f %s", normalize); } static __inline int @@ -89,7 +96,7 @@ timespec_sub(struct timespec a, struct timespec b) return ret; } -static uint64_t +static __inline uint64_t wait_for_next_report(struct timeval *prev, struct timeval *cur, int report_interval) { @@ -106,3 +113,4 @@ wait_for_next_report(struct timeval *prev, struct time return delta.tv_sec* 1000000 + delta.tv_usec; } #endif /* CTRS_H_ */ + Copied: stable/12/tools/tools/netmap/lb.8 (from r340279, head/tools/tools/netmap/lb.8) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/12/tools/tools/netmap/lb.8 Mon Nov 19 08:53:52 2018 (r340618, copy of r340279, head/tools/tools/netmap/lb.8) @@ -0,0 +1,130 @@ +.\" Copyright (c) 2017 Corelight, Inc. and Universita` di Pisa +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd October 28, 2018 +.Dt LB 8 +.Os +.Sh NAME +.Nm lb +.Nd netmap-based load balancer +.Sh SYNOPSIS +.Bk -words +.Bl -tag -width "lb" +.It Nm +.Op Fl i Ar port +.Op Fl p Ar pipe-group +.Op Fl B Ar extra-buffers +.Op Fl b Ar batch-size +.Op Fl w Ar wait-link +.El +.Ek +.Sh DESCRIPTION +.Nm +reads packets from an input netmap port and sends them to a number of netmap pipes, +trying to balance the packets received by each pipe. +Packets belonging to the +same connection will always be sent to the same pipe. +.Pp +Command line options are listed below. +.Bl -tag -width Ds +.It Fl i Ar port +Name of a netmap port. +It must be supplied exactly once to identify +the input port. +Any netmap port type (e.g., physical interface, VALE switch, pipe, +monitor port) can be used. +.It Fl p Ar name Ns Cm \&: Ns Ar number | number +Add a new pipe group of the given number of pipes. +The pipe group will receive all the packets read from the input port, balanced +among the available pipes. +The receiving ends of the pipes +will be called +.Dq Ar name Ns Em }0 +to +.Dq Ar name No Ns Em } Ns Aq Ar number No - 1 . +The name is optional and defaults to +the name of the input port (stripped down of any netmap operator). +If the name is omitted, also the colon can be omitted. +.Pp +This option can be supplied multiple times to define a sequence of pipe groups, +each group receiving all the packets in turn. +.Pp +If no +.Fl p +option is given, a single group of two pipes with default name is assumed. +.Pp +It is allowed to use the same name for several groups. +The pipe numbering in each +group will start from were the previous identically-named group had left. +.It Fl B Ar extra-buffers +Try to reserve the given number of extra buffers. +Extra buffers are shared among +all pipes in all groups and work as an extension of the pipe rings. +If a pipe ring is full for whatever reason, +.Nm +tries to use extra buffers before dropping any packets directed to that pipe. +.Pp +If all extra buffers are busy, some are stolen from the pipe with the longest +backlog. +This gives preference to newer packets over old ones, and prevents a +stalled pipe to deplete the pool of extra buffers. +.It Fl b Ar batch-size +Maximum number of packets processed between two read operations from the input port. +Higher values of batch-size improve performance by amortizing read operations, +but increase the risk of filling up the port internal queues. +.It Fl w Ar wait-link +indicates the number of seconds to wait before transmitting. +It defaults to 2, and may be useful when talking to physical +ports to let link negotiation complete before starting transmission. +.El +.Sh LIMITATIONS +The group chaining assumes that the applications on the receiving end of the +pipes are read-only: they must not modify the buffers or the pipe ring slots +in any way. +.Pp +The group naming is currently implemented by creating a persistent VALE port +with the given name. +If +.Nm +does not exit cleanly the ports will not be removed. +Please use +.Xr vale-ctl 4 +to remove any stale persistent VALE port. +.Sh SEE ALSO +.Xr netmap 4 , +.Xr bridge 8 , +.Xr pkt-gen 8 +.Pp +.Pa http://info.iet.unipi.it/~luigi/netmap/ +.Sh AUTHORS +.An -nosplit +.Nm +has been written by +.An Seth Hall +at Corelight, USA. +The facilities related to extra buffers and pipe groups have been added by +.An Giuseppe Lettieri +at University of Pisa, Italy, under contract by Corelight, USA. Copied: stable/12/tools/tools/netmap/lb.c (from r340279, head/tools/tools/netmap/lb.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/12/tools/tools/netmap/lb.c Mon Nov 19 08:53:52 2018 (r340618, copy of r340279, head/tools/tools/netmap/lb.c) @@ -0,0 +1,1027 @@ +/* + * Copyright (C) 2017 Corelight, Inc. and Universita` di Pisa. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ +/* $FreeBSD$ */ +#include +#include +#include +#include +#include +#include + +#define NETMAP_WITH_LIBS +#include +#include + +#include /* htonl */ + +#include + +#include "pkt_hash.h" +#include "ctrs.h" + + +/* + * use our version of header structs, rather than bringing in a ton + * of platform specific ones + */ +#ifndef ETH_ALEN +#define ETH_ALEN 6 +#endif + +struct compact_eth_hdr { + unsigned char h_dest[ETH_ALEN]; + unsigned char h_source[ETH_ALEN]; + u_int16_t h_proto; +}; + +struct compact_ip_hdr { + u_int8_t ihl:4, version:4; + u_int8_t tos; + u_int16_t tot_len; + u_int16_t id; + u_int16_t frag_off; + u_int8_t ttl; + u_int8_t protocol; + u_int16_t check; + u_int32_t saddr; + u_int32_t daddr; +}; + +struct compact_ipv6_hdr { + u_int8_t priority:4, version:4; + u_int8_t flow_lbl[3]; + u_int16_t payload_len; + u_int8_t nexthdr; + u_int8_t hop_limit; + struct in6_addr saddr; + struct in6_addr daddr; +}; + +#define MAX_IFNAMELEN 64 +#define MAX_PORTNAMELEN (MAX_IFNAMELEN + 40) +#define DEF_OUT_PIPES 2 +#define DEF_EXTRA_BUFS 0 +#define DEF_BATCH 2048 +#define DEF_WAIT_LINK 2 +#define DEF_STATS_INT 600 +#define BUF_REVOKE 100 +#define STAT_MSG_MAXSIZE 1024 + +struct { + char ifname[MAX_IFNAMELEN]; + char base_name[MAX_IFNAMELEN]; + int netmap_fd; + uint16_t output_rings; + uint16_t num_groups; + uint32_t extra_bufs; + uint16_t batch; + int stdout_interval; + int syslog_interval; + int wait_link; + bool busy_wait; +} glob_arg; + +/* + * the overflow queue is a circular queue of buffers + */ +struct overflow_queue { + char name[MAX_IFNAMELEN + 16]; + struct netmap_slot *slots; + uint32_t head; + uint32_t tail; + uint32_t n; + uint32_t size; +}; + +struct overflow_queue *freeq; + +static inline int +oq_full(struct overflow_queue *q) +{ + return q->n >= q->size; +} + +static inline int +oq_empty(struct overflow_queue *q) +{ + return q->n <= 0; +} + +static inline void +oq_enq(struct overflow_queue *q, const struct netmap_slot *s) +{ + if (unlikely(oq_full(q))) { + D("%s: queue full!", q->name); + abort(); + } + q->slots[q->tail] = *s; + q->n++; + q->tail++; + if (q->tail >= q->size) + q->tail = 0; +} + +static inline struct netmap_slot +oq_deq(struct overflow_queue *q) +{ + struct netmap_slot s = q->slots[q->head]; + if (unlikely(oq_empty(q))) { + D("%s: queue empty!", q->name); + abort(); + } + q->n--; + q->head++; + if (q->head >= q->size) + q->head = 0; + return s; +} + +static volatile int do_abort = 0; + +uint64_t dropped = 0; +uint64_t forwarded = 0; +uint64_t received_bytes = 0; +uint64_t received_pkts = 0; +uint64_t non_ip = 0; +uint32_t freeq_n = 0; + +struct port_des { + char interface[MAX_PORTNAMELEN]; + struct my_ctrs ctr; + unsigned int last_sync; + uint32_t last_tail; + struct overflow_queue *oq; + struct nm_desc *nmd; + struct netmap_ring *ring; + struct group_des *group; +}; + +struct port_des *ports; + +/* each group of pipes receives all the packets */ +struct group_des { + char pipename[MAX_IFNAMELEN]; + struct port_des *ports; + int first_id; + int nports; + int last; + int custom_port; +}; + +struct group_des *groups; + +/* statistcs */ +struct counters { + struct timeval ts; + struct my_ctrs *ctrs; + uint64_t received_pkts; + uint64_t received_bytes; + uint64_t non_ip; + uint32_t freeq_n; + int status __attribute__((aligned(64))); +#define COUNTERS_EMPTY 0 +#define COUNTERS_FULL 1 +}; + +struct counters counters_buf; + +static void * +print_stats(void *arg) +{ + int npipes = glob_arg.output_rings; + int sys_int = 0; + (void)arg; + struct my_ctrs cur, prev; + struct my_ctrs *pipe_prev; + + pipe_prev = calloc(npipes, sizeof(struct my_ctrs)); + if (pipe_prev == NULL) { + D("out of memory"); + exit(1); + } + + char stat_msg[STAT_MSG_MAXSIZE] = ""; + + memset(&prev, 0, sizeof(prev)); + while (!do_abort) { + int j, dosyslog = 0, dostdout = 0, newdata; + uint64_t pps = 0, dps = 0, bps = 0, dbps = 0, usec = 0; + struct my_ctrs x; + + counters_buf.status = COUNTERS_EMPTY; + newdata = 0; + memset(&cur, 0, sizeof(cur)); + sleep(1); + if (counters_buf.status == COUNTERS_FULL) { + __sync_synchronize(); + newdata = 1; + cur.t = counters_buf.ts; + if (prev.t.tv_sec || prev.t.tv_usec) { + usec = (cur.t.tv_sec - prev.t.tv_sec) * 1000000 + + cur.t.tv_usec - prev.t.tv_usec; + } + } + + ++sys_int; + if (glob_arg.stdout_interval && sys_int % glob_arg.stdout_interval == 0) + dostdout = 1; + if (glob_arg.syslog_interval && sys_int % glob_arg.syslog_interval == 0) + dosyslog = 1; + + for (j = 0; j < npipes; ++j) { + struct my_ctrs *c = &counters_buf.ctrs[j]; + cur.pkts += c->pkts; + cur.drop += c->drop; + cur.drop_bytes += c->drop_bytes; + cur.bytes += c->bytes; + + if (usec) { + x.pkts = c->pkts - pipe_prev[j].pkts; + x.drop = c->drop - pipe_prev[j].drop; + x.bytes = c->bytes - pipe_prev[j].bytes; + x.drop_bytes = c->drop_bytes - pipe_prev[j].drop_bytes; + pps = (x.pkts*1000000 + usec/2) / usec; + dps = (x.drop*1000000 + usec/2) / usec; + bps = ((x.bytes*1000000 + usec/2) / usec) * 8; + dbps = ((x.drop_bytes*1000000 + usec/2) / usec) * 8; + } + pipe_prev[j] = *c; + + if ( (dosyslog || dostdout) && newdata ) + snprintf(stat_msg, STAT_MSG_MAXSIZE, + "{" + "\"ts\":%.6f," + "\"interface\":\"%s\"," + "\"output_ring\":%" PRIu16 "," + "\"packets_forwarded\":%" PRIu64 "," + "\"packets_dropped\":%" PRIu64 "," + "\"data_forward_rate_Mbps\":%.4f," + "\"data_drop_rate_Mbps\":%.4f," + "\"packet_forward_rate_kpps\":%.4f," + "\"packet_drop_rate_kpps\":%.4f," + "\"overflow_queue_size\":%" PRIu32 + "}", cur.t.tv_sec + (cur.t.tv_usec / 1000000.0), + ports[j].interface, + j, + c->pkts, + c->drop, + (double)bps / 1024 / 1024, + (double)dbps / 1024 / 1024, + (double)pps / 1000, + (double)dps / 1000, + c->oq_n); + + if (dosyslog && stat_msg[0]) + syslog(LOG_INFO, "%s", stat_msg); + if (dostdout && stat_msg[0]) + printf("%s\n", stat_msg); + } + if (usec) { + x.pkts = cur.pkts - prev.pkts; + x.drop = cur.drop - prev.drop; + x.bytes = cur.bytes - prev.bytes; + x.drop_bytes = cur.drop_bytes - prev.drop_bytes; + pps = (x.pkts*1000000 + usec/2) / usec; + dps = (x.drop*1000000 + usec/2) / usec; + bps = ((x.bytes*1000000 + usec/2) / usec) * 8; + dbps = ((x.drop_bytes*1000000 + usec/2) / usec) * 8; + } + + if ( (dosyslog || dostdout) && newdata ) + snprintf(stat_msg, STAT_MSG_MAXSIZE, + "{" + "\"ts\":%.6f," + "\"interface\":\"%s\"," + "\"output_ring\":null," + "\"packets_received\":%" PRIu64 "," + "\"packets_forwarded\":%" PRIu64 "," + "\"packets_dropped\":%" PRIu64 "," + "\"non_ip_packets\":%" PRIu64 "," + "\"data_forward_rate_Mbps\":%.4f," + "\"data_drop_rate_Mbps\":%.4f," + "\"packet_forward_rate_kpps\":%.4f," + "\"packet_drop_rate_kpps\":%.4f," + "\"free_buffer_slots\":%" PRIu32 + "}", cur.t.tv_sec + (cur.t.tv_usec / 1000000.0), + glob_arg.ifname, + received_pkts, + cur.pkts, + cur.drop, + counters_buf.non_ip, + (double)bps / 1024 / 1024, + (double)dbps / 1024 / 1024, + (double)pps / 1000, + (double)dps / 1000, + counters_buf.freeq_n); + + if (dosyslog && stat_msg[0]) + syslog(LOG_INFO, "%s", stat_msg); + if (dostdout && stat_msg[0]) + printf("%s\n", stat_msg); + + prev = cur; + } + + free(pipe_prev); + + return NULL; +} + +static void +free_buffers(void) +{ + int i, tot = 0; + struct port_des *rxport = &ports[glob_arg.output_rings]; + + /* build a netmap free list with the buffers in all the overflow queues */ + for (i = 0; i < glob_arg.output_rings + 1; i++) { + struct port_des *cp = &ports[i]; + struct overflow_queue *q = cp->oq; + + if (!q) + continue; + + while (q->n) { + struct netmap_slot s = oq_deq(q); + uint32_t *b = (uint32_t *)NETMAP_BUF(cp->ring, s.buf_idx); + + *b = rxport->nmd->nifp->ni_bufs_head; + rxport->nmd->nifp->ni_bufs_head = s.buf_idx; + tot++; + } + } + D("added %d buffers to netmap free list", tot); + + for (i = 0; i < glob_arg.output_rings + 1; ++i) { + nm_close(ports[i].nmd); + } +} + + +static void sigint_h(int sig) +{ + (void)sig; /* UNUSED */ + do_abort = 1; + signal(SIGINT, SIG_DFL); +} + +void usage() +{ + printf("usage: lb [options]\n"); + printf("where options are:\n"); + printf(" -h view help text\n"); + printf(" -i iface interface name (required)\n"); + printf(" -p [prefix:]npipes add a new group of output pipes\n"); + printf(" -B nbufs number of extra buffers (default: %d)\n", DEF_EXTRA_BUFS); + printf(" -b batch batch size (default: %d)\n", DEF_BATCH); + printf(" -w seconds wait for link up (default: %d)\n", DEF_WAIT_LINK); + printf(" -W enable busy waiting. this will run your CPU at 100%%\n"); + printf(" -s seconds seconds between syslog stats messages (default: 0)\n"); + printf(" -o seconds seconds between stdout stats messages (default: 0)\n"); + exit(0); +} + +static int +parse_pipes(char *spec) +{ + char *end = index(spec, ':'); + static int max_groups = 0; + struct group_des *g; + + ND("spec %s num_groups %d", spec, glob_arg.num_groups); + if (max_groups < glob_arg.num_groups + 1) { + size_t size = sizeof(*g) * (glob_arg.num_groups + 1); + groups = realloc(groups, size); + if (groups == NULL) { + D("out of memory"); + return 1; + } + } + g = &groups[glob_arg.num_groups]; + memset(g, 0, sizeof(*g)); + + if (end != NULL) { + if (end - spec > MAX_IFNAMELEN - 8) { + D("name '%s' too long", spec); + return 1; + } + if (end == spec) { + D("missing prefix before ':' in '%s'", spec); + return 1; + } + strncpy(g->pipename, spec, end - spec); + g->custom_port = 1; + end++; + } else { + /* no prefix, this group will use the + * name of the input port. + * This will be set in init_groups(), + * since here the input port may still + * be uninitialized + */ + end = spec; + } + if (*end == '\0') { + g->nports = DEF_OUT_PIPES; + } else { + g->nports = atoi(end); + if (g->nports < 1) { + D("invalid number of pipes '%s' (must be at least 1)", end); + return 1; + } + } + glob_arg.output_rings += g->nports; + glob_arg.num_groups++; + return 0; +} + +/* complete the initialization of the groups data structure */ +void init_groups(void) +{ + int i, j, t = 0; + struct group_des *g = NULL; + for (i = 0; i < glob_arg.num_groups; i++) { + g = &groups[i]; + g->ports = &ports[t]; + for (j = 0; j < g->nports; j++) + g->ports[j].group = g; + t += g->nports; + if (!g->custom_port) + strcpy(g->pipename, glob_arg.base_name); + for (j = 0; j < i; j++) { + struct group_des *h = &groups[j]; + if (!strcmp(h->pipename, g->pipename)) + g->first_id += h->nports; + } + } + g->last = 1; +} + +/* push the packet described by slot rs to the group g. + * This may cause other buffers to be pushed down the + * chain headed by g. + * Return a free buffer. + */ +uint32_t forward_packet(struct group_des *g, struct netmap_slot *rs) +{ + uint32_t hash = rs->ptr; + uint32_t output_port = hash % g->nports; + struct port_des *port = &g->ports[output_port]; + struct netmap_ring *ring = port->ring; + struct overflow_queue *q = port->oq; + + /* Move the packet to the output pipe, unless there is + * either no space left on the ring, or there is some + * packet still in the overflow queue (since those must + * take precedence over the new one) + */ + if (ring->head != ring->tail && (q == NULL || oq_empty(q))) { + struct netmap_slot *ts = &ring->slot[ring->head]; + struct netmap_slot old_slot = *ts; + + ts->buf_idx = rs->buf_idx; + ts->len = rs->len; + ts->flags |= NS_BUF_CHANGED; + ts->ptr = rs->ptr; + ring->head = nm_ring_next(ring, ring->head); + port->ctr.bytes += rs->len; + port->ctr.pkts++; + forwarded++; + return old_slot.buf_idx; + } + + /* use the overflow queue, if available */ + if (q == NULL || oq_full(q)) { + /* no space left on the ring and no overflow queue + * available: we are forced to drop the packet + */ + dropped++; + port->ctr.drop++; + port->ctr.drop_bytes += rs->len; + return rs->buf_idx; + } + + oq_enq(q, rs); + + /* + * we cannot continue down the chain and we need to + * return a free buffer now. We take it from the free queue. + */ + if (oq_empty(freeq)) { + /* the free queue is empty. Revoke some buffers + * from the longest overflow queue + */ + uint32_t j; + struct port_des *lp = &ports[0]; + uint32_t max = lp->oq->n; + + /* let lp point to the port with the longest queue */ + for (j = 1; j < glob_arg.output_rings; j++) { + struct port_des *cp = &ports[j]; + if (cp->oq->n > max) { + lp = cp; + max = cp->oq->n; + } + } + + /* move the oldest BUF_REVOKE buffers from the + * lp queue to the free queue + */ + // XXX optimize this cycle + for (j = 0; lp->oq->n && j < BUF_REVOKE; j++) { + struct netmap_slot tmp = oq_deq(lp->oq); + + dropped++; + lp->ctr.drop++; + lp->ctr.drop_bytes += tmp.len; + + oq_enq(freeq, &tmp); + } + + ND(1, "revoked %d buffers from %s", j, lq->name); + } + + return oq_deq(freeq).buf_idx; +} + +int main(int argc, char **argv) +{ + int ch; + uint32_t i; + int rv; + unsigned int iter = 0; + int poll_timeout = 10; /* default */ + + glob_arg.ifname[0] = '\0'; + glob_arg.output_rings = 0; + glob_arg.batch = DEF_BATCH; + glob_arg.wait_link = DEF_WAIT_LINK; + glob_arg.busy_wait = false; + glob_arg.syslog_interval = 0; + glob_arg.stdout_interval = 0; + + while ( (ch = getopt(argc, argv, "hi:p:b:B:s:o:w:W")) != -1) { + switch (ch) { + case 'i': + D("interface is %s", optarg); + if (strlen(optarg) > MAX_IFNAMELEN - 8) { + D("ifname too long %s", optarg); + return 1; + } + if (strncmp(optarg, "netmap:", 7) && strncmp(optarg, "vale", 4)) { + sprintf(glob_arg.ifname, "netmap:%s", optarg); + } else { + strcpy(glob_arg.ifname, optarg); + } + break; + + case 'p': + if (parse_pipes(optarg)) { + usage(); + return 1; + } + break; + + case 'B': + glob_arg.extra_bufs = atoi(optarg); + D("requested %d extra buffers", glob_arg.extra_bufs); + break; + + case 'b': + glob_arg.batch = atoi(optarg); + D("batch is %d", glob_arg.batch); + break; + + case 'w': + glob_arg.wait_link = atoi(optarg); + D("link wait for up time is %d", glob_arg.wait_link); + break; + + case 'W': + glob_arg.busy_wait = true; + break; + + case 'o': + glob_arg.stdout_interval = atoi(optarg); + break; + + case 's': + glob_arg.syslog_interval = atoi(optarg); + break; + + case 'h': + usage(); + return 0; + break; + + default: + D("bad option %c %s", ch, optarg); + usage(); + return 1; + } + } + + if (glob_arg.ifname[0] == '\0') { + D("missing interface name"); + usage(); + return 1; + } + + /* extract the base name */ + char *nscan = strncmp(glob_arg.ifname, "netmap:", 7) ? + glob_arg.ifname : glob_arg.ifname + 7; + strncpy(glob_arg.base_name, nscan, MAX_IFNAMELEN-1); + for (nscan = glob_arg.base_name; *nscan && !index("-*^{}/@", *nscan); nscan++) + ; + *nscan = '\0'; + + if (glob_arg.num_groups == 0) + parse_pipes(""); + + if (glob_arg.syslog_interval) { + setlogmask(LOG_UPTO(LOG_INFO)); + openlog("lb", LOG_CONS | LOG_PID | LOG_NDELAY, LOG_LOCAL1); + } + + uint32_t npipes = glob_arg.output_rings; + + + pthread_t stat_thread; + + ports = calloc(npipes + 1, sizeof(struct port_des)); + if (!ports) { + D("failed to allocate the stats array"); + return 1; + } + struct port_des *rxport = &ports[npipes]; + init_groups(); + + memset(&counters_buf, 0, sizeof(counters_buf)); + counters_buf.ctrs = calloc(npipes, sizeof(struct my_ctrs)); + if (!counters_buf.ctrs) { + D("failed to allocate the counters snapshot buffer"); + return 1; + } + + /* we need base_req to specify pipes and extra bufs */ + struct nmreq base_req; + memset(&base_req, 0, sizeof(base_req)); + + base_req.nr_arg1 = npipes; + base_req.nr_arg3 = glob_arg.extra_bufs; + + rxport->nmd = nm_open(glob_arg.ifname, &base_req, 0, NULL); + + if (rxport->nmd == NULL) { + D("cannot open %s", glob_arg.ifname); + return (1); + } else { + D("successfully opened %s (tx rings: %u)", glob_arg.ifname, + rxport->nmd->req.nr_tx_slots); + } + + uint32_t extra_bufs = rxport->nmd->req.nr_arg3; + struct overflow_queue *oq = NULL; + /* reference ring to access the buffers */ + rxport->ring = NETMAP_RXRING(rxport->nmd->nifp, 0); + + if (!glob_arg.extra_bufs) + goto run; + + D("obtained %d extra buffers", extra_bufs); + if (!extra_bufs) + goto run; + + /* one overflow queue for each output pipe, plus one for the + * free extra buffers + */ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Mon Nov 19 08:55:27 2018 Return-Path: Delivered-To: svn-src-all@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 4F6F51139650; Mon, 19 Nov 2018 08:55:27 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.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 F09636C2B0; Mon, 19 Nov 2018 08:55:26 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B8B0B1FE03; Mon, 19 Nov 2018 08:55:26 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAJ8tQIV097818; Mon, 19 Nov 2018 08:55:26 GMT (envelope-from vmaffione@FreeBSD.org) Received: (from vmaffione@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAJ8tQMG097816; Mon, 19 Nov 2018 08:55:26 GMT (envelope-from vmaffione@FreeBSD.org) Message-Id: <201811190855.wAJ8tQMG097816@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vmaffione set sender to vmaffione@FreeBSD.org using -f From: Vincenzo Maffione Date: Mon, 19 Nov 2018 08:55:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r340619 - stable/12/tools/tools/netmap X-SVN-Group: stable-12 X-SVN-Commit-Author: vmaffione X-SVN-Commit-Paths: stable/12/tools/tools/netmap X-SVN-Commit-Revision: 340619 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: F09636C2B0 X-Spamd-Result: default: False [0.44 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_MEDIUM(0.15)[0.148,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.29)[0.290,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Nov 2018 08:55:27 -0000 Author: vmaffione Date: Mon Nov 19 08:55:26 2018 New Revision: 340619 URL: https://svnweb.freebsd.org/changeset/base/340619 Log: MFC r340325 netmap: pkt-gen: several updates from upstream Various improvements to the netmap pkt-gen program: - indentation fixes - support for IPV6 - fixes to checksum computation - support for NS_MOREFRAG - rate limiting in ping mode Differential Revision: https://reviews.freebsd.org/D17698 Modified: stable/12/tools/tools/netmap/pkt-gen.8 stable/12/tools/tools/netmap/pkt-gen.c Directory Properties: stable/12/ (props changed) Modified: stable/12/tools/tools/netmap/pkt-gen.8 ============================================================================== --- stable/12/tools/tools/netmap/pkt-gen.8 Mon Nov 19 08:53:52 2018 (r340618) +++ stable/12/tools/tools/netmap/pkt-gen.8 Mon Nov 19 08:55:26 2018 (r340619) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 23, 2018 +.Dd October 31, 2018 .Dt PKT-GEN 8 .Os .Sh NAME @@ -36,96 +36,215 @@ .Bl -item -compact .It .Nm +.Op Fl h46XzZNIWvrAB .Op Fl i Ar interface .Op Fl f Ar function .Op Fl n Ar count -.Op Fl t Ar pkts_to_send -.Op Fl r Ar pkts_to_receive .Op Fl l Ar pkt_size +.Op Fl b Ar burst_size .Op Fl d Ar dst_ip[:port[-dst_ip:port]] .Op Fl s Ar src_ip[:port[-src_ip:port]] -.Op Fl D Ar dst-mac -.Op Fl S Ar src-mac +.Op Fl D Ar dst_mac +.Op Fl S Ar src_mac .Op Fl a Ar cpu_id -.Op Fl b Ar burst size -.Op Fl c Ar cores +.Op Fl c Ar cpus .Op Fl p Ar threads .Op Fl T Ar report_ms -.Op Fl P +.Op Fl P Ar file .Op Fl w Ar wait_for_link_time .Op Fl R Ar rate -.Op Fl X .Op Fl H Ar len -.Op Fl P Ar xfile -.Op Fl z -.Op Fl Z +.Op Fl F Ar num_frags +.Op Fl M Ar frag_size +.Op Fl C Ar port_config +.El .Sh DESCRIPTION .Nm -generates and receives raw network packets using -.Xr netmap 4 . +leverages +.Xr netmap 4 +to generate and receive raw network packets in batches. The arguments are as follows: -.Pp .Bl -tag -width Ds +.It Fl h +Show program usage and exit. .It Fl i Ar interface -Network interface name. -.It Fl f Ar function tx rx ping pong -Set the function to transmit, receive of ping/pong. -.It Fl n count -Number of iterations (can be 0). -.It Fl t pkts_to_send -Number of packets to send. Also forces transmit mode. -.It Fl r Ar pkts_to_receive -Number of packets to receive. Also forces rx mode. +Name of the network interface that +.Nm +operates on. +It can be a system network interface (e.g., em0), +the name of a +.Xr vale 4 +port (e.g., valeSSS:PPP), the name of a netmap pipe or monitor, +or any valid netmap port name accepted by the +.Ar nm_open +library function, as documented in +.Xr netmap 4 +(NIOCREGIF section). +.It Fl f Ar function +The function to be executed by +.Nm . +Specify +.Cm tx +for transmission, +.Cm rx +for reception, +.Cm ping +for client-side ping-pong operation, and +.Cm pong +for server-side ping-pong operation. +.It Fl n Ar count +Number of iterations of the +.Nm +function, with 0 meaning infinite). +In case of +.Cm tx +or +.Cm rx , +.Ar count +is the number of packets to receive or transmit. +In case of +.Cm ping +or +.Cm pong , +.Ar count +is the number of ping-pong transactions. .It Fl l Ar pkt_size Packet size in bytes excluding CRC. +If passed a second time, use random sizes larger or equal than the +second one and lower than the first one. +.It Fl b Ar burst_size +Transmit or receive up to +.Ar burst_size +packets at a time. +.It Fl 4 +Use IPv4 addresses. +.It Fl 6 +Use IPv6 addresses. .It Fl d Ar dst_ip[:port[-dst_ip:port]] -Destination IPv4 address and port, single or range. +Destination IPv4/IPv6 address and port, single or range. .It Fl s Ar src_ip[:port[-src_ip:port]] -Source IPv4 address and port, single or range. -.It Fl D Ar dst-mac -Destination MAC address in colon notation. -.It Fl S Ar src-mac +Source IPv4/IPv6 address and port, single or range. +.It Fl D Ar dst_mac +Destination MAC address in colon notation (e.g., aa:bb:cc:dd:ee:00). +.It Fl S Ar src_mac Source MAC address in colon notation. .It Fl a Ar cpu_id -Tie +Pin the first thread of .Nm -to a particular CPU core using -.Xr setaffinity 2. -.It Fl b Ar burst size -Set the size of a burst of packets. -.It Fl c Ar cores -Number of cores to use. +to a particular CPU using +.Xr pthread_setaffinity_np 3 . +If more threads are used, they are pinned to the subsequent CPUs, +one per thread. +.It Fl c Ar cpus +Maximum number of CPUs to use (0 means to use all the available ones). .It Fl p Ar threads Number of threads to use. +By default, only a single thread is used +to handle all the netmap rings. +If +.Ar threads +is larger than one, each thread handles a single TX ring (in +.Cm tx +mode), a single RX ring (in +.Cm rx +mode), or a TX/RX ring couple. +The number of +.Ar threads +must be less or equal than the number of TX (or RX) ring available +in the device specified by +.Ar interface . .It Fl T Ar report_ms Number of milliseconds between reports. -.It Fl P -Use libpcap instead of netmap for reading or writing. .It Fl w Ar wait_for_link_time -Number of seconds to wait to make sure that the network link is up. A -network device driver may take some time to create a new -transmit/receive ring pair when +Number of seconds to wait before starting the +.Nm +function, useuful to make sure that the network link is up. +A network device driver may take some time to enter netmap mode, or +to create a new transmit/receive ring pair when .Xr netmap 4 requests one. .It Fl R Ar rate -Packet transmission rate. Not setting the packet transmission rate tells +Packet transmission rate. +Not setting the packet transmission rate tells .Nm -to transmit packets as quickly as possible. On servers from 2010 on-wards +to transmit packets as quickly as possible. +On servers from 2010 on-wards .Xr netmap 4 is able to completely use all of the bandwidth of a 10 or 40Gbps link, so this option should be used unless your intention is to saturate the link. .It Fl X -Dump payload transmitted or received. +Dump payload of each packet transmitted or received. .It Fl H Ar len -Add empty virtio-net-header with size 'len'. This option is only use -with Virtual Machine technologies that use virtio as a network interface. +Add empty virtio-net-header with size +.Ar len . +Valid sizes are 0, 10 and 12. +This option is only used with Virtual Machine technologies that use virtio +as a network interface. .It Fl P Ar file -Load the packet from a pcap file rather than constructing it inside of -.Nm +Load the packet to be transmitted from a pcap file rather than constructing +it within +.Nm . .It Fl z -Use random IPv4 src address/port +Use random IPv4/IPv6 src address/port. .It Fl Z -Use random IPv4 dst address/port +Use random IPv4/IPv6 dst address/port. +.It Fl N +Do not normalize units (i.e., use bps, pps instead of Mbps, Kpps, etc.). +.It Fl F Ar num_frags +Send multi-slot packets, each one with +.Ar num_frags +fragments. +A multi-slot packet is represented by two or more consecutive netmap slots +with the +.Ar NS_MOREFRAG +flag set (except for the last slot). +This is useful to transmit or receive packets larger than the netmap +buffer size. +.It Fl M Ar frag_size +In multi-slot mode, +.Ar frag_size +specifies the size of each fragment, if smaller than the packet length +divided by +.Ar num_frags . +.It Fl I +Use indirect buffers. +It is only valid for transmitting on VALE ports, +and it is implemented by setting the +.Ar NS_INDIRECT +flag in the netmap slots. +.It Fl W +Exit immediately if all the RX rings are empty the first time they are +examined. +.It Fl v +Increase the verbosity level. +.It Fl r +In +.Cm tx +mode, do not initialize packets, but send whatever the content of +the uninitialized netmap buffers is (rubbish mode). +.It Fl A +Compute mean and standard deviation (over a sliding window) for the +transmit or receive rate. +.It Fl B +Take Ethernet framing and CRC into account when computing the average bps. +This adds 4 bytes of CRC and 20 bytes of framing to each packet. +.It Fl C Ar tx_slots Ns Oo Cm \&, Ns Ar rx_slots Ns Oo Cm \&, Ns Ar tx_rings Ns Oo Cm \&, Ns Ar rx_rings Oc Oc Oc +Configuration in terms of number of rings and slots to be used when +opening the netmap port. +Such configuration has effect on software ports +created on the fly, such as VALE ports and netmap pipes. +The configuration may consist of 1 to 4 numbers separated by commas: +.Dq tx_slots,rx_slots,tx_rings,rx_rings . +Missing numbers or zeroes stand for default values. +As an additional convenience, if exactly one number is specified, +then this is assigned to both +.Ar tx_slots +and +.Ar rx_slots . +If there is no fourth number, then the third one is assigned to both +.Ar tx_rings +and +.Ar rx_rings . .El .Pp .Nm @@ -133,7 +252,7 @@ is a raw packet generator that can utilize either .Xr netmap 4 or .Xr bpf 4 -but which is most often uses with +but which is most often used with .Xr netmap 4 . The .Ar interface name @@ -146,7 +265,8 @@ system to balance traffic across the interface. .Nm can peel off one or more of the transmit or receive rings for its own use without interfering with packets that might otherwise be destined -for the host. For example on a system with a Chelsio Network +for the host. +For example on a system with a Chelsio Network Interface Card (NIC) the interface specification of .Ar -i netmap:ncxl0 gives @@ -156,20 +276,20 @@ the more commonly known cxl0 interface, which is used system's TCP/IP stack. .Sh EXAMPLES Capture and count all packets arriving on the operating system's cxl0 -interface. Using this will block packets from reaching the operating +interface. +Using this will block packets from reaching the operating system's network stack. -.Dl +.Bd -literal -offset indent +pkt-gen -i cxl0 -f rx +.Ed .Pp -.Nm --i cxl0 -f rx -.Pp Send a stream of fake DNS packets between two hosts with a packet -length of 128 bytes. You must set the destination MAC address for +length of 128 bytes. +You must set the destination MAC address for packets to be received by the target host. -.Pp -.Dl -.Nm --i netmap:ncxl0 -f tx -s 172.16.0.1:53 -d 172.16.1.3:53 -D 00:07:43:29:2a:e0 +.Bd -literal -offset intent +pkt-gen -i netmap:ncxl0 -f tx -s 172.16.0.1:53 -d 172.16.1.3:53 -D 00:07:43:29:2a:e0 +.Ed .Sh SEE ALSO .Xr netmap 4 , .Xr bridge 8 Modified: stable/12/tools/tools/netmap/pkt-gen.c ============================================================================== --- stable/12/tools/tools/netmap/pkt-gen.c Mon Nov 19 08:53:52 2018 (r340618) +++ stable/12/tools/tools/netmap/pkt-gen.c Mon Nov 19 08:55:26 2018 (r340619) @@ -55,6 +55,11 @@ #include #include #include +#include +#ifdef linux +#define IPV6_VERSION 0x60 +#define IPV6_DEFHLIM 64 +#endif #include #include @@ -66,16 +71,18 @@ #include "ctrs.h" +static void usage(int); + #ifdef _WIN32 #define cpuset_t DWORD_PTR //uint64_t static inline void CPU_ZERO(cpuset_t *p) { - *p = 0; + *p = 0; } static inline void CPU_SET(uint32_t i, cpuset_t *p) { - *p |= 1<< (i & 0x3f); + *p |= 1<< (i & 0x3f); } #define pthread_setaffinity_np(a, b, c) !SetThreadAffinityMask(a, *c) //((void)a, 0) @@ -155,12 +162,12 @@ ether_ntoa(const struct ether_addr *n) #define cpuset_t uint64_t // XXX static inline void CPU_ZERO(cpuset_t *p) { - *p = 0; + *p = 0; } static inline void CPU_SET(uint32_t i, cpuset_t *p) { - *p |= 1<< (i & 0x3f); + *p |= 1<< (i & 0x3f); } #define pthread_setaffinity_np(a, b, c) ((void)a, 0) @@ -169,7 +176,7 @@ static inline void CPU_SET(uint32_t i, cpuset_t *p) #define IFF_PPROMISC IFF_PROMISC #include /* LLADDR */ #define clock_gettime(a,b) \ - do {struct timespec t0 = {0,0}; *(b) = t0; } while (0) + do {struct timespec t0 = {0,0}; *(b) = t0; } while (0) #endif /* __APPLE__ */ const char *default_payload="netmap pkt-gen DIRECT payload\n" @@ -179,10 +186,8 @@ const char *indirect_payload="netmap pkt-gen indirect "http://info.iet.unipi.it/~luigi/netmap/ "; int verbose = 0; +int normalize = 1; -#define SKIP_PAYLOAD 1 /* do not check payload. XXX unused */ - - #define VIRT_HDR_1 10 /* length of a base vnet-hdr */ #define VIRT_HDR_2 12 /* length of the extenede vnet-hdr */ #define VIRT_HDR_MAX VIRT_HDR_2 @@ -195,14 +200,34 @@ struct virt_header { struct pkt { struct virt_header vh; struct ether_header eh; - struct ip ip; - struct udphdr udp; - uint8_t body[MAX_BODYSIZE]; // XXX hardwired + union { + struct { + struct ip ip; + struct udphdr udp; + uint8_t body[MAX_BODYSIZE]; /* hardwired */ + } ipv4; + struct { + struct ip6_hdr ip; + struct udphdr udp; + uint8_t body[MAX_BODYSIZE]; /* hardwired */ + } ipv6; + }; } __attribute__((__packed__)); +#define PKT(p, f, af) \ + ((af) == AF_INET ? (p)->ipv4.f: (p)->ipv6.f) + struct ip_range { char *name; - uint32_t start, end; /* same as struct in_addr */ + union { + struct { + uint32_t start, end; /* same as struct in_addr */ + } ipv4; + struct { + struct in6_addr start, end; + uint8_t sgroup, egroup; + } ipv6; + }; uint16_t port0, port1; }; @@ -227,15 +252,18 @@ struct tstamp { */ struct glob_arg { + int af; /* address family AF_INET/AF_INET6 */ struct ip_range src_ip; struct ip_range dst_ip; struct mac_range dst_mac; struct mac_range src_mac; int pkt_size; + int pkt_min_size; int burst; int forever; uint64_t npackets; /* total packets to send */ - int frags; /* fragments per packet */ + int frags; /* fragments per packet */ + u_int mtu; /* size of each fragment */ int nthreads; int cpus; /* cpus used for running */ int system_cpus; /* cpus on the system */ @@ -271,12 +299,12 @@ struct glob_arg { char *nmr_config; int dummy_send; int virt_header; /* send also the virt_header */ - int extra_bufs; /* goes in nr_arg3 */ - int extra_pipes; /* goes in nr_arg1 */ char *packet_file; /* -P option */ #define STATS_WIN 15 int win_idx; int64_t win[STATS_WIN]; + int wait_link; + int framing; /* #bits of framing (for bw output) */ }; enum dev_type { DEV_NONE, DEV_NETMAP, DEV_PCAP, DEV_TAP }; @@ -304,79 +332,166 @@ struct targ { struct pkt pkt; void *frame; + uint16_t seed[3]; + u_int frags; + u_int frag_size; }; +static __inline uint16_t +cksum_add(uint16_t sum, uint16_t a) +{ + uint16_t res; + res = sum + a; + return (res + (res < a)); +} + +static void +extract_ipv4_addr(char *name, uint32_t *addr, uint16_t *port) +{ + struct in_addr a; + char *pp; + + pp = strchr(name, ':'); + if (pp != NULL) { /* do we have ports ? */ + *pp++ = '\0'; + *port = (uint16_t)strtol(pp, NULL, 0); + } + + inet_pton(AF_INET, name, &a); + *addr = ntohl(a.s_addr); +} + +static void +extract_ipv6_addr(char *name, struct in6_addr *addr, uint16_t *port, + uint8_t *group) +{ + char *pp; + + /* + * We accept IPv6 address in the following form: + * group@[2001:DB8::1001]:port (w/ brackets and port) + * group@[2001:DB8::1] (w/ brackets and w/o port) + * group@2001:DB8::1234 (w/o brackets and w/o port) + */ + pp = strchr(name, '@'); + if (pp != NULL) { + *pp++ = '\0'; + *group = (uint8_t)strtol(name, NULL, 0); + if (*group > 7) + *group = 7; + name = pp; + } + if (name[0] == '[') + name++; + pp = strchr(name, ']'); + if (pp != NULL) + *pp++ = '\0'; + if (pp != NULL && *pp != ':') + pp = NULL; + if (pp != NULL) { /* do we have ports ? */ + *pp++ = '\0'; + *port = (uint16_t)strtol(pp, NULL, 0); + } + inet_pton(AF_INET6, name, addr); +} /* * extract the extremes from a range of ipv4 addresses. * addr_lo[-addr_hi][:port_lo[-port_hi]] */ -static void -extract_ip_range(struct ip_range *r) +static int +extract_ip_range(struct ip_range *r, int af) { - char *ap, *pp; + char *name, *ap, start[INET6_ADDRSTRLEN]; + char end[INET6_ADDRSTRLEN]; struct in_addr a; + uint32_t tmp; if (verbose) D("extract IP range from %s", r->name); - r->port0 = r->port1 = 0; - r->start = r->end = 0; + name = strdup(r->name); + if (name == NULL) { + D("strdup failed"); + usage(-1); + } /* the first - splits start/end of range */ - ap = index(r->name, '-'); /* do we have ports ? */ - if (ap) { + ap = strchr(name, '-'); + if (ap != NULL) *ap++ = '\0'; - } - /* grab the initial values (mandatory) */ - pp = index(r->name, ':'); - if (pp) { - *pp++ = '\0'; - r->port0 = r->port1 = strtol(pp, NULL, 0); - }; - inet_aton(r->name, &a); - r->start = r->end = ntohl(a.s_addr); - if (ap) { - pp = index(ap, ':'); - if (pp) { - *pp++ = '\0'; - if (*pp) - r->port1 = strtol(pp, NULL, 0); + r->port0 = 1234; /* default port */ + if (af == AF_INET6) { + r->ipv6.sgroup = 7; /* default group */ + extract_ipv6_addr(name, &r->ipv6.start, &r->port0, + &r->ipv6.sgroup); + } else + extract_ipv4_addr(name, &r->ipv4.start, &r->port0); + + r->port1 = r->port0; + if (af == AF_INET6) { + if (ap != NULL) { + r->ipv6.egroup = r->ipv6.sgroup; + extract_ipv6_addr(ap, &r->ipv6.end, &r->port1, + &r->ipv6.egroup); + } else { + r->ipv6.end = r->ipv6.start; + r->ipv6.egroup = r->ipv6.sgroup; } - if (*ap) { - inet_aton(ap, &a); - r->end = ntohl(a.s_addr); - } + } else { + if (ap != NULL) { + extract_ipv4_addr(ap, &r->ipv4.end, &r->port1); + if (r->ipv4.start > r->ipv4.end) { + tmp = r->ipv4.end; + r->ipv4.end = r->ipv4.start; + r->ipv4.start = tmp; + } + } else + r->ipv4.end = r->ipv4.start; } + if (r->port0 > r->port1) { - uint16_t tmp = r->port0; + tmp = r->port0; r->port0 = r->port1; r->port1 = tmp; } - if (r->start > r->end) { - uint32_t tmp = r->start; - r->start = r->end; - r->end = tmp; + if (af == AF_INET) { + a.s_addr = htonl(r->ipv4.start); + inet_ntop(af, &a, start, sizeof(start)); + a.s_addr = htonl(r->ipv4.end); + inet_ntop(af, &a, end, sizeof(end)); + } else { + inet_ntop(af, &r->ipv6.start, start, sizeof(start)); + inet_ntop(af, &r->ipv6.end, end, sizeof(end)); } - { - struct in_addr a; - char buf1[16]; // one ip address + if (af == AF_INET) + D("range is %s:%d to %s:%d", start, r->port0, end, r->port1); + else + D("range is %d@[%s]:%d to %d@[%s]:%d", r->ipv6.sgroup, + start, r->port0, r->ipv6.egroup, end, r->port1); - a.s_addr = htonl(r->end); - strncpy(buf1, inet_ntoa(a), sizeof(buf1)); - a.s_addr = htonl(r->start); - if (1) - D("range is %s:%d to %s:%d", - inet_ntoa(a), r->port0, buf1, r->port1); - } + free(name); + if (r->port0 != r->port1 || + (af == AF_INET && r->ipv4.start != r->ipv4.end) || + (af == AF_INET6 && + !IN6_ARE_ADDR_EQUAL(&r->ipv6.start, &r->ipv6.end))) + return (OPT_COPY); + return (0); } -static void +static int extract_mac_range(struct mac_range *r) { + struct ether_addr *e; if (verbose) D("extract MAC range from %s", r->name); - bcopy(ether_aton(r->name), &r->start, 6); - bcopy(ether_aton(r->name), &r->end, 6); + + e = ether_aton(r->name); + if (e == NULL) { + D("invalid MAC address '%s'", r->name); + return 1; + } + bcopy(e, &r->start, 6); + bcopy(e, &r->end, 6); #if 0 bcopy(targ->src_mac, eh->ether_shost, 6); p = index(targ->g->src_mac, '-'); @@ -391,6 +506,7 @@ extract_mac_range(struct mac_range *r) #endif if (verbose) D("%s starts at %s", r->name, ether_ntoa(&r->start)); + return 0; } static struct targ *targs; @@ -456,7 +572,7 @@ system_ncpus(void) /* * parse the vale configuration in conf and put it in nmr. * Return the flag set if necessary. - * The configuration may consist of 0 to 4 numbers separated + * The configuration may consist of 1 to 4 numbers separated * by commas: #tx-slots,#rx-slots,#tx-rings,#rx-rings. * Missing numbers or zeroes stand for default values. * As an additional convenience, if exactly one number @@ -500,7 +616,7 @@ parse_nmr_config(const char* conf, struct nmreq *nmr) nmr->nr_rx_rings, nmr->nr_rx_slots); free(w); return (nmr->nr_tx_rings || nmr->nr_tx_slots || - nmr->nr_rx_rings || nmr->nr_rx_slots) ? + nmr->nr_rx_rings || nmr->nr_rx_slots) ? NM_OPEN_RING_CFG : 0; } @@ -513,7 +629,6 @@ static int source_hwaddr(const char *ifname, char *buf) { struct ifaddrs *ifaphead, *ifap; - int l = sizeof(ifap->ifa_name); if (getifaddrs(&ifaphead) != 0) { D("getifaddrs %s failed", ifname); @@ -527,7 +642,7 @@ source_hwaddr(const char *ifname, char *buf) if (!sdl || sdl->sdl_family != AF_LINK) continue; - if (strncmp(ifap->ifa_name, ifname, l) != 0) + if (strncmp(ifap->ifa_name, ifname, IFNAMSIZ) != 0) continue; mac = (uint8_t *)LLADDR(sdl); sprintf(buf, "%02x:%02x:%02x:%02x:%02x:%02x", @@ -562,19 +677,20 @@ setaffinity(pthread_t me, int i) return 0; } + /* Compute the checksum of the given ip header. */ -static uint16_t +static uint32_t checksum(const void *data, uint16_t len, uint32_t sum) { - const uint8_t *addr = data; + const uint8_t *addr = data; uint32_t i; - /* Checksum all the pairs of bytes first... */ - for (i = 0; i < (len & ~1U); i += 2) { - sum += (u_int16_t)ntohs(*((u_int16_t *)(addr + i))); - if (sum > 0xFFFF) - sum -= 0xFFFF; - } + /* Checksum all the pairs of bytes first... */ + for (i = 0; i < (len & ~1U); i += 2) { + sum += (u_int16_t)ntohs(*((u_int16_t *)(addr + i))); + if (sum > 0xFFFF) + sum -= 0xFFFF; + } /* * If there's a single byte left over, checksum it, too. * Network byte order is big-endian, so the remaining byte is @@ -588,8 +704,8 @@ checksum(const void *data, uint16_t len, uint32_t sum) return sum; } -static u_int16_t -wrapsum(u_int32_t sum) +static uint16_t +wrapsum(uint32_t sum) { sum = ~sum & 0xFFFF; return (htons(sum)); @@ -637,64 +753,198 @@ dump_payload(const char *_p, int len, struct netmap_ri #define uh_sum check #endif /* linux */ -/* - * increment the addressed in the packet, - * starting from the least significant field. - * DST_IP DST_PORT SRC_IP SRC_PORT - */ static void -update_addresses(struct pkt *pkt, struct glob_arg *g) +update_ip(struct pkt *pkt, struct targ *t) { - uint32_t a; - uint16_t p; - struct ip *ip = &pkt->ip; - struct udphdr *udp = &pkt->udp; + struct glob_arg *g = t->g; + struct ip ip; + struct udphdr udp; + uint32_t oaddr, naddr; + uint16_t oport, nport; + uint16_t ip_sum, udp_sum; - do { - /* XXX for now it doesn't handle non-random src, random dst */ - if (g->options & OPT_RANDOM_SRC) { - udp->uh_sport = random(); - ip->ip_src.s_addr = random(); - } else { - p = ntohs(udp->uh_sport); - if (p < g->src_ip.port1) { /* just inc, no wrap */ - udp->uh_sport = htons(p + 1); + memcpy(&ip, &pkt->ipv4.ip, sizeof(ip)); + memcpy(&udp, &pkt->ipv4.udp, sizeof(udp)); + do { + ip_sum = udp_sum = 0; + naddr = oaddr = ntohl(ip.ip_src.s_addr); + nport = oport = ntohs(udp.uh_sport); + if (g->options & OPT_RANDOM_SRC) { + ip.ip_src.s_addr = nrand48(t->seed); + udp.uh_sport = nrand48(t->seed); + naddr = ntohl(ip.ip_src.s_addr); + nport = ntohs(udp.uh_sport); break; } - udp->uh_sport = htons(g->src_ip.port0); - - a = ntohl(ip->ip_src.s_addr); - if (a < g->src_ip.end) { /* just inc, no wrap */ - ip->ip_src.s_addr = htonl(a + 1); + if (oport < g->src_ip.port1) { + nport = oport + 1; + udp.uh_sport = htons(nport); break; } - ip->ip_src.s_addr = htonl(g->src_ip.start); - - udp->uh_sport = htons(g->src_ip.port0); + nport = g->src_ip.port0; + udp.uh_sport = htons(nport); + if (oaddr < g->src_ip.ipv4.end) { + naddr = oaddr + 1; + ip.ip_src.s_addr = htonl(naddr); + break; + } + naddr = g->src_ip.ipv4.start; + ip.ip_src.s_addr = htonl(naddr); + } while (0); + /* update checksums if needed */ + if (oaddr != naddr) { + ip_sum = cksum_add(ip_sum, ~oaddr >> 16); + ip_sum = cksum_add(ip_sum, ~oaddr & 0xffff); + ip_sum = cksum_add(ip_sum, naddr >> 16); + ip_sum = cksum_add(ip_sum, naddr & 0xffff); } - - if (g->options & OPT_RANDOM_DST) { - udp->uh_dport = random(); - ip->ip_dst.s_addr = random(); - } else { - p = ntohs(udp->uh_dport); - if (p < g->dst_ip.port1) { /* just inc, no wrap */ - udp->uh_dport = htons(p + 1); + if (oport != nport) { + udp_sum = cksum_add(udp_sum, ~oport); + udp_sum = cksum_add(udp_sum, nport); + } + do { + naddr = oaddr = ntohl(ip.ip_dst.s_addr); + nport = oport = ntohs(udp.uh_dport); + if (g->options & OPT_RANDOM_DST) { + ip.ip_dst.s_addr = nrand48(t->seed); + udp.uh_dport = nrand48(t->seed); + naddr = ntohl(ip.ip_dst.s_addr); + nport = ntohs(udp.uh_dport); break; } - udp->uh_dport = htons(g->dst_ip.port0); - - a = ntohl(ip->ip_dst.s_addr); - if (a < g->dst_ip.end) { /* just inc, no wrap */ - ip->ip_dst.s_addr = htonl(a + 1); + if (oport < g->dst_ip.port1) { + nport = oport + 1; + udp.uh_dport = htons(nport); break; } + nport = g->dst_ip.port0; + udp.uh_dport = htons(nport); + if (oaddr < g->dst_ip.ipv4.end) { + naddr = oaddr + 1; + ip.ip_dst.s_addr = htonl(naddr); + break; + } + naddr = g->dst_ip.ipv4.start; + ip.ip_dst.s_addr = htonl(naddr); + } while (0); + /* update checksums */ + if (oaddr != naddr) { + ip_sum = cksum_add(ip_sum, ~oaddr >> 16); + ip_sum = cksum_add(ip_sum, ~oaddr & 0xffff); + ip_sum = cksum_add(ip_sum, naddr >> 16); + ip_sum = cksum_add(ip_sum, naddr & 0xffff); } - ip->ip_dst.s_addr = htonl(g->dst_ip.start); - } while (0); - // update checksum + if (oport != nport) { + udp_sum = cksum_add(udp_sum, ~oport); + udp_sum = cksum_add(udp_sum, nport); + } + if (udp_sum != 0) + udp.uh_sum = ~cksum_add(~udp.uh_sum, htons(udp_sum)); + if (ip_sum != 0) { + ip.ip_sum = ~cksum_add(~ip.ip_sum, htons(ip_sum)); + udp.uh_sum = ~cksum_add(~udp.uh_sum, htons(ip_sum)); + } + memcpy(&pkt->ipv4.ip, &ip, sizeof(ip)); + memcpy(&pkt->ipv4.udp, &udp, sizeof(udp)); } +#ifndef s6_addr16 +#define s6_addr16 __u6_addr.__u6_addr16 +#endif +static void +update_ip6(struct pkt *pkt, struct targ *t) +{ + struct glob_arg *g = t->g; + struct ip6_hdr ip6; + struct udphdr udp; + uint16_t udp_sum; + uint16_t oaddr, naddr; + uint16_t oport, nport; + uint8_t group; + + memcpy(&ip6, &pkt->ipv6.ip, sizeof(ip6)); + memcpy(&udp, &pkt->ipv6.udp, sizeof(udp)); + do { + udp_sum = 0; + group = g->src_ip.ipv6.sgroup; + naddr = oaddr = ntohs(ip6.ip6_src.s6_addr16[group]); + nport = oport = ntohs(udp.uh_sport); + if (g->options & OPT_RANDOM_SRC) { + ip6.ip6_src.s6_addr16[group] = nrand48(t->seed); + udp.uh_sport = nrand48(t->seed); + naddr = ntohs(ip6.ip6_src.s6_addr16[group]); + nport = ntohs(udp.uh_sport); + break; + } + if (oport < g->src_ip.port1) { + nport = oport + 1; + udp.uh_sport = htons(nport); + break; + } + nport = g->src_ip.port0; + udp.uh_sport = htons(nport); + if (oaddr < ntohs(g->src_ip.ipv6.end.s6_addr16[group])) { + naddr = oaddr + 1; + ip6.ip6_src.s6_addr16[group] = htons(naddr); + break; + } + naddr = ntohs(g->src_ip.ipv6.start.s6_addr16[group]); + ip6.ip6_src.s6_addr16[group] = htons(naddr); + } while (0); + /* update checksums if needed */ + if (oaddr != naddr) + udp_sum = cksum_add(~oaddr, naddr); + if (oport != nport) + udp_sum = cksum_add(udp_sum, + cksum_add(~oport, nport)); + do { + group = g->dst_ip.ipv6.egroup; + naddr = oaddr = ntohs(ip6.ip6_dst.s6_addr16[group]); + nport = oport = ntohs(udp.uh_dport); + if (g->options & OPT_RANDOM_DST) { + ip6.ip6_dst.s6_addr16[group] = nrand48(t->seed); + udp.uh_dport = nrand48(t->seed); + naddr = ntohs(ip6.ip6_dst.s6_addr16[group]); + nport = ntohs(udp.uh_dport); + break; + } + if (oport < g->dst_ip.port1) { + nport = oport + 1; + udp.uh_dport = htons(nport); + break; + } + nport = g->dst_ip.port0; + udp.uh_dport = htons(nport); + if (oaddr < ntohs(g->dst_ip.ipv6.end.s6_addr16[group])) { + naddr = oaddr + 1; + ip6.ip6_dst.s6_addr16[group] = htons(naddr); + break; + } + naddr = ntohs(g->dst_ip.ipv6.start.s6_addr16[group]); + ip6.ip6_dst.s6_addr16[group] = htons(naddr); + } while (0); + /* update checksums */ + if (oaddr != naddr) + udp_sum = cksum_add(udp_sum, + cksum_add(~oaddr, naddr)); + if (oport != nport) + udp_sum = cksum_add(udp_sum, + cksum_add(~oport, nport)); + if (udp_sum != 0) + udp.uh_sum = ~cksum_add(~udp.uh_sum, udp_sum); + memcpy(&pkt->ipv6.ip, &ip6, sizeof(ip6)); + memcpy(&pkt->ipv6.udp, &udp, sizeof(udp)); +} + +static void +update_addresses(struct pkt *pkt, struct targ *t) +{ + + if (t->g->af == AF_INET) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Mon Nov 19 08:56:35 2018 Return-Path: Delivered-To: svn-src-all@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 24F8F1139724; Mon, 19 Nov 2018 08:56:35 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.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 BA7586C448; Mon, 19 Nov 2018 08:56:34 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9B30E1FE07; Mon, 19 Nov 2018 08:56:34 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAJ8uYPf097921; Mon, 19 Nov 2018 08:56:34 GMT (envelope-from vmaffione@FreeBSD.org) Received: (from vmaffione@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAJ8uYN2097920; Mon, 19 Nov 2018 08:56:34 GMT (envelope-from vmaffione@FreeBSD.org) Message-Id: <201811190856.wAJ8uYN2097920@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vmaffione set sender to vmaffione@FreeBSD.org using -f From: Vincenzo Maffione Date: Mon, 19 Nov 2018 08:56:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r340620 - stable/12/share/man/man9 X-SVN-Group: stable-12 X-SVN-Commit-Author: vmaffione X-SVN-Commit-Paths: stable/12/share/man/man9 X-SVN-Commit-Revision: 340620 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: BA7586C448 X-Spamd-Result: default: False [0.36 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.25)[0.245,0]; NEURAL_SPAM_MEDIUM(0.12)[0.116,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Nov 2018 08:56:35 -0000 Author: vmaffione Date: Mon Nov 19 08:56:34 2018 New Revision: 340620 URL: https://svnweb.freebsd.org/changeset/base/340620 Log: MFC r340475 ifnet(9): Add description of IFCAP_NETMAP Describe IFCAP_NETMAP adding a cross reference to netmap(4). Differential Revision: https://reviews.freebsd.org/D17988 Modified: stable/12/share/man/man9/ifnet.9 Directory Properties: stable/12/ (props changed) Modified: stable/12/share/man/man9/ifnet.9 ============================================================================== --- stable/12/share/man/man9/ifnet.9 Mon Nov 19 08:55:26 2018 (r340619) +++ stable/12/share/man/man9/ifnet.9 Mon Nov 19 08:56:34 2018 (r340620) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 6, 2017 +.Dd November 14, 2018 .Dt IFNET 9 .Os .Sh NAME @@ -759,6 +759,9 @@ interfaces (implies .Dv IFCAP_TSO ) . .It Dv IFCAP_LINKSTATE This Ethernet interface supports dynamic link state changes. +.It Dv IFCAP_NETMAP +This Ethernet interface supports +.Xr netmap 4 . .El .Pp The ability of advanced network interfaces to offload certain From owner-svn-src-all@freebsd.org Mon Nov 19 09:35:17 2018 Return-Path: Delivered-To: svn-src-all@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 72966113A357; Mon, 19 Nov 2018 09:35:17 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.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 0F1D26D56B; Mon, 19 Nov 2018 09:35:17 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DC0E920478; Mon, 19 Nov 2018 09:35:16 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAJ9ZGSg018218; Mon, 19 Nov 2018 09:35:16 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAJ9ZGTx018217; Mon, 19 Nov 2018 09:35:16 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201811190935.wAJ9ZGTx018217@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 19 Nov 2018 09:35:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340621 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 340621 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 0F1D26D56B X-Spamd-Result: default: False [0.58 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_MEDIUM(0.14)[0.139,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.44)[0.439,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Nov 2018 09:35:17 -0000 Author: hselasky Date: Mon Nov 19 09:35:16 2018 New Revision: 340621 URL: https://svnweb.freebsd.org/changeset/base/340621 Log: Be more verbose when a sysctl fails to unregister. Print name of sysctl in question. MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/kern/kern_sysctl.c Modified: head/sys/kern/kern_sysctl.c ============================================================================== --- head/sys/kern/kern_sysctl.c Mon Nov 19 08:56:34 2018 (r340620) +++ head/sys/kern/kern_sysctl.c Mon Nov 19 09:35:16 2018 (r340621) @@ -565,8 +565,10 @@ sysctl_unregister_oid(struct sysctl_oid *oidp) * being unloaded afterwards. It should not be a panic() * for normal use. */ - if (error) - printf("%s: failed to unregister sysctl\n", __func__); + if (error) { + printf("%s: failed(%d) to unregister sysctl(%s)\n", + __func__, error, oidp->oid_name); + } } /* Initialize a new context to keep track of dynamically added sysctls. */ From owner-svn-src-all@freebsd.org Mon Nov 19 09:36:10 2018 Return-Path: Delivered-To: svn-src-all@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 92292113A3B0; Mon, 19 Nov 2018 09:36:10 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.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 345296D6D4; Mon, 19 Nov 2018 09:36:10 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1599C2047D; Mon, 19 Nov 2018 09:36:10 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAJ9a916018296; Mon, 19 Nov 2018 09:36:09 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAJ9a9N0018295; Mon, 19 Nov 2018 09:36:09 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201811190936.wAJ9a9N0018295@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 19 Nov 2018 09:36:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340622 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 340622 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 345296D6D4 X-Spamd-Result: default: False [0.58 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.44)[0.439,0]; NEURAL_SPAM_MEDIUM(0.14)[0.139,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Nov 2018 09:36:10 -0000 Author: hselasky Date: Mon Nov 19 09:36:09 2018 New Revision: 340622 URL: https://svnweb.freebsd.org/changeset/base/340622 Log: Minor code factoring. No functional change. MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/kern/kern_sysctl.c Modified: head/sys/kern/kern_sysctl.c ============================================================================== --- head/sys/kern/kern_sysctl.c Mon Nov 19 09:35:16 2018 (r340621) +++ head/sys/kern/kern_sysctl.c Mon Nov 19 09:36:09 2018 (r340622) @@ -546,10 +546,10 @@ sysctl_unregister_oid(struct sysctl_oid *oidp) int error; SYSCTL_ASSERT_WLOCKED(); - error = ENOENT; if (oidp->oid_number == OID_AUTO) { error = EINVAL; } else { + error = ENOENT; SLIST_FOREACH(p, oidp->oid_parent, oid_link) { if (p == oidp) { SLIST_REMOVE(oidp->oid_parent, oidp, From owner-svn-src-all@freebsd.org Mon Nov 19 09:40:03 2018 Return-Path: Delivered-To: svn-src-all@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 712D5113A4D6; Mon, 19 Nov 2018 09:40:03 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.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 0FD696D8AA; Mon, 19 Nov 2018 09:40:03 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E223820484; Mon, 19 Nov 2018 09:40:02 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAJ9e2Gk018531; Mon, 19 Nov 2018 09:40:02 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAJ9e2cb018530; Mon, 19 Nov 2018 09:40:02 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201811190940.wAJ9e2cb018530@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 19 Nov 2018 09:40:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r340623 - stable/12/usr.sbin/newsyslog/newsyslog.conf.d X-SVN-Group: stable-12 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/12/usr.sbin/newsyslog/newsyslog.conf.d X-SVN-Commit-Revision: 340623 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 0FD696D8AA X-Spamd-Result: default: False [0.51 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_MEDIUM(0.12)[0.116,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.39)[0.394,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Nov 2018 09:40:03 -0000 Author: hselasky Date: Mon Nov 19 09:40:02 2018 New Revision: 340623 URL: https://svnweb.freebsd.org/changeset/base/340623 Log: MFC r340254: Put a size limit on the opensm.log and use bzip2(1). Discussed with: markj@ Sponsored by: Mellanox Technologies Modified: stable/12/usr.sbin/newsyslog/newsyslog.conf.d/opensm.conf Directory Properties: stable/12/ (props changed) Modified: stable/12/usr.sbin/newsyslog/newsyslog.conf.d/opensm.conf ============================================================================== --- stable/12/usr.sbin/newsyslog/newsyslog.conf.d/opensm.conf Mon Nov 19 09:36:09 2018 (r340622) +++ stable/12/usr.sbin/newsyslog/newsyslog.conf.d/opensm.conf Mon Nov 19 09:40:02 2018 (r340623) @@ -1,3 +1,3 @@ # $FreeBSD$ -/var/log/opensm.log 600 7 * * Z /var/run/opensm.pid 30 +/var/log/opensm.log 600 7 1000 * J /var/run/opensm.pid 30 From owner-svn-src-all@freebsd.org Mon Nov 19 09:46:49 2018 Return-Path: Delivered-To: svn-src-all@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 F378C113A768; Mon, 19 Nov 2018 09:46:48 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.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 7C8416DDEB; Mon, 19 Nov 2018 09:46:48 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5776E20616; Mon, 19 Nov 2018 09:46:48 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAJ9kmGm023649; Mon, 19 Nov 2018 09:46:48 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAJ9kmGp023648; Mon, 19 Nov 2018 09:46:48 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201811190946.wAJ9kmGp023648@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 19 Nov 2018 09:46:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r340624 - stable/11/etc/newsyslog.conf.d X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/11/etc/newsyslog.conf.d X-SVN-Commit-Revision: 340624 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 7C8416DDEB X-Spamd-Result: default: False [0.51 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.39)[0.394,0]; NEURAL_SPAM_MEDIUM(0.12)[0.116,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Nov 2018 09:46:49 -0000 Author: hselasky Date: Mon Nov 19 09:46:47 2018 New Revision: 340624 URL: https://svnweb.freebsd.org/changeset/base/340624 Log: MFC r340254: Put a size limit on the opensm.log and use bzip2(1). Discussed with: markj@ Sponsored by: Mellanox Technologies Modified: stable/11/etc/newsyslog.conf.d/opensm.conf Directory Properties: stable/11/ (props changed) Modified: stable/11/etc/newsyslog.conf.d/opensm.conf ============================================================================== --- stable/11/etc/newsyslog.conf.d/opensm.conf Mon Nov 19 09:40:02 2018 (r340623) +++ stable/11/etc/newsyslog.conf.d/opensm.conf Mon Nov 19 09:46:47 2018 (r340624) @@ -1,3 +1,3 @@ # $FreeBSD$ -/var/log/opensm.log 600 7 * * Z /var/run/opensm.pid 30 +/var/log/opensm.log 600 7 1000 * J /var/run/opensm.pid 30 From owner-svn-src-all@freebsd.org Mon Nov 19 09:50:07 2018 Return-Path: Delivered-To: svn-src-all@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 1E8AB113A840; Mon, 19 Nov 2018 09:50:07 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B94F96DF96; Mon, 19 Nov 2018 09:50:06 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9BC952061D; Mon, 19 Nov 2018 09:50:06 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAJ9o6YZ023860; Mon, 19 Nov 2018 09:50:06 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAJ9o6CO023859; Mon, 19 Nov 2018 09:50:06 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201811190950.wAJ9o6CO023859@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 19 Nov 2018 09:50:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r340625 - stable/10/etc/newsyslog.conf.d X-SVN-Group: stable-10 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/10/etc/newsyslog.conf.d X-SVN-Commit-Revision: 340625 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B94F96DF96 X-Spamd-Result: default: False [0.51 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.39)[0.394,0]; NEURAL_SPAM_MEDIUM(0.12)[0.116,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Nov 2018 09:50:07 -0000 Author: hselasky Date: Mon Nov 19 09:50:06 2018 New Revision: 340625 URL: https://svnweb.freebsd.org/changeset/base/340625 Log: MFC r340254: Put a size limit on the opensm.log and use bzip2(1). Discussed with: markj@ Sponsored by: Mellanox Technologies Modified: stable/10/etc/newsyslog.conf.d/opensm.conf Directory Properties: stable/10/ (props changed) Modified: stable/10/etc/newsyslog.conf.d/opensm.conf ============================================================================== --- stable/10/etc/newsyslog.conf.d/opensm.conf Mon Nov 19 09:46:47 2018 (r340624) +++ stable/10/etc/newsyslog.conf.d/opensm.conf Mon Nov 19 09:50:06 2018 (r340625) @@ -1,3 +1,3 @@ # $FreeBSD$ -/var/log/opensm.log 600 7 * * Z /var/run/opensm.pid 30 +/var/log/opensm.log 600 7 1000 * J /var/run/opensm.pid 30 From owner-svn-src-all@freebsd.org Mon Nov 19 10:01:04 2018 Return-Path: Delivered-To: svn-src-all@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 7819F113AE07; Mon, 19 Nov 2018 10:01:04 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.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 139E16E798; Mon, 19 Nov 2018 10:01:04 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E8F5D2090D; Mon, 19 Nov 2018 10:01:03 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAJA1364029887; Mon, 19 Nov 2018 10:01:03 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAJA13TR029886; Mon, 19 Nov 2018 10:01:03 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201811191001.wAJA13TR029886@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Mon, 19 Nov 2018 10:01:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r340626 - stable/12/sys/fs/nfsserver X-SVN-Group: stable-12 X-SVN-Commit-Author: avg X-SVN-Commit-Paths: stable/12/sys/fs/nfsserver X-SVN-Commit-Revision: 340626 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 139E16E798 X-Spamd-Result: default: False [0.26 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.14)[0.140,0]; NEURAL_SPAM_MEDIUM(0.12)[0.116,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Nov 2018 10:01:04 -0000 Author: avg Date: Mon Nov 19 10:01:03 2018 New Revision: 340626 URL: https://svnweb.freebsd.org/changeset/base/340626 Log: MFC r339595: nfsrvd_readdirplus: for some errors, do not fail the entire request Sponsored by: Panzura Modified: stable/12/sys/fs/nfsserver/nfs_nfsdport.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/fs/nfsserver/nfs_nfsdport.c ============================================================================== --- stable/12/sys/fs/nfsserver/nfs_nfsdport.c Mon Nov 19 09:50:06 2018 (r340625) +++ stable/12/sys/fs/nfsserver/nfs_nfsdport.c Mon Nov 19 10:01:03 2018 (r340626) @@ -2416,10 +2416,22 @@ again: } } } - if (!r) { - if (refp == NULL && - ((nd->nd_flag & ND_NFSV3) || - NFSNONZERO_ATTRBIT(&attrbits))) { + + /* + * If we failed to look up the entry, then it + * has become invalid, most likely removed. + */ + if (r != 0) { + if (needs_unbusy) + vfs_unbusy(new_mp); + goto invalid; + } + KASSERT(refp != NULL || nvp != NULL, + ("%s: undetected lookup error", __func__)); + + if (refp == NULL && + ((nd->nd_flag & ND_NFSV3) || + NFSNONZERO_ATTRBIT(&attrbits))) { r = nfsvno_getfh(nvp, &nfh, p); if (!r) r = nfsvno_getattr(nvp, nvap, nd, p, @@ -2440,17 +2452,25 @@ again: if (new_mp == mp) new_mp = nvp->v_mount; } - } - } else { - nvp = NULL; } - if (r) { + + /* + * If we failed to get attributes of the entry, + * then just skip it for NFSv3 (the traditional + * behavior in the old NFS server). + * For NFSv4 the behavior is controlled by + * RDATTRERROR: we either ignore the error or + * fail the request. + * Note that RDATTRERROR is never set for NFSv3. + */ + if (r != 0) { if (!NFSISSET_ATTRBIT(&attrbits, NFSATTRBIT_RDATTRERROR)) { - if (nvp != NULL) - vput(nvp); + vput(nvp); if (needs_unbusy != 0) vfs_unbusy(new_mp); + if ((nd->nd_flag & ND_NFSV3)) + goto invalid; nd->nd_repstat = r; break; } @@ -2519,6 +2539,7 @@ again: if (dirlen <= cnt) entrycnt++; } +invalid: cpos += dp->d_reclen; dp = (struct dirent *)cpos; cookiep++; From owner-svn-src-all@freebsd.org Mon Nov 19 13:59:13 2018 Return-Path: Delivered-To: svn-src-all@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 8317811046BD; Mon, 19 Nov 2018 13:59:13 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.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 262ED76542; Mon, 19 Nov 2018 13:59:13 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DE55022EE1; Mon, 19 Nov 2018 13:59:12 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAJDxCKR052072; Mon, 19 Nov 2018 13:59:12 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAJDxCc9052068; Mon, 19 Nov 2018 13:59:12 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201811191359.wAJDxCc9052068@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 19 Nov 2018 13:59:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r340627 - in releng/12.0/sys: amd64/vmm/intel x86/include x86/x86 X-SVN-Group: releng X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in releng/12.0/sys: amd64/vmm/intel x86/include x86/x86 X-SVN-Commit-Revision: 340627 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 262ED76542 X-Spamd-Result: default: False [0.73 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.58)[0.584,0]; NEURAL_SPAM_MEDIUM(0.15)[0.147,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Nov 2018 13:59:13 -0000 Author: kib Date: Mon Nov 19 13:59:11 2018 New Revision: 340627 URL: https://svnweb.freebsd.org/changeset/base/340627 Log: MFS r340605: Align IA32_ARCH_CAP MSR definitions and use with SDM rev. 068. Approved by: re (gjb) Modified: releng/12.0/sys/amd64/vmm/intel/vmx.c releng/12.0/sys/x86/include/specialreg.h releng/12.0/sys/x86/x86/cpu_machdep.c releng/12.0/sys/x86/x86/identcpu.c Directory Properties: releng/12.0/ (props changed) Modified: releng/12.0/sys/amd64/vmm/intel/vmx.c ============================================================================== --- releng/12.0/sys/amd64/vmm/intel/vmx.c Mon Nov 19 10:01:03 2018 (r340626) +++ releng/12.0/sys/amd64/vmm/intel/vmx.c Mon Nov 19 13:59:11 2018 (r340627) @@ -814,7 +814,8 @@ vmx_init(int ipinum) return (error); } - guest_l1d_flush = (cpu_ia32_arch_caps & IA32_ARCH_CAP_RDCL_NO) == 0; + guest_l1d_flush = (cpu_ia32_arch_caps & + IA32_ARCH_CAP_SKIP_L1DFL_VMENTRY) == 0; TUNABLE_INT_FETCH("hw.vmm.l1d_flush", &guest_l1d_flush); /* Modified: releng/12.0/sys/x86/include/specialreg.h ============================================================================== --- releng/12.0/sys/x86/include/specialreg.h Mon Nov 19 10:01:03 2018 (r340626) +++ releng/12.0/sys/x86/include/specialreg.h Mon Nov 19 13:59:11 2018 (r340627) @@ -434,7 +434,9 @@ /* MSR IA32_ARCH_CAP(ABILITIES) bits */ #define IA32_ARCH_CAP_RDCL_NO 0x00000001 #define IA32_ARCH_CAP_IBRS_ALL 0x00000002 -#define IA32_ARCH_CAP_SSBD_NO 0x00000004 +#define IA32_ARCH_CAP_RSBA 0x00000004 +#define IA32_ARCH_CAP_SKIP_L1DFL_VMENTRY 0x00000008 +#define IA32_ARCH_CAP_SSB_NO 0x00000010 /* * CPUID manufacturers identifiers Modified: releng/12.0/sys/x86/x86/cpu_machdep.c ============================================================================== --- releng/12.0/sys/x86/x86/cpu_machdep.c Mon Nov 19 10:01:03 2018 (r340626) +++ releng/12.0/sys/x86/x86/cpu_machdep.c Mon Nov 19 13:59:11 2018 (r340627) @@ -891,7 +891,7 @@ hw_ssb_recalculate(bool all_cpus) hw_ssb_set(true, all_cpus); break; case 2: /* auto */ - hw_ssb_set((cpu_ia32_arch_caps & IA32_ARCH_CAP_SSBD_NO) != 0 ? + hw_ssb_set((cpu_ia32_arch_caps & IA32_ARCH_CAP_SSB_NO) != 0 ? false : true, all_cpus); break; } Modified: releng/12.0/sys/x86/x86/identcpu.c ============================================================================== --- releng/12.0/sys/x86/x86/identcpu.c Mon Nov 19 10:01:03 2018 (r340626) +++ releng/12.0/sys/x86/x86/identcpu.c Mon Nov 19 13:59:11 2018 (r340627) @@ -1014,6 +1014,9 @@ printcpuinfo(void) "\020" "\001RDCL_NO" "\002IBRS_ALL" + "\003RSBA" + "\004SKIP_L1DFL_VME" + "\005SSB_NO" ); } From owner-svn-src-all@freebsd.org Mon Nov 19 14:19:29 2018 Return-Path: Delivered-To: svn-src-all@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 EEB1C1104CC0; Mon, 19 Nov 2018 14:19:28 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9476176FFF; Mon, 19 Nov 2018 14:19:28 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 731FF23221; Mon, 19 Nov 2018 14:19:28 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAJEJSl5062375; Mon, 19 Nov 2018 14:19:28 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAJEJSl4062374; Mon, 19 Nov 2018 14:19:28 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201811191419.wAJEJSl4062374@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 19 Nov 2018 14:19:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r340628 - releng/12.0/sys/kern X-SVN-Group: releng X-SVN-Commit-Author: kib X-SVN-Commit-Paths: releng/12.0/sys/kern X-SVN-Commit-Revision: 340628 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 9476176FFF X-Spamd-Result: default: False [0.48 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.46)[0.460,0]; NEURAL_SPAM_MEDIUM(0.02)[0.018,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Nov 2018 14:19:29 -0000 Author: kib Date: Mon Nov 19 14:19:27 2018 New Revision: 340628 URL: https://svnweb.freebsd.org/changeset/base/340628 Log: MFS r340603: Allow set ether/vlan PCP operation from the VNET jails. Approved by: re (gjb) Modified: releng/12.0/sys/kern/kern_jail.c Directory Properties: releng/12.0/ (props changed) Modified: releng/12.0/sys/kern/kern_jail.c ============================================================================== --- releng/12.0/sys/kern/kern_jail.c Mon Nov 19 13:59:11 2018 (r340627) +++ releng/12.0/sys/kern/kern_jail.c Mon Nov 19 14:19:27 2018 (r340628) @@ -3062,6 +3062,7 @@ prison_priv_check(struct ucred *cred, int priv) case PRIV_NET_SETIFMETRIC: case PRIV_NET_SETIFPHYS: case PRIV_NET_SETIFMAC: + case PRIV_NET_SETLANPCP: case PRIV_NET_ADDMULTI: case PRIV_NET_DELMULTI: case PRIV_NET_HWIOCTL: From owner-svn-src-all@freebsd.org Mon Nov 19 14:40:18 2018 Return-Path: Delivered-To: svn-src-all@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 165F111054D8; Mon, 19 Nov 2018 14:40:18 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail106.syd.optusnet.com.au (mail106.syd.optusnet.com.au [211.29.132.42]) by mx1.freebsd.org (Postfix) with ESMTP id 4ED8477A3A; Mon, 19 Nov 2018 14:40:11 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from [192.168.0.102] (c110-21-101-228.carlnfd1.nsw.optusnet.com.au [110.21.101.228]) by mail106.syd.optusnet.com.au (Postfix) with ESMTPS id C8B193D6534; Tue, 20 Nov 2018 01:40:00 +1100 (AEDT) Date: Tue, 20 Nov 2018 01:39:59 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Warner Losh cc: Andriy Gapon , "Rodney W. Grimes" , Allan Jude , Warner Losh , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r340450 - head/sys/sys In-Reply-To: Message-ID: <20181120005944.B1050@besplex.bde.org> References: <201811190104.wAJ14CaE059062@pdx.rh.CN85.dnsmgr.net> <5e227743-6463-d395-f2ba-da8d4ba248ca@FreeBSD.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.2 cv=FNpr/6gs c=1 sm=1 tr=0 a=PalzARQSbocsUSjMRkwAPg==:117 a=PalzARQSbocsUSjMRkwAPg==:17 a=kj9zAlcOel0A:10 a=6I5d2MoRAAAA:8 a=LIQbiBchzmXMh4q9X1oA:9 a=Qyu579rOfU3iaBEE:21 a=csjIOMLcv_6KWWZE:21 a=CjuIK1q_8ugA:10 a=IjZwj45LgO3ly-622nXo:22 X-Rspamd-Queue-Id: 4ED8477A3A X-Spamd-Result: default: False [-0.86 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.83)[-0.827,0]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:211.29.132.0/23]; FREEMAIL_FROM(0.00)[optusnet.com.au]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[optusnet.com.au]; NEURAL_SPAM_SHORT(0.28)[0.285,0]; TO_MATCH_ENVRCPT_SOME(0.00)[]; MX_GOOD(-0.01)[extmail.optusnet.com.au]; RCPT_COUNT_SEVEN(0.00)[8]; IP_SCORE(-0.01)[country: AU(-0.04)]; RCVD_NO_TLS_LAST(0.10)[]; RCVD_IN_DNSWL_LOW(-0.10)[42.132.29.211.list.dnswl.org : 127.0.5.1]; R_DKIM_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[optusnet.com.au]; ASN(0.00)[asn:4804, ipnet:211.28.0.0/14, country:AU]; RCVD_COUNT_TWO(0.00)[2]; FROM_EQ_ENVFROM(0.00)[] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Nov 2018 14:40:18 -0000 On Mon, 19 Nov 2018, Warner Losh wrote: > On Mon, Nov 19, 2018 at 12:31 AM Andriy Gapon wrote: > >> On 19/11/2018 03:38, Warner Losh wrote: >>> I'll talk to Allan to see if he can test that. the bare 1 should be >> handled >>> properly because of C's promotion rules. 1ull << 32 is an unsigned long >> long. >>> What I really wanted was "~(uint32_t)0" but that construct has bit me in >> the past. Using the long long abomination is only one of the bugs. Not a critical one. The critical one in this constant is that it is garbage. The correct constant is 2**64 divided by a power of 10. For nanoseconds, the power of 10 os 10**9, and 2**64/10**9 resembles the garbage constant. It is 4.29 times larger. This 4.29 rounded down is SBT_1NS, and it also works to add SBT_1NS outside of the shift... >> I think that you could just do (unsigned int)-1 or UINT_MAX. > > Perhaps. This avoids using the abomination, but still uses a garbage constant and the garbage constant is off by 1 relative to the intended garbage constant. >> As a side note, I wonder if those functions are ever used on negative >> values, >> given the type of the argument, and if anyone checked their correctness in >> that >> case. > > I don't think so, but an assert would be good to make sure. I checked them on all valid values. They obviously can't work, since the constant is garbage. Unfortunately, I lost the test program. IIRC, it finds about 80 million out of 1 billion wrong results for nsec precision, 32 out of 1 million wrong for usec precision, and 0 out of 1000 wrong for msec precision. > > But I think I understand the problem now. > > mstosbt(1000) is overflowing with my change, but not without because we're > adding 2^32 to a number that's ~900 away from overflowing changing a very This value is just invalid. Negative values are obviously invalid. Positive values of more than 1 second are invalid. In the old version, values of precisely 1 second don't overflow since the scale factor is rounded down; the result is just 1 unit lower than 1 second. Overflow (actually truncation) occurs at 1 unit above 1 second. E.g., sbttoms(mstosbt(1000)) was 999 and sbttoms(mstosbt(1001)) was 0. Now in my fixed version, sbttoms(mstosbt(1000)) is truncated to 0 and sbttoms(mstosbt(1001)) is truncated to 1. The test program also showed that in the old version, all valid args except 0 are reduced by precisely 1 by conversion to sbt and back. > large sleep of 1 second to a tiny sleep of 0 (which is 1ms at the default > Hz). I think we get this in the mlx code because there's a msleep(1000) in > at least one place. msleep(1001) would have failed before my change. Now I > think msleep(999) works, but msleep(1000) fails. Since the code is waiting > a second for hardware to initialize, a 1ms instead is likely to catch the > hardware before it's finished. I think this will cause problems no matter > cold or not, since it's all pause_sbt() under the covers and a delay of 0 > is still 0 either way. Bug in the mlx code. The seconds part must be converted separately, as in tstosbt(). > The fix I think is something like: > > diff --git a/sys/sys/time.h b/sys/sys/time.h > index 2207767813f2..00c6bb4a20fb 100644 > --- a/sys/sys/time.h > +++ b/sys/sys/time.h > @@ -204,8 +204,12 @@ sbttoms(sbintime_t _sbt) > static __inline sbintime_t > mstosbt(int64_t _ms) > { > + sbintime_t sb; > > - return ((_ms * (((uint64_t)1 << 63) / 500) + (1ull << 32) - 1) >> > 32); > + sb = (_ms / 1000) * SBT_1S; > + _ms = _ms % 1000; > + sb += (_ms * (((uint64_t)1 << 42) / 1000) + 1023) >> 10; > + return (sb); > } sbt never supported this. This pessimizes correct code and bloats the functions with divisions. I know too much about this because I wrote similar code for {ts,tv}<->bt conversions but phk disapproved of it and only committed a comment in sys/time.h saying not to do it. The comment forbids doing it for sbt too. However, the comment allows truncation to correct values. The sbt values are truncated to far below the floor of the infinite-precision values, because the scaling is sloppy. The scaling is much sloppier for sbt than for bt since the scale factor is in fixed point with 64 bits for bt but only 32 bits for sbt. 32 bits is barely enough for the error to be only 1 after converting back. This is because SBT_1NS is 4, so nanonseconds can be represented to an accuracy of about 1/4 using sbt; rounding down loses at most 1/4 on the nsec scale so converting back loses at most 1 provided scaling and other rounding steps don't lose several quarters. Here is a working version with too many comments. XX Index: time.h XX =================================================================== XX --- time.h (revision 340473) XX +++ time.h (working copy) XX @@ -97,11 +97,11 @@ XX { XX uint64_t _p1, _p2; XX XX - _p1 = (_bt->frac & 0xffffffffull) * _x; XX + _p1 = (_bt->frac & 0xffffffff) * _x; XX _p2 = (_bt->frac >> 32) * _x + (_p1 >> 32); XX _bt->sec *= _x; XX _bt->sec += (_p2 >> 32); XX - _bt->frac = (_p2 << 32) | (_p1 & 0xffffffffull); XX + _bt->frac = (_p2 << 32) | (_p1 & 0xffffffff); XX } XX XX static __inline void Fix other instances of the long long abomination. These were especially gratuitous, since the natural constants are 32 bits. The natural promotions of these are also correct. Using the abomination doesn't simplify analysis of conversions. long long may be larger than 64 bits. Then you have to analyze demotions instead of promotions. On LP64 systems, long long has higher rank than uint64_t, so you still must analyze demotions. XX @@ -162,9 +162,56 @@ XX * large roundoff errors which sbttons() and nstosbt() avoid. Millisecond and XX * microsecond functions are also provided for completeness. XX * XX - * These functions return the smallest sbt larger or equal to the number of XX - * seconds requested so that sbttoX(Xtosbt(y)) == y. The 1 << 32 - 1 term added XX - * transforms the >> 32 from floor() to ceil(). XX + * Violate the comment about "Background information": XX + * XX + * All these functions do sloppy scaling and/or rounding, but it is arranged XX + * that the errors compensate for each other so that sbttoX(Xtosbt(x)) == x XX + * for all valid args. XX + * XX + * Sloppy scaling in the decimal->sbt functions tends to give a result that XX + * is significantly far below the floor of the correctly rounded result (call XX + * this the "true floor"). Similary sloppy scaling in the sbt->decimal XX + * functions reduces further below the true floor. The result was that XX + * sbttoX(Xtosbt(x)) was 1 too small for all cases except x = 0. XX + * XX + * Doing correct even scaling and rounding up to the true ceiling in the XX + * decimal->sbt functions alone is useless for fixing this, since, the XX + * sbt->decimal functions reduc even true ceilings to below true floors. XX + * XX + * Instead of correcting all the functions, return a fake ceiling in the XX + * decimal->sbt functions. This ceiling is approx. 1 decimal unit above the XX + * sloppily scaled value. It is thus above the true ceiling but not 1 XX + * decimal unit or more above. It is unobvious that the sbt->decimal XX + * functions don't reduce even this fake ceiling to below the true floor. XX + * Exhaustive testing shows that they don't. The fake ceiling must be XX + * significantly more than 1 sbt unit above the true ceiling for the XX + * reduction to be not too large. Fortunately, there are no numerical XX + * accidents that give a too-low fake ceiling. XX + * XX + * The previous version claimed to calculate true ceilings. These never XX + * work. But it actually calculated fake ceilings of 2**32-1 sbt units XX + * above the sloppily scaled value. This value is nonsense, but worked XX + * accidentally in some cases. The decimal unit of 1 nsec is XX + * 2**64/10**9 ~= 18e9 sbt units. 2**32-1 is thus about 4.29 times too XX + * small to work non-accidentally. In practice, it worked accidentally in XX + * about 92% of cases. For conversions of microseconds, the value used was XX + * about 4.29e3 times too small, but worked accidentally in all except 32 XX + * cases. For conversions of milliseconds, the value used was about 4.29e6 XX + * times too small, but worked accidentally in all cases. XX + * XX + * Note that the range of valid args is significantly limited, since the XX + * efficient sloppy scaling and rounding methods used here only work up to 1 XX + * second. E.g., _ms must be between 0 and 999 inclusive, since XX + * ustosbt(1000) = 0 due to overflow of of the multiplication to almost XX + * exactly 0. This allows exhaustive testing that the sloppy methods work XX + * It is unclear if similar sloppy scaling would work above 1 second, but XX + * non-sloppy scaling is very easy for whole seconds (see tstosbt()). XX + * XX + * Uncommitted code for ts/tv<->bt was more careful, but was disapproved and XX + * the comment about "Background information" was added to inhibit commits XX + * in this area. It does non-sloppy scaling of fractional parts, then rounds XX + * to nearest. I don't remember doing exhaustive testing of it, and now don't XX + * see why rounding to nearest is enough. XX */ XX static __inline int64_t XX sbttons(sbintime_t _sbt) XX @@ -177,7 +224,79 @@ XX nstosbt(int64_t _ns) XX { XX XX - return ((_ns * (((uint64_t)1 << 63) / 500000000) + (1ull << 32) - 1) >> 32); XX + /* XX + * The adjustment is essentially to add SBT_1NS to the result of XX + * sloppy scaling and rounding down. That happens to work too, but XX + * use the slightly less sloppy method of combining shifts and XX + * subtracting 1. The result in most cses is much higher than the XX + * true ceiling, but sloppy rounding for the reverse conversion XX + * discards the extras. XX + * XX + * E.g., 2**64/10**9 has a fractional part of ~0.71. Multiplying XX + * this by the maximum valid _ns of 10**9-1 gives ~0.71e9, so XX + * rounding down after scaling gives a raw sbt that is ~0.71e9 below XX + * the true floor (only ~0.17 below the true floor in seconds). XX + * Replacing _ns by (_ns + 1) gives a raw sbt that is ~0.29e9 above XX + * the true ceiling (only ~0.068 above the true ceiling in seconds). XX + * Subtracting 1 from this makes no significant difference. Sloppy XX + * scaling and rounding in the reverse conversion recovers the XX + * original value: the sloppy scaling reduces the value from above the XX + * true ceiling to below the true ceiling (but not below the true XX + * floor); then rounding down recovers the true floor. XX + * XX + * Similarly for _all_ valid args and for the us and ms conversions. XX + * It is fairly obvious that the result of conversion back to ns is XX + * never 1 too low (since we add 1), but not obvious that the result XX + * is never 1 too high (since adding 1 risks this). XX + * XX + * Conversion from sbt to decimal and back has no chance of always XX + * restoring the original values since the decimal formats have less XX + * precision. Adding 1 is too sloppy to do anything good for this XX + * direction. The uncommitted ts/tv<->bt conversions are supposed to XX + * work as well as possible in both directions. Rounding to nearest XX + * works better and non-sloppy scaling is obviously needed to work in XX + * both directions. However, non-sloppy scaling doesn't work with XX + * mixed or sloppy rounding. In the above example with _ns = 10**9-1, XX + * it gives a raw sbt that is just 1 below the true floor. Adding 1 XX + * to this gives the true ceiling in the sbt, but unless the reverse XX + * conversion is changed similarly, it reduces from the true ceiling XX + * to below the true floor, so the result of converting back has much XX + * the same off-by-1 errors as simpler method (always 1 too low except XX + * for an arg of 0). XX + * XX + * Further examples: XX + * - when _ns = 0, sbt is SBT_1NS, but converting this back to ns XX + * gives 0. If we start with this sbt, oue conversion functions XX + * are still unusable for printing it in nsec. XX + * - when _ns = 10**9-1, we are close to overflow. Adding 1 to it XX + * doesn't quite reach the overflow threshold. XX + * - in previous versions, when _ns = 10**9, overflow was not quite XX + * reached, and the result of a double conversion had the usual XX + * off-by-1 error. XX + * - when _ns = 10**9, overflow now occurs and the result of a double XX + * conversion is 0 XX + * - when _ns = 10**9+1, overflow occurs in previous versions and the XX + * result of a double conversion is 0 (overflow gives an off-by-10**9 XX + * error and then the usual off-by-1-error occurs. XX + */ XX +#if 1 XX + /* XX + * This version does non-sloppy scaling which after rounding down is XX + * close to or equal 1 below the true ceiling for all nonzero args. XX + * Then adding 1 gives an adequate true or fake ceiling. Some of the XX + * above comments are wrong about the true ceiling not working. XX + * Unfortunately, this is about 30% slower (a whole cycle extra in XX + * the test). The unnecessary subtraction of 1 in the main version XX + * costs about 1/2 of a cycle in the test. XX + */ XX + uint64_t factor, frac; XX + XX + factor = ((uint64_t)1 << 63) / 500000000; XX + frac = ((0 - factor * 1000000000) << 32) / 1000000000; XX + return (((_ns * factor + ((_ns * frac) >> 32)) >> 32) + 1); XX +#else XX + return (((_ns + 1) * (((uint64_t)1 << 63) / 500000000) - 1) >> 32); XX +#endif XX } XX XX static __inline int64_t XX @@ -191,7 +310,7 @@ XX ustosbt(int64_t _us) XX { XX XX - return ((_us * (((uint64_t)1 << 63) / 500000) + (1ull << 32) - 1) >> 32); XX + return (((_us + 1) * (((uint64_t)1 << 63) / 500000) - 1) >> 32); XX } XX XX static __inline int64_t XX @@ -205,7 +324,7 @@ XX mstosbt(int64_t _ms) XX { XX XX - return ((_ms * (((uint64_t)1 << 63) / 500) + (1ull << 32) - 1) >> 32); XX + return (((_ms + 1) * (((uint64_t)1 << 63) / 500) - 1) >> 32); XX } XX XX /*- Here is my old code for the corresponding disapproved scaling for bt. This uses rounding to nearest in all functions, and does less sloppy scaling, but has wrong constants. It seemed to work, but I don't remember do exhaustive testing of it. The rounding to nearest probably compensates for errors in the constants. YY Index: time.h YY =================================================================== YY RCS file: /home/ncvs/src/sys/sys/time.h,v YY retrieving revision 1.50 YY diff -u -2 -r1.50 time.h YY --- time.h 8 Feb 2002 03:55:37 -0000 1.50 YY +++ time.h 7 Mar 2002 10:04:34 -0000 YY @@ -127,5 +125,6 @@ YY YY ts->tv_sec = bt->sec; YY - ts->tv_nsec = (1000000000ULL * (u_int32_t)(bt->frac >> 32)) >> 32; YY + ts->tv_nsec = ((uint64_t)1000000000 * (uint32_t)(bt->frac >> 32) + YY + 0x80000000) >> 32; YY } YY The power-of-2 constant is correct in this direction. YY @@ -133,7 +132,17 @@ YY timespec2bintime(struct timespec *ts, struct bintime *bt) YY { YY + uint64_t factor, frac; YY YY bt->sec = ts->tv_sec; YY - bt->frac = ts->tv_nsec * 18446744073ULL; /* int(2^64 / 1000000000) */ YY + YY + /* YY + * Even the imperfect rounding here is much more expensive than the YY + * perfect rounding in bintime2timespec(), but this is not a problem YY + * because this function is rarely used. In fact, it is not used at YY + * all (yet?) (only timeval2bintime() is used). YY + */ YY + factor = (uint64_t)(-1) / 1000000000; YY + frac = (((uint64_t)(-1) - factor * 100000000 + 1) << 32) / 1000000000; YY + bt->frac = ts->tv_nsec * factor + ((ts->tv_nsec * frac) >> 32); YY } YY This shows how to do the scaling accurately to within 1 bt unit, except the constant is wrong in the new code (for frac) -- one of the powers of 10 is missing an 0 digit :-(. As the comment says, this doesn't bother to round bt->frac specially, so does rounding down. bt has so much more precision than ts (about 2**34 times more) that the rounding doesn't matter, provided you round to nearest in the reverse direction. Perfect rounding down in both directions of course gives a reduction by 1 unit for the double conversion for all args except 0. Unlike for sbt, the bt conversion functions support args larger than 1 second, so there are too many args for exhaustive testing, but the conversions don't lose precision for whole seconds so there is no need to test args larger than 1 second. YY @@ -143,5 +152,6 @@ YY YY tv->tv_sec = bt->sec; YY - tv->tv_usec = (1000000ULL * (u_int32_t)(bt->frac >> 32)) >> 32; YY + tv->tv_usec = ((uint64_t)1000000 * (uint32_t)(bt->frac >> 32) + YY + 0x80000000) >> 32; YY } YY YY @@ -149,10 +159,13 @@ YY timeval2bintime(struct timeval *tv, struct bintime *bt) YY { YY + uint64_t factor, frac; YY YY bt->sec = tv->tv_sec; YY - bt->frac = tv->tv_usec * 18446744073709ULL; /* int(2^64 / 1000000) */ YY -} YY YY -/* end of struct bintime stuff */ YY + /* See above rounding. */ YY + factor = (uint64_t)(-1) / 1000000; YY + frac = (((uint64_t)(-1) - factor * 100000 + 1) << 32) / 1000000; This is also missing an 0 digit. YY + bt->frac = tv->tv_usec * factor + ((tv->tv_usec * frac) >> 32); YY +} YY YY #ifdef _KERNEL sys/time.h still uses the long long abominations and the obfuscated constant 1844... in the code. Only verbose comments which spell this constant constant correctly (in pseudo-code) were committed. These bugs are missing for the corresponding constants in sbt conversions. Bruce From owner-svn-src-all@freebsd.org Mon Nov 19 15:18:31 2018 Return-Path: Delivered-To: svn-src-all@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 6B3FF1106436; Mon, 19 Nov 2018 15:18:31 +0000 (UTC) (envelope-from shurd@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 0BFD17952F; Mon, 19 Nov 2018 15:18:31 +0000 (UTC) (envelope-from shurd@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E134E23BCD; Mon, 19 Nov 2018 15:18:30 +0000 (UTC) (envelope-from shurd@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAJFIU8L093137; Mon, 19 Nov 2018 15:18:30 GMT (envelope-from shurd@FreeBSD.org) Received: (from shurd@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAJFIUg0093136; Mon, 19 Nov 2018 15:18:30 GMT (envelope-from shurd@FreeBSD.org) Message-Id: <201811191518.wAJFIUg0093136@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: shurd set sender to shurd@FreeBSD.org using -f From: Stephen Hurd Date: Mon, 19 Nov 2018 15:18:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r340629 - stable/12/sys/net X-SVN-Group: stable-12 X-SVN-Commit-Author: shurd X-SVN-Commit-Paths: stable/12/sys/net X-SVN-Commit-Revision: 340629 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 0BFD17952F X-Spamd-Result: default: False [0.42 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-0.00)[-0.002,0]; NEURAL_SPAM_SHORT(0.43)[0.426,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Nov 2018 15:18:31 -0000 Author: shurd Date: Mon Nov 19 15:18:30 2018 New Revision: 340629 URL: https://svnweb.freebsd.org/changeset/base/340629 Log: MFC r340434, r340445 r340434: Fix leaks caused by ifc_nhwtxqs never being initialized r333502 removed initialization of ifc_nhwtxqs, and it's not clear there's a need to copy it into the struct iflib_ctx at all. Use ctx->ifc_sctx->isc_ntxqs instead. Further, iflib_stop() did not clear the last ring in the case where isc_nfl != isc_nrxqs (such as when IFLIB_HAS_RXCQ is set). Use ctx->ifc_sctx->isc_nrxqs here instead of isc_nfl. Reported by: pkelsey Reviewed by: pkelsey Sponsored by: Limelight Networks Differential Revision: https://reviews.freebsd.org/D17979 r340445: Clear RX completion queue state veriables in iflib_stop() iflib_stop() was not resetting the rxq completion queue state variables. This meant that for any driver that has receive completion queues, after a reinit, iflib would start asking what's available on the rx side starting at whatever the completion queue index was prior to the stop, instead of at 0. Submitted by: pkelsey Reported by: pkelsey Sponsored by: Limelight Networks Modified: stable/12/sys/net/iflib.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/net/iflib.c ============================================================================== --- stable/12/sys/net/iflib.c Mon Nov 19 14:19:27 2018 (r340628) +++ stable/12/sys/net/iflib.c Mon Nov 19 15:18:30 2018 (r340629) @@ -175,8 +175,6 @@ struct iflib_ctx { struct sx ifc_ctx_sx; struct mtx ifc_state_mtx; - uint16_t ifc_nhwtxqs; - iflib_txq_t ifc_txqs; iflib_rxq_t ifc_rxqs; uint32_t ifc_if_flags; @@ -1771,6 +1769,7 @@ iflib_txq_setup(iflib_txq_t txq) { if_ctx_t ctx = txq->ift_ctx; if_softc_ctx_t scctx = &ctx->ifc_softc_ctx; + if_shared_ctx_t sctx = ctx->ifc_sctx; iflib_dma_info_t di; int i; @@ -1784,11 +1783,11 @@ iflib_txq_setup(iflib_txq_t txq) txq->ift_pidx = txq->ift_cidx = txq->ift_npending = 0; txq->ift_size = scctx->isc_ntxd[txq->ift_br_offset]; - for (i = 0, di = txq->ift_ifdi; i < ctx->ifc_nhwtxqs; i++, di++) + for (i = 0, di = txq->ift_ifdi; i < sctx->isc_ntxqs; i++, di++) bzero((void *)di->idi_vaddr, di->idi_size); IFDI_TXQ_SETUP(ctx, txq->ift_id); - for (i = 0, di = txq->ift_ifdi; i < ctx->ifc_nhwtxqs; i++, di++) + for (i = 0, di = txq->ift_ifdi; i < sctx->isc_ntxqs; i++, di++) bus_dmamap_sync(di->idi_tag, di->idi_map, BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); return (0); @@ -2375,6 +2374,7 @@ iflib_stop(if_ctx_t ctx) iflib_txq_t txq = ctx->ifc_txqs; iflib_rxq_t rxq = ctx->ifc_rxqs; if_softc_ctx_t scctx = &ctx->ifc_softc_ctx; + if_shared_ctx_t sctx = ctx->ifc_sctx; iflib_dma_info_t di; iflib_fl_t fl; int i, j; @@ -2408,13 +2408,14 @@ iflib_stop(if_ctx_t ctx) txq->ift_no_tx_dma_setup = txq->ift_txd_encap_efbig = txq->ift_map_failed = 0; txq->ift_pullups = 0; ifmp_ring_reset_stats(txq->ift_br); - for (j = 0, di = txq->ift_ifdi; j < ctx->ifc_nhwtxqs; j++, di++) + for (j = 0, di = txq->ift_ifdi; j < sctx->isc_ntxqs; j++, di++) bzero((void *)di->idi_vaddr, di->idi_size); } for (i = 0; i < scctx->isc_nrxqsets; i++, rxq++) { /* make sure all transmitters have completed before proceeding XXX */ - for (j = 0, di = rxq->ifr_ifdi; j < rxq->ifr_nfl; j++, di++) + rxq->ifr_cq_gen = rxq->ifr_cq_cidx = rxq->ifr_cq_pidx = 0; + for (j = 0, di = rxq->ifr_ifdi; j < sctx->isc_nrxqs; j++, di++) bzero((void *)di->idi_vaddr, di->idi_size); /* also resets the free lists pidx/cidx */ for (j = 0, fl = rxq->ifr_fl; j < rxq->ifr_nfl; j++, fl++) @@ -5516,11 +5517,12 @@ static void iflib_tx_structures_free(if_ctx_t ctx) { iflib_txq_t txq = ctx->ifc_txqs; + if_shared_ctx_t sctx = ctx->ifc_sctx; int i, j; for (i = 0; i < NTXQSETS(ctx); i++, txq++) { iflib_txq_destroy(txq); - for (j = 0; j < ctx->ifc_nhwtxqs; j++) + for (j = 0; j < sctx->isc_ntxqs; j++) iflib_dma_free(&txq->ift_ifdi[j]); } free(ctx->ifc_txqs, M_IFLIB); From owner-svn-src-all@freebsd.org Mon Nov 19 15:20:08 2018 Return-Path: Delivered-To: svn-src-all@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 147DF110655B; Mon, 19 Nov 2018 15:20:08 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail105.syd.optusnet.com.au (mail105.syd.optusnet.com.au [211.29.132.249]) by mx1.freebsd.org (Postfix) with ESMTP id AA7A179738; Mon, 19 Nov 2018 15:20:06 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from [192.168.0.102] (c110-21-101-228.carlnfd1.nsw.optusnet.com.au [110.21.101.228]) by mail105.syd.optusnet.com.au (Postfix) with ESMTPS id E7E2810562FF; Tue, 20 Nov 2018 02:19:57 +1100 (AEDT) Date: Tue, 20 Nov 2018 02:19:57 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Bruce Evans cc: Warner Losh , Andriy Gapon , "Rodney W. Grimes" , Allan Jude , Warner Losh , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r340450 - head/sys/sys In-Reply-To: <20181120005944.B1050@besplex.bde.org> Message-ID: <20181120014951.J1250@besplex.bde.org> References: <201811190104.wAJ14CaE059062@pdx.rh.CN85.dnsmgr.net> <5e227743-6463-d395-f2ba-da8d4ba248ca@FreeBSD.org> <20181120005944.B1050@besplex.bde.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.2 cv=P6RKvmIu c=1 sm=1 tr=0 a=PalzARQSbocsUSjMRkwAPg==:117 a=PalzARQSbocsUSjMRkwAPg==:17 a=kj9zAlcOel0A:10 a=6I5d2MoRAAAA:8 a=04AClt5CvOlRR2CIbe8A:9 a=ODUrRZQBT3x5M27z:21 a=yO6B2NnfoD2nWY7K:21 a=CjuIK1q_8ugA:10 a=IjZwj45LgO3ly-622nXo:22 X-Rspamd-Queue-Id: AA7A179738 X-Spamd-Result: default: False [-0.86 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.83)[-0.829,0]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; FREEMAIL_FROM(0.00)[optusnet.com.au]; R_SPF_ALLOW(-0.20)[+ip4:211.29.132.0/23]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[optusnet.com.au]; NEURAL_SPAM_SHORT(0.28)[0.284,0]; TO_MATCH_ENVRCPT_SOME(0.00)[]; MX_GOOD(-0.01)[cached: extmail.optusnet.com.au]; RCPT_COUNT_SEVEN(0.00)[9]; IP_SCORE(-0.01)[country: AU(-0.04)]; FREEMAIL_TO(0.00)[optusnet.com.au]; RCVD_NO_TLS_LAST(0.10)[]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[optusnet.com.au]; ASN(0.00)[asn:4804, ipnet:211.28.0.0/14, country:AU]; RCVD_COUNT_TWO(0.00)[2]; RCVD_IN_DNSWL_LOW(-0.10)[249.132.29.211.list.dnswl.org : 127.0.5.1] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Nov 2018 15:20:08 -0000 On Tue, 20 Nov 2018, Bruce Evans wrote: > On Mon, 19 Nov 2018, Warner Losh wrote: > >> On Mon, Nov 19, 2018 at 12:31 AM Andriy Gapon wrote: > >>> As a side note, I wonder if those functions are ever used on negative >>> values, >>> given the type of the argument, and if anyone checked their correctness in >>> that >>> case. >> >> I don't think so, but an assert would be good to make sure. > > I checked them on all valid values. They obviously can't work, since the > constant is garbage. Unfortunately, I lost the test program. IIRC, it > finds about 80 million out of 1 billion wrong results for nsec precision, > 32 out of 1 million wrong for usec precision, and 0 out of 1000 wrong for > msec precision. I found my test program. >> But I think I understand the problem now. >> >> mstosbt(1000) is overflowing with my change, but not without because we're >> adding 2^32 to a number that's ~900 away from overflowing changing a very > > This value is just invalid. Negative values are obviously invalid. Positive > values of more than 1 second are invalid. In the old version, values of > precisely 1 second don't overflow since the scale factor is rounded down; > the result is just 1 unit lower than 1 second. Overflow (actually > truncation) > occurs at 1 unit above 1 second. E.g., sbttoms(mstosbt(1000)) was 999 and > sbttoms(mstosbt(1001)) was 0. Now in my fixed version, > sbttoms(mstosbt(1000)) > is truncated to 0 and sbttoms(mstosbt(1001)) is truncated to 1. > > The test program also showed that in the old version, all valid args except > 0 are reduced by precisely 1 by conversion to sbt and back. > >> large sleep of 1 second to a tiny sleep of 0 (which is 1ms at the default >> Hz). I think we get this in the mlx code because there's a msleep(1000) in >> at least one place. msleep(1001) would have failed before my change. Now I >> think msleep(999) works, but msleep(1000) fails. Since the code is waiting >> a second for hardware to initialize, a 1ms instead is likely to catch the >> hardware before it's finished. I think this will cause problems no matter >> cold or not, since it's all pause_sbt() under the covers and a delay of 0 >> is still 0 either way. > > Bug in the mlx code. The seconds part must be converted separately, as in > tstosbt(). mlx doesn't seem to use sbt directly, or even msleep(), so the bug does seem to be central. mlx actually uses mtx_sleep() with timo = hz(). mtx_sleep() is actually an obfuscated macro wrapping _sleep(). The conversion to sbt is done by the macro and is sloppy. It multiplies timo by tick_sbt. tick_sbt is SBT_1S / hz, so the sbt is SBT_1S / hz * hz which is SBT_1S reduced a little. This is not affected by the new code, and it still isn't converted back to 1 second in ms, us or ns. Even if it is converted back and then forth to sbt using the new code, it remains less than 1 second as an sbt so shouldn't cause any new problems. Here is the test program: XX /* Test decimal<->sbt conversions. */ XX XX #include XX XX #include XX XX int XX main(int argc, char **argcv) XX { XX uint64_t sbt; XX int i, j, wrong; XX XX wrong = 0; XX for (i = 0; i < 1000; i++) { XX sbt = mstosbt(i); XX j = sbttoms(sbt); XX if (i != j) { XX wrong++; XX if (argc > 1) XX printf("%d -> %#jx -> %d\n", XX i, (uintmax_t)sbt, j); XX } XX } XX printf("%d wrong values for ms\n", wrong); XX XX wrong = 0; XX for (i = 0; i < 1000000; i++) { XX sbt = ustosbt(i); XX j = sbttous(sbt); XX if (i != j) { XX wrong++; XX if (argc > 1) XX printf("%d -> %#jx -> %d\n", XX i, (uintmax_t)sbt, j); XX } XX } XX printf("%d wrong values for us\n", wrong); XX XX wrong = 0; XX for (i = 0; i < 1000000000; i++) { XX sbt = nstosbt(i); XX j = sbttons(sbt); XX if (i != j) { XX wrong++; XX if (argc > 1) XX printf("%d -> %#jx -> %d\n", XX i, (uintmax_t)sbt, j); XX } XX } XX printf("%d wrong values for ns\n", wrong); XX } Output: 0 wrong values for ms 32 wrong values for us 82602428 wrong values for ns Bruce From owner-svn-src-all@freebsd.org Mon Nov 19 15:29:41 2018 Return-Path: Delivered-To: svn-src-all@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 9F1281106A40; Mon, 19 Nov 2018 15:29:41 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 459A07A05D; Mon, 19 Nov 2018 15:29:41 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0317823DA6; Mon, 19 Nov 2018 15:29:41 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAJFTecT098578; Mon, 19 Nov 2018 15:29:40 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAJFTeDA098576; Mon, 19 Nov 2018 15:29:40 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201811191529.wAJFTeDA098576@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Mon, 19 Nov 2018 15:29:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r340630 - in stable/12/sys: amd64/conf riscv/conf X-SVN-Group: stable-12 X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: in stable/12/sys: amd64/conf riscv/conf X-SVN-Commit-Revision: 340630 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 459A07A05D X-Spamd-Result: default: False [0.42 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-0.00)[-0.002,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.43)[0.426,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Nov 2018 15:29:41 -0000 Author: gjb Date: Mon Nov 19 15:29:40 2018 New Revision: 340630 URL: https://svnweb.freebsd.org/changeset/base/340630 Log: Remove debugging options from amd64 MINIMAL [1] and riscv GENERIC kernel configuration files. This should have been turned off when stable/12 branched. This is a direct commit to stable/12. Submitted by: Harry Schmalzbauer [1] Sponsored by: The FreeBSD Foundation Modified: stable/12/sys/amd64/conf/MINIMAL stable/12/sys/riscv/conf/GENERIC Modified: stable/12/sys/amd64/conf/MINIMAL ============================================================================== --- stable/12/sys/amd64/conf/MINIMAL Mon Nov 19 15:18:30 2018 (r340629) +++ stable/12/sys/amd64/conf/MINIMAL Mon Nov 19 15:29:40 2018 (r340630) @@ -82,15 +82,6 @@ options INCLUDE_CONFIG_FILE # Include this file in ke # Debugging support. Always need this: options KDB # Enable kernel debugger support. options KDB_TRACE # Print a stack trace for a panic. -# For full debugger support use (turn off in stable branch): -options DDB # Support DDB. -options GDB # Support remote GDB. -options DEADLKRES # Enable the deadlock resolver -options INVARIANTS # Enable calls of extra sanity checking -options INVARIANT_SUPPORT # Extra sanity checks of internal structures, required by INVARIANTS -options WITNESS # Enable checks to detect deadlocks and cycles -options WITNESS_SKIPSPIN # Don't run witness on spinlocks for speed -options MALLOC_DEBUG_MAXZONES=8 # Separate malloc(9) zones # Make an SMP-capable kernel by default options SMP # Symmetric MultiProcessor Kernel Modified: stable/12/sys/riscv/conf/GENERIC ============================================================================== --- stable/12/sys/riscv/conf/GENERIC Mon Nov 19 15:18:30 2018 (r340629) +++ stable/12/sys/riscv/conf/GENERIC Mon Nov 19 15:29:40 2018 (r340630) @@ -114,17 +114,6 @@ device uart_ns8250 # ns8250-type UART driver # Debugging support. Always need this: options KDB # Enable kernel debugger support. options KDB_TRACE # Print a stack trace for a panic. -# For full debugger support use (turn off in stable branch): -options DDB # Support DDB. -# options GDB # Support remote GDB. -options DEADLKRES # Enable the deadlock resolver -options INVARIANTS # Enable calls of extra sanity checking -options INVARIANT_SUPPORT # Extra sanity checks of internal structures, required by INVARIANTS -# options WITNESS # Enable checks to detect deadlocks and cycles -# options WITNESS_SKIPSPIN # Don't run witness on spinlocks for speed -options MALLOC_DEBUG_MAXZONES=8 # Separate malloc(9) zones -# options EARLY_PRINTF -# options VERBOSE_SYSINIT # Kernel dump features. options ZSTDIO # zstd-compressed kernel and user dumps From owner-svn-src-all@freebsd.org Mon Nov 19 15:31:55 2018 Return-Path: Delivered-To: svn-src-all@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 7DA861106B44; Mon, 19 Nov 2018 15:31:55 +0000 (UTC) (envelope-from tijl@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 24CE57A606; Mon, 19 Nov 2018 15:31:55 +0000 (UTC) (envelope-from tijl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 05F9923F1C; Mon, 19 Nov 2018 15:31:55 +0000 (UTC) (envelope-from tijl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAJFVsV3002782; Mon, 19 Nov 2018 15:31:54 GMT (envelope-from tijl@FreeBSD.org) Received: (from tijl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAJFVsb2002781; Mon, 19 Nov 2018 15:31:54 GMT (envelope-from tijl@FreeBSD.org) Message-Id: <201811191531.wAJFVsb2002781@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tijl set sender to tijl@FreeBSD.org using -f From: Tijl Coosemans Date: Mon, 19 Nov 2018 15:31:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340631 - head/sys/compat/linux X-SVN-Group: head X-SVN-Commit-Author: tijl X-SVN-Commit-Paths: head/sys/compat/linux X-SVN-Commit-Revision: 340631 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 24CE57A606 X-Spamd-Result: default: False [0.49 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_MEDIUM(0.03)[0.027,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.47)[0.467,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Nov 2018 15:31:55 -0000 Author: tijl Date: Mon Nov 19 15:31:54 2018 New Revision: 340631 URL: https://svnweb.freebsd.org/changeset/base/340631 Log: Do proper copyin of control message data in the Linux sendmsg syscall. Instead of calling m_append with a user address, allocate an mbuf cluster and copy data into it using copyin. For the SCM_CREDS case, instead of zeroing a stack variable and appending that to the mbuf, zero part of the mbuf cluster directly. One mbuf cluster is also the size limit used by the FreeBSD sendmsg syscall (uipc_syscalls.c:sockargs()). PR: 217901 Reviewed by: kib MFC after: 3 days Modified: head/sys/compat/linux/linux_socket.c Modified: head/sys/compat/linux/linux_socket.c ============================================================================== --- head/sys/compat/linux/linux_socket.c Mon Nov 19 15:29:40 2018 (r340630) +++ head/sys/compat/linux/linux_socket.c Mon Nov 19 15:31:54 2018 (r340631) @@ -1085,7 +1085,6 @@ linux_sendmsg_common(struct thread *td, l_int s, struc l_uint flags) { struct cmsghdr *cmsg; - struct cmsgcred cmcred; struct mbuf *control; struct msghdr msg; struct l_cmsghdr linux_cmsg; @@ -1096,6 +1095,7 @@ linux_sendmsg_common(struct thread *td, l_int s, struc struct sockaddr *sa; sa_family_t sa_family; void *data; + l_size_t len; int error; error = copyin(msghdr, &linux_msg, sizeof(linux_msg)); @@ -1126,7 +1126,6 @@ linux_sendmsg_common(struct thread *td, l_int s, struc return (error); control = NULL; - cmsg = NULL; if ((ptr_cmsg = LINUX_CMSG_FIRSTHDR(&linux_msg)) != NULL) { error = kern_getsockname(td, s, &sa, &datalen); @@ -1136,8 +1135,10 @@ linux_sendmsg_common(struct thread *td, l_int s, struc free(sa, M_SONAME); error = ENOBUFS; - cmsg = malloc(CMSG_HDRSZ, M_LINUX, M_WAITOK|M_ZERO); control = m_get(M_WAITOK, MT_CONTROL); + MCLGET(control, M_WAITOK); + data = mtod(control, void *); + datalen = 0; do { error = copyin(ptr_cmsg, &linux_cmsg, @@ -1149,10 +1150,14 @@ linux_sendmsg_common(struct thread *td, l_int s, struc if (linux_cmsg.cmsg_len < sizeof(struct l_cmsghdr)) goto bad; + if (datalen + CMSG_HDRSZ > MCLBYTES) + goto bad; + /* * Now we support only SCM_RIGHTS and SCM_CRED, * so return EINVAL in any other cmsg_type */ + cmsg = data; cmsg->cmsg_type = linux_to_bsd_cmsg_type(linux_cmsg.cmsg_type); cmsg->cmsg_level = @@ -1170,35 +1175,34 @@ linux_sendmsg_common(struct thread *td, l_int s, struc if (sa_family != AF_UNIX) continue; - data = LINUX_CMSG_DATA(ptr_cmsg); - datalen = linux_cmsg.cmsg_len - L_CMSG_HDRSZ; + if (cmsg->cmsg_type == SCM_CREDS) { + len = sizeof(struct cmsgcred); + if (datalen + CMSG_SPACE(len) > MCLBYTES) + goto bad; - switch (cmsg->cmsg_type) - { - case SCM_RIGHTS: - break; - - case SCM_CREDS: - data = &cmcred; - datalen = sizeof(cmcred); - /* * The lower levels will fill in the structure */ - bzero(data, datalen); - break; + memset(CMSG_DATA(data), 0, len); + } else { + len = linux_cmsg.cmsg_len - L_CMSG_HDRSZ; + if (datalen + CMSG_SPACE(len) < datalen || + datalen + CMSG_SPACE(len) > MCLBYTES) + goto bad; + + error = copyin(LINUX_CMSG_DATA(ptr_cmsg), + CMSG_DATA(data), len); + if (error != 0) + goto bad; } - cmsg->cmsg_len = CMSG_LEN(datalen); - - error = ENOBUFS; - if (!m_append(control, CMSG_HDRSZ, (c_caddr_t)cmsg)) - goto bad; - if (!m_append(control, datalen, (c_caddr_t)data)) - goto bad; + cmsg->cmsg_len = CMSG_LEN(len); + data = (char *)data + CMSG_SPACE(len); + datalen += CMSG_SPACE(len); } while ((ptr_cmsg = LINUX_CMSG_NXTHDR(&linux_msg, ptr_cmsg))); - if (m_length(control, NULL) == 0) { + control->m_len = datalen; + if (datalen == 0) { m_freem(control); control = NULL; } @@ -1212,8 +1216,6 @@ linux_sendmsg_common(struct thread *td, l_int s, struc bad: m_freem(control); free(iov, M_IOV); - if (cmsg) - free(cmsg, M_LINUX); return (error); } From owner-svn-src-all@freebsd.org Mon Nov 19 15:36:59 2018 Return-Path: Delivered-To: svn-src-all@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 18DF91106F2D; Mon, 19 Nov 2018 15:36:59 +0000 (UTC) (envelope-from zeising@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.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 B1AFE7AD94; Mon, 19 Nov 2018 15:36:58 +0000 (UTC) (envelope-from zeising@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9281923F53; Mon, 19 Nov 2018 15:36:58 +0000 (UTC) (envelope-from zeising@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAJFawJI003819; Mon, 19 Nov 2018 15:36:58 GMT (envelope-from zeising@FreeBSD.org) Received: (from zeising@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAJFawVk003818; Mon, 19 Nov 2018 15:36:58 GMT (envelope-from zeising@FreeBSD.org) Message-Id: <201811191536.wAJFawVk003818@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: zeising set sender to zeising@FreeBSD.org using -f From: Niclas Zeising Date: Mon, 19 Nov 2018 15:36:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340632 - head/sys/powerpc/conf X-SVN-Group: head X-SVN-Commit-Author: zeising X-SVN-Commit-Paths: head/sys/powerpc/conf X-SVN-Commit-Revision: 340632 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B1AFE7AD94 X-Spamd-Result: default: False [0.56 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.54)[0.542,0]; NEURAL_SPAM_MEDIUM(0.02)[0.018,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Nov 2018 15:36:59 -0000 Author: zeising (doc,ports committer) Date: Mon Nov 19 15:36:58 2018 New Revision: 340632 URL: https://svnweb.freebsd.org/changeset/base/340632 Log: Enable evdev on ppc64 Enable evdev on ppc64 as well, similar to what was done for amd64 and i386 in r340387. Evdev can be used by X and is used by wayland to handle input devices. Approved by: mmacy MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D18026 Modified: head/sys/powerpc/conf/GENERIC64 Modified: head/sys/powerpc/conf/GENERIC64 ============================================================================== --- head/sys/powerpc/conf/GENERIC64 Mon Nov 19 15:31:54 2018 (r340631) +++ head/sys/powerpc/conf/GENERIC64 Mon Nov 19 15:36:58 2018 (r340632) @@ -246,3 +246,8 @@ device snd_uaudio # USB Audio # Netmap provides direct access to TX/RX rings on supported NICs device netmap # netmap(4) support + +# evdev interface +options EVDEV_SUPPORT # evdev support in legacy drivers +device evdev # input event device support +device uinput # install /dev/uinput cdev From owner-svn-src-all@freebsd.org Mon Nov 19 15:42:36 2018 Return-Path: Delivered-To: svn-src-all@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 1ED651107300; Mon, 19 Nov 2018 15:42:36 +0000 (UTC) (envelope-from chmeeedalf@gmail.com) Received: from mail-it1-x130.google.com (mail-it1-x130.google.com [IPv6:2607:f8b0:4864:20::130]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 747EA7B323; Mon, 19 Nov 2018 15:42:35 +0000 (UTC) (envelope-from chmeeedalf@gmail.com) Received: by mail-it1-x130.google.com with SMTP id a205-v6so8884594itd.4; Mon, 19 Nov 2018 07:42:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=HbIwgcHuXX//9R6rTqoQYOso6gar08aGpe1OBN8vahA=; b=iTHrSyWui22whsyiPw1i/i+WsPfEyEJfnXpzFL3T9fDINKRUooVeLrBZtSfqGPjLAA 360bgaWTCVWY4Z5ovGhE1lThKbpFxDpo+qaPUqlNPi2RGlISFJLCJ0FoPRTtMaYaS44V BHJZeH8AZuFztNo/qXSUi9xhLeLzZ975pHhcJRbKQcxt+3dksa4jPb79mGjxs/jacy4k UbGffUOPNLL89U+P0HLu5lUhVueezsZXa9wkQtq7O/y+JnS8SlzY0dgAeHp+ksGfytvl jaPtqMtLWcrm+f9tPaS7SJSW3T5JaHbVE6KS/1fnwLzqAyCLD0qhH1JuN9tCFnUhquYK iMow== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=HbIwgcHuXX//9R6rTqoQYOso6gar08aGpe1OBN8vahA=; b=j6PUO0Rhg4auhrnlc5o8NyPY0yV/eKjfUG4KBIdGv4+/wTAiagMZyCdjI7uonnhnst +/4Rc5HAT16iQJ/ttENBplDZvAS4F+anwMajI1Ry7X+U76r68DYLdR0lNmXMUKQ7+3fi h5x9GrBVEIV6TXutxfXDd8P1MUmVnfAlB4HBmQLs+yZa3tliNaTpwV0jO/MeyZn8OFZU Iwo12FdswOH4bn9xkcT/zVWIDCF9A6FeFowvIk9HFaa5TA6x2ersIFpFir19PUNdhnIx PmKbXmD4oehywT8ZWL4YigpjQUowO36BjN5zu34us3B7s0LX0HvHp3i7T/Y5WAQPUwDw c/JA== X-Gm-Message-State: AGRZ1gJnp8z2BR0BO9nVy/8W4jYt1i34P8Afv+jgSaXLoj0WmMtQIHR3 ay3V09xaOXVymv29fnXes0OR3BgZ X-Google-Smtp-Source: AJdET5d/YLK/xaAQkaRfJSup8CmDuaPcwsshHgEdL7mAW78kF7chEywOGQZNCOVLET7GM4+7WekE+g== X-Received: by 2002:a24:4a10:: with SMTP id k16-v6mr8776928itb.170.1542642154513; Mon, 19 Nov 2018 07:42:34 -0800 (PST) Received: from ralga.knownspace (173-25-245-129.client.mchsi.com. [173.25.245.129]) by smtp.gmail.com with ESMTPSA id p74sm7656851iod.14.2018.11.19.07.42.33 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 19 Nov 2018 07:42:34 -0800 (PST) Date: Mon, 19 Nov 2018 09:42:31 -0600 From: Justin Hibbits To: Niclas Zeising Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r340632 - head/sys/powerpc/conf Message-ID: <20181119094231.2802ec8c@ralga.knownspace> In-Reply-To: <201811191536.wAJFawVk003818@repo.freebsd.org> References: <201811191536.wAJFawVk003818@repo.freebsd.org> X-Mailer: Claws Mail 3.16.0 (GTK+ 2.24.32; powerpc64-portbld-freebsd12.0) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 747EA7B323 X-Spamd-Result: default: False [-5.09 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_DKIM_ALLOW(-0.20)[gmail.com]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36]; FREEMAIL_FROM(0.00)[gmail.com]; MIME_GOOD(-0.10)[text/plain]; TO_MATCH_ENVRCPT_ALL(0.00)[]; TO_DN_SOME(0.00)[]; RCVD_COUNT_THREE(0.00)[3]; DKIM_TRACE(0.00)[gmail.com:+]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; RCVD_IN_DNSWL_NONE(0.00)[0.3.1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.0]; MX_GOOD(-0.01)[cached: alt3.gmail-smtp-in.l.google.com]; NEURAL_HAM_SHORT(-0.99)[-0.988,0]; FROM_EQ_ENVFROM(0.00)[]; RCVD_TLS_LAST(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; IP_SCORE(-2.09)[ip: (-6.24), ipnet: 2607:f8b0::/32(-2.43), asn: 15169(-1.67), country: US(-0.09)] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Nov 2018 15:42:36 -0000 On Mon, 19 Nov 2018 15:36:58 +0000 (UTC) Niclas Zeising wrote: > Author: zeising (doc,ports committer) > Date: Mon Nov 19 15:36:58 2018 > New Revision: 340632 > URL: https://svnweb.freebsd.org/changeset/base/340632 > > Log: > Enable evdev on ppc64 > > Enable evdev on ppc64 as well, similar to what was done for amd64 > and i386 in r340387. > > Evdev can be used by X and is used by wayland to handle input > devices. > Approved by: mmacy > MFC after: 2 weeks > Differential Revision: https://reviews.freebsd.org/D18026 > > Modified: > head/sys/powerpc/conf/GENERIC64 > > Modified: head/sys/powerpc/conf/GENERIC64 > ============================================================================== > --- head/sys/powerpc/conf/GENERIC64 Mon Nov 19 15:31:54 > 2018 (r340631) +++ head/sys/powerpc/conf/GENERIC64 Mon > Nov 19 15:36:58 2018 (r340632) @@ -246,3 +246,8 @@ > device snd_uaudio # USB Audio > # Netmap provides direct access to TX/RX rings on supported NICs > device netmap # netmap(4) support > + > +# evdev interface > +options EVDEV_SUPPORT # evdev support in > legacy drivers +device evdev # > input event device support +device > uinput # install /dev/uinput cdev > Is there a reason this is only in GENERIC64, not GENERIC as well? Does it not compile for 32-bit powerpc? - Justin From owner-svn-src-all@freebsd.org Mon Nov 19 15:49:41 2018 Return-Path: Delivered-To: svn-src-all@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 DA07111074EE; Mon, 19 Nov 2018 15:49:40 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 81A2C7B620; Mon, 19 Nov 2018 15:49:40 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 48A9B2410A; Mon, 19 Nov 2018 15:49:40 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAJFne3H009052; Mon, 19 Nov 2018 15:49:40 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAJFnd6S009050; Mon, 19 Nov 2018 15:49:39 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201811191549.wAJFnd6S009050@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Mon, 19 Nov 2018 15:49:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r340633 - in releng/12.0/sys: amd64/conf riscv/conf X-SVN-Group: releng X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: in releng/12.0/sys: amd64/conf riscv/conf X-SVN-Commit-Revision: 340633 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 81A2C7B620 X-Spamd-Result: default: False [0.58 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.55)[0.550,0]; NEURAL_SPAM_MEDIUM(0.03)[0.027,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Nov 2018 15:49:41 -0000 Author: gjb Date: Mon Nov 19 15:49:39 2018 New Revision: 340633 URL: https://svnweb.freebsd.org/changeset/base/340633 Log: MFS12 r340630: Remove debugging options from amd64 MINIMAL [1] and riscv GENERIC kernel configuration files. This should have been turned off when stable/12 branched. Submitted by: Harry Schmalzbauer [1] Approved by: re (kib) Sponsored by: The FreeBSD Foundation Modified: releng/12.0/sys/amd64/conf/MINIMAL releng/12.0/sys/riscv/conf/GENERIC Directory Properties: releng/12.0/ (props changed) Modified: releng/12.0/sys/amd64/conf/MINIMAL ============================================================================== --- releng/12.0/sys/amd64/conf/MINIMAL Mon Nov 19 15:36:58 2018 (r340632) +++ releng/12.0/sys/amd64/conf/MINIMAL Mon Nov 19 15:49:39 2018 (r340633) @@ -82,15 +82,6 @@ options INCLUDE_CONFIG_FILE # Include this file in ke # Debugging support. Always need this: options KDB # Enable kernel debugger support. options KDB_TRACE # Print a stack trace for a panic. -# For full debugger support use (turn off in stable branch): -options DDB # Support DDB. -options GDB # Support remote GDB. -options DEADLKRES # Enable the deadlock resolver -options INVARIANTS # Enable calls of extra sanity checking -options INVARIANT_SUPPORT # Extra sanity checks of internal structures, required by INVARIANTS -options WITNESS # Enable checks to detect deadlocks and cycles -options WITNESS_SKIPSPIN # Don't run witness on spinlocks for speed -options MALLOC_DEBUG_MAXZONES=8 # Separate malloc(9) zones # Make an SMP-capable kernel by default options SMP # Symmetric MultiProcessor Kernel Modified: releng/12.0/sys/riscv/conf/GENERIC ============================================================================== --- releng/12.0/sys/riscv/conf/GENERIC Mon Nov 19 15:36:58 2018 (r340632) +++ releng/12.0/sys/riscv/conf/GENERIC Mon Nov 19 15:49:39 2018 (r340633) @@ -114,17 +114,6 @@ device uart_ns8250 # ns8250-type UART driver # Debugging support. Always need this: options KDB # Enable kernel debugger support. options KDB_TRACE # Print a stack trace for a panic. -# For full debugger support use (turn off in stable branch): -options DDB # Support DDB. -# options GDB # Support remote GDB. -options DEADLKRES # Enable the deadlock resolver -options INVARIANTS # Enable calls of extra sanity checking -options INVARIANT_SUPPORT # Extra sanity checks of internal structures, required by INVARIANTS -# options WITNESS # Enable checks to detect deadlocks and cycles -# options WITNESS_SKIPSPIN # Don't run witness on spinlocks for speed -options MALLOC_DEBUG_MAXZONES=8 # Separate malloc(9) zones -# options EARLY_PRINTF -# options VERBOSE_SYSINIT # Kernel dump features. options ZSTDIO # zstd-compressed kernel and user dumps From owner-svn-src-all@freebsd.org Mon Nov 19 15:58:35 2018 Return-Path: Delivered-To: svn-src-all@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 7F6541107D44; Mon, 19 Nov 2018 15:58:35 +0000 (UTC) (envelope-from zeising@freebsd.org) Received: from mail.daemonic.se (mail.daemonic.se [IPv6:2607:f740:d:20::25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 06EEE7BE5D; Mon, 19 Nov 2018 15:58:35 +0000 (UTC) (envelope-from zeising@freebsd.org) Received: from cid.daemonic.se (localhost [IPv6:::1]) by mail.daemonic.se (Postfix) with ESMTP id 42zD5j23cqzDj6N; Mon, 19 Nov 2018 15:58:33 +0000 (UTC) X-Virus-Scanned: amavisd-new at daemonic.se Received: from mail.daemonic.se ([127.0.0.1]) (using TLS with cipher ECDHE-RSA-AES128-GCM-SHA256) by cid.daemonic.se (mailscanner.daemonic.se [127.0.0.1]) (amavisd-new, port 10587) with ESMTPS id 0JnOSS2JoyNK; Mon, 19 Nov 2018 15:58:32 +0000 (UTC) Received: from garnet.daemonic.se (host-95-192-227-159.mobileonline.telia.com [95.192.227.159]) by mail.daemonic.se (Postfix) with ESMTPSA id 42zD5h4ySczDhFd; Mon, 19 Nov 2018 15:58:32 +0000 (UTC) Subject: Re: svn commit: r339476 - head/sys/i386/conf To: Conrad Meyer , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201810201916.w9KJGh0H066643@repo.freebsd.org> From: Niclas Zeising Message-ID: <2afa1dbf-10f9-8e38-36b6-e40fb0020d87@freebsd.org> Date: Mon, 19 Nov 2018 16:58:31 +0100 User-Agent: Mutt/1.5.21 MIME-Version: 1.0 In-Reply-To: <201810201916.w9KJGh0H066643@repo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 06EEE7BE5D X-Spamd-Result: default: False [-0.07 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_HAM_MEDIUM(-0.68)[-0.675,0]; ASN(0.00)[asn:36236, ipnet:2607:f740:d::/48, country:US]; NEURAL_SPAM_SHORT(0.61)[0.609,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Nov 2018 15:58:35 -0000 On 10/20/18 9:16 PM, Conrad Meyer wrote: > Author: cem > Date: Sat Oct 20 19:16:43 2018 > New Revision: 339476 > URL: https://svnweb.freebsd.org/changeset/base/339476 > > Log: > Add a MINIMAL config for i386, based on amd64 > Any plans to MFC this? Regards -- Niclas Zeising From owner-svn-src-all@freebsd.org Mon Nov 19 16:05:42 2018 Return-Path: Delivered-To: svn-src-all@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 BCD21110804C; Mon, 19 Nov 2018 16:05:42 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail106.syd.optusnet.com.au (mail106.syd.optusnet.com.au [211.29.132.42]) by mx1.freebsd.org (Postfix) with ESMTP id 445B57C598; Mon, 19 Nov 2018 16:05:41 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from [192.168.0.102] (c110-21-101-228.carlnfd1.nsw.optusnet.com.au [110.21.101.228]) by mail106.syd.optusnet.com.au (Postfix) with ESMTPS id 439063D7C56; Tue, 20 Nov 2018 03:05:38 +1100 (AEDT) Date: Tue, 20 Nov 2018 03:05:37 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Bruce Evans cc: Warner Losh , Andriy Gapon , "Rodney W. Grimes" , Allan Jude , Warner Losh , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r340450 - head/sys/sys In-Reply-To: <20181120014951.J1250@besplex.bde.org> Message-ID: <20181120023823.M1428@besplex.bde.org> References: <201811190104.wAJ14CaE059062@pdx.rh.CN85.dnsmgr.net> <5e227743-6463-d395-f2ba-da8d4ba248ca@FreeBSD.org> <20181120005944.B1050@besplex.bde.org> <20181120014951.J1250@besplex.bde.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.2 cv=FNpr/6gs c=1 sm=1 tr=0 a=PalzARQSbocsUSjMRkwAPg==:117 a=PalzARQSbocsUSjMRkwAPg==:17 a=kj9zAlcOel0A:10 a=6I5d2MoRAAAA:8 a=4dtU_Np7U4CNcjolt7IA:9 a=CjuIK1q_8ugA:10 a=IjZwj45LgO3ly-622nXo:22 X-Rspamd-Queue-Id: 445B57C598 X-Spamd-Result: default: False [-1.64 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.83)[-0.828,0]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; FREEMAIL_FROM(0.00)[optusnet.com.au]; R_SPF_ALLOW(-0.20)[+ip4:211.29.132.0/23]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[optusnet.com.au]; TO_MATCH_ENVRCPT_SOME(0.00)[]; MX_GOOD(-0.01)[cached: extmail.optusnet.com.au]; NEURAL_HAM_SHORT(-0.50)[-0.499,0]; RCPT_COUNT_SEVEN(0.00)[9]; IP_SCORE(-0.01)[country: AU(-0.04)]; FREEMAIL_TO(0.00)[optusnet.com.au]; RCVD_NO_TLS_LAST(0.10)[]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[optusnet.com.au]; ASN(0.00)[asn:4804, ipnet:211.28.0.0/14, country:AU]; RCVD_COUNT_TWO(0.00)[2]; RCVD_IN_DNSWL_LOW(-0.10)[42.132.29.211.list.dnswl.org : 127.0.5.1] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Nov 2018 16:05:43 -0000 On Tue, 20 Nov 2018, Bruce Evans wrote: > On Tue, 20 Nov 2018, Bruce Evans wrote: > >> On Mon, 19 Nov 2018, Warner Losh wrote: >> >>> On Mon, Nov 19, 2018 at 12:31 AM Andriy Gapon wrote: > ... > I found my test program. > >>> But I think I understand the problem now. >>> >>> mstosbt(1000) is overflowing with my change, but not without because we're >>> adding 2^32 to a number that's ~900 away from overflowing changing a very >> >> This value is just invalid. Negative values are obviously invalid. >> Positive >> values of more than 1 second are invalid. In the old version, values of >> precisely 1 second don't overflow since the scale factor is rounded down; >> the result is just 1 unit lower than 1 second. Overflow (actually >> truncation) >> occurs at 1 unit above 1 second. E.g., sbttoms(mstosbt(1000)) was 999 and >> sbttoms(mstosbt(1001)) was 0. Now in my fixed version, >> sbttoms(mstosbt(1000)) >> is truncated to 0 and sbttoms(mstosbt(1001)) is truncated to 1. >> >> The test program also showed that in the old version, all valid args except >> 0 are reduced by precisely 1 by conversion to sbt and back. >> >>> large sleep of 1 second to a tiny sleep of 0 (which is 1ms at the default >>> Hz). I think we get this in the mlx code because there's a msleep(1000) in >>> at least one place. msleep(1001) would have failed before my change. Now I >>> think msleep(999) works, but msleep(1000) fails. Since the code is waiting >>> a second for hardware to initialize, a 1ms instead is likely to catch the >>> hardware before it's finished. I think this will cause problems no matter >>> cold or not, since it's all pause_sbt() under the covers and a delay of 0 >>> is still 0 either way. >> >> Bug in the mlx code. The seconds part must be converted separately, as in >> tstosbt(). > > mlx doesn't seem to use sbt directly, or even msleep(), so the bug does > seem to be central. > > mlx actually uses mtx_sleep() with timo = hz(). mtx_sleep() is actually > an obfuscated macro wrapping _sleep(). The conversion to sbt is done by > the macro and is sloppy. It multiplies timo by tick_sbt. > > tick_sbt is SBT_1S / hz, so the sbt is SBT_1S / hz * hz which is SBT_1S > reduced a little. This is not affected by the new code, and it still isn't > converted back to 1 second in ms, us or ns. Even if it is converted back > and then forth to sbt using the new code, it remains less than 1 second as > an sbt so shouldn't cause any new problems. Here are all uses of these functions in kern outside of sys/time.h: XX arm/arm/mpcore_timer.c: sc->et.et_min_period = nstosbt(20); OK since 20 ns is less than 1 second. XX cddl/compat/opensolaris/sys/kcondvar.h: return (cv_timedwait_sbt(cvp, mp, nstosbt(tim), nstosbt(res), 0)); XX cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_tx.c: pause_sbt("dmu_tx_delay", nstosbt(wakeup), XX cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_tx.c: nstosbt(zfs_delay_resolution_ns), C_ABSOLUTE); XX cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c: sbintime_t sleep = nstosbt((zilog->zl_last_lwb_latency * pct) / 100); XX compat/linuxkpi/common/include/linux/delay.h: pause_sbt("lnxsleep", mstosbt(ms), 0, C_HARDCLOCK); XX compat/linuxkpi/common/src/linux_hrtimer.c: nstosbt(hrtimer->expires), nstosbt(hrtimer->precision), 0); XX compat/linuxkpi/common/src/linux_hrtimer.c: callout_reset_sbt(&hrtimer->callout, nstosbt(ktime_to_ns(time)), XX compat/linuxkpi/common/src/linux_hrtimer.c: nstosbt(nsec), hrtimer_call_handler, hrtimer, 0); XX compat/linuxkpi/common/src/linux_hrtimer.c: callout_reset_sbt(&hrtimer->callout, nstosbt(ktime_to_ns(interval)), XX compat/linuxkpi/common/src/linux_hrtimer.c: nstosbt(hrtimer->precision), hrtimer_call_handler, hrtimer, 0); XX compat/linuxkpi/common/src/linux_schedule.c: ret = -pause_sbt("lnxsleep", mstosbt(ms), 0, C_HARDCLOCK | C_CATCH); All of the above might are broken unless their timeout arg is restricted to less than 1 second. Also, at least the sleep and pause calls in the above probably have a style bug in knowing about sbt's at all. More important functions like msleep() hide the use of sbt's and use fuzzier scale factors like tick_sbt. XX dev/iicbus/nxprtc.c: pause_sbt("nxpotp", mstosbt(100), mstosbt(10), 0); XX dev/iicbus/nxprtc.c: pause_sbt("nxpbat", mstosbt(100), 0, 0); OK since 100 ms is less than 1 second. XX kern/kern_sysctl.c: sb = ustosbt(tt); XX kern/kern_sysctl.c: sb = mstosbt(tt); Recently added bugs. The args is supplied by applications so can be far above 1 second. Also, these functions have a bogus API that takes uint64_t args. sbt's can't represent that high, and the API doesn't support failure, so callers have the burden of passing valid values. It is easiest to only support args up to 1 second and require the caller to handle seconds. Lots of itimer and select() code handle the corresponding problem for timevals and timespecs almost correctly. Timevals and timespecs already have the seconds part separate and itimer and select() syscalls do validity checking on the fractional seconds, so there is no problem converting the fractional sections to an sbt. Howver, the seconds part has type time_t and this can be int64_t, which sbt's cannot represent. Also, POSIX doesn't permit failure for seconds values that are representable by time_t. The almost correct handling is to split up large seconds values in some cases and break POSIX conformance by silently reducing the seconds value in other cases. The reduction is usually to INT32_MAX / 2. This allows adding 2 limited values but it is not obvious that this is enough since rounding up twice or just adding 2 more would give overflow. XX kern/subr_rtc.c: sbt = nstosbt(waitns); This is correct, since waitns is the nanoseconds part of a timespec. Bruce From owner-svn-src-all@freebsd.org Mon Nov 19 16:07:43 2018 Return-Path: Delivered-To: svn-src-all@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 16EED1108237; Mon, 19 Nov 2018 16:07:43 +0000 (UTC) (envelope-from zeising@freebsd.org) Received: from mail.daemonic.se (mail.daemonic.se [IPv6:2607:f740:d:20::25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A97C17C7F6; Mon, 19 Nov 2018 16:07:42 +0000 (UTC) (envelope-from zeising@freebsd.org) Received: from cid.daemonic.se (localhost [IPv6:::1]) by mail.daemonic.se (Postfix) with ESMTP id 42zDJF647szDj6N; Mon, 19 Nov 2018 16:07:41 +0000 (UTC) X-Virus-Scanned: amavisd-new at daemonic.se Received: from mail.daemonic.se ([IPv6:::1]) (using TLS with cipher ECDHE-RSA-AES128-GCM-SHA256) by cid.daemonic.se (mailscanner.daemonic.se [IPv6:::1]) (amavisd-new, port 10587) with ESMTPS id zXFiegDcBMMf; Mon, 19 Nov 2018 16:07:41 +0000 (UTC) Received: from garnet.daemonic.se (host-95-192-227-159.mobileonline.telia.com [95.192.227.159]) by mail.daemonic.se (Postfix) with ESMTPSA id 42zDJF0snbzDj6l; Mon, 19 Nov 2018 16:07:41 +0000 (UTC) Subject: Re: svn commit: r340632 - head/sys/powerpc/conf To: Justin Hibbits Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201811191536.wAJFawVk003818@repo.freebsd.org> <20181119094231.2802ec8c@ralga.knownspace> From: Niclas Zeising Message-ID: Date: Mon, 19 Nov 2018 17:07:40 +0100 User-Agent: Mutt/1.5.21 MIME-Version: 1.0 In-Reply-To: <20181119094231.2802ec8c@ralga.knownspace> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: A97C17C7F6 X-Spamd-Result: default: False [0.33 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_HAM_MEDIUM(-0.25)[-0.249,0]; NEURAL_SPAM_SHORT(0.58)[0.580,0]; ASN(0.00)[asn:36236, ipnet:2607:f740:d::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Nov 2018 16:07:43 -0000 On 11/19/18 4:42 PM, Justin Hibbits wrote: > On Mon, 19 Nov 2018 15:36:58 +0000 (UTC) > Niclas Zeising wrote: > >> Author: zeising (doc,ports committer) >> Date: Mon Nov 19 15:36:58 2018 >> New Revision: 340632 >> URL: https://svnweb.freebsd.org/changeset/base/340632 >> >> Log: >> Enable evdev on ppc64 >> >> Enable evdev on ppc64 as well, similar to what was done for amd64 >> and i386 in r340387. >> >> Evdev can be used by X and is used by wayland to handle input >> devices. >> Approved by: mmacy >> MFC after: 2 weeks >> Differential Revision: https://reviews.freebsd.org/D18026 >> >> Modified: >> head/sys/powerpc/conf/GENERIC64 >> >> Modified: head/sys/powerpc/conf/GENERIC64 >> ============================================================================== >> --- head/sys/powerpc/conf/GENERIC64 Mon Nov 19 15:31:54 >> 2018 (r340631) +++ head/sys/powerpc/conf/GENERIC64 Mon >> Nov 19 15:36:58 2018 (r340632) @@ -246,3 +246,8 @@ >> device snd_uaudio # USB Audio >> # Netmap provides direct access to TX/RX rings on supported NICs >> device netmap # netmap(4) support >> + >> +# evdev interface >> +options EVDEV_SUPPORT # evdev support in >> legacy drivers +device evdev # >> input event device support +device >> uinput # install /dev/uinput cdev >> > > Is there a reason this is only in GENERIC64, not GENERIC as well? Does > it not compile for 32-bit powerpc? > > - Justin > Hi! mmacy only asked about ppc64, and as far as I know it's only tested there. I can create a patch for ppc32 as well, but I can't test myself. Regards -- Niclas Zeising From owner-svn-src-all@freebsd.org Mon Nov 19 16:40:20 2018 Return-Path: Delivered-To: svn-src-all@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 9DB0611092D3; Mon, 19 Nov 2018 16:40:20 +0000 (UTC) (envelope-from shurd@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 3CE477DF6E; Mon, 19 Nov 2018 16:40:20 +0000 (UTC) (envelope-from shurd@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1D80B24942; Mon, 19 Nov 2018 16:40:20 +0000 (UTC) (envelope-from shurd@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAJGeKqf035825; Mon, 19 Nov 2018 16:40:20 GMT (envelope-from shurd@FreeBSD.org) Received: (from shurd@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAJGeJDb035824; Mon, 19 Nov 2018 16:40:19 GMT (envelope-from shurd@FreeBSD.org) Message-Id: <201811191640.wAJGeJDb035824@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: shurd set sender to shurd@FreeBSD.org using -f From: Stephen Hurd Date: Mon, 19 Nov 2018 16:40:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r340634 - releng/12.0/sys/net X-SVN-Group: releng X-SVN-Commit-Author: shurd X-SVN-Commit-Paths: releng/12.0/sys/net X-SVN-Commit-Revision: 340634 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 3CE477DF6E X-Spamd-Result: default: False [0.51 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_MEDIUM(0.03)[0.027,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.49)[0.487,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Nov 2018 16:40:20 -0000 Author: shurd Date: Mon Nov 19 16:40:19 2018 New Revision: 340634 URL: https://svnweb.freebsd.org/changeset/base/340634 Log: MFS r340629 r340434: Fix leaks caused by ifc_nhwtxqs never being initialized (broken by r333502) and clear the last ring in the case where isc_nfl != isc_nrxqs r340445: Clear RX completion queue state variables in iflib_stop() Approved by: re (gjb) Sponsored by: Limelight Networks Modified: releng/12.0/sys/net/iflib.c Directory Properties: releng/12.0/ (props changed) Modified: releng/12.0/sys/net/iflib.c ============================================================================== --- releng/12.0/sys/net/iflib.c Mon Nov 19 15:49:39 2018 (r340633) +++ releng/12.0/sys/net/iflib.c Mon Nov 19 16:40:19 2018 (r340634) @@ -175,8 +175,6 @@ struct iflib_ctx { struct sx ifc_ctx_sx; struct mtx ifc_state_mtx; - uint16_t ifc_nhwtxqs; - iflib_txq_t ifc_txqs; iflib_rxq_t ifc_rxqs; uint32_t ifc_if_flags; @@ -1771,6 +1769,7 @@ iflib_txq_setup(iflib_txq_t txq) { if_ctx_t ctx = txq->ift_ctx; if_softc_ctx_t scctx = &ctx->ifc_softc_ctx; + if_shared_ctx_t sctx = ctx->ifc_sctx; iflib_dma_info_t di; int i; @@ -1784,11 +1783,11 @@ iflib_txq_setup(iflib_txq_t txq) txq->ift_pidx = txq->ift_cidx = txq->ift_npending = 0; txq->ift_size = scctx->isc_ntxd[txq->ift_br_offset]; - for (i = 0, di = txq->ift_ifdi; i < ctx->ifc_nhwtxqs; i++, di++) + for (i = 0, di = txq->ift_ifdi; i < sctx->isc_ntxqs; i++, di++) bzero((void *)di->idi_vaddr, di->idi_size); IFDI_TXQ_SETUP(ctx, txq->ift_id); - for (i = 0, di = txq->ift_ifdi; i < ctx->ifc_nhwtxqs; i++, di++) + for (i = 0, di = txq->ift_ifdi; i < sctx->isc_ntxqs; i++, di++) bus_dmamap_sync(di->idi_tag, di->idi_map, BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); return (0); @@ -2375,6 +2374,7 @@ iflib_stop(if_ctx_t ctx) iflib_txq_t txq = ctx->ifc_txqs; iflib_rxq_t rxq = ctx->ifc_rxqs; if_softc_ctx_t scctx = &ctx->ifc_softc_ctx; + if_shared_ctx_t sctx = ctx->ifc_sctx; iflib_dma_info_t di; iflib_fl_t fl; int i, j; @@ -2408,13 +2408,14 @@ iflib_stop(if_ctx_t ctx) txq->ift_no_tx_dma_setup = txq->ift_txd_encap_efbig = txq->ift_map_failed = 0; txq->ift_pullups = 0; ifmp_ring_reset_stats(txq->ift_br); - for (j = 0, di = txq->ift_ifdi; j < ctx->ifc_nhwtxqs; j++, di++) + for (j = 0, di = txq->ift_ifdi; j < sctx->isc_ntxqs; j++, di++) bzero((void *)di->idi_vaddr, di->idi_size); } for (i = 0; i < scctx->isc_nrxqsets; i++, rxq++) { /* make sure all transmitters have completed before proceeding XXX */ - for (j = 0, di = rxq->ifr_ifdi; j < rxq->ifr_nfl; j++, di++) + rxq->ifr_cq_gen = rxq->ifr_cq_cidx = rxq->ifr_cq_pidx = 0; + for (j = 0, di = rxq->ifr_ifdi; j < sctx->isc_nrxqs; j++, di++) bzero((void *)di->idi_vaddr, di->idi_size); /* also resets the free lists pidx/cidx */ for (j = 0, fl = rxq->ifr_fl; j < rxq->ifr_nfl; j++, fl++) @@ -5516,11 +5517,12 @@ static void iflib_tx_structures_free(if_ctx_t ctx) { iflib_txq_t txq = ctx->ifc_txqs; + if_shared_ctx_t sctx = ctx->ifc_sctx; int i, j; for (i = 0; i < NTXQSETS(ctx); i++, txq++) { iflib_txq_destroy(txq); - for (j = 0; j < ctx->ifc_nhwtxqs; j++) + for (j = 0; j < sctx->isc_ntxqs; j++) iflib_dma_free(&txq->ift_ifdi[j]); } free(ctx->ifc_txqs, M_IFLIB); From owner-svn-src-all@freebsd.org Mon Nov 19 16:45:00 2018 Return-Path: Delivered-To: svn-src-all@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 055EE110951A; Mon, 19 Nov 2018 16:45:00 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: from mail-oi1-f196.google.com (mail-oi1-f196.google.com [209.85.167.196]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 673197E4C3; Mon, 19 Nov 2018 16:44:59 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: by mail-oi1-f196.google.com with SMTP id p82-v6so25761147oih.11; Mon, 19 Nov 2018 08:44:59 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=XyOR6qBYKiI96Z5p/zrOomwx7VCMAnsz+pVScw7eySQ=; b=bLrGymn5HOtgyzNYEXCaLyDCMtFHtOWi5IIuMbvmKPv1814knN6CAkl8j+VUrOdhla 32FyGeHxhbPMhfTVRZIDkDi62jlXOKzSgWXWMytKq0PI7EW/v63P7Xj+xJOEmdhPr1GX frHHOAjoTKFz4hBso4fHICU9ZKNmFKZs9ClH5Og852UnBK3uOFNKhHDaQWciaQYxIZfX 55hhH9H93k8bpiy05njSr6I3f/f+qrfahM/c6G97gvjmV5pqeKv94EGAoGVr9D1uO0bO N2SrK9Mfz41MOdt3XsZsEdGHXhwwJreEUBmdzIEEBy3tzAEeW+wwfrF0gPLQ1RPJo1NR A7Sw== X-Gm-Message-State: AGRZ1gL0ZGdDkZp+JwhUTX5fL+Fm+Jz4pKB/CmJ7OlWf7uzOL6WtHBJ+ hDNOTWrmG3aHHgVz6oB0F+wHuj1n9d1mayFGaMFeQtLH X-Google-Smtp-Source: AJdET5fPISuTnolB1mdGleB/kpa8hJbZiuTBT/FQrWteMD2OZbNM/XkE4gSGtCaBvI2NaC785wmrHIHOaBPyAdLs3Fc= X-Received: by 2002:aca:cc0d:: with SMTP id c13mr1354004oig.150.1542645411766; Mon, 19 Nov 2018 08:36:51 -0800 (PST) MIME-Version: 1.0 References: <201811121552.wACFqjLr002955@repo.freebsd.org> In-Reply-To: <201811121552.wACFqjLr002955@repo.freebsd.org> From: Ed Maste Date: Mon, 19 Nov 2018 11:36:38 -0500 Message-ID: Subject: Re: svn commit: r340363 - in head: . contrib/tcpdump contrib/traceroute lib/libcasper/services/cap_dns lib/libcasper/services/cap_dns/tests sbin/ping To: Mariusz Zaborski , Pawel Jakub Dawidek Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 673197E4C3 X-Spamd-Result: default: False [-3.03 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.99)[-0.991,0]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; RCVD_TLS_LAST(0.00)[]; DMARC_NA(0.00)[freebsd.org]; RCPT_COUNT_FIVE(0.00)[5]; IP_SCORE(-1.05)[ipnet: 209.85.128.0/17(-3.47), asn: 15169(-1.67), country: US(-0.09)]; MX_GOOD(-0.01)[cached: alt3.gmail-smtp-in.l.google.com]; NEURAL_HAM_SHORT(-0.98)[-0.980,0]; RCVD_IN_DNSWL_NONE(0.00)[196.167.85.209.list.dnswl.org : 127.0.5.0]; FORGED_SENDER(0.30)[emaste@freebsd.org,carpeddiem@gmail.com]; RWL_MAILSPIKE_POSSIBLE(0.00)[196.167.85.209.rep.mailspike.net : 127.0.0.17]; R_DKIM_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; FROM_NEQ_ENVFROM(0.00)[emaste@freebsd.org,carpeddiem@gmail.com]; RCVD_COUNT_TWO(0.00)[2] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Nov 2018 16:45:00 -0000 On Mon, 12 Nov 2018 at 10:53, Mariusz Zaborski wrote: > > Author: oshogbo > Date: Mon Nov 12 15:52:45 2018 > New Revision: 340363 > URL: https://svnweb.freebsd.org/changeset/base/340363 > > Log: > libcasper: [ch]ange the name of limits in cap_dns so the intentions are obvious. Mariusz and I discussed this on IRC but for the sake of the archives this breaks applications with existing calls to cap_dns_type_limit using the old names - e.g., upstream tcpdump. As tcpdump is the only out-of-tree consumer of cap_dns_type_limit that I'm aware of we could probably fix this by submitting a patch to tcpdump to add a configure test or a __FreeBSD_version conditional. However, it seems easiest to just allow either string in cap_dns. From owner-svn-src-all@freebsd.org Mon Nov 19 16:47:22 2018 Return-Path: Delivered-To: svn-src-all@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 150EA11095DB; Mon, 19 Nov 2018 16:47:22 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AE38A7E732; Mon, 19 Nov 2018 16:47:21 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8B48924AE7; Mon, 19 Nov 2018 16:47:21 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAJGlLoq040877; Mon, 19 Nov 2018 16:47:21 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAJGlLfm040876; Mon, 19 Nov 2018 16:47:21 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201811191647.wAJGlLfm040876@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Mon, 19 Nov 2018 16:47:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340635 - head/lib/libbe X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/lib/libbe X-SVN-Commit-Revision: 340635 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: AE38A7E732 X-Spamd-Result: default: False [0.49 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_MEDIUM(0.02)[0.018,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.48)[0.476,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Nov 2018 16:47:22 -0000 Author: kevans Date: Mon Nov 19 16:47:21 2018 New Revision: 340635 URL: https://svnweb.freebsd.org/changeset/base/340635 Log: libbe(3): Handle non-ZFS rootfs better If rootfs isn't ZFS, current version will emit an error claiming so and fail to initialize libbe. As a consumer, bectl -r (undocumented) can be specified to operate on a BE independently of whether on a UFS or ZFS root. Unbreak this for the UFS case by only erroring out the init if we can't determine a ZFS dataset for rootfs and no BE root was specified. Consumers of libbe should take care to ensure that rootfs is non-empty if they're trying to use it, because this could certainly be the case. Some check is needed before zfs_path_to_zhandle because it will unconditionally emit to stderr if the path isn't a ZFS filesystem, which is unhelpful for our purposes. This should also unbreak the bectl(8) tests on a UFS root, as is the case in Jenkins' -test runs. MFC after: 3 days Modified: head/lib/libbe/be.c Modified: head/lib/libbe/be.c ============================================================================== --- head/lib/libbe/be.c Mon Nov 19 16:40:19 2018 (r340634) +++ head/lib/libbe/be.c Mon Nov 19 16:47:21 2018 (r340635) @@ -58,8 +58,22 @@ static int be_create_child_cloned(libbe_handle_t *lbh, static int be_locate_rootfs(libbe_handle_t *lbh) { + struct statfs sfs; + struct extmnttab entry; zfs_handle_t *zfs; + /* + * Check first if root is ZFS; if not, we'll bail on rootfs capture. + * Unfortunately needed because zfs_path_to_zhandle will emit to + * stderr if / isn't actually a ZFS filesystem, which we'd like + * to avoid. + */ + if (statfs("/", &sfs) == 0) { + statfs2mnttab(&sfs, &entry); + if (strcmp(entry.mnt_fstype, MNTTYPE_ZFS) != 0) + return (1); + } else + return (1); zfs = zfs_path_to_zhandle(lbh->lzh, "/", ZFS_TYPE_FILESYSTEM); if (zfs == NULL) return (1); @@ -93,8 +107,11 @@ libbe_init(const char *root) * Grab rootfs, we'll work backwards from there if an optional BE root * has not been passed in. */ - if (be_locate_rootfs(lbh) != 0) - goto err; + if (be_locate_rootfs(lbh) != 0) { + if (root == NULL) + goto err; + *lbh->rootfs = '\0'; + } if (root == NULL) { /* Strip off the final slash from rootfs to get the be root */ strlcpy(lbh->root, lbh->rootfs, sizeof(lbh->root)); From owner-svn-src-all@freebsd.org Mon Nov 19 17:09:58 2018 Return-Path: Delivered-To: svn-src-all@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 95B2A1109FCD; Mon, 19 Nov 2018 17:09:58 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3C0347FC36; Mon, 19 Nov 2018 17:09:58 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1D79F24E18; Mon, 19 Nov 2018 17:09:58 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAJH9vhr050948; Mon, 19 Nov 2018 17:09:57 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAJH9vHK050947; Mon, 19 Nov 2018 17:09:57 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201811191709.wAJH9vHK050947@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Mon, 19 Nov 2018 17:09:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340636 - head/sbin/bectl/tests X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/sbin/bectl/tests X-SVN-Commit-Revision: 340636 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 3C0347FC36 X-Spamd-Result: default: False [0.49 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.48)[0.476,0]; NEURAL_SPAM_MEDIUM(0.02)[0.018,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Nov 2018 17:09:58 -0000 Author: kevans Date: Mon Nov 19 17:09:57 2018 New Revision: 340636 URL: https://svnweb.freebsd.org/changeset/base/340636 Log: bectl(8) tests: attempt to load the ZFS module Observed in a CI test image, bectl_create test will run and be marked as skipped because the module is not loaded. The first zpool invocation will automagically load the module, but bectl_create is still skipped. Subsequent tests all pass as expected because the module is now loaded and everything is OK. MFC after: 3 days Modified: head/sbin/bectl/tests/bectl_test.sh Modified: head/sbin/bectl/tests/bectl_test.sh ============================================================================== --- head/sbin/bectl/tests/bectl_test.sh Mon Nov 19 16:47:21 2018 (r340635) +++ head/sbin/bectl/tests/bectl_test.sh Mon Nov 19 17:09:57 2018 (r340636) @@ -34,7 +34,7 @@ bectl_create_setup() disk=$2 mnt=$3 - kldstat -qm zfs || atf_skip "ZFS module not loaded on the current system" + kldload -n -q zfs || atf_skip "ZFS module not loaded on the current system" atf_check mkdir -p ${mnt} atf_check truncate -s 1G ${disk} atf_check zpool create -o altroot=${mnt} ${zpool} ${disk} From owner-svn-src-all@freebsd.org Mon Nov 19 17:17:24 2018 Return-Path: Delivered-To: svn-src-all@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 38C98110D4A6; Mon, 19 Nov 2018 17:17:24 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.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 C06DE80296; Mon, 19 Nov 2018 17:17:23 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 92B7524FAF; Mon, 19 Nov 2018 17:17:23 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAJHHNPH056278; Mon, 19 Nov 2018 17:17:23 GMT (envelope-from alc@FreeBSD.org) Received: (from alc@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAJHHNIS056277; Mon, 19 Nov 2018 17:17:23 GMT (envelope-from alc@FreeBSD.org) Message-Id: <201811191717.wAJHHNIS056277@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: alc set sender to alc@FreeBSD.org using -f From: Alan Cox Date: Mon, 19 Nov 2018 17:17:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340637 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: alc X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 340637 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C06DE80296 X-Spamd-Result: default: False [0.49 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.48)[0.476,0]; NEURAL_SPAM_MEDIUM(0.02)[0.018,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Nov 2018 17:17:24 -0000 Author: alc Date: Mon Nov 19 17:17:23 2018 New Revision: 340637 URL: https://svnweb.freebsd.org/changeset/base/340637 Log: Use swp_pager_isondev() throughout. Submitted by: ota@j.email.ne.jp Change swp_pager_isondev()'s return type to bool. Reviewed by: kib MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D16712 Modified: head/sys/vm/swap_pager.c Modified: head/sys/vm/swap_pager.c ============================================================================== --- head/sys/vm/swap_pager.c Mon Nov 19 17:09:57 2018 (r340636) +++ head/sys/vm/swap_pager.c Mon Nov 19 17:17:23 2018 (r340637) @@ -756,7 +756,7 @@ done: return (blk); } -static int +static bool swp_pager_isondev(daddr_t blk, struct swdevt *sp) { @@ -770,7 +770,7 @@ swp_pager_strategy(struct buf *bp) mtx_lock(&sw_dev_mtx); TAILQ_FOREACH(sp, &swtailq, sw_list) { - if (bp->b_blkno >= sp->sw_first && bp->b_blkno < sp->sw_end) { + if (swp_pager_isondev(bp->b_blkno, sp)) { mtx_unlock(&sw_dev_mtx); if ((sp->sw_flags & SW_UNMAPPED) != 0 && unmapped_buf_allowed) { @@ -804,7 +804,7 @@ swp_pager_freeswapspace(daddr_t blk, daddr_t npages) return; mtx_lock(&sw_dev_mtx); TAILQ_FOREACH(sp, &swtailq, sw_list) { - if (blk >= sp->sw_first && blk < sp->sw_end) { + if (swp_pager_isondev(blk, sp)) { sp->sw_used -= npages; /* * If we are attempting to stop swapping on From owner-svn-src-all@freebsd.org Mon Nov 19 17:22:54 2018 Return-Path: Delivered-To: svn-src-all@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 E48F1110D929; Mon, 19 Nov 2018 17:22:53 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 832F880A66; Mon, 19 Nov 2018 17:22:53 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4A4E62515F; Mon, 19 Nov 2018 17:22:53 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAJHMroK061231; Mon, 19 Nov 2018 17:22:53 GMT (envelope-from oshogbo@FreeBSD.org) Received: (from oshogbo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAJHMrb2061230; Mon, 19 Nov 2018 17:22:53 GMT (envelope-from oshogbo@FreeBSD.org) Message-Id: <201811191722.wAJHMrb2061230@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: oshogbo set sender to oshogbo@FreeBSD.org using -f From: Mariusz Zaborski Date: Mon, 19 Nov 2018 17:22:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340638 - head/lib/libcasper/services/cap_dns X-SVN-Group: head X-SVN-Commit-Author: oshogbo X-SVN-Commit-Paths: head/lib/libcasper/services/cap_dns X-SVN-Commit-Revision: 340638 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 832F880A66 X-Spamd-Result: default: False [0.49 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.48)[0.476,0]; NEURAL_SPAM_MEDIUM(0.02)[0.018,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Nov 2018 17:22:54 -0000 Author: oshogbo Date: Mon Nov 19 17:22:52 2018 New Revision: 340638 URL: https://svnweb.freebsd.org/changeset/base/340638 Log: libcasper: provide compatibility with the old version of service Some external tools like tcpdump(1) have upstream the changes with old limits name. Because of that provide compatibility with the old names. Reported by: emaste Modified: head/lib/libcasper/services/cap_dns/cap_dns.c Modified: head/lib/libcasper/services/cap_dns/cap_dns.c ============================================================================== --- head/lib/libcasper/services/cap_dns/cap_dns.c Mon Nov 19 17:17:23 2018 (r340637) +++ head/lib/libcasper/services/cap_dns/cap_dns.c Mon Nov 19 17:22:52 2018 (r340638) @@ -474,7 +474,8 @@ dns_gethostbyname(const nvlist_t *limits, const nvlist struct hostent *hp; int family; - if (!dns_allowed_type(limits, "NAME2ADDR")) + if (!dns_allowed_type(limits, "NAME2ADDR") && + !dns_allowed_type(limits, "NAME")) return (NO_RECOVERY); family = (int)nvlist_get_number(nvlin, "family"); @@ -498,7 +499,8 @@ dns_gethostbyaddr(const nvlist_t *limits, const nvlist size_t addrsize; int family; - if (!dns_allowed_type(limits, "ADDR2NAME")) + if (!dns_allowed_type(limits, "ADDR2NAME") && + !dns_allowed_type(limits, "ADDR")) return (NO_RECOVERY); family = (int)nvlist_get_number(nvlin, "family"); @@ -524,7 +526,8 @@ dns_getnameinfo(const nvlist_t *limits, const nvlist_t socklen_t salen; int error, flags; - if (!dns_allowed_type(limits, "ADDR2NAME")) + if (!dns_allowed_type(limits, "ADDR2NAME") && + !dns_allowed_type(limits, "ADDR")) return (NO_RECOVERY); error = 0; @@ -617,7 +620,8 @@ dns_getaddrinfo(const nvlist_t *limits, const nvlist_t unsigned int ii; int error, family, n; - if (!dns_allowed_type(limits, "NAME2ADDR")) + if (!dns_allowed_type(limits, "NAME2ADDR") && + !dns_allowed_type(limits, "NAME")) return (NO_RECOVERY); hostname = dnvlist_get_string(nvlin, "hostname", NULL); @@ -703,7 +707,9 @@ dns_limit(const nvlist_t *oldlimits, const nvlist_t *n return (EINVAL); type = nvlist_get_string(newlimits, name); if (strcmp(type, "ADDR2NAME") != 0 && - strcmp(type, "NAME2ADDR") != 0) { + strcmp(type, "NAME2ADDR") != 0 && + strcmp(type, "ADDR") != 0 && + strcmp(type, "NAME") != 0) { return (EINVAL); } if (!dns_allowed_type(oldlimits, type)) From owner-svn-src-all@freebsd.org Mon Nov 19 17:26:33 2018 Return-Path: Delivered-To: svn-src-all@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 154A3110DAE6; Mon, 19 Nov 2018 17:26:33 +0000 (UTC) (envelope-from asomers@gmail.com) Received: from mail-lj1-f169.google.com (mail-lj1-f169.google.com [209.85.208.169]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3BCFD80C61; Mon, 19 Nov 2018 17:26:32 +0000 (UTC) (envelope-from asomers@gmail.com) Received: by mail-lj1-f169.google.com with SMTP id n18-v6so5877772lji.7; Mon, 19 Nov 2018 09:26:32 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=OMUIucwwhZ4mInbMD/qmxtUPg0i6uh6NMlUgnwL4jKM=; b=uRPRtoip694t/+c3TBqP515dwplXxwd+73m4kacPJVWdXq2T6dxNlbKtgF8dD2EbrV vcmkDpYlsMP5ch3CVbQ6NweueF4drg9bw+2z3Qw0VvcjAZTMAutsESFUo/7UwJs32fdE fKb9BSikzKcwUoEiQQjTqV7O+eL4dK5UaRZxf5ttphaBaPjZAsLb2F0LDCBxH48+lJY1 E/syBswgY4CE0KVoLSp5htlmuby9XRJEcZPjX51HFPCAfFbXIP77uNAx5j8D8Ub2e1R1 ea9nomUlEvbfPiZks4l+mcVzPYINCr2Ur3DKZ0SM3Kei2m1CtrketGkfwuatX170Pk0t 7b/Q== X-Gm-Message-State: AGRZ1gJ2FnsVQ+rKKwUg76h/9kiabFZKiPXeqdcAgAE6ql3ZVb2sCECG bGppXZPdzLARNYCqHKeAKCQM/OtiXclGZpYjXh1VPYPO X-Google-Smtp-Source: AJdET5f5pBpq6otbScOkhqkVLwYUYE58pRaUqU5Urk49Zx/Qy2+wQMXPgIwvT+oju9Fpfyk45GcKdNWhdgvINGoy8wQ= X-Received: by 2002:a2e:5418:: with SMTP id i24-v6mr13233068ljb.51.1542648384803; Mon, 19 Nov 2018 09:26:24 -0800 (PST) MIME-Version: 1.0 References: <201805042054.w44KsRtc038808@repo.freebsd.org> In-Reply-To: From: Alan Somers Date: Mon, 19 Nov 2018 10:26:13 -0700 Message-ID: Subject: Re: svn commit: r333263 - in head: lib/libjail sys/cddl/contrib/opensolaris/uts/common/fs/zfs sys/compat/linprocfs sys/compat/linsysfs sys/fs/devfs sys/fs/fdescfs sys/fs/nullfs sys/fs/procfs sys/fs/pse... To: jamie@freebsd.org Cc: src-committers , svn-src-all , svn-src-head , Ross Williams X-Rspamd-Queue-Id: 3BCFD80C61 X-Spamd-Result: default: False [-3.03 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.99)[-0.993,0]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; RCVD_TLS_LAST(0.00)[]; DMARC_NA(0.00)[freebsd.org]; RCPT_COUNT_FIVE(0.00)[5]; TO_MATCH_ENVRCPT_SOME(0.00)[]; MX_GOOD(-0.01)[cached: alt3.gmail-smtp-in.l.google.com]; NEURAL_HAM_SHORT(-0.98)[-0.984,0]; RCVD_IN_DNSWL_NONE(0.00)[169.208.85.209.list.dnswl.org : 127.0.5.0]; IP_SCORE(-1.05)[ipnet: 209.85.128.0/17(-3.47), asn: 15169(-1.67), country: US(-0.09)]; FORGED_SENDER(0.30)[asomers@freebsd.org,asomers@gmail.com]; RWL_MAILSPIKE_POSSIBLE(0.00)[169.208.85.209.rep.mailspike.net : 127.0.0.17]; R_DKIM_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; FROM_NEQ_ENVFROM(0.00)[asomers@freebsd.org,asomers@gmail.com]; RCVD_COUNT_TWO(0.00)[2] X-Rspamd-Server: mx1.freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Nov 2018 17:26:33 -0000 On Fri, Nov 16, 2018 at 7:16 PM James Gritton wrote: > On 2018-11-16 16:30, Alan Somers wrote: > > On Fri, Nov 16, 2018 at 2:28 PM James Gritton wrote: > >> On 2018-11-16 10:34, Alan Somers wrote: >> >> On Fri, May 4, 2018 at 2:54 PM Jamie Gritton wrote: >> >>> Author: jamie >>> Date: Fri May 4 20:54:27 2018 >>> New Revision: 333263 >>> URL: https://svnweb.freebsd.org/changeset/base/333263 >>> >>> Log: >>> Make it easier for filesystems to count themselves as jail-enabled, >>> by doing most of the work in a new function prison_add_vfs in >>> kern_jail.c >>> Now a jail-enabled filesystem need only mark itself with VFCF_JAIL, and >>> the rest is taken care of. This includes adding a jail parameter like >>> allow.mount.foofs, and a sysctl like security.jail.mount_foofs_allowed. >>> Both of these used to be a static list of known filesystems, with >>> predefined permission bits. >>> >>> Reviewed by: kib >>> Differential Revision: D14681 >>> >>> Modified: >>> head/lib/libjail/jail.c >>> head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c >>> head/sys/compat/linprocfs/linprocfs.c >>> head/sys/compat/linsysfs/linsysfs.c >>> head/sys/fs/devfs/devfs_vfsops.c >>> head/sys/fs/fdescfs/fdesc_vfsops.c >>> head/sys/fs/nullfs/null_vfsops.c >>> head/sys/fs/procfs/procfs.c >>> head/sys/fs/pseudofs/pseudofs.h >>> head/sys/fs/tmpfs/tmpfs_vfsops.c >>> head/sys/kern/kern_jail.c >>> head/sys/kern/vfs_init.c >>> head/sys/kern/vfs_mount.c >>> head/sys/kern/vfs_subr.c >>> head/sys/sys/jail.h >>> head/sys/sys/mount.h >>> head/usr.sbin/jail/jail.8 >>> >>> Modified: head/lib/libjail/jail.c >>> >>> ============================================================================== >>> --- head/lib/libjail/jail.c Fri May 4 20:38:26 2018 (r333262) >>> +++ head/lib/libjail/jail.c Fri May 4 20:54:27 2018 (r333263) >>> @@ -1048,7 +1048,13 @@ kldload_param(const char *name) >>> else if (strcmp(name, "sysvmsg") == 0 || strcmp(name, "sysvsem") >>> == 0 || >>> strcmp(name, "sysvshm") == 0) >>> kl = kldload(name); >>> - else { >>> + else if (strncmp(name, "allow.mount.", 12) == 0) { >>> + /* Load the matching filesystem */ >>> + kl = kldload(name + 12); >>> + if (kl < 0 && errno == ENOENT && >>> + strncmp(name + 12, "no", 2) == 0) >>> + kl = kldload(name + 14); >>> + } else { >>> errno = ENOENT; >>> return (-1); >>> } >>> >> I'm curious about this part of the change. Why is it necessary to load >> the module in the "allow.mount.noXXXfs" case, when the jail is forbidden to >> mount the filesystem? It seems like that would just load modules that >> aren't going to be used. >> Additional discussion at https://github.com/iocage/iocage/issues/689 . >> -Alan >> >> Presumably such a parameter would be included in some jails in >> conjunction with the positive being included in others (perhaps as a >> default). The truth is I never really considered whether the "no" option >> would be used, I just always treat these option as pairs. >> It may be reasonable (at least in the allow.mount.* case) to silently >> disregard a "no" option that doesn't exist, but I don't know how many >> places would need to be modified for that to go smoothly. Though I don't >> expect that there would be too many people who bother to include a jail >> parameter about a filesystem which they're not planning to use. >> - Jamie >> > > Well, many people use the "no" option because one of the most popular jail > managers, iocage, uses it under the hood. But since "no" is the default, > its presence on the command line is a noop. Are there any situations in > which the "no" option has an effect? The only two possibilities I could > think of were: > > 1) Somebody puts both the positive and negative options on the same > command line. From experiment, it seems like the last option takes > effect. In this case, the presence of the positive option would cause the > kld to be loaded, regardless of the presence of the negative option. > 2) When using hierarchical jails, it might make sense to use the positive > option for the outer jail and the negative option for the inner jail. But > this would only be important if the inner jail inherited the outer jail's > parameters, which doesn't seem to be the case. > > So I can't think of any reason to continue to mount the kld for "no" > options. Can you? > > > 3) There's allow.mount.foofs as a global parameter, with some jails > overriding that with a jail-specific allow.mount.nofoofs. In that case, > KLD loading shouldn't be a problem as global parameters typically come > first. > > It makes sense not to load a KLD for a "no" option, as long as that option > is then silently ignored. I wouldn't want it to error out with "unknown > parameter". > See also https://github.com/iocage/iocage/issues/689 From owner-svn-src-all@freebsd.org Mon Nov 19 17:33:45 2018 Return-Path: Delivered-To: svn-src-all@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 B276A110DE61; Mon, 19 Nov 2018 17:33:45 +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 557EC8129C; Mon, 19 Nov 2018 17:33:45 +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 36A742530A; Mon, 19 Nov 2018 17:33:45 +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 wAJHXjCf066527; Mon, 19 Nov 2018 17:33:45 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAJHXiUr066525; Mon, 19 Nov 2018 17:33:44 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201811191733.wAJHXiUr066525@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 19 Nov 2018 17:33:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340639 - head/sys/fs/fuse X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/fs/fuse X-SVN-Commit-Revision: 340639 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 557EC8129C X-Spamd-Result: default: False [0.49 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.48)[0.476,0]; NEURAL_SPAM_MEDIUM(0.02)[0.018,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Nov 2018 17:33:45 -0000 Author: markj Date: Mon Nov 19 17:33:44 2018 New Revision: 340639 URL: https://svnweb.freebsd.org/changeset/base/340639 Log: Remove comments made obsolete by the ino64 work. MFC after: 3 days Sponsored by: The FreeBSD Foundation Modified: head/sys/fs/fuse/fuse_internal.c head/sys/fs/fuse/fuse_internal.h Modified: head/sys/fs/fuse/fuse_internal.c ============================================================================== --- head/sys/fs/fuse/fuse_internal.c Mon Nov 19 17:22:52 2018 (r340638) +++ head/sys/fs/fuse/fuse_internal.c Mon Nov 19 17:33:44 2018 (r340639) @@ -350,7 +350,7 @@ fuse_internal_readdir_processdata(struct uio *uio, fiov_adjust(cookediov, bytesavail); de = (struct dirent *)cookediov->base; - de->d_fileno = fudge->ino; /* XXX: truncation */ + de->d_fileno = fudge->ino; de->d_reclen = bytesavail; de->d_type = fudge->type; de->d_namlen = fudge->namelen; Modified: head/sys/fs/fuse/fuse_internal.h ============================================================================== --- head/sys/fs/fuse/fuse_internal.h Mon Nov 19 17:22:52 2018 (r340638) +++ head/sys/fs/fuse/fuse_internal.h Mon Nov 19 17:33:44 2018 (r340639) @@ -212,7 +212,7 @@ fuse_internal_attr_fat2vat(struct mount *mp, vattr_null(vap); vap->va_fsid = mp->mnt_stat.f_fsid.val[0]; - vap->va_fileid = fat->ino; /* XXX cast from 64 bits to 32 */ + vap->va_fileid = fat->ino; vap->va_mode = fat->mode & ~S_IFMT; vap->va_nlink = fat->nlink; vap->va_uid = fat->uid; From owner-svn-src-all@freebsd.org Mon Nov 19 18:12:40 2018 Return-Path: Delivered-To: svn-src-all@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 37AD11121CEB; Mon, 19 Nov 2018 18:12:40 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C9B9483D87; Mon, 19 Nov 2018 18:12:39 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AAC982597D; Mon, 19 Nov 2018 18:12:39 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAJICdtW087393; Mon, 19 Nov 2018 18:12:39 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAJICdFf087392; Mon, 19 Nov 2018 18:12:39 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201811191812.wAJICdFf087392@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 19 Nov 2018 18:12:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340640 - head/lib/libc X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/lib/libc X-SVN-Commit-Revision: 340640 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C9B9483D87 X-Spamd-Result: default: False [0.31 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_MEDIUM(0.02)[0.018,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.30)[0.297,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Nov 2018 18:12:40 -0000 Author: emaste Date: Mon Nov 19 18:12:39 2018 New Revision: 340640 URL: https://svnweb.freebsd.org/changeset/base/340640 Log: libc: forcibly disable BIND_NOW Building libc WITH_BIND_NOW results in segfault at process start. For now force BIND_NOW off until the root cause can be identified and fixed. PR: 233333 Sponsored by: The FreeBSD Foundation Modified: head/lib/libc/Makefile Modified: head/lib/libc/Makefile ============================================================================== --- head/lib/libc/Makefile Mon Nov 19 17:33:44 2018 (r340639) +++ head/lib/libc/Makefile Mon Nov 19 18:12:39 2018 (r340640) @@ -6,6 +6,8 @@ SHLIBDIR?= /lib .include +# BIND_NOW in libc results in segfault at startup (PR 233333) +MK_BIND_NOW= no # Force building of libc_pic.a MK_TOOLCHAIN= yes From owner-svn-src-all@freebsd.org Mon Nov 19 18:23:19 2018 Return-Path: Delivered-To: svn-src-all@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 DB5A311227BB; Mon, 19 Nov 2018 18:23:19 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 82F0485025; Mon, 19 Nov 2018 18:23:19 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 645A625B26; Mon, 19 Nov 2018 18:23:18 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAJINIFp093946; Mon, 19 Nov 2018 18:23:18 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAJINIfp093945; Mon, 19 Nov 2018 18:23:18 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201811191823.wAJINIfp093945@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Mon, 19 Nov 2018 18:23:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340641 - head/lib/libc/gen X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/lib/libc/gen X-SVN-Commit-Revision: 340641 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 82F0485025 X-Spamd-Result: default: False [0.31 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_MEDIUM(0.02)[0.018,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.30)[0.297,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Nov 2018 18:23:20 -0000 Author: trasz Date: Mon Nov 19 18:23:17 2018 New Revision: 340641 URL: https://svnweb.freebsd.org/changeset/base/340641 Log: Make sysconf(_SC_PAGESIZE) return the value from getpagesize(3). That avoids a syscall - getpagesize(3) gets the value from the ELF aux strings. Reviewed by: kib MFC after: 2 weeks Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D17989 Modified: head/lib/libc/gen/sysconf.c Modified: head/lib/libc/gen/sysconf.c ============================================================================== --- head/lib/libc/gen/sysconf.c Mon Nov 19 18:12:39 2018 (r340640) +++ head/lib/libc/gen/sysconf.c Mon Nov 19 18:23:17 2018 (r340641) @@ -291,10 +291,7 @@ do_NAME_MAX: mib[1] = CTL_P1003_1B_MQ_OPEN_MAX; goto yesno; case _SC_PAGESIZE: - defaultresult = getpagesize(); - mib[0] = CTL_P1003_1B; - mib[1] = CTL_P1003_1B_PAGESIZE; - goto yesno; + return (getpagesize()); case _SC_RTSIG_MAX: mib[0] = CTL_P1003_1B; mib[1] = CTL_P1003_1B_RTSIG_MAX; From owner-svn-src-all@freebsd.org Mon Nov 19 18:24:09 2018 Return-Path: Delivered-To: svn-src-all@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 C1AA41122896; Mon, 19 Nov 2018 18:24:09 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5C1EE852CC; Mon, 19 Nov 2018 18:24:09 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3D5BF25B2C; Mon, 19 Nov 2018 18:24:09 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAJIO9Gk094172; Mon, 19 Nov 2018 18:24:09 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAJIO9LP094171; Mon, 19 Nov 2018 18:24:09 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201811191824.wAJIO9LP094171@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Mon, 19 Nov 2018 18:24:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340642 - head/lib/libthr/thread X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/lib/libthr/thread X-SVN-Commit-Revision: 340642 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 5C1EE852CC X-Spamd-Result: default: False [0.31 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.30)[0.297,0]; NEURAL_SPAM_MEDIUM(0.02)[0.018,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Nov 2018 18:24:09 -0000 Author: trasz Date: Mon Nov 19 18:24:08 2018 New Revision: 340642 URL: https://svnweb.freebsd.org/changeset/base/340642 Log: Make libthr(3) use sysconf(_SC_NPROCESSORS_CONF); this shaves off two calls to sysctl(2) from the binary startup. Reviewed by: kib MFC after: 2 weeks Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D18046 Modified: head/lib/libthr/thread/thr_init.c Modified: head/lib/libthr/thread/thr_init.c ============================================================================== --- head/lib/libthr/thread/thr_init.c Mon Nov 19 18:23:17 2018 (r340641) +++ head/lib/libthr/thread/thr_init.c Mon Nov 19 18:24:08 2018 (r340642) @@ -474,8 +474,9 @@ init_private(void) PANIC("Cannot get stack rlimit"); _thr_stack_initial = rlim.rlim_cur; } - len = sizeof(_thr_is_smp); - sysctlbyname("kern.smp.cpus", &_thr_is_smp, &len, NULL, 0); + _thr_is_smp = sysconf(_SC_NPROCESSORS_CONF); + if (_thr_is_smp == -1) + PANIC("Cannot get _SC_NPROCESSORS_CONF"); _thr_is_smp = (_thr_is_smp > 1); _thr_page_size = getpagesize(); _thr_guard_default = _thr_page_size; From owner-svn-src-all@freebsd.org Mon Nov 19 18:26:12 2018 Return-Path: Delivered-To: svn-src-all@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 C1D6011229E0; Mon, 19 Nov 2018 18:26:12 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.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 5068185717; Mon, 19 Nov 2018 18:26:12 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2C27D25B31; Mon, 19 Nov 2018 18:26:12 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAJIQCto094430; Mon, 19 Nov 2018 18:26:12 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAJIQCDp094429; Mon, 19 Nov 2018 18:26:12 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201811191826.wAJIQCDp094429@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Mon, 19 Nov 2018 18:26:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r340643 - stable/12/sys/dev/pci X-SVN-Group: stable-12 X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: stable/12/sys/dev/pci X-SVN-Commit-Revision: 340643 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 5068185717 X-Spamd-Result: default: False [0.31 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-0.01)[-0.012,0]; NEURAL_SPAM_SHORT(0.32)[0.318,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Nov 2018 18:26:12 -0000 Author: brooks Date: Mon Nov 19 18:26:11 2018 New Revision: 340643 URL: https://svnweb.freebsd.org/changeset/base/340643 Log: MFC r340489-r340490 r340489: Fix freebsd32 support for PCIOCGETCONF. This fixes regresssions in pciconf -l and some ports as reported on freebsd-current: https://lists.freebsd.org/pipermail/freebsd-current/2018-November/072144.html Reported by: jbeich Reviewed by: kib (also proposed an idential patch) Tested by: jbeich Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D18011 r340490: Fix stray tab. Reported by: jbeich MFC with: r340489 Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D18011 Modified: stable/12/sys/dev/pci/pci_user.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/pci/pci_user.c ============================================================================== --- stable/12/sys/dev/pci/pci_user.c Mon Nov 19 18:24:08 2018 (r340642) +++ stable/12/sys/dev/pci/pci_user.c Mon Nov 19 18:26:11 2018 (r340643) @@ -945,6 +945,9 @@ pci_ioctl(struct cdev *dev, u_long cmd, caddr_t data, if (!(flag & FWRITE)) { switch (cmd) { case PCIOCGETCONF: +#ifdef COMPAT_FREEBSD32 + case PCIOCGETCONF32: +#endif #ifdef PRE7_COMPAT case PCIOCGETCONF_OLD: #ifdef COMPAT_FREEBSD32 @@ -962,6 +965,9 @@ pci_ioctl(struct cdev *dev, u_long cmd, caddr_t data, switch (cmd) { case PCIOCGETCONF: +#ifdef COMPAT_FREEBSD32 + case PCIOCGETCONF32: +#endif #ifdef PRE7_COMPAT case PCIOCGETCONF_OLD: #ifdef COMPAT_FREEBSD32 From owner-svn-src-all@freebsd.org Mon Nov 19 18:29:04 2018 Return-Path: Delivered-To: svn-src-all@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 5C94A1122AB6; Mon, 19 Nov 2018 18:29:04 +0000 (UTC) (envelope-from bwidawsk@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 0000A8589A; Mon, 19 Nov 2018 18:29:03 +0000 (UTC) (envelope-from bwidawsk@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D494525B35; Mon, 19 Nov 2018 18:29:03 +0000 (UTC) (envelope-from bwidawsk@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAJIT3ax094602; Mon, 19 Nov 2018 18:29:03 GMT (envelope-from bwidawsk@FreeBSD.org) Received: (from bwidawsk@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAJIT3WS094599; Mon, 19 Nov 2018 18:29:03 GMT (envelope-from bwidawsk@FreeBSD.org) Message-Id: <201811191829.wAJIT3WS094599@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bwidawsk set sender to bwidawsk@FreeBSD.org using -f From: Ben Widawsky Date: Mon, 19 Nov 2018 18:29:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340644 - in head/sys: dev/acpica kern sys X-SVN-Group: head X-SVN-Commit-Author: bwidawsk X-SVN-Commit-Paths: in head/sys: dev/acpica kern sys X-SVN-Commit-Revision: 340644 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 0000A8589A X-Spamd-Result: default: False [0.34 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_MEDIUM(0.03)[0.027,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.31)[0.308,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Nov 2018 18:29:04 -0000 Author: bwidawsk Date: Mon Nov 19 18:29:03 2018 New Revision: 340644 URL: https://svnweb.freebsd.org/changeset/base/340644 Log: acpi: fix acpi_ec_probe to only check EC devices This patch utilizes the fixed_devclass attribute in order to make sure other acpi devices with params don't get confused for an EC device. The existing code assumes that acpi_ec_probe is only ever called with a dereferencable acpi param. Aside from being incorrect because other devices of ACPI_TYPE_DEVICE may be probed here which aren't ec devices, (and they may have set acpi private data), it is even more nefarious if another ACPI driver uses private data which is not dereferancable. This will result in a pointer deref during boot and therefore boot failure. On X86, as it stands today, no other devices actually do this (acpi_cpu checks for PROCESSOR type devices) and so there is no issue. I ran into this because I am adding such a device which gets probed before acpi_ec_probe and sets private data. If ARM ever has an EC, I think they'd run into this issue as well. There have been several iterations of this patch. Earlier iterations had ECDT enumerated ECs not call into the probe/attach functions of this driver. This change was Suggested by: jhb@. Reviewed by: jhb Approved by: emaste (mentor) Differential Revision: https://reviews.freebsd.org/D16635 Modified: head/sys/dev/acpica/acpi_ec.c head/sys/kern/subr_bus.c head/sys/sys/bus.h Modified: head/sys/dev/acpica/acpi_ec.c ============================================================================== --- head/sys/dev/acpica/acpi_ec.c Mon Nov 19 18:26:11 2018 (r340643) +++ head/sys/dev/acpica/acpi_ec.c Mon Nov 19 18:29:03 2018 (r340644) @@ -345,92 +345,95 @@ acpi_ec_probe(device_t dev) struct acpi_ec_params *params; static char *ec_ids[] = { "PNP0C09", NULL }; + ret = ENXIO; + /* Check that this is a device and that EC is not disabled. */ if (acpi_get_type(dev) != ACPI_TYPE_DEVICE || acpi_disabled("ec")) - return (ENXIO); + return (ret); - /* - * If probed via ECDT, set description and continue. Otherwise, - * we can access the namespace and make sure this is not a - * duplicate probe. - */ - ret = ENXIO; - ecdt = 0; + if (device_is_devclass_fixed(dev)) { + /* + * If probed via ECDT, set description and continue. Otherwise, we can + * access the namespace and make sure this is not a duplicate probe. + */ + ecdt = 1; + params = acpi_get_private(dev); + if (params != NULL) + ret = 0; + + goto out; + } + + ret = ACPI_ID_PROBE(device_get_parent(dev), dev, ec_ids, NULL); + if (ret > 0) + return (ret); + + params = malloc(sizeof(struct acpi_ec_params), M_TEMP, M_WAITOK | M_ZERO); + buf.Pointer = NULL; buf.Length = ACPI_ALLOCATE_BUFFER; - params = acpi_get_private(dev); - if (params != NULL) { - ecdt = 1; - ret = 0; - } else { - ret = ACPI_ID_PROBE(device_get_parent(dev), dev, ec_ids, NULL); - if (ret > 0) - goto out; - params = malloc(sizeof(struct acpi_ec_params), M_TEMP, - M_WAITOK | M_ZERO); - h = acpi_get_handle(dev); + h = acpi_get_handle(dev); - /* - * Read the unit ID to check for duplicate attach and the - * global lock value to see if we should acquire it when - * accessing the EC. - */ - status = acpi_GetInteger(h, "_UID", ¶ms->uid); - if (ACPI_FAILURE(status)) - params->uid = 0; - status = acpi_GetInteger(h, "_GLK", ¶ms->glk); - if (ACPI_FAILURE(status)) - params->glk = 0; + /* + * Read the unit ID to check for duplicate attach and the global lock value + * to see if we should acquire it when accessing the EC. + */ + status = acpi_GetInteger(h, "_UID", ¶ms->uid); + if (ACPI_FAILURE(status)) + params->uid = 0; - /* - * Evaluate the _GPE method to find the GPE bit used by the EC to - * signal status (SCI). If it's a package, it contains a reference - * and GPE bit, similar to _PRW. - */ - status = AcpiEvaluateObject(h, "_GPE", NULL, &buf); - if (ACPI_FAILURE(status)) { - device_printf(dev, "can't evaluate _GPE - %s\n", - AcpiFormatException(status)); - goto out; - } - obj = (ACPI_OBJECT *)buf.Pointer; - if (obj == NULL) - goto out; + status = acpi_GetInteger(h, "_GLK", ¶ms->glk); + if (ACPI_FAILURE(status)) + params->glk = 0; - switch (obj->Type) { - case ACPI_TYPE_INTEGER: - params->gpe_handle = NULL; - params->gpe_bit = obj->Integer.Value; - break; - case ACPI_TYPE_PACKAGE: - if (!ACPI_PKG_VALID(obj, 2)) - goto out; - params->gpe_handle = - acpi_GetReference(NULL, &obj->Package.Elements[0]); - if (params->gpe_handle == NULL || - acpi_PkgInt32(obj, 1, ¶ms->gpe_bit) != 0) - goto out; - break; - default: - device_printf(dev, "_GPE has invalid type %d\n", obj->Type); - goto out; - } + /* + * Evaluate the _GPE method to find the GPE bit used by the EC to signal + * status (SCI). If it's a package, it contains a reference and GPE bit, + * similar to _PRW. + */ + status = AcpiEvaluateObject(h, "_GPE", NULL, &buf); + if (ACPI_FAILURE(status)) { + device_printf(dev, "can't evaluate _GPE - %s\n", AcpiFormatException(status)); + goto out; + } - /* Store the values we got from the namespace for attach. */ - acpi_set_private(dev, params); + obj = (ACPI_OBJECT *)buf.Pointer; + if (obj == NULL) + goto out; - /* - * Check for a duplicate probe. This can happen when a probe - * via ECDT succeeded already. If this is a duplicate, disable - * this device. - */ - peer = devclass_get_device(acpi_ec_devclass, params->uid); - if (peer != NULL && device_is_alive(peer)){ - ret = ENXIO; - device_disable(dev); - } + switch (obj->Type) { + case ACPI_TYPE_INTEGER: + params->gpe_handle = NULL; + params->gpe_bit = obj->Integer.Value; + break; + case ACPI_TYPE_PACKAGE: + if (!ACPI_PKG_VALID(obj, 2)) + goto out; + params->gpe_handle = acpi_GetReference(NULL, &obj->Package.Elements[0]); + if (params->gpe_handle == NULL || + acpi_PkgInt32(obj, 1, ¶ms->gpe_bit) != 0) + goto out; + break; + default: + device_printf(dev, "_GPE has invalid type %d\n", obj->Type); + goto out; } + /* Store the values we got from the namespace for attach. */ + acpi_set_private(dev, params); + + /* + * Check for a duplicate probe. This can happen when a probe via ECDT + * succeeded already. If this is a duplicate, disable this device. + */ + peer = devclass_get_device(acpi_ec_devclass, params->uid); + if (peer == NULL || !device_is_alive(peer)) + ret = 0; + else + device_disable(dev); + + if (buf.Pointer) + AcpiOsFree(buf.Pointer); out: if (ret <= 0) { snprintf(desc, sizeof(desc), "Embedded Controller: GPE %#x%s%s", @@ -439,8 +442,7 @@ out: device_set_desc_copy(dev, desc); } else free(params, M_TEMP); - if (buf.Pointer) - AcpiOsFree(buf.Pointer); + return (ret); } Modified: head/sys/kern/subr_bus.c ============================================================================== --- head/sys/kern/subr_bus.c Mon Nov 19 18:26:11 2018 (r340643) +++ head/sys/kern/subr_bus.c Mon Nov 19 18:29:03 2018 (r340644) @@ -2780,6 +2780,16 @@ device_set_devclass_fixed(device_t dev, const char *cl } /** + * @brief Query the device to determine if it's of a fixed devclass + * @see device_set_devclass_fixed() + */ +bool +device_is_devclass_fixed(device_t dev) +{ + return ((dev->flags & DF_FIXEDCLASS) != 0); +} + +/** * @brief Set the driver of a device * * @retval 0 success Modified: head/sys/sys/bus.h ============================================================================== --- head/sys/sys/bus.h Mon Nov 19 18:26:11 2018 (r340643) +++ head/sys/sys/bus.h Mon Nov 19 18:29:03 2018 (r340644) @@ -612,6 +612,7 @@ void device_set_desc(device_t dev, const char* desc); void device_set_desc_copy(device_t dev, const char* desc); int device_set_devclass(device_t dev, const char *classname); int device_set_devclass_fixed(device_t dev, const char *classname); +bool device_is_devclass_fixed(device_t dev); int device_set_driver(device_t dev, driver_t *driver); void device_set_flags(device_t dev, u_int32_t flags); void device_set_softc(device_t dev, void *softc); From owner-svn-src-all@freebsd.org Mon Nov 19 18:32:48 2018 Return-Path: Delivered-To: svn-src-all@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 07C311122E70; Mon, 19 Nov 2018 18:32:48 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-io1-f45.google.com (mail-io1-f45.google.com [209.85.166.45]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 64CDF85F63; Mon, 19 Nov 2018 18:32:47 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-io1-f45.google.com with SMTP id f12-v6so22994830iog.0; Mon, 19 Nov 2018 10:32:47 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:reply-to :from:date:message-id:subject:to:cc; bh=le6WfTs6iFcNUnPnulDIUNjiE3ug48b6qAGcAb+qODY=; b=aJpHYxQMWXtVzIx6z4X2366Uzj1tdzAiAY501MGa/SAwFNoBnDTwqJhpNgDwlljbPb IR2DdmgHgsRFuJSRa+YuHD+iTXeeitIV+sUGy5aTpqmIHHurc7kyryqvO7W0grQOvv/r TJARx8DpRIwOFKa4GxPYDelxh/Rq6rzkSrnAk8DPqC2pxj8NRB46BnKc3Q1eGINt6hMR OKAyoBornP+nPJdmgozrrxChiIjQkB5Klzt8Sd86hbMn6YzD2E1oR7AIQU5kq8sHUhhk nouUPBYuVjJSCKWe8jn4lr2MkQsdjTndW2D8KjBloxpV85LNG9OwwEPkAJMv9UdX7twd UJvw== X-Gm-Message-State: AGRZ1gKvlAG38Ra7x0W+4a+/8MTzlQsIZCT80uvwdkL1cLf8UOkUup9r +64BOkJojNL5pfzTXj+g1N6LfAQ+ X-Google-Smtp-Source: AFSGD/VYee6QUsstEsEbfGYfSwh/lSubUhhwJI5H+GQLRF/Tmb3fkUHfnBSMygsTuhgE+m93z9L7Sg== X-Received: by 2002:a6b:b642:: with SMTP id g63-v6mr18907815iof.34.1542652361235; Mon, 19 Nov 2018 10:32:41 -0800 (PST) Received: from mail-it1-f174.google.com (mail-it1-f174.google.com. [209.85.166.174]) by smtp.gmail.com with ESMTPSA id g4sm2975216iop.49.2018.11.19.10.32.41 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 19 Nov 2018 10:32:41 -0800 (PST) Received: by mail-it1-f174.google.com with SMTP id h193so8427827ita.5; Mon, 19 Nov 2018 10:32:41 -0800 (PST) X-Received: by 2002:a24:7296:: with SMTP id x144-v6mr8663209itc.166.1542652360635; Mon, 19 Nov 2018 10:32:40 -0800 (PST) MIME-Version: 1.0 References: <201810201916.w9KJGh0H066643@repo.freebsd.org> <2afa1dbf-10f9-8e38-36b6-e40fb0020d87@freebsd.org> In-Reply-To: <2afa1dbf-10f9-8e38-36b6-e40fb0020d87@freebsd.org> Reply-To: cem@freebsd.org From: Conrad Meyer Date: Mon, 19 Nov 2018 10:32:29 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r339476 - head/sys/i386/conf To: Niclas Zeising Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 64CDF85F63 X-Spamd-Result: default: False [-2.97 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; HAS_REPLYTO(0.00)[cem@freebsd.org]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; RCVD_TLS_LAST(0.00)[]; DMARC_NA(0.00)[freebsd.org]; TO_DN_SOME(0.00)[]; REPLYTO_ADDR_EQ_FROM(0.00)[]; RCVD_COUNT_THREE(0.00)[4]; IP_SCORE(-1.04)[ipnet: 209.85.128.0/17(-3.46), asn: 15169(-1.66), country: US(-0.09)]; MX_GOOD(-0.01)[cached: alt3.gmail-smtp-in.l.google.com]; NEURAL_HAM_SHORT(-0.92)[-0.922,0]; RCVD_IN_DNSWL_NONE(0.00)[45.166.85.209.list.dnswl.org : 127.0.5.0]; NEURAL_HAM_MEDIUM(-1.00)[-0.996,0]; FORGED_SENDER(0.30)[cem@freebsd.org,csecem@gmail.com]; R_DKIM_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; TAGGED_FROM(0.00)[]; FROM_NEQ_ENVFROM(0.00)[cem@freebsd.org,csecem@gmail.com] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Nov 2018 18:32:48 -0000 No. On Mon, Nov 19, 2018 at 7:58 AM Niclas Zeising wrote: > > On 10/20/18 9:16 PM, Conrad Meyer wrote: > > Author: cem > > Date: Sat Oct 20 19:16:43 2018 > > New Revision: 339476 > > URL: https://svnweb.freebsd.org/changeset/base/339476 > > > > Log: > > Add a MINIMAL config for i386, based on amd64 > > > > Any plans to MFC this? > Regards > -- > Niclas Zeising From owner-svn-src-all@freebsd.org Mon Nov 19 18:58:35 2018 Return-Path: Delivered-To: svn-src-all@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 A05AF1123A4E; Mon, 19 Nov 2018 18:58:35 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.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 46CDD87036; Mon, 19 Nov 2018 18:58:35 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 23EFA26024; Mon, 19 Nov 2018 18:58:35 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAJIwYxY010003; Mon, 19 Nov 2018 18:58:34 GMT (envelope-from arichardson@FreeBSD.org) Received: (from arichardson@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAJIwY0S010002; Mon, 19 Nov 2018 18:58:34 GMT (envelope-from arichardson@FreeBSD.org) Message-Id: <201811191858.wAJIwY0S010002@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arichardson set sender to arichardson@FreeBSD.org using -f From: Alex Richardson Date: Mon, 19 Nov 2018 18:58:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340645 - head/tools/build X-SVN-Group: head X-SVN-Commit-Author: arichardson X-SVN-Commit-Paths: head/tools/build X-SVN-Commit-Revision: 340645 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 46CDD87036 X-Spamd-Result: default: False [0.46 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_MEDIUM(0.02)[0.018,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.44)[0.438,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Nov 2018 18:58:35 -0000 Author: arichardson Date: Mon Nov 19 18:58:34 2018 New Revision: 340645 URL: https://svnweb.freebsd.org/changeset/base/340645 Log: Add capsicum_helpers.h to -legacy if needed This fixes bootstrap of capsicumized strings on FreeBSD 11. Reviewed By: oshogbo, bdrewery Differential Revision: https://reviews.freebsd.org/D17971 Modified: head/tools/build/Makefile Modified: head/tools/build/Makefile ============================================================================== --- head/tools/build/Makefile Mon Nov 19 18:29:03 2018 (r340644) +++ head/tools/build/Makefile Mon Nov 19 18:58:34 2018 (r340645) @@ -48,6 +48,16 @@ INCS+= strings.h SRCS+= explicit_bzero.c .endif +.if exists(/usr/include/capsicum_helpers.h) +_WITH_CAPH_ENTER!= grep -c caph_enter /usr/include/capsicum_helpers.h || true +.endif +.if !defined(_WITH_CAPH_ENTER) || ${_WITH_CAPH_ENTER} == 0 +.PATH: ${SRCTOP}/lib/libcapsicum +INCS+= capsicum_helpers.h +.PATH: ${SRCTOP}/lib/libcasper/libcasper +INCS+= libcasper.h +.endif + .if empty(SRCS) SRCS= dummy.c .endif From owner-svn-src-all@freebsd.org Mon Nov 19 18:59:09 2018 Return-Path: Delivered-To: svn-src-all@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 ACB371123B1D; Mon, 19 Nov 2018 18:59:09 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5450587195; Mon, 19 Nov 2018 18:59:09 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 35EAD26039; Mon, 19 Nov 2018 18:59:09 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAJIx9P5010086; Mon, 19 Nov 2018 18:59:09 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAJIx7l3010077; Mon, 19 Nov 2018 18:59:07 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201811191859.wAJIx7l3010077@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Mon, 19 Nov 2018 18:59:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r340646 - in stable/12/sys/dts: . arm arm/overlays arm64 arm64/overlays mips powerpc X-SVN-Group: stable-12 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in stable/12/sys/dts: . arm arm/overlays arm64 arm64/overlays mips powerpc X-SVN-Commit-Revision: 340646 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 5450587195 X-Spamd-Result: default: False [0.43 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-0.00)[-0.002,0]; NEURAL_SPAM_SHORT(0.44)[0.436,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Nov 2018 18:59:09 -0000 Author: kevans Date: Mon Nov 19 18:59:06 2018 New Revision: 340646 URL: https://svnweb.freebsd.org/changeset/base/340646 Log: MFC r340390: Fix test-dts{,o} targets There were two main problems here: 1.) sys/dts/Makefile.inc is not included from various */overlays directories by default, only ../Makefile.inc 2.) When shelling out for DTS/DTSO, cwd != .CURDIR, so enumeration always failed These changes allow make test-dts and make test-dtso to function in their respective directories. Added: stable/12/sys/dts/arm/Makefile.inc - copied unchanged from r340390, head/sys/dts/arm/Makefile.inc stable/12/sys/dts/arm64/Makefile.inc - copied unchanged from r340390, head/sys/dts/arm64/Makefile.inc Modified: stable/12/sys/dts/Makefile.inc stable/12/sys/dts/arm/Makefile stable/12/sys/dts/arm/overlays/Makefile stable/12/sys/dts/arm64/Makefile stable/12/sys/dts/arm64/overlays/Makefile stable/12/sys/dts/mips/Makefile stable/12/sys/dts/powerpc/Makefile Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dts/Makefile.inc ============================================================================== --- stable/12/sys/dts/Makefile.inc Mon Nov 19 18:58:34 2018 (r340645) +++ stable/12/sys/dts/Makefile.inc Mon Nov 19 18:59:06 2018 (r340646) @@ -5,9 +5,9 @@ SYSDIR?=${SRCTOP}/sys test-dts: .for dts in ${DTS} @env MACHINE=`basename ${.CURDIR}` ${SYSDIR}/tools/fdt/make_dtb.sh ${SYSDIR} ${dts} /tmp +.endfor test-dtso: .for dtso in ${DTSO} @env MACHINE=`basename ${.CURDIR}` ${SYSDIR}/tools/fdt/make_dtbo.sh ${SYSDIR} ${dtso} /tmp - .endfor Modified: stable/12/sys/dts/arm/Makefile ============================================================================== --- stable/12/sys/dts/arm/Makefile Mon Nov 19 18:58:34 2018 (r340645) +++ stable/12/sys/dts/arm/Makefile Mon Nov 19 18:59:06 2018 (r340646) @@ -1,6 +1,6 @@ # $FreeBSD$ -DTS!=ls *.dts +DTS!=ls ${.CURDIR}/*.dts all: test-dts Copied: stable/12/sys/dts/arm/Makefile.inc (from r340390, head/sys/dts/arm/Makefile.inc) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/12/sys/dts/arm/Makefile.inc Mon Nov 19 18:59:06 2018 (r340646, copy of r340390, head/sys/dts/arm/Makefile.inc) @@ -0,0 +1,3 @@ +# $FreeBSD$ + +.include "../Makefile.inc" Modified: stable/12/sys/dts/arm/overlays/Makefile ============================================================================== --- stable/12/sys/dts/arm/overlays/Makefile Mon Nov 19 18:58:34 2018 (r340645) +++ stable/12/sys/dts/arm/overlays/Makefile Mon Nov 19 18:59:06 2018 (r340646) @@ -1,6 +1,6 @@ # $FreeBSD$ -DTSO!=ls *.dtso +DTSO!=ls ${.CURDIR}/*.dtso all: test-dtso Modified: stable/12/sys/dts/arm64/Makefile ============================================================================== --- stable/12/sys/dts/arm64/Makefile Mon Nov 19 18:58:34 2018 (r340645) +++ stable/12/sys/dts/arm64/Makefile Mon Nov 19 18:59:06 2018 (r340646) @@ -1,6 +1,6 @@ # $FreeBSD$ -DTS!=ls *.dts +DTS!=ls ${.CURDIR}/*.dts all: test-dts Copied: stable/12/sys/dts/arm64/Makefile.inc (from r340390, head/sys/dts/arm64/Makefile.inc) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/12/sys/dts/arm64/Makefile.inc Mon Nov 19 18:59:06 2018 (r340646, copy of r340390, head/sys/dts/arm64/Makefile.inc) @@ -0,0 +1,3 @@ +# $FreeBSD$ + +.include "../Makefile.inc" Modified: stable/12/sys/dts/arm64/overlays/Makefile ============================================================================== --- stable/12/sys/dts/arm64/overlays/Makefile Mon Nov 19 18:58:34 2018 (r340645) +++ stable/12/sys/dts/arm64/overlays/Makefile Mon Nov 19 18:59:06 2018 (r340646) @@ -1,6 +1,6 @@ # $FreeBSD$ -DTSO!=ls *.dtso +DTSO!=ls ${.CURDIR}/*.dtso all: test-dtso Modified: stable/12/sys/dts/mips/Makefile ============================================================================== --- stable/12/sys/dts/mips/Makefile Mon Nov 19 18:58:34 2018 (r340645) +++ stable/12/sys/dts/mips/Makefile Mon Nov 19 18:59:06 2018 (r340646) @@ -1,6 +1,6 @@ # $FreeBSD$ -DTS!=ls *.dts +DTS!=ls ${.CURDIR}/*.dts all: test-dts Modified: stable/12/sys/dts/powerpc/Makefile ============================================================================== --- stable/12/sys/dts/powerpc/Makefile Mon Nov 19 18:58:34 2018 (r340645) +++ stable/12/sys/dts/powerpc/Makefile Mon Nov 19 18:59:06 2018 (r340646) @@ -1,6 +1,6 @@ # $FreeBSD$ -DTS!=ls *.dts +DTS!=ls ${.CURDIR}/*.dts all: test-dts From owner-svn-src-all@freebsd.org Mon Nov 19 19:04:51 2018 Return-Path: Delivered-To: svn-src-all@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 BB9A61123EC9; Mon, 19 Nov 2018 19:04:51 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5F6DA87861; Mon, 19 Nov 2018 19:04:51 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 38FCF261D0; Mon, 19 Nov 2018 19:04:51 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAJJ4pFH015218; Mon, 19 Nov 2018 19:04:51 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAJJ4p2j015217; Mon, 19 Nov 2018 19:04:51 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201811191904.wAJJ4p2j015217@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Mon, 19 Nov 2018 19:04:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r340647 - stable/12/sys/kern X-SVN-Group: stable-12 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: stable/12/sys/kern X-SVN-Commit-Revision: 340647 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 5F6DA87861 X-Spamd-Result: default: False [0.42 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-0.01)[-0.012,0]; NEURAL_SPAM_SHORT(0.43)[0.428,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Nov 2018 19:04:51 -0000 Author: kevans Date: Mon Nov 19 19:04:50 2018 New Revision: 340647 URL: https://svnweb.freebsd.org/changeset/base/340647 Log: MFC r340392: Add dynamic_kenv assertion to init_static_kenv Both to formally document the requirement that this not be called after the dynamic kenv is setup, and to perhaps help static analyzers figure out what's going on. While calling init_static_kenv this late isn't fatal, there are some caveats that the caller should be aware of: - Late calls are effectively a no-op, as far as default FreeBSD is concerned, as everything will switch to searching the dynamic kenv once it's available. - Each of the kern_getenv calls will leak memory, as it's assumed that these are searching static environment and allocations will not be made. As such, this usage is not sensible and should be detected. Modified: stable/12/sys/kern/kern_environment.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/kern/kern_environment.c ============================================================================== --- stable/12/sys/kern/kern_environment.c Mon Nov 19 18:59:06 2018 (r340646) +++ stable/12/sys/kern/kern_environment.c Mon Nov 19 19:04:50 2018 (r340647) @@ -249,6 +249,7 @@ init_static_kenv(char *buf, size_t len) { char *eval; + KASSERT(!dynamic_kenv, ("kenv: dynamic_kenv already initialized")); /* * Give the static environment a chance to disable the loader(8) * environment first. This is done with loader_env.disabled=1. From owner-svn-src-all@freebsd.org Mon Nov 19 19:05:09 2018 Return-Path: Delivered-To: svn-src-all@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 E717F1123F04; Mon, 19 Nov 2018 19:05:08 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8F2BD8810F; Mon, 19 Nov 2018 19:05:08 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6F0D2261D1; Mon, 19 Nov 2018 19:05:08 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAJJ586T015292; Mon, 19 Nov 2018 19:05:08 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAJJ58xf015291; Mon, 19 Nov 2018 19:05:08 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201811191905.wAJJ58xf015291@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Mon, 19 Nov 2018 19:05:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r340648 - stable/11/sys/kern X-SVN-Group: stable-11 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: stable/11/sys/kern X-SVN-Commit-Revision: 340648 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 8F2BD8810F X-Spamd-Result: default: False [0.42 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-0.01)[-0.012,0]; NEURAL_SPAM_SHORT(0.43)[0.428,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Nov 2018 19:05:09 -0000 Author: kevans Date: Mon Nov 19 19:05:07 2018 New Revision: 340648 URL: https://svnweb.freebsd.org/changeset/base/340648 Log: MFC r340392: Add dynamic_kenv assertion to init_static_kenv Both to formally document the requirement that this not be called after the dynamic kenv is setup, and to perhaps help static analyzers figure out what's going on. While calling init_static_kenv this late isn't fatal, there are some caveats that the caller should be aware of: - Late calls are effectively a no-op, as far as default FreeBSD is concerned, as everything will switch to searching the dynamic kenv once it's available. - Each of the kern_getenv calls will leak memory, as it's assumed that these are searching static environment and allocations will not be made. As such, this usage is not sensible and should be detected. Modified: stable/11/sys/kern/kern_environment.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/kern/kern_environment.c ============================================================================== --- stable/11/sys/kern/kern_environment.c Mon Nov 19 19:04:50 2018 (r340647) +++ stable/11/sys/kern/kern_environment.c Mon Nov 19 19:05:07 2018 (r340648) @@ -247,6 +247,7 @@ init_static_kenv(char *buf, size_t len) { char *eval; + KASSERT(!dynamic_kenv, ("kenv: dynamic_kenv already initialized")); /* * Give the static environment a chance to disable the loader(8) * environment first. This is done with loader_env.disabled=1. From owner-svn-src-all@freebsd.org Mon Nov 19 19:38:55 2018 Return-Path: Delivered-To: svn-src-all@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 87EC0112505B for ; Mon, 19 Nov 2018 19:38:55 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: from mail-wm1-x32b.google.com (mail-wm1-x32b.google.com [IPv6:2a00:1450:4864:20::32b]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5533D89330 for ; Mon, 19 Nov 2018 19:38:54 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: by mail-wm1-x32b.google.com with SMTP id y139so6510726wmc.5 for ; Mon, 19 Nov 2018 11:38:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hardenedbsd.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=pjEpAGVkN73gdX1dj0hFF9z0laXMUCvB1KSDr3bOKTk=; b=O1O+nJ6ifz50SNpAINjLeYmpf1CVFp4z4euj3uiWluutRZbUe/RaxaQLo7CVL7PJWn 850TJ7l43hFAwDVH4cuLbR/KTNO6rYWzioEu2SJFahkdYrbd9grmKBMA+cCVGh6H2KRu v/50axRX4Hj20Olp14+izgcHDlnLZAo4EBygCbBlMC32F63kAk4FpgZnI/E40Sq/IhCj dFKMf8p1pHGxtVTV8yTff3+jIS72aidmcqJ5awlclCazSCXRbyQIgTfXoC7sowgVHmiM QTeD02nEjGOlgSxchwci6QwR5/XLbNrRvoDm07YOXuJrcB3+BfxyzPgm7LiESYNsfRQV Q7fQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=pjEpAGVkN73gdX1dj0hFF9z0laXMUCvB1KSDr3bOKTk=; b=EkZFP0+bbvciw9t/9dtjCv6PGG0WOVzfK/YAruO4g5qCqCgbdoq313Htcma0zSTPAb +L4lnuE5NBcwblOQK4JPEQt0vkjTPGDXhiLiBaqJsxDhczEH6CkYzZK8fQjlNOixvXQY VNn6b8B/kRMQ8Mp3XBivcoXcOiSBIYa5R14H7VUIZz6BQKwckKZArxeDDx3MM5jMfbDT 6hxNmrn0zlOdz4X88rIQT8DFj0yAfVZfAIiMHh2vd42/k82EKVn7h4+pqp+BHSVqkpGa PjtFprKOOaFLg+kMbd2+2+Ix3hYqXMt2DEROayChvTcwd+eRPYE+nxZgltrSaez+xbfI 2JZA== X-Gm-Message-State: AGRZ1gJ11Rmu306uyWSTLIJRV1PwiXtudI+Pbc8aZYqKH0YEqoDlL/Uw He4b/YbP/PiW0abnzUHgah1uMA== X-Google-Smtp-Source: AJdET5dcu0GWTf0Rdd62DnNPp8TELhYyZKXbfQp8rtGLwZm88BvJWpJrsBAeLsomyJqYfOFvcieQlA== X-Received: by 2002:a1c:2104:: with SMTP id h4-v6mr7730847wmh.130.1542656332794; Mon, 19 Nov 2018 11:38:52 -0800 (PST) Received: from mutt-hbsd ([195.135.194.134]) by smtp.gmail.com with ESMTPSA id q2sm20294930wru.56.2018.11.19.11.38.48 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 19 Nov 2018 11:38:51 -0800 (PST) Date: Mon, 19 Nov 2018 14:38:10 -0500 From: Shawn Webb To: Ed Maste Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r340640 - head/lib/libc Message-ID: <20181119193810.b4mexvznrqyb7j7v@mutt-hbsd> References: <201811191812.wAJICdFf087392@repo.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="bpbhymxallxpmppd" Content-Disposition: inline In-Reply-To: <201811191812.wAJICdFf087392@repo.freebsd.org> X-Operating-System: FreeBSD mutt-hbsd 13.0-CURRENT FreeBSD 13.0-CURRENT HARDENEDBSD-13-CURRENT amd64 X-PGP-Key: http://pgp.mit.edu/pks/lookup?op=vindex&search=0x6A84658F52456EEE User-Agent: NeoMutt/20180622 X-Rspamd-Queue-Id: 5533D89330 X-Spamd-Result: default: False [-3.13 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_DKIM_ALLOW(0.00)[hardenedbsd.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_SPF_ALLOW(0.00)[+ip6:2a00:1450:4000::/36]; RECEIVED_SPAMHAUS_XBL(3.00)[134.194.135.195.zen.spamhaus.org : 127.0.0.4]; MIME_GOOD(-0.20)[multipart/signed,text/plain]; PREVIOUSLY_DELIVERED(0.00)[svn-src-all@freebsd.org]; DMARC_NA(0.00)[hardenedbsd.org]; TO_DN_SOME(0.00)[]; BAD_REP_POLICIES(0.10)[]; RCVD_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[hardenedbsd.org:+]; MX_GOOD(-0.01)[alt1.aspmx.l.google.com,aspmx.l.google.com,aspmx2.googlemail.com,alt2.aspmx.l.google.com,aspmx3.googlemail.com]; RCVD_IN_DNSWL_NONE(0.00)[b.2.3.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.5.4.1.0.0.a.2.list.dnswl.org : 127.0.5.0]; NEURAL_HAM_SHORT(-0.98)[-0.976,0]; SIGNED_PGP(-2.00)[]; FROM_EQ_ENVFROM(0.00)[]; MID_RHS_NOT_FQDN(0.50)[]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US]; IP_SCORE(-2.55)[ip: (-9.27), ipnet: 2a00:1450::/32(-1.70), asn: 15169(-1.66), country: US(-0.09)] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Nov 2018 19:38:55 -0000 --bpbhymxallxpmppd Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Nov 19, 2018 at 06:12:39PM +0000, Ed Maste wrote: > Author: emaste > Date: Mon Nov 19 18:12:39 2018 > New Revision: 340640 > URL: https://svnweb.freebsd.org/changeset/base/340640 >=20 > Log: > libc: forcibly disable BIND_NOW > =20 > Building libc WITH_BIND_NOW results in segfault at process start. For > now force BIND_NOW off until the root cause can be identified and fixed. > =20 > PR: 233333 > Sponsored by: The FreeBSD Foundation >=20 > Modified: > head/lib/libc/Makefile >=20 > Modified: head/lib/libc/Makefile > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/lib/libc/Makefile Mon Nov 19 17:33:44 2018 (r340639) > +++ head/lib/libc/Makefile Mon Nov 19 18:12:39 2018 (r340640) > @@ -6,6 +6,8 @@ SHLIBDIR?=3D /lib > =20 > .include > =20 > +# BIND_NOW in libc results in segfault at startup (PR 233333) > +MK_BIND_NOW=3D no Since the use of ifunc in libc is only applicable to amd64, I wonder if it would be best to disable BIND_NOW in lib/libc/amd64/Makefile.inc. I don't believe there's any need to disable BIND_NOW for libc on other architectures. Thanks, --=20 Shawn Webb Cofounder and Security Engineer HardenedBSD Tor-ified Signal: +1 443-546-8752 Tor+XMPP+OTR: lattera@is.a.hacker.sx GPG Key ID: 0x6A84658F52456EEE GPG Key Fingerprint: 2ABA B6BD EF6A F486 BE89 3D9E 6A84 658F 5245 6EEE --bpbhymxallxpmppd Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEKrq2ve9q9Ia+iT2eaoRlj1JFbu4FAlvzER0ACgkQaoRlj1JF bu5JzhAAnElmh4OS0FrWWzC19j53e+iI/9g4+Em80H/X2TrTmV0h9ADeebdyJIdI zy849RR+V6oRRxpzYWlT59Jn+Pvh/ARlWIKosId9f14NRnMdKEhP8G/jRmixkUF2 ZDGEad0cb+d0tGGf3m1EhagJ8bSr2aJ6yiygFnVO81/fdOKSAIjhqVdS4q0Oi5HH 1BJWzyFtCEipr3gK5i7Tnq5q7f5CSIi2sbL/EAfafl3gSopBUZuscQlqJal9LUQ1 ytFSiXNg6VD7rbekAV54cgpsw+cvPsIkV7AmB+W4yuUvendFnKbd2vOR4HvsOiGC IKiP1uBsCLJzyJ6EIptTemjDVJaurOpCsrhriesOFDiMMZEqiB3FEoe7s0oMWQf3 N6Uv7+JAhf9HUP/nCfC8MjIUaYzha42nbOv9/QZGUmLIha2vvdtVF73f8+P+xGtq hirJC8ZfII7rair3hjo0YR02W+ii0iiZV24XUl9GaSkswkXbxDP19BlCuRWdjdAh 6fwS+Oj2lKnCPl/jbvdtk0wOHnHuvISeFYYO5+GB04eTGxXdAU05g53Gqho84Z5h nqgT6SlvEOpaesMa76zT2wlvOhgnJleBBoXS9WEiYnaX1E7PVztbh5VHFArN6O6T Br+q2Q98wMuD1E5lY7V8dJIJDwwMqYSw3SPU0ZtF0DoSt3W/EBw= =2tib -----END PGP SIGNATURE----- --bpbhymxallxpmppd-- From owner-svn-src-all@freebsd.org Mon Nov 19 20:34:39 2018 Return-Path: Delivered-To: svn-src-all@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 14C941126959; Mon, 19 Nov 2018 20:34:39 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: from mail-it1-f195.google.com (mail-it1-f195.google.com [209.85.166.195]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 771E98B3D4; Mon, 19 Nov 2018 20:34:38 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: by mail-it1-f195.google.com with SMTP id a205-v6so59906itd.4; Mon, 19 Nov 2018 12:34:38 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=wZ7L94FHOEIJ4Wx4YtBOB4LT6WsDwMOVb5+V34YDHIw=; b=dlnN89acPAGaRWYAcsl7033UgRXerqfQ7juZLQsBCXLTSPPmZFLmjS7ZSprae0npjJ a5c8HYwR6Q6hl/OXwoHqfnq+pcxNFHg/8CzJVoxNwynhTCmZosRFaH3SHbxbzQqnbDkD UaR1TQsNzQX832lgjBPkUE/rkMk3MylRkeIpmCrGHGdsacwjkoLr2WIhbcny35g5vywF XTv+eZMhEmJ02UXqYoWFolXPa728rpOlgh3tR7bQLRhskIYMNBZBxwRPYDAUYg1PjF7H 65SgSyFe1VsfmrVY/a/TzJemaceWK8Z+5m4Cwr7CCVj6GsXZlZmUXBgVcLKWLpWnWJ0u u22g== X-Gm-Message-State: AA+aEWYVFz4u+4lq5Ag7MQ7yTt4vTt03B3omlHhRTKIfrj0KET/iWEjB HUYtJSaAtaElWJFkbtbWvRGo4d9+01l5j0N/uCFC+w== X-Google-Smtp-Source: AJdET5fmXJgbpuSqvRY1OBJ3ti39oMLrfpzxeMTH7ycMDBd5gUU7Dgl8pm/MFqFpWG6mywWOOWIzy2L40tJOBiy1W6w= X-Received: by 2002:a24:f5c1:: with SMTP id k184mr9386609ith.87.1542659671950; Mon, 19 Nov 2018 12:34:31 -0800 (PST) MIME-Version: 1.0 References: <201811191812.wAJICdFf087392@repo.freebsd.org> <20181119193810.b4mexvznrqyb7j7v@mutt-hbsd> In-Reply-To: <20181119193810.b4mexvznrqyb7j7v@mutt-hbsd> From: Ed Maste Date: Mon, 19 Nov 2018 15:34:16 -0500 Message-ID: Subject: Re: svn commit: r340640 - head/lib/libc To: Shawn Webb Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 771E98B3D4 X-Spamd-Result: default: False [-2.99 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.99)[-0.994,0]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17]; MIME_GOOD(-0.10)[text/plain]; RCVD_TLS_LAST(0.00)[]; DMARC_NA(0.00)[freebsd.org]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; MX_GOOD(-0.01)[cached: alt3.gmail-smtp-in.l.google.com]; NEURAL_HAM_SHORT(-0.95)[-0.948,0]; RCVD_IN_DNSWL_NONE(0.00)[195.166.85.209.list.dnswl.org : 127.0.5.0]; IP_SCORE(-1.04)[ipnet: 209.85.128.0/17(-3.43), asn: 15169(-1.67), country: US(-0.09)]; FORGED_SENDER(0.30)[emaste@freebsd.org,carpeddiem@gmail.com]; RWL_MAILSPIKE_POSSIBLE(0.00)[195.166.85.209.rep.mailspike.net : 127.0.0.17]; R_DKIM_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; FROM_NEQ_ENVFROM(0.00)[emaste@freebsd.org,carpeddiem@gmail.com]; RCVD_COUNT_TWO(0.00)[2] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Nov 2018 20:34:39 -0000 On Mon, 19 Nov 2018 at 14:38, Shawn Webb wrote: > > Since the use of ifunc in libc is only applicable to amd64, I wonder > if it would be best to disable BIND_NOW in > lib/libc/amd64/Makefile.inc. I don't believe there's any need to > disable BIND_NOW for libc on other architectures. At least arm64 and i386 will probably start making use of ifuncs in the not-too-distant future. After some more investigation and if we're sure that it's only ifuncs that are affected this might be made machine-dependent. From owner-svn-src-all@freebsd.org Mon Nov 19 20:45:50 2018 Return-Path: Delivered-To: svn-src-all@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 B94181126E25; Mon, 19 Nov 2018 20:45:50 +0000 (UTC) (envelope-from bcr@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5C5588BAA0; Mon, 19 Nov 2018 20:45:50 +0000 (UTC) (envelope-from bcr@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3BE86271F5; Mon, 19 Nov 2018 20:45:50 +0000 (UTC) (envelope-from bcr@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAJKjoTe067903; Mon, 19 Nov 2018 20:45:50 GMT (envelope-from bcr@FreeBSD.org) Received: (from bcr@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAJKjolj067902; Mon, 19 Nov 2018 20:45:50 GMT (envelope-from bcr@FreeBSD.org) Message-Id: <201811192045.wAJKjolj067902@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bcr set sender to bcr@FreeBSD.org using -f From: Benedict Reuschling Date: Mon, 19 Nov 2018 20:45:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340649 - head/usr.bin/fortune/datfiles X-SVN-Group: head X-SVN-Commit-Author: bcr X-SVN-Commit-Paths: head/usr.bin/fortune/datfiles X-SVN-Commit-Revision: 340649 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 5C5588BAA0 X-Spamd-Result: default: False [0.47 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.45)[0.453,0]; NEURAL_SPAM_MEDIUM(0.02)[0.018,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Nov 2018 20:45:50 -0000 Author: bcr (doc committer) Date: Mon Nov 19 20:45:49 2018 New Revision: 340649 URL: https://svnweb.freebsd.org/changeset/base/340649 Log: Add a fortune describing how to upload a machine's dmesg information to the NYCBUG database. We want to encourage our users to upload their dmesgs so that the project can get a better insight into what kind of hardware is run on. This helps in making data-driven decisions about i.e., platform and driver support. Note that dmesgs may contain sensitive information like hardware serial numbers, hence uploading them without review is discouraged. Reviewed by: brooks, imp, allanjude Approved by: allanjude MFC after: 5 days Differential Revision: https://reviews.freebsd.org/D17705 Modified: head/usr.bin/fortune/datfiles/freebsd-tips Modified: head/usr.bin/fortune/datfiles/freebsd-tips ============================================================================== --- head/usr.bin/fortune/datfiles/freebsd-tips Mon Nov 19 19:05:07 2018 (r340648) +++ head/usr.bin/fortune/datfiles/freebsd-tips Mon Nov 19 20:45:49 2018 (r340649) @@ -554,3 +554,9 @@ Use "sysrc name=value" to add an entry and "sysrc -x n -- Lars Engels % +You can upload the dmesg of your system to help developers get an overview of commonly used hardware and peripherals for FreeBSD. +Use the curl package to upload it in one command: +curl -v -d "nickname=$USER" -d "description=FreeBSD/$(uname -m) on \ +$(kenv smbios.system.maker) $(kenv smbios.system.product)" -d "do=addd" \ +--data-urlencode 'dmesg@/var/run/dmesg.boot' http://dmesgd.nycbug.org/index.cgi +% From owner-svn-src-all@freebsd.org Mon Nov 19 20:48:48 2018 Return-Path: Delivered-To: svn-src-all@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 56E7E1126F04; Mon, 19 Nov 2018 20:48:48 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EFE8C8BC5D; Mon, 19 Nov 2018 20:48:47 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C915E271FC; Mon, 19 Nov 2018 20:48:47 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAJKmlk4068085; Mon, 19 Nov 2018 20:48:47 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAJKmltP068084; Mon, 19 Nov 2018 20:48:47 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201811192048.wAJKmltP068084@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 19 Nov 2018 20:48:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340650 - head/share/mk X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/share/mk X-SVN-Commit-Revision: 340650 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: EFE8C8BC5D X-Spamd-Result: default: False [0.47 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_MEDIUM(0.02)[0.018,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.45)[0.453,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Nov 2018 20:48:48 -0000 Author: emaste Date: Mon Nov 19 20:48:47 2018 New Revision: 340650 URL: https://svnweb.freebsd.org/changeset/base/340650 Log: Avoid retpolineplt with static linking Statically linked binaries linked with -zretpolineplt crash at startup as lld produces a broken PLT. PR: 233336 Sponsored by: The FreeBSD Foundation Modified: head/share/mk/bsd.prog.mk Modified: head/share/mk/bsd.prog.mk ============================================================================== --- head/share/mk/bsd.prog.mk Mon Nov 19 20:45:49 2018 (r340649) +++ head/share/mk/bsd.prog.mk Mon Nov 19 20:48:47 2018 (r340650) @@ -41,7 +41,10 @@ LDFLAGS+= -Wl,-znow .if ${MK_RETPOLINE} != "no" CFLAGS+= -mretpoline CXXFLAGS+= -mretpoline +# retpolineplt is broken with static linking (PR 233336) +.if !defined(NO_SHARED) || ${NO_SHARED} == "no" || ${NO_SHARED} == "NO" LDFLAGS+= -Wl,-zretpolineplt +.endif .endif .if defined(CRUNCH_CFLAGS) From owner-svn-src-all@freebsd.org Mon Nov 19 20:57:22 2018 Return-Path: Delivered-To: svn-src-all@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 D5C9511272D0 for ; Mon, 19 Nov 2018 20:57:21 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-it1-x135.google.com (mail-it1-x135.google.com [IPv6:2607:f8b0:4864:20::135]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A92AF8C1C7 for ; Mon, 19 Nov 2018 20:57:20 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-it1-x135.google.com with SMTP id m15so167720itl.4 for ; Mon, 19 Nov 2018 12:57:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=V9keR/S2XANhR74kkQO4MluzrMO8+5jqKQvG0LkGQqw=; b=H/hT19hS8h/zoljwRQHRKDISXei8iZzRQrjBZ8ROu+ADmjtVHv41ZovCxFAKXKnlYl 5y5xq/Mvn+3vD69jVKVqEzyMsWKP3E9eeqXXhEdFqoOcwtBgLjs04xDgRL4FRwT655iP 9Zp5fIKL0lMsfGA9jOn1A5/l7xQgBMoYQrRiGxVc77zk9jcQM8GEhw9PFbI8RwY95jZW PVfWOnBiUEm/yLTvYqQAghcsnvBrZKSGWviklgn8uQGaFd8m0HtzKeQOsUyg6EWtOhka knEn/K/b2aArfP1KgkfVs1how/ateaJq/5caEdWx+4YnQF6D2owPACon0NPWZh9yRWD+ opjQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=V9keR/S2XANhR74kkQO4MluzrMO8+5jqKQvG0LkGQqw=; b=tDRanNvbuhqPiEQX2SqDnr57b/HfGAJa1UvCOlLjWLeWx0ITVqwGsdNYbNpepQuaa8 VsxWOoAmK0WR7f5Y6hfad/cgnoD/VUm/8Q2iYup/OMIDap41P1GB4meNW+/xKcIw/dsL cuxPXfRkBYKsqiVCFkjQF9ca1xFst3/ymvlVE5JgCRvJj6FdPQINvwPKFsT5bBS7oOkp f0fWxwEYCKVfCuHcfgGWdCYIRL6qBQ+21feuh04IXOPbcCR1ItUQr2MH9RtDV53OGiVh RxYBX6rzAJJc/DX7eicL68HoC1yVmg29CWGpVgxN+5anPkyrOfAUTRhkOxppegl7vror dkZQ== X-Gm-Message-State: AA+aEWbzpNkuuiFtXiLnKL/R1Lo75ucIQBgH4zXt9FTYHvucHv/oC/zw Zmqkiu3HmFipn/Ux+Z2AJI1kEvcT+hCLK9ONwqlfGg== X-Google-Smtp-Source: AJdET5fijaFkrDI9Eau8iZHa8cn/VTduwL2zrrEPt3cvZRuRFYyZnvEG5WL6R3hmbvG5ySTyX1o5+8iPeRThg8yPGa4= X-Received: by 2002:a24:5f94:: with SMTP id r142-v6mr10140749itb.171.1542661039677; Mon, 19 Nov 2018 12:57:19 -0800 (PST) MIME-Version: 1.0 References: <201811190104.wAJ14CaE059062@pdx.rh.CN85.dnsmgr.net> <5e227743-6463-d395-f2ba-da8d4ba248ca@FreeBSD.org> <20181120005944.B1050@besplex.bde.org> <20181120014951.J1250@besplex.bde.org> <20181120023823.M1428@besplex.bde.org> In-Reply-To: <20181120023823.M1428@besplex.bde.org> From: Warner Losh Date: Mon, 19 Nov 2018 13:57:08 -0700 Message-ID: Subject: Re: svn commit: r340450 - head/sys/sys To: Bruce Evans Cc: Andriy Gapon , "Rodney W. Grimes" , Allan Jude , Warner Losh , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org X-Rspamd-Queue-Id: A92AF8C1C7 X-Spamd-Result: default: False [-4.20 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; R_DKIM_ALLOW(-0.20)[bsdimp-com.20150623.gappssmtp.com]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; NEURAL_HAM_SHORT(-0.98)[-0.977,0]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[svn-src-all@freebsd.org]; DMARC_NA(0.00)[bsdimp.com]; TO_MATCH_ENVRCPT_SOME(0.00)[]; MX_GOOD(-0.01)[cached: ALT1.aspmx.l.google.com]; DKIM_TRACE(0.00)[bsdimp-com.20150623.gappssmtp.com:+]; RCPT_COUNT_SEVEN(0.00)[8]; RCVD_IN_DNSWL_NONE(0.00)[5.3.1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.0]; R_SPF_NA(0.00)[]; FORGED_SENDER(0.30)[imp@bsdimp.com,wlosh@bsdimp.com]; FREEMAIL_TO(0.00)[optusnet.com.au]; RCVD_TLS_LAST(0.00)[]; IP_SCORE(-2.22)[ip: (-6.89), ipnet: 2607:f8b0::/32(-2.45), asn: 15169(-1.67), country: US(-0.09)]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; FROM_NEQ_ENVFROM(0.00)[imp@bsdimp.com,wlosh@bsdimp.com]; RCVD_COUNT_TWO(0.00)[2] X-Rspamd-Server: mx1.freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Nov 2018 20:57:22 -0000 On Mon, Nov 19, 2018 at 9:05 AM Bruce Evans wrote: > On Tue, 20 Nov 2018, Bruce Evans wrote: > > > On Tue, 20 Nov 2018, Bruce Evans wrote: > > > >> On Mon, 19 Nov 2018, Warner Losh wrote: > >> > >>> On Mon, Nov 19, 2018 at 12:31 AM Andriy Gapon wrote: > > ... > > I found my test program. > > > >>> But I think I understand the problem now. > >>> > >>> mstosbt(1000) is overflowing with my change, but not without because > we're > >>> adding 2^32 to a number that's ~900 away from overflowing changing a > very > >> > >> This value is just invalid. Negative values are obviously invalid. > >> Positive > >> values of more than 1 second are invalid. In the old version, values of > >> precisely 1 second don't overflow since the scale factor is rounded > down; > >> the result is just 1 unit lower than 1 second. Overflow (actually > >> truncation) > >> occurs at 1 unit above 1 second. E.g., sbttoms(mstosbt(1000)) was 999 > and > >> sbttoms(mstosbt(1001)) was 0. Now in my fixed version, > >> sbttoms(mstosbt(1000)) > >> is truncated to 0 and sbttoms(mstosbt(1001)) is truncated to 1. > >> > >> The test program also showed that in the old version, all valid args > except > >> 0 are reduced by precisely 1 by conversion to sbt and back. > >> > >>> large sleep of 1 second to a tiny sleep of 0 (which is 1ms at the > default > >>> Hz). I think we get this in the mlx code because there's a > msleep(1000) in > >>> at least one place. msleep(1001) would have failed before my change. > Now I > >>> think msleep(999) works, but msleep(1000) fails. Since the code is > waiting > >>> a second for hardware to initialize, a 1ms instead is likely to catch > the > >>> hardware before it's finished. I think this will cause problems no > matter > >>> cold or not, since it's all pause_sbt() under the covers and a delay > of 0 > >>> is still 0 either way. > >> > >> Bug in the mlx code. The seconds part must be converted separately, as > in > >> tstosbt(). > > > > mlx doesn't seem to use sbt directly, or even msleep(), so the bug does > > seem to be central. > > > > mlx actually uses mtx_sleep() with timo = hz(). mtx_sleep() is actually > > an obfuscated macro wrapping _sleep(). The conversion to sbt is done by > > the macro and is sloppy. It multiplies timo by tick_sbt. > > > > tick_sbt is SBT_1S / hz, so the sbt is SBT_1S / hz * hz which is SBT_1S > > reduced a little. This is not affected by the new code, and it still > isn't > > converted back to 1 second in ms, us or ns. Even if it is converted back > > and then forth to sbt using the new code, it remains less than 1 second > as > > an sbt so shouldn't cause any new problems. > > Here are all uses of these functions in kern outside of sys/time.h: > > XX arm/arm/mpcore_timer.c: sc->et.et_min_period = nstosbt(20); > > OK since 20 ns is less than 1 second. > > XX cddl/compat/opensolaris/sys/kcondvar.h: return > (cv_timedwait_sbt(cvp, mp, nstosbt(tim), nstosbt(res), 0)); > XX cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_tx.c: > pause_sbt("dmu_tx_delay", nstosbt(wakeup), > XX cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_tx.c: > nstosbt(zfs_delay_resolution_ns), C_ABSOLUTE); > XX cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c: sbintime_t sleep = > nstosbt((zilog->zl_last_lwb_latency * pct) / 100); > XX compat/linuxkpi/common/include/linux/delay.h: > pause_sbt("lnxsleep", mstosbt(ms), 0, C_HARDCLOCK); > XX compat/linuxkpi/common/src/linux_hrtimer.c: > nstosbt(hrtimer->expires), nstosbt(hrtimer->precision), 0); > XX compat/linuxkpi/common/src/linux_hrtimer.c: > callout_reset_sbt(&hrtimer->callout, nstosbt(ktime_to_ns(time)), > XX compat/linuxkpi/common/src/linux_hrtimer.c: nstosbt(nsec), > hrtimer_call_handler, hrtimer, 0); > XX compat/linuxkpi/common/src/linux_hrtimer.c: > callout_reset_sbt(&hrtimer->callout, nstosbt(ktime_to_ns(interval)), > XX compat/linuxkpi/common/src/linux_hrtimer.c: > nstosbt(hrtimer->precision), hrtimer_call_handler, hrtimer, 0); > XX compat/linuxkpi/common/src/linux_schedule.c: ret = > -pause_sbt("lnxsleep", mstosbt(ms), 0, C_HARDCLOCK | C_CATCH); > > All of the above might are broken unless their timeout arg is restricted to > less than 1 second. > > Also, at least the sleep and pause calls in the above probably have a > style bug in knowing about sbt's at all. More important functions > like msleep() hide the use of sbt's and use fuzzier scale factors like > tick_sbt. > Yes. It's for these users I'm fixing the >= 1s cases. > XX dev/iicbus/nxprtc.c: pause_sbt("nxpotp", mstosbt(100), > mstosbt(10), 0); > XX dev/iicbus/nxprtc.c: pause_sbt("nxpbat", mstosbt(100), 0, 0); > > OK since 100 ms is less than 1 second. > > XX kern/kern_sysctl.c: sb = ustosbt(tt); > XX kern/kern_sysctl.c: sb = mstosbt(tt); > > Recently added bugs. The args is supplied by applications so can be far > above > 1 second. > > Also, these functions have a bogus API that takes uint64_t args. sbt's > can't represent that high, and the API doesn't support failure, so callers > have the burden of passing valid values. It is easiest to only support > args > up to 1 second and require the caller to handle seconds. > It's just as easy to cope. > Lots of itimer and select() code handle the corresponding problem for > timevals and timespecs almost correctly. Timevals and timespecs already > have the seconds part separate and itimer and select() syscalls do validity > checking on the fractional seconds, so there is no problem converting the > fractional sections to an sbt. Howver, the seconds part has type time_t > and this can be int64_t, which sbt's cannot represent. Also, POSIX doesn't > permit failure for seconds values that are representable by time_t. The > almost correct handling is to split up large seconds values in some cases > and break POSIX conformance by silently reducing the seconds value in > other cases. The reduction is usually to INT32_MAX / 2. This allows > adding 2 limited values but it is not obvious that this is enough since > rounding up twice or just adding 2 more would give overflow. > Right, that's beyond the scope of what I'm fixing. > XX kern/subr_rtc.c: sbt = nstosbt(waitns); > > This is correct, since waitns is the nanoseconds part of a timespec. > Yup. https://reviews.freebsd.org/D18051 Contains the changes. They address all the actual problems you've raised, but I'm going to disagree that 'ull' is bogus. For FreeBSD, it's fine and it's a lot more readable than the alternatives. Warner From owner-svn-src-all@freebsd.org Mon Nov 19 21:59:09 2018 Return-Path: Delivered-To: svn-src-all@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 DCD0F1128E0E; Mon, 19 Nov 2018 21:59:08 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.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 6BC9F8E264; Mon, 19 Nov 2018 21:59:08 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4AA1927D48; Mon, 19 Nov 2018 21:59:08 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAJLx8Rt004123; Mon, 19 Nov 2018 21:59:08 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAJLx713004119; Mon, 19 Nov 2018 21:59:07 GMT (envelope-from np@FreeBSD.org) Message-Id: <201811192159.wAJLx713004119@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Mon, 19 Nov 2018 21:59:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340651 - in head/sys: conf dev/cxgbe/firmware modules/cxgbe/t4_firmware modules/cxgbe/t5_firmware modules/cxgbe/t6_firmware X-SVN-Group: head X-SVN-Commit-Author: np X-SVN-Commit-Paths: in head/sys: conf dev/cxgbe/firmware modules/cxgbe/t4_firmware modules/cxgbe/t5_firmware modules/cxgbe/t6_firmware X-SVN-Commit-Revision: 340651 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 6BC9F8E264 X-Spamd-Result: default: False [0.28 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_MEDIUM(0.05)[0.055,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.22)[0.224,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Nov 2018 21:59:09 -0000 Author: np Date: Mon Nov 19 21:59:07 2018 New Revision: 340651 URL: https://svnweb.freebsd.org/changeset/base/340651 Log: cxgbe(4): Update T4/5/6 firmwares to 1.22.0.3. Obtained from: Chelsio Communications MFC after: 2 months Sponsored by: Chelsio Communications Added: head/sys/dev/cxgbe/firmware/t4fw-1.22.0.3.bin.uu (contents, props changed) head/sys/dev/cxgbe/firmware/t5fw-1.22.0.3.bin.uu (contents, props changed) head/sys/dev/cxgbe/firmware/t6fw-1.22.0.3.bin.uu (contents, props changed) Deleted: head/sys/dev/cxgbe/firmware/t4fw-1.19.1.0.bin.uu head/sys/dev/cxgbe/firmware/t5fw-1.19.1.0.bin.uu head/sys/dev/cxgbe/firmware/t6fw-1.19.1.0.bin.uu Modified: head/sys/conf/files head/sys/dev/cxgbe/firmware/t4fw_interface.h head/sys/modules/cxgbe/t4_firmware/Makefile head/sys/modules/cxgbe/t5_firmware/Makefile head/sys/modules/cxgbe/t6_firmware/Makefile Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Mon Nov 19 20:48:47 2018 (r340650) +++ head/sys/conf/files Mon Nov 19 21:59:07 2018 (r340651) @@ -1451,7 +1451,7 @@ t4fw.fwo optional cxgbe \ no-implicit-rule \ clean "t4fw.fwo" t4fw.fw optional cxgbe \ - dependency "$S/dev/cxgbe/firmware/t4fw-1.19.1.0.bin.uu" \ + dependency "$S/dev/cxgbe/firmware/t4fw-1.22.0.3.bin.uu" \ compile-with "${NORMAL_FW}" \ no-obj no-implicit-rule \ clean "t4fw.fw" @@ -1485,7 +1485,7 @@ t5fw.fwo optional cxgbe \ no-implicit-rule \ clean "t5fw.fwo" t5fw.fw optional cxgbe \ - dependency "$S/dev/cxgbe/firmware/t5fw-1.19.1.0.bin.uu" \ + dependency "$S/dev/cxgbe/firmware/t5fw-1.22.0.3.bin.uu" \ compile-with "${NORMAL_FW}" \ no-obj no-implicit-rule \ clean "t5fw.fw" @@ -1519,7 +1519,7 @@ t6fw.fwo optional cxgbe \ no-implicit-rule \ clean "t6fw.fwo" t6fw.fw optional cxgbe \ - dependency "$S/dev/cxgbe/firmware/t6fw-1.19.1.0.bin.uu" \ + dependency "$S/dev/cxgbe/firmware/t6fw-1.22.0.3.bin.uu" \ compile-with "${NORMAL_FW}" \ no-obj no-implicit-rule \ clean "t6fw.fw" Added: head/sys/dev/cxgbe/firmware/t4fw-1.22.0.3.bin.uu ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/cxgbe/firmware/t4fw-1.22.0.3.bin.uu Mon Nov 19 21:59:07 2018 (r340651) @@ -0,0 +1,9881 @@ +/*- + * Copyright (c) 2018 Chelsio Communications, Inc. + * 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. + */ +begin-base64 644 t4fw +AAAESQEWAAMAAQkEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAABCwEOwRDAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAENoZWxzaW8gRlcgUlVOTUVNIERFQlVHPTAgKEJ1aWx0IFR1ZSBOb3YgIDYgMDU6 +NDI6NTUgUFNUIDIwMTggb24gdm5jNC5hc2ljZGVzaWduZXJzLmNvbTovaG9tZS9maXJtd2FyZS9j +dnMvZnctcmVsZWFzZS9iYWNrdXBzLzE4MTAyNi1UNC0xLjIyLjAuMC1pYm1zdG9yZXdpAEok3blg +AMgA4QB78AAQAADhADC4eP///x/84UCAAAAB4QB7cAAAEAAf//yQ4QGUcCAAAADhAZwE4QB5AAAC +AEDhAHmAAAYAQAACAAoABgAK4QB5BAAMAACAAAEC4QB7POEAe0ThAHvk4gAAAAABAADhAHuQIAAA +AAAAgADhAHsAAABAAeEAe5wAAEAAREREQuAAAADjAARzREREQOMACAAgAAJcAAAAAB//jhAAAAAA +H/+OFAAAAAAf/44YAAAAAB//jhwf/8AAAAAAAAAAAADAABL/zRP/zZMgEv/NE//NhCAEMwGTIBH/ +zBL/zJIQEf/MEv/MkhAR/8wB9DER/8siCv+SEADkMQAFMQECABL/yALnMQIWABH/x4EQAQFfwCEC +EQHJERH/xBL/xJIQEf/EEv/EkhBgAA8R/78S/8OSEBH/vxL/wpIQgRAR/8HAIJIREv/AkhLAIJIT +Ev+/khCCEALyUGUv9xH/vccvkhAR/7ySEBL/vBP/vJMgwDKTIRP/u5MigiIS/7oT/7qTICMiIRT/ +uQQzAck4E/+4gzADgxQIMxEU/7akM5MhE/+qkyJgAAjCMJMhE/+nkyIS/7GQIJAhkCKQI5AkkCWQ +JpAnkCiQKZAqkCuQLJAtkC6QLyAmECAmEYIiEv+kwDAtNzAtNzQtNzgtNzwjPQFyM+0AAgAS/6HA +MC83AC83EC83IC83MCM9AXIz7QACABL/l8AwKDcwKDc0KDc4KDc8Iz0BcjPtEv+VwDAnNwAnNxAn +NyAnNzAjPQFyM+0S/5AV/5AW/5HAMNcgBWYBYAAZAAAAAAAAAAQ2BQACANMP0w8FMwxuOxQHRxQH +BEN2MeYENgUFMwxvO+0AAgAS/4MV/4EjCgACJwIHBEMEPgUFMwwHRxRvO/ADAgAS/33JLoMghCGF +IrwidDsOhlC0VZYwtDN0M/Rj/+YAZT/iZV/fEv9xwDIDLgUDAgAS/2jAMCg3QCg3RCg3SCg3TCM9 +AXIz7QACABL/ay0nAMARAUkxAEgxAQIAwAAU/2gE0jEV/2eUUBT/ZwTTMRX/ZpRQFP9mBNQxFf9m +lFAU/2UE1TEV/2WUUBD/ZQMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf/AAA +H/wAAOMACfgf/AAAH/wAAOMACfgf/AAAH/wAAOMACfgf/4AAH/+FsOMACfgf/4WwH/+FsOMAD6gf +/4WwH/+FsOMAD6gf/4WwH/+HQOMAD6gf/4dAH/+OCOMAETgf/44QH/+yYOMAGAgf/7JgH/+yYOMA +PFgf/8AAH//90+MAPFggAAAAIAABauMAeiwgAAF4IAABfOMAe5ggAAF8IAABheMAe5wgAAGYIAAB +nOMAe6ggAAGcIAABpeMAe6wgAAG4IAABvOMAe7ggAAG8IAABxeMAe7wgAAHYIAAB2OMAe8ggAAHc +IAAB4uMAe8ggAAH4IAAB+OMAe9AgAAH8IAAB/OMAe9AgAAIYIAACGOMAe9AgAAIcIAACHOMAe9Ag +AAI4IAACOOMAe9AgAAI8IAACPOMAe9AgAAJYIAACWOMAe9AgAAJcIAACYuMAe9AgAAJ4IAACeOMA +e9ggAAJ8IAACguMAe9ggAAKYIAISTeMAe+AgAwAAIAMXgOMCi5ggAxeAIAMXgOMCoxggAxeAIAcf +hOMCoxggBx+QIAcjAOMGqyggCAAAIAgS8OMGrpggCBLwIAkvZuMGwYggCS9wIAkwPOMH3gggCwAA +IAsAAOMH3tQgCwAAIAsAAOMH3tQgCwAAIAt4KOMH3tQAAAAAAAAAAAAAAAAgABQWIAAUCCAAF/Ig +ABQIIAAXbSAAFAggABS6IAAXBSAAFoogABQIIAAWOSAAFfIgABWFIAAT9SAAFS8gABQIIAAUCCAA +FAggABTaAAAAAP///////w/8///w////APz///////8P/P//8P///wD8IADKHiAAy6QgAMvUIADL +miAAy0UgAMs7IADLCiAAywAgAMr2IADKoiAAy9IgAMqYIADKbCAAy9QgAMpiIADKUAEQGAEABAAA +AAAAIAAAAEAAAgIFBQgICwsODhERFBQXFxoaHR0gICMjJiYpKSwsLy8yMjU1ODg7OwAAAAAAAAAg +BSQkIAHGVCAAPOAgAZHYIAHBOCABu2AgAXe4IARIeB//6TQgALKoIADMsB//3CAgAHWAIABnYAAA +AAAAAAAAIAGTkCAAnWggAJVQAAAAAB//1KQf/8YoH//CWB//wDAgAFq4IABOFCAAS0AgAL5AH//i +6CAG9UAAAAAAAAAAACAAUcggAF30AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIADGsCABquggANcw +IADWLB//8BAf/89MH//MeCAAksggBaqgIAFC+CABK4AgARAYIAEHcCAA/JQgAO8MIADaKCAFKBgg +AyjYIAE4dCADVwAgAfgkIAB1QAAAAAAgANeYIAYgdCAAyZAgAZ2EIAACmCAAuAAAAAAAAAAAAB// +8zggANdMIAMriAAAAAAAAAAAIAOviCAAKjQgA63QIAAotAAAAAAgADToIAAzHCAAMWQAAAAAIAA8 +hCABPDgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgBBTYIAUjxAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAA5/CADuFggADeYAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAACAAPOAgAK9wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAsA +AAAgAxTUCAAAACADFOAIAAAAIAMU7AoAAAAgAxT4DAAAACADFQQSAAAAIAMVFA0AAAAgAxUoDgAA +ACADFTgTAAAAIAMVSAoAAAAgAxVcDgAAACADFWgYAAAAIAMVeA0AAAAgAxWUDgAAACADFaQQAAAA +IAMVtBIAAAAgAxXIDgAAACADFdwQAAAAIAMV7BEAAAAgAxYACgAAACADFhQLAAAAIAMWIA0AAAAg +AxYsFAAAACADFjwKAAAAIAMWVA8AAAAgAxZgBgAAACADFnAGAAAAIAMWeAYAAAAgAxaABgAAACAD +FogGAAAAIAMWkAkAAAAgAxaYBgAAACADFqQEAAAAIAMWrAYAAAAgAxa0CwAAACADFrwLAAAAIAMW +yAQAAAAgAxasBAAAACADFtQJAAAAIAMW3AkAAAAgAxboAAAAAAAAAAANAAAAIAMW9AoAAAAgAxcE +BgAAACADFxACAAAAIAMXGAMAAAAgAxCsAQAAACADFxwAAAAAAAAAANdqpHjox7dWJCBw28G9zu71 +fA+vR4fGKqgwRhP9RpUBaYCY2ItE96///1uxiVzXvmuQESL9mHGTpnlDjkm0CCH2HiViwECzQCZe +WlHptseq1i8QXQJEFFPYoeaB59P7yCHhzebDNwfW9NUNh0VaFO2p4+kF/O+j+GdvAtmNKkyK//o5 +Qodx9oFtnWEi/eU4DKS+6kRL3s+p9rtLYL6/vHAom37G6qEn+tTvMIUEiB0F2dTQOebbmeUfonz4 +xKxWZfQpIkRDKv+Xq5Qjp/yToDllW1nDjwzMkv/v9H2FhF3Rb6h+T/4s5uCjAUMUTggRofdTfoK9 +OvI1KtfSu+uG05EHDBEWBwwRFgcMERYHDBEWBQkOFAUJDhQFCQ4UBQkOFAQLEBcECxAXBAsQFwQL +EBcGCg8VBgoPFQYKDxUGCg8VH//AAAAEACAgByMAIAcocB/83gAf/6gEIAcjMB//qSQf/6ygA4AA +AIEAAAAA//gAH/+naAEAAAAAEAAAgQQBAIEEAAABBAAAAQQBAIAAAAAABf//H/+mrAYAAAAEAQAI +H/+AwAIAAACAEAAAQUAAAEFAAQCDAAAB//+//7////8f/5RYBAAACCADDqiBgAAADAAAAB//jqD/ +/wAA//8A/wABAAAAAP//H/+vkB//pFwP///////QdB//Yhwf/ODoIAcgvP//vwwf/2KcH/+p6B// +mmQf/OIAAAAIyOD//gDhAZIAH/+UxAD///8f/5kMH/+qAARBAAilAAAAwAAAAMAEAAAwAAAAH/+q +kAAAHdAAAP+AIAcfkCALRZDhAC4AH/+qhB//pjwf/6swH/+moB//qoDgAACg4QAwuOAAAAAAAIAA +4QBgEAAAQADhAhAA4QIwAOECUADhAnAA4QAQCB/84UDhAHtwH/+x8B//segf/OAIH/+x7B//shgf +/7IQH/+yFB//skAf/7I4H/+yPB//qAQf/6+QIAcjMB/83gAf/6kkH/+ooB//qcAf/5kcH/+vDB// +pcggCwBgH/+rXAAA/4AAAB6wH/+OoB//q2gf/6tkH/+ryB//rJAqAAAAIAsEYCALBJAEAAAIBQAA +AIP/AACBAAAAABAAACALBNAgCwQwIAAJ+CADDbgf/4TwH/+AwB//rKBnRSMB782riZi63P4QMlR2 +H/+AAAAAPyggAxCsz////yALBfAQAAAAP////wIAAABAAAAAGgAAAB/84HQgoAAAH/+nvCAAHeAg +AB98gAAAAAAAgAD//v//AAAQAABAAAAgAc1YIAAjCCAAAAAgACNwIAsIwP//f///+///D/aAACAL +CPAgCwkgAAEAAAAEAAAf/6gsIAtRsCALCbAgADToIAA2OCAAMxwgCwtQIAsKECALCqAgADFkIAsK +8FMAAAAA////UgAAAFEAAAAgAgF4H/+p2CAAOWAgBBDAH/+p0CALC3Af/5kUH/+pqCALDZAUAAAA +gAAAAnxQAACAAAAQgAAABoAAsAAAAAoAAP80kv//8A+AALEA4QGaAAACAAAgCw0gH/+WjAAAfkAg +Cw1gH/+p4AD/wAABAAAAKAAAAOAAAAAmAAAAAAD//x//j3AGAAAABYAAAB//pYgrAAAAIABVMCAL +VJAf/6dUA4AAAAf///8EAQAINQAAAAMAAAAAP///gEAAAAgP//8f////QUAAAEFAAQAABf//AQQB +AAEEAAAAAMAAH/+pxD0AAAAf/5UABwAAAIEEAQCBBAAAH/+pkAAAOpjDAAAAAAAP/wBDAAAf/6cc +AAAIAAQAAAAf/5hMIAtU8B//sWQf/6+wH/+UWAAGAADhAHoAH/+UwB//maAf/6oAH/+ZJB//mRAg +C1UgAAMHgCALVZAIAAAAH/+W8AAgAAAAAAkAAAAwAv/8+H/AAAAAo/+7AKP/ugANAAAA4AMAAIP/ +tgAP////D//4AP8AAAAgC1XQIAsO0CALDwAgC1ZgAA8AAAAKAAD//wAPH/+pzAP/wACD/8AAIAtW +4CALV1Af/6pIH/+wIP9g8AAEgAAIH/+OIB//gFAARAAAAYDCAAAAgQAf/45gH/+AYP8f//8AwAAA +8AAAAIGAAAD/f///H/+kXP+//////wAAAIAAAAAAht0f/5pcH/ziAB//j2DuAAAAAAAJzB/84gwP +AAAAIAsPQB//qkwAAAjMH/+rVB//mmQgCxEwIAMIIOD//gAgC0sgH/+a4B//lhwf/4BwIAchMAAA +MAAAACcQH//bkCALZKAgC2RwH/+qtB//lPQAAP/+H/+ZBN6tvu80AAAAPwAAAAAAiQYAmQAAH/+v +KBAABwIBwIAAH/+vBJkAAAAf/6/kAIgACIKAAAEf/694///wAAMVAAADEQAAAA8D/x//qaQgAQPM +IAEHuCkAAAAAAIkUIAEMjCADC3QAAEAAIAMOoAwAAAAgAReIH/+wQAAAIaAgAwuEH/+qIB//rkj/ +AP8A8PDw8KqqqqrMzMzMAAP//wAAJ/8gAwvIIAtk8CABJ+AAD0JAIANeIB//qngACQAAAABIAIIA +AAAgATxAH/+qLDsAAAgOAAAA0AAAAB//gLAAACKKAAAIUAAAH0Af/6noIAsjcCALI5AgCyOw/9// +/wAJAAgf/690MAAAAH8AAAAf/6gUIAsm0AAAD/4gCyYAIAsmYCALJqAAAOAA///3/yALJ2AgA2VY +AACD/yAHJxgVoAAAIAcoEB//rzgAAAgGAACIzB//lqAABAP/CgAAACAHI6ggByVIIAcj8IP/twCD +/7YgIAsnkOEAAAAzAAAAH/+vQB//sDQD/+AAf///AAA/9pAAACKYA//wACALSHAgC0gwIAtIkB// +sUAf/688AA///x//qeQgC2dQH/+ZRCAAeaggByC4IAAFiB//pKAf/5SMH/+pFCALKBDABAAAH/+n +1B//p8gf/6fgH/+t8B//rWQgA+moIAsoUCADD3Af/6XgIAB6iOABAAAf/5pgIAtoECALKJAf/5pY +IADDGCAAwBgf/5CoIAtnkCALZ+Af/5bAIAsqoB//jzQf/5DsH/+p1CALP1AgCz+ASAAAACAB0zAf +/6doIAHVNB//lUgf/6Y8H/+lJB//pOwAABhQAAAWTB//ltwf/6g4IAcjJB//pXwf/5TE4QAuAB// +qEThAF4A4QIOAP//v//hAA4A4QGOAP//vv8f/6YQIAHaWCAB5pTgBQAAA/8AAB//pUQgAw6oH/y/ +/zwAAAAf/4C4gwAAAB//pSwPPAAAIAtH8IKAAAAgAghsIAILIB//qsQgAg7YAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAACBgAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAgYAAAAAAAAD/////////////////////H//7aB//+2gf//swH//7 +MB//+zAf//swH//0sB//9+Af//Y4H//2OB//9jggBvcwAAAAAAAAAAAAAAAAAAAAACAG+nggBvp4 +AAAAAAAAAAAAAAAAAAAAACAG9zAgBvcwH//43B//+Nwf//jcH//43B//+Nwf//jcAAAAACAB23AA +AAAAAAAAAAAAAAAAAAAAAgEAAAAAAAAAAAAAAAAAAAEDEREICBAJAwEAAAAAAAAEAAAAAAAAAIGA +AAAAAAAQBQAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAgQAAAAAAABgFAAAAgAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +ACAKABHxaxPxa9MPA+YxAQIAFvFpF/Fqd2sGkGC0Zndj+FQO61XXqg8UAGP/+QAAAGwQCCggBZQV +JCAH9mCkFaAZRQD5AA2NYUQBAIgiGvFdF/Fc7fFdHAsOAAAMSRGnmSuSnsDp/2AM+6AMpQApkp0K +SworssMLmQHpFgQkjJmAAInY9yAM+JIAnQAvcq5k8UEf8U4qcq0v8n/vqwEEw/0AAP9ACX5iAJ0A +mNj/QAmGYgCdAIoVKSAUqpkJCUcpJBT1IAu10gCdABvxQS8iFy0hK4kUGPFAr92YkPpD6BWgDiUA +7pYCLu/CgAD9IGYV4AxlAO3xOR1WAoAADKoCjBSakesAFQTIQQAA+IJoHeBKBQCdxurGByZIgQAA +6+MFDNAEgAAKAmEKAmEKAmEKAmHApOpqNgHAQQAAbakFCACGCQJhKCErH/El+EVEFeAMFQD5ACAV +oA0FAPogiBXviAEACYgu+kPoFa+IAQD4RWQdoAYFAPYgBhWgHuUA5hYCLEVCgADoFgEl2YEAAFiK +uP6AABc3xQEA98AAR3ANlQDt5p0oBAqAAPmABMFSAJ0AwCDRDwAAAAAA6iQACdgEgADsEgUq6ASA +AFiMg9Kg0Q8AAAAAwLAMnzTv1ggt9sYAAPpAaB2gG8UA/AACHaANFQBYkvJj/8EAAOokAArYBIAA +WI4w0qDRDwD/+bQNoAkFAOokAAJYYQAA/AACHaANlQBYkuZj/5HAoFnR/B3w54nY+T/yuJAMpQBj +/6TaIFgLVGP+hYonjRXAwOqsIC7YBIAAWIYR0qDRD2wQCC8iEJQUhiknIRr+QPAVoBuFAPQgZhXg +HMUA73gRDigEgAD9AfINoe4BAAYJQsiUBwhCZIJHKSAFjSL+vgAN8BpFAPsgE70iAJ0A7/DHHo6W +AAAU8MYW8MTn5AAPTwKAAPXADpoQC6UAppkokp6eEA/qCvcAGHtSAJ0AKqLDKZKdCpkB6RYBJJIx +gACKSPdAEqCSAJ0ALmKu7fC7Fw+pgAAuYq0v0u4P6AHoFgIlS/0AAP/ADwZiAJ0AmUj/wA82YgCd +AIspiioMBD4Lqgz1QAnjogCdACohKC0hJo8U+6AQxCIAnQAuIBSv7g4ORy4kFPXAEM3SAJ0Asago +JSgqMAHzQBEOkA0VAC4hCSsgBy8hJPhgJBWgCVUA+UAEBPCrEQDgmRENUoKAAAqZAhrwlwmIAikh +Bxvwlgr/AvsGAAw6mQEA6iEiLMsCgAAJ7gKJEQuqAhvwj5iQiCCek5+UmpL9AAAUMAplAAqIApiR +LyIQn5UuIDjo8Ige0ASAAP0hJhXgTxUA9SEGFeDuGQAO+jn/bQAMMA4FAJ6XCogCmJYrIhnq8HQV ++AUAAC8mGZ6bm5rr8HMU+QEAAOoAFQTQwQAACgCKnJ8uPBD7IcYV4AplAA4ghg8CYw4Ahg8CYQx8 +EabM6sadIgCpgACOKS0gOKTuninzoAwfkgCdAI8TDw9H+eALCVIAnQDAINEPAOokAApYBIAAWI78 +/0uQDeAcxQDsEgQpUASAAO0SAynYBIAAWIvT0qDRD4pI90AKgJIAnQAMeRGmmSiSnvcAC0NSAJ0A +LZKdD3gKKILDCN0BnRKNEunUAAaK0YAAsK+fSOkWASzw1gAA/iAGFaABUgDz/+2gUgCdAAl1DPS9 +ABXv9qYAAMCQmRKNEguuNA8CAO5GCC7xFgAA+kBoHaAbxQD8ACIdoA0VAFiSKmP/ZAAA6xIDKVAE +gABYjWjSoNEPAIsQ+kBoHaAMFQD7YwAV4A1lAFiSIGP/OsCgWdE2ikjBzPlf7RiQC6UAY/+rjCLA +1A3MAvxARhWv/HIAAAAAAADrEgIpUASAAFgKhyohKP/3ZA2gHMUAAAAa8BgrIhmJJyqhIImeC6oB +ClgUCYgK/wCIFeSqAQDuIT0tAQqAAADZGgn/Au+GBCdwBQAALiU9+mAwFa/2ogAAiieNFMDA6qwg +LtgEgABYhTLSoNEP2iBYi0Zj/ngAAAD/8+gNoAkFAP4gBhWgCgUAWdEKikiOEP/f5gXgHMUA+V/0 +yJALpQD/+vQNoAkFAADA0PwgRhXv+pIAC680/oEGFe/6ngAAAABsEA6VGygiEI4pJyE3KSAHkx2K +Mv5giBXgDRUA/GBoHae1AQDjIRol2/kAAAvbOfohhhXhmQEA5/82CbfCgAD+wlIN46oBAA4OQvHA +cA3i0wEAZNQaJiAFwej5/gAPMBdFAPbAIdViAJ0AhyKLHfThbA3gDoUAK7ABnxHzYB7fEgCdAJkQ +mRmaExjvw+3vxBIoDQAA5RYKLK8CgADoVQgM34KAAK276xYIInAFAACJGZ4XjRr1IAaqEgCdACtS +noYY/WAKG+IAnQAvUp0mYsMG/wFk8/AZ77KJmPcgCZiSAJ0AKoKuZKFQGu+vI4KtKqJ/He+rCjsB +6xYEJNv9AAD6YAnWIgCdAJvY+mAdHiIAnQCHKYYqDAM+B2YM8sAJm+IAnQApGgDzIjIN4Pr1ACsg +FpwS+2AJ3SIAnQCLEYbDKiA49+DmFaAGBQD34SYVoEcFAPvhBhXgqhkACnY5F++clhUtIhgW75md ++i0iHJ37icQKdjmWFvlgD8LiAJ0AixyeHuwWAiWNUYAAYAEbGe+EiZhqkS6LGipSno8Ye6NLLVKd +L/LDD90BnRSGFOvvfRTT/QAA72QAAwHpgACauGX/E2ADAZ4e/CBGFaAKBQBZ0IkZ73OJmBjvcIwS +7hIOJI7bAAD//1wNoA8FAMCg+iCGFa/+5gAd72rAugubNPuhBhXv/vYAAAAA//sYDaAPBQAAnh6f +H/wgRhWgCgUAWdB1Ge9gjBKPH4mYjh4Y71v5P/WAkgCdAGACdsCgmhSLFBbvWMDaDZ007WYILfY2 +AABgAl2eHp8fnBLqJAAJ2ASAAFiN9owSjx/uEg4ldcGAAGACFSogB54enx/6IAAFMAwFAFiNzmSj +biogBysgFvxgaB2hqgEAWI2fjBKPH/4hyBWv+m4AAAAAAACLEogTjBGGFY4WrN0IZgL3xgAPP4gF +ACgkOwyWDJa0LSYc7SIQKVAEgABYjHSOHowSGO8vKladiikpIDijquomCST5loAAJiE3j8QrIRop +IhDm/zYN78KAAH/bCgoKQsikCw1CZNBT/iAmFeAdhQD5/gAO8AoVAPohhhWgBjUA9iFmFa/2CgCK +J58fix3qrCAqYASAAFiI+I8fmhItIhz5QIgV7/12ANogWIpdGO8QjBKOHvpBKBWv/j4AcZ6oCr8M +//0AFe/+igCLE4oVLSIQGe8WC6oCG+8WCmgChhwa7w0JiALp7wwbCn4AACMWECUWESYgB4XAIyEH +9kEkFeBmEQDrVQELMoKAAPamAAq6MwEA5iEiKZsCgAADdwIKVQIjISQJZgKV8IUgl/OW8v3gphXj +mAEA6PYGLMoCgAAJOQLjEhAiU/kAAOn2BCquAoAA5eUCBkCBAADl9gEnyMEAAOUSESIUNQAAbakF +CACGCQJhJiAUpGYGBkcmJBT0wAd10gCdAIkXKVadKCIYsYjoJhghgKmAAIspKiA4o7ubKfNAB5+S +AJ0AjBxlwM/AINEPLSEoZNwiDngC+EBGFaAAhgAAAAAAAPMf3whSAJ0ADj8M//0AFe/vWgAAAAAA +AOsSDSlQBIAA7RILKmAEgABYikXSoNEPAOsSCylQBIAAWIv80qDRDwD6QGgdoBvFAPwAIh2gDRUA +WJC0Y//BixD6QGgdoAwVAO0SCiXYYQAAWJCuY/+pAAAmIDtkYGHqJAAOWASAAPwgKBWviQUA6SQ7 +LHAEgABYi+n6IOYVoAsFACsmHPpHZh3v/C4AAAAAAOsSBClQBIAAWAkRY/8HiifrRAAKaASAAPtE +ABWgDAUAWIPN0qDRDwDaIFiJ4WP/CCMWEIfAIyAHJiEi+uAEA/AzEQDjIQcp2oKAAAt3Agp3Aosn +KiEJ+MYAC3ozAQDpsRUpmwKAAAOqAiMhJJfwhyCa85j27fYFJdiBAAD34EYVr80FAP1gBAXzaAEA +650ICzICgAAGMwLj9gQrvgKAAAfnAuf2ASZggQAA4xIQJukBAADty0J+QASAACxM/gzGEaaG5tM6 +d8jBAAD0n/GpEgCdAG3JBQgAhgkCYWP+JIsQ+kBoHaAMFQD7YkAV4A0FAFiQYmP+eQAA+Y8ADH/+ ++gAI3AwMTRRt2QUIIIYJAmPvyQgFwQEAAO1MDATIwQAA9Z/vARIAnQAqzP5tqQUIQIYJAmVj/cwA +AGwQBiggBSYgB/xASBWgGUUA+QATXW/7NQD0IEYVoAeFAP1gEligCVUAhCce7kcsITz0gcgVoAsV +AP5gyBXhZgEA/iAmFeXcHQDk3QoLVwKAAP2giBXkzAEA7qoIDgEKgADuIT0toAqAAATdAQ29OeSi +ni7ABIAA/W0ADHAMNQD5LQAOMAsFAAh7Oay7+oAQA+IAnQAc7i4qop0MbAoswsMMqgHqFgMlDcmA +AIknJCE8iZ4EWBQJiAr3AIgV5MQBAPuABADQCRUAAJka9yAEB/AMFQAPzzn/zwAPf/z1AAyZAx/u +Ki4lPQl3AZeEL/F+mxDn7hsSIAUAAAT/AS8lPOTuFhaDCYAA+kAIFeAMFQBYI/6LEI4RLyEJLSAH +KCEiKSEk/dw2BaDdEQDniAIO6oKAAA2ZAgyZApmgjCCepf9AZhXgDSUA6KYCLmYCgAANzALspgEl +aGEAAOQAFQVQgQAADQCKKCAHGe4LCChACogQCYgCmKCOIPdARhXgH4UAn6P9wAAXMA81AO/uAgVg +QQAA7qYBIcghAAAJQIgMCIoJIIgMBIoJAIjsgx4FSKEAAAQAiQkAihrt5AxpEaqZK5adBQtH+WAG +gVAKBQAsISiLIrDM/ETEFe/MAQDsJSgl8BiAAMjEfbdpfctmiifHwwy7AesmAiVQwQAAWI8m4+3m +FQERgAAooAADiAqIjOygBy1YBIAA+kBoHaANRQALgABlr+GJJ8qVKpkUyqqKmcmsKKAAA4gKiIzs +oActWASAAPpAaB2gDTUAC4AAZa/hwCDRD9Kg0Q8AAP//SA2gCgUAiSL6IAYV7/o1AHqQOmS/UAUL +R2iySsAg0Q8AAAAAAADqJAAK2ASAAFiK8NKg0Q8A//g8DaAKBQCKJ+qsMCnYBIAAWI7bY/8j6iQA +A1hhAAD8IAgV4AwVAFiPoosQY/+sAIon2zDsEgIlUMEAAFiHZMAg0Q9sEAgsIg8vIAcoITaHN/5D +RBWn1QEA+b/AFeALFQDpuTkJsASAAOsiCSpQBIAA+CCGFeAEFQDodzYPT8KAAPciUg3h/wEACwlC +8SBwDeKOAQBkgm/BtOx7Hw6UdAAALCEp6SEnJmAFAAAMDE8sJSn9IBULogCdACwgBfuAE2ViAJ0A +jSL6IAYVr/s1AP1gDkDiAJ0AKCIajjL5wBT9IgCdACkyCBjteBztdOSSKW/fgoAAmhCYEay76O1v +FUgNAACZE+sWAi+nAoAAqET14A0CEgCdAIsTKkKe+0AbO+IAnQCKEilCnSqiwwqZAe6UAASSoYAA +jCmLKgwFPgy7DPVgCdviAJ0ALRoA9aHyDeD49QArIBb5YBmlIgCdACwhIhntaighByohJCshCfxA +8BXqiAEA6aoCDEMCgAAIuwIZ7WMY7VUNLUDpzAIO6oKAAAjdAp3giSCc4prk+8BmFeAKVQDr7Vsc +zgKAAAqZApnhiC+Y5SwgOPfBBhXgDQUA/cDmFeAKJQD92qYF4EklAPjAiBWgzBkADJo5mOkM2zmN +ZZ3qHe1N/MDIFaAJBQDs5gsjh+GAAAqcEA3MApzsjBGJaJfvme6IaSjmEI1qLeYR7AAVB0khAAAJ +AIqIZ/jgC+OiAJ0AH+0zCr0CD90CnebAxfyTphWhCQUA9SHyDeD49QArIBb5YBPFIgCdACwiGoop +KyEpKSA45aoIBmAFAADsJhol2/0AACslKZop8yAPx5IAnQCLFGWx9sAg0Q+fFZ8WnhfqJAAK2ASA +AFiLs44X7xIFJXWRgACMFGXP24on2zDsEgAlUMEAAFiGyMAg0Q8a7QOKqPdAEMCSAJ0AjBMrQp79 +YBF7ogCdAIsSKUKdK7LDHez6C5kB5JIbZWP9AACc2O6UAAzydgAAYACWKCA58R/4DhIAnQD/++QN +oAkVAAAAAADzn+xgUgCdAAnnDPb9gBXv9gYAiTdkndXwANgNoAoVAAAAAAAAAMGze8kULCA6mhD+ +IMYV4A31AP2AEL1iAJ0A6iQACtgEgABYihrSoNEPAMGtjDcrIQmNOI4y668RDd0CgAAPuwLkuwIJ +UASAAFiKAMAg0Q8AAAD//1gNoBqFAOokAAfYYQAA/CBoFeAMFQBYjsZj/v0AAAq4ApjmwNX8k6YV +4QwFAHXLDSsgFikK//lgDjViAJ0AihRkoV2LaoxnimmrewfMDJxn92DSDeAOBQCxqoxlm2qLZppp +rOqre3e7AbGqjimbZpplLSA4pe6eKfOgCjeSAJ0AiScomRTKgYuZyb0Z7L4osACfFZ8WCYgKiIws +sAf6QGgdoA01AAuAAI8ViyLHo/tf8kjiAJ0AKCE2h2cuIRqKL4sp6Hc2D2fCgAB3ywoLCULIlA4L +QmSwtcHU+v4ADrAMFQD8IIYVr/KiANogWIfeY/4DiifqrDArWASAAFiNwNKg0Q8AAAD/8pANoAkF +AJ8VKiAHnxaeF/ogAAUwDAUAWIsOjhfvEgUtZbYAAOokAAfYSQAA/AAiHaANBQBYjn1j/dcqIAf8 +oGgdoaoBAFiK2WP9ep8V/iDGFeAKBQBZzY0a7HeKqI8V+V/uoJIAnQD/98QNoAkFAMCQHOxxwLoL +qzT7gQYV7/d+AAAAAAAA81/6MFIAnQAJ5wz2/YAV7/zuAIonnxXvFgYp2ASAAOwSACVQwQAAWIYm +1qD+IKgV7/oWAJ8V7xYGKVAEgABYh6b+IKgV7/q2AAAAwVP6QGgdoAsFAPwAAh2gDTUAWIAvKyAF +jxaKEPV/2l1iAJ0AY/0ZKiAHnxWfFvygaB2hqgEAWIqo/iCoFe/4ogBsEA6ILycgBS4hNikgB5Uc +8iFmFeAGFQDygGgd50UBAO0SCyJ7+QAAD285nx0vIRqM1JwT7dABLqgEgAD/gQAOMZkBAO4iCS+3 +woAA/MJSDaCtMQAODkLxwHAN4m8BAGRkacH0CM+N/uAlzWIAnQCOIg8CAPXGzA3gD4UALBYB86Ah +lxIAnQCZEJkZmhLm7CQRwA0AAJga6OwhHP+CgACm/+8WCCznAoAAqMzsFg4h6AUAAIYZnReKHvTA +BiISAJ0Aixoqop6GGC8SDvtACWviAJ0AJmLDL/KdBv8BZPRqGewRiZj3IAjgkgCdACqCruTsDhUJ +sYAALoKtJEJ/F+wJBOsB6xYEJLP9AAD1wAj2IgCdAJZ49cAg3iIAnQCKKYkqDAQ+CpkM9SAIu6IA +nQArGgD1YfINoPz1ACsgFv1gCQUiAJ0AjhEqIDj8CAIdoAcFAPfg5hXhCQUA9qCIFaCqGQDqlzkL +2ASAAArLOZsVlxb3wBISogCdAIsdZLHZYAEBGevoiZhqkTKKHosajBgqop4swsN7o0aLHiuynQy7 +AZsUjhTq6+AUs/0AAO/kAAcByYAAlqhl/yVgA438IeYV4AoFAFnM7Bnr14mYGOvU7RIPJI7bAAD/ +/2wNoA8FAMCg+iCGFa/+9gAc687AugubNPuBBhXv/wYAAAAA//twDaAPBQCdH/4iBhXgCgUAWcza +GevELxIQiZiNHxjrwPk/9lCSAJ0AYAMKwKCaFIsUHuu9wMoMnDTs5ggt9xYAAGAC8Z0fLxYQ6iQA +ClgEgABYilwvEhDtEg8ldrGAAGACfgAqIAedHy8WEPogAAUwDAUAWIozLxIQ7RIPLXZWAABgBAwA +nR/8ICgVr4kFAOkkOyK4QQAA5wMeB7CBAAAGAmGOV5z4hlSJVq7ODGYMllR86wftFg8kyAUAAJ5X +hhaOFZlWBu4CFuusjBHtIg8pUASAAObuAgrYBIAAWIjTjR8Y64+JHvszphWhBwUAdHsNKyAWKgr/ ++2AELSIAnQCKKSsgOKSq6iYJKAQKgADzYAQ/kgCdAC8hNoxULiEaiS/vzDYPX8KAAHy7CgoKQsik +DgZCZGB0/CAmFaAfRQD5ngAP8AsVAPohphXgCjUA+iGGFa/1jgAAAAAAnR+KJy8WEIsb6qwgKeAE +gABYhU7vEhAtKASAAPwh6BXv/C4AAAAqIAf8gGgdoaoBAFiJwxjrZPwh6BXv/aoA2iBYhqwY62CN +H/pBKBWv/b4AcZ6HCuwM/Z2AFa/+BgAc62MY62eLEo4V+gAiHaAJBQALqTgH7gIa61z31tIF4AYF +AAmGOQbuAoYdG+te6fwgIsBBAADn7gILC54AACYgB4VQBiZA61UBCzKCgAAGVQIKVQIqIQcrISIn +IQn2QegVqqoBAOy7Ag1TAoAACncCKiEklfCFIJfzm/L34KYVo74BAO72Bi3aAoAAC6oC6vYEKq4C +gADl1QIB0/0AAOX2ASGMNQAAbakFCACGCQJhiB4nEgf3E6YV4QYFAPTB8g2g+fUAKyAW+WAKpWIA +nQAqIBSjqgoKRyokFPVACH3SAJ0AyE+MKSsgOKTMnCnzYAknkgCdAI0dZdEAwCDRDyYhKGRryw/o +AvhARhWgAIoAAAAAAAAA8x/ckFIAnQAO/Az9nYAVr+4eAIQcBARHaEIVhhOIVMCRBpY5CGYo9qCG +FaACBQDRD4onixvqrCAp4ASAAFiE5osTjKTA0QvbOQy7KPtAhhXgAgUA0Q8AAOsSDClQBIAAWIg8 +0qDRDwD6QGgdoBvFAPwAIh2gDRUAWIz0Y/+UixD6QGgdoAwVAO0SCiXYYQAAWIzuY/98AAAmIDsP +AgAPAgBkYHj8ICgVr4oFACokOwgghgkCY+z2CCrYBIAA7SIPKVAEgABYiCX6IOYVoAsFAPpHZh3v ++xoA6xIEKVAEgABYBU9j/uaKJ+s0AAnoBIAA+0QAFaAMBQBYgAvSoNEPANogWIYfY/7XAAAqIAf8 +gGgdoaoBAFiJLWP+ngAAIxYSJyEHg1AlIAf2QSQVqncBAOszAQu7AoAA+kDoFeBVEQDnZgIKqoKA +AAUzAgozAiohIocvJbEVDKoCLCEkk/CDIJryl/WW8+72BimeAoAA86YACfPeAQDj9gEu6gKAAO3M +AgXYgQAA/eCGFa/MBQAMuwGrXeMSEibpAQAA7YtBfGAEgACwOAyGEabGdtM69H/vSJIAnQBtiQUM +QIYJAmVj/dgAAIsQ+kBoHaAMFQD7YkAV4A0FAFiMnWP+NwAAAAAA9Q8ADn/+/gAM3QwNSBRtiQUM +YIYJAmfv3ggFyQEAAOg8DAdAgQAA9Z/seJIAnQCwz235BQmAhggCaWP9fAAAAGwQBiggBSMgByQK +A/0PQERRMwEAKCAiZIBvAioCWH3Q/UzAgNANFQAsICEY6oEPAgDsMxEGfVaAAKgzKTKeDwIAbpNF +KzKdZLA/+kAIFaD+5QAOzgH9xgAO8A8FAPxEJh3gCQUA+CAGFeAMBQD4ICYV4A6VAPggRhXgDQUA +WIQY9HOmFaACBQDRD8Ag0Q8AAGwQCiogBfhA8BXgDBUA+GBoHae1AQDoFgAl2/kAAOvLOQoYBIAA +6xYFLCAEgAD9QcAEUZkBAMHD/UAfZSIAnQCNIu/qWB6bdgAA6+pVEbARAADmFgQs94KAAK/u7hYD +LNcCgACrquoWByzABIAAhxf1AAQiEgCdAIoUJ3KehhOPF/rgB1uiAJ0AJmLDL/KdBv8B7xYGJ5lR +gAAlIRuKQocphioFpTb1TwAOcQsFAHyzAdWgmBoHZgz0wAXj4gCdACoaAPVCMg3g/PUAKyAWmBr9 +YAX1IgCdAIpC+qAOUqIAnQAb6kmHQwt3AYsV6BYKJYkJgABgALgAGuosiqjoFgolDN+AAIsXjBSG +Eyuyno8XJmLDfLNDL/KdHOojBv8B5PA5ZVv9AACbyO8WBi/7bgAAYAKLAAAAAPghZhXgCgUAWcsu +GuoZiqiJG+gSCiUO3wAA//9MDaAPBQDA8BzqE8C6C6s0+4EGFe//BgAAAAAA//x4DaAPBQCZG+ok +AArYBIAAWIiwiRvoEgoleamAAGACISogB5kb+iAABTAMBQBYiImJG+gSCi15hgAAYAMAAPDgBEBS +AJ0ALSEajCmXGPghRhWi7QEA6RYLLwPOAACXGPghRhWi7AEA6RYLJwM5gACYGukWCy7/woAAdftV +DtUM+dQMBaC36QDmQgMt3IKAAAt5ApkYCGYB9oBmFaAA3gCKJ5kbixDqrCAp4ASAAFiDwokb+CFI +FaALJQDrpAItIASAAOqiAiOGAoAAjCmXGJgamRuOGI8W5a0MClgEgADlzAgJUASAAO1GAiroBIAA +7CYJKeAEgABYg96IGokbjxf786YVoQ4FAHXrCCsgFiYK/3a5CsCh+iCmFa/3jgAAKiAH/KBoHaGq +AQBYiCCJG/ghSBWv/4YAjykY6dmJFqX/nymMQ4tAjRXnxAAEyIEAAPwOAAU36wEA7hYBLohOAAAn +IAcHB0EIdwoncqHurRANU8KAAO2qAgJAQQAA6ncBAdP9AADnxwIBjD0AAG2pBQgAhgkCYYtAwICY +EhnpxRrpwy8hGoYWHunAJCEHGOm9/CAoFaHXMQD/oABGukQBAO3QgConAoAA7MwPJnBBAAD4hgAK +NMwdAORmACZgBQAADDwMFOmZDV0MiCCfZpdnnmOdZQykOQmJAulmBCxGAoAA5GYCIdAFAAAIqAKY +YSYgFONmCA0gBIAA5iQUJan6gACIF/UTphWhBwUA9OHyDeD59QArIBb5YATFYgCdAIgS0oDRD4oV +ZKCcwCDRDwAAAOokAATYYQAA/CCIFeAMFQBYi3Jj/92KJ/whJhWn20EA6qwgKAQKgAD1oARh0gCd +AIwWKwoB7MwgKegEgABYfp6aEvqACBXv/BoAAIsW7E0RCVAEgAD9YABF8AwVAFh8evSAYBWv/bYA +ZbwU+V/giNIAnQAvICDx/+A3kgCdAGP/dwAqIAf8oGgdoaoBAFiHs4gS0oDRD4on3DDrEgAlUIEA +AFiDMcCy+0BGHeACBQDRDwAAAAAAAADrNAAOOASAAPxgaB3gDAUAWH5720DsNAAK6ASAAOoWAivw +BIAA7xIGKVAEgABYg0/6gAgV7/tKAOokAATYSQAA/AAiHaANBQBYizZj/u0AAGwQCJIUkxUZ6UiI +QPggRhWvywUA6yoBAnAhAAD6IGYVp4hBAOSBwGJQEQAAjxMtIQWpjCzAAK/fBMwL7/xALlgEgAD/ +gA2K4gCdAPogJhWgaAEA/gAiHeANBQAG/TgL3wvr3QoH2CEAAIIVnhD5AABFcAwlAPJBABXgDwUA +8kCAFaACDgCNFA5VDP/gIBWgAwUA7+QABEAFAADxDmAN4H4BAIYTIqAALdEFBCIL5tYICVgEgADi +FgYjMQEAAPZABnqiAJ0ACAZA8gAiHaANBQAGLTgL0gvr3QoBWCEAAPcgEBWgAhUAByM4hxUHZgsX +6RunNydwoAYyCgYzC+x8CAGYIQAAjtALAIkF7jYuJgADAIsi0gDqrAEkyAUAAPRf+yPiAJ0ABSkM +DioM+6AGFaAHFQD1YCgV4AYFAAl2OAhoCCKyAAXlCCW2AX5bAiIsAeK2ACZ9EoAAFukCixIe6QHm +tgEHkAUAAAYiAoYV7rsBDG4CgAANuwKSYPqABhXhLB0A0Q+LEPwgKBXv/VIAAAD8TwAN//zGAIUV +GejTBcUL+AAKFeACBQCxIuWDHgkP6AAAHejrhhIa6OvtbQEH2AUAAA27Ao0V6mYBDE4CgAAJZgLr +1gAmEAUAAPaABhWhIh0A0Q8AAAAA6hYBLWgEgAD7wGgd7/nWAP2PAA3/+T4AbBAM+EBIFaAKBQDr +IAcpyASAAPKAaB3nxQEA/Z/AFaAEFQDsTDkMuASAAPwhJhWhuwEA8xtcDeAMBQCaFpwVmRObFJsb +GOimHuilFejHlRjl6KId74KAAA7dCC0WCi4gFu3owh2nAoAA9IAAQnD/9QB/4RMCKgJYMr4Y6Jkd +6LvqFgglKhGAAGAAFwAAZmPL+MAfKJD69QApIBb7IBlNIgCdAImI9yAGEJIAnQArUq4c6I1ksNEs +wn8rUq0MuwFksMewmZmIHOiqZLNLLMCALMw3/iFoFaTMHQCsPOsWAiZgHQAA9cAFghIAnQAuQp79 +wAgrogCdAIwaK0KdLMLDDLsB6xYAJZlRgAAqcQyJd5kR/UAOrGIAnQAscBDrcgMmCUGAAPmf+yjS +AJ0ALnIDZODQjxZl8bCGEY8YjRTuEgApUASAAOb/NgvYBIAA7xYBKeAEgABYMHAY6GId6ITnry5t +MASAAGAC8gAAwKBZyXEY6FyJiB3offk/+YiSAJ0A//0IDaALBQDAsMCqCpk0+QEGFe/8zgAAapEk +K0KefLNBjBorQp0swsMMuwHksDVk8/0AAP8BBhWv/SoAAAAAAPwhphWgCgUAWclaGOhFiYgd6Gfs +Eg0kjxMAAP/8jA2gCwUAwLDA+g+fNP8BBhXv/FIAAAAAAAAA//wYDaALBQAAAACKGMCxmxb5X/kq +4gCdAMDgnhb5X/jK4gCdAOt0AAlQBIAA7RIJKeAEgABYMKz+ACId4AcVAOcWCS04BIAA/0BmFe/7 +ugBksEmPFf4AIh2gDAUAD+w4ZMCMiBGGGOokAAvYBIAA7RIEKeAEgADoZjYI8ASAAOYWASD4EQAA +WDE86OgXHTAEgAD90HAF7/f+AAAAAIsYDwIADwIA+WE2DeAMBQB5owHAwfgAIh3gDgUADJ447BYF +J3yRgADrdAAJUASAAO0SCSngBIAAWDHa90BoHeALFQD6ISYV4AoVAPrgZhWv/Z4AixAV6BoqIQeJ +cBzoFv/P/AXqqgEA/0AAFTiZAQDsqgIEwD0AAPwhKBWkiB0A6rYAJEAJAAAIOAyOIJmz6F85AbP9 +AADvtgIvdgKAAO5uAgWoQQAA7rYBLg7mAACIE+iMICGUVQAA6jz+KsgEgABtqQUIAIYJAmErPP4M +uxGrW5sQKCAULCAEo4j1gAiZEgCdAAgJRykkFPUgCi5SAJ0AiHIoJhyJcegWBy2oBIAA8yAKMFIA +nQDxNfgN4AcFAKdmJkadKiAWKwr/e6EK6xIBKVAEgABYNZqMGWXA48Ag0Q/rEgEpUASAAFg1lS4g +Fhjnwv3PyAXg//UA/9/lHGIAnQBj/IeIGWWP0ipwENtw/GBoHaAJFQD7X+AVoA0FAOqdOAlQBIAA +WC+JwCDRDwAAAPpAaB2gG8UA/AAiHaANFQBYiapj/70AAB3n0C3QgOsSBCbo3QAA+kBoHaTdHQD8 +YABG8AwVAO3cByXYYQAAWImfY/+PLiAWLwr//9/69GIAnQDrEgEpUASAAFg1bcAg0Q+LEAxsEay7 ++iAGFe/7lgAoJBSNcPG/+LqSAJ0A+kBoHaAMBQBYeqj2wGAVr/wSAIon6zQACegEgAD7RAAVoAwF +AFh8vdKg0Q8AAAAAAAAA6xICKVAEgABYAfX6IAgV7/rCAAAAAAAA6iQADGAEgABYA3CIF4lxmhzn +pAANXwKAAOtVCAT1TYAA61QACVAEgAD9AGgd4AwFAFgDNfdAAEP/+joAiif8oGgdoAslAOqsICno +BIAAWDGxK3AQ+X/xONIAnQApcBUJCEVkjhkrcQkc54kqcQwvcBGOJwyqDKv/D4gJ/cKkFa/NBQDu +7CAkeIkAAO3uAQRASQAACvg5qH2uzu7sQCbogQAA7ttaftAEgAAO6jAb53ktoQH9QAQVofkxAAv/ +CisiF+/yoS5kAoAADN0CC+4MD+4srt2oXv3AJB3v3YEA/cAEHe/2dgCLFPpAaB2gDBUA+2JAFeAN +BQBYiT5j/g0AAP2vAA0//poAbBAEIyAAJArtdDEGIiEDvCLRD4QhhiDyQGgVoAglAPdkAAKwlHEA ++Q8ADHM2AQD0YABB82aBAOXnVhwBCoAAAGYa9mABAb1EAQDlIgEBqDkAAOUiDAGYaQAABCQsBDMo +oyLRD2wQCIoiJyAHiTCVFfhC0BWhdwEA8V1MDeiZAQD4ICYV4Pz1AHyBHQULR/t/wBXgCRUA65s5 +CVAEgABYNRPzUzAN4Pz1ABrnE4ioFucQ9wANmJIAnQAuYq4Z5xBk4dspkn8lYq0JVQFkUdEojP8o +pgjpVAACjYGAABvnKyWwgO3nBBKo3QAA+CAGFeRVHQDlRQgLzwKAAOaZCAKoDQAA9OAIkhIAnQAo +kp71ABM74gCdACWSnQ14CiiCwwhVAWRRiCkgFv0jJg2g69UAKjAQ+0ASVGIAnQArMQu8u9ogWDS/ +KCAULCAEpIj1gAxBF5gBACkkFPUgDi5SAJ0AihUe5wKNESghBxzm5xnm/v+h4BXqiAEA/wAAFDT/ +HQDpiAIH+AUAAA9PDJhQiyAP7Dn8oGYV56oBAOxWAi3eAoAA60sCAshBAADrVgEhwEEAAPlACXFS +AJ0A6EENYlP9AABtqQUIAIYJAmHAgJgU6SAEIlv9AAAMuxGrW/UgCQkSAJ0AiDIoJhzpMgEl2EEA +AJsTKBYC8yAJuFAFBQBmkVClTIgUDH0Rpt3s1p0sEASAANEPAAAAAAD3AA6QkgCdAAx5EaaZLpKe +9cAO++IAnQAlkp0NeworssMLVQFkUc2wjZ2oZV7dYABjAAAAAAAAAOokAAnYBIAA7RIFKmAEgABY +ginSoNEPAMCgWce4GuaiiKj5H/IYkPz1AP/5WA2gBQUAAAAAAAAA+kBoHaAbxQD8ACIdoA0VAFiI +lGP/scBQwOoOiDT5QQYVr/iuAB3mti3QgC3cN/rjABXk3R0A7U0ICVAEgAD9oGAV4AwVAFiIh2P/ +ewAAAAD4QoYdr/oOAAAAAIon/SBoHaALFQDqrCAqaASAAFh7tPoghhWv+0oAizDzYAiikgCdAOIS +BCvnAoAApswkxp3RDwAAAAAAAADrEgApUASAAFgA5WP+MAAA6iQADGAEgABYAmKJMYsTiBLsrBEN +KASAAOy7CAT1nYAA2iD9AGgd4AwFAFgCKYgUpaWlTAx9Eabd7NadLBAEgADRDwAAAAAA//aUDaAF +BQCNNYw0HuaD+mDoFeAJJQD8cAAHsK1xAPsvAAy7jCEA+yAEANPMAQDozAgP+AqAAP+AAQZ93QEA +7rsBBnA5AADuuwwGYGkAAA29LA3MKP1gAEW/9boAAAAA6iQAA9hJAAD8ACIdoA0FAFiIQGP+YcCg +WcdWGuZBiKgd5j/5H/EIkPz1AP/48A2gBQUAwFDAuguLNPtBBhXv+LYAsEsMuxHrWwgJUASAAPti +ABXgDAUAWHlKs0ziEgQr7wKAAKbdLNad0Q8AbBAEiTcX5lIrMBb5zJIFoyoFAAoqKAu2CeioCAs3 +AoAAqGbnZwgJAQqAAPT4aBWgDBUA4M0aAzNTAADucsQjMgEAAOZBFnTAIQAAizKY4J6TlpINuwIo +dsSbMtEPH+Y9r68p8sEAsQTt8sUucAqAAA6ZAvn4JhXv/vUADt0DDZkBHuY15XLEKW8CgACu3ZnQ +jzKYUOaGACkBCoAA5YYBLiAKgAAE/wIodsSfMtEPAABsEAoZ5ioJKQookn/iFggpUASAAPsABADQ +BhUA5hYKKygKgAD4IIYV4FVNAOLmIRFjuQAAG+YT+cviBaMtBQDtqigNPwKAACmSf5wVHOYaqHfo +crkky/0AAP1AAEIzmQEAmRnkQqEmYhEAAKysnBerqvogxhWgYwUA+IAEAjAAagCKGsCw/f/iHaBj +BQDsVQMFAwmAAJsaLXK4BF4BDt0BnRABAIcDNmBoPtWKGIsXjRX4IMgVr//1AOM5CQHygQAA7hYJ +LM8CgADpiAgPAQqAAOKICARjCwAA6IKhK0gKgAAPmQPpRAEGYgEAAAuAAGP/pIoZixSxqgoKQyq2 +f9EPbBAEG+XtKiIADwIAK7J/HuXr+08ADXMvBQAPrygO/ggp4sMo4sL9y8wF7/v1AAuZA+mLAQ1n +AoAA/YAARn/09QD9gAgVoAMVAPkO4B3gDQUAGeXcGOXL+QAARn8sAQDs/AgF/USAAMspCOowKcLD +L+LECYgM6PsTfoEKgAAv4sIAOBoEiAMI/wEv5sL9oCAV4bsdAOSwLGZgwQAAf7cUY//EAAAJ6jD5 +mGYV7/+GAAAAAAAA/aAgFeG7HQDlv9xmYMEAAFg1bMAg0Q8AbBAEJiEJ+EKQFe/4BQAnIBXomAEL +NgKAAOiZDAu5AoAAB2YC+EKGHeAHBQAnNAD4YGYdoAQVAARmApYxFeV9JFat0Q8AAAAAbBAEFuWs +FeWH0w+mIgU1AiUmgCQigGdAC20IBSgigGeAAmP/89EPAGwQBBPloyI2imP//AAAAABsEAQoIAUl +IAeKNfX/oh2gAyUA/QFgEdFVAQDAINEPAAAAiCkZ5ZiaK/sAB9wiAJ0ACVkJKZ0CK5EIKZEEGuVr ++yAEY+IAnQCLIg8CAHuof9ogWHiQiyIPAgADugFkr7qKJwS7AesmAiVQwQAAWIaj4+VkFQERgAAo +oAADiAqIjOygBy1YBIAA+kBoHaANRQALgABlr+GJJ2SffyqZFMqmiplkr3UooAADiAqIjOygBy1Y +BIAA+kBoHaANNQALgABlr+Fj/1QAAP//WA2gCgUA2iBYeIMrICLquwwJUASAAFh5zdpQ+gAiHeAM +BQBYe36LIgO6AfN/+yZiAJ0ALSAHBLwBnCLzn/iQEb0BAOu8HylQBIAA/AAiHaANBQBYhyPAINEP +AAAAAOsgIilQBIAAWHm5KiAFweN+oQxoqCmLIvNgBAV//GYALyA6wI94+er6QGgdoAsFAPwAAh2g +DSUAWHjwY//XAAD6QGgdoAsFAPwAAh2gDSUAWHhpY/+/AABsEAqIKx3lMi4gIYs3/GDIFaD/5QAP +7gEuJCENzAEMuwzriQh4yASAAMAg0Q8DAIYJAmGbFSggBSUgB8dN+CEGFeADJQD9HABB0VUBAIop +myv7QAfcYgCdABvlKgtbCSu9AiyxCCuxBBrlAf1gBEuiAJ0AjCJ8qH/aIFh4JosiDwIAA7oBZK+g +iicEuwHrJgIlUMEAAFiGOePk+hUBEYAAKKAAA4gKiIzsoActWASAAPpAaB2gDUUAC4AAZa/hiSdk +n2UqmRTKpoqZZK9bKKAAA4gKiIzsoActWASAAPpAaB2gDTUAC4AAZa/hY/86AAD//1gNoAoFANog +WHgZKyAi6rsMCVAEgABYeWPaUPoAIh3gDAUAWHsUiyIDugHzf/smYgCdAC0gBwS8AZwi85/3wBG9 +AQDrvB8pUASAAPwAIh2gDQUAWIa5wCDRDwAAAADrICIpUASAAFh5TyogBcHjfqEMaKgpiyLzYAQF +f/xmAC8gOsCPePnq+kBoHaALBQD8AAIdoA0lAFh4hmP/1wAA+kBoHaALBQD8AAIdoA0lAFh3/2P/ +vwAAbBAEHOTXKzIEKTAW/WAEBbWZHQD1IAgAkgCdAOrk0hSIgYAA/8miBa/95QDk5KsUpLUAACyh +fmmVHXyzCirMBPtgCKOiAJ0AKyAGsLsLC0frJAYlgsGAAMAg0Q8ALKF+7LMMdngRAAD/YAfj4gCd +ACggBrCICAhH6CQGLH7mAACJJ4siKpkUDbsBmyKLmWSgtiiwAASICoiM2iD9YPAVoA01AAuAAMAg +0Q8AAIsiiicNuwHrJgIlUMEAAFiFxsmsKKAABIgKiIzsoActWASAAPpAaB2gDUUAC4AAZa/hiSfT +D2SfciqZFGSgZIqZZK9nKKAABIgKiIzsoActWASAAPpAaB2gDTUAC4AAZa/hY/9GAAAAAAAAAOok +AAnYBIAA7EQACugEgABYh3PAINEPAOokAAnYBIAA7EQACugEgABb/0XAINEPAP/9FA2gCwUA//5k +DaAKBQCINyLifwmIEfhAAEE/+5IAiDci4n8JiBH4QABBP/vyAGwQBBrkZCii32SACwnqMCui4AuZ +DGeQAdEPWHst0Q8AbBAEHeR0JyAHHORM/kEEFeDnEQAO3DmcMIgg+8h2BeAKJQD6YEYV4BkFAOk2 +AyxGAoAACokC+GAmFeF3AQDmIHkrvAKAAPfmAA9wDQUA/AQCHaALNQDp5GATAjmAAJ01nDMLigIW +5F2aMRrkXQbuAiYhCZ40mjYEZgIiIAedOZU7+MYAC3EiAQDmNgopFAKAAAL/Agn/Au82CC2QBIAA +0Q8sIQgrIQmdNZU3B8wCBLsCCbsCCcwCnDTrNgYtEASAANEPAGwQBBjkMB7kQiwgBx3kGxnkRPpB +BBXg/BEA/80ADvHMAQDtNgAuZAKAAAy7Agm7AuOAgCmwBIAAHeQD/EAIFaAOBQCeZe1mAiG43QAA ++sCGFeR3HQDqfP8uZgKAAOx8Ag1XAoAA7GYBJVPhAACaYwIEiZlmk2cGIIvlIQkkQ/cAAPTBZhWk +Mx0A5WYKK5AEgADoAAUDKMEAAG05AgUCYdEPAAAAbBAGHeQfCysRrbMqMn8Z5B0X4/6IoMBA+OAA +RPAGFQDpuQgEAamAACwyeC8ye/mABZxiAJ0AZfEYLDZ8KzJ5KzZ73UAN5BYBAgCUoA3kFsDJ/EAF +/CIAnQAvMnvBwO3kCheDsYAAIjJ8KiEEjiDz4f4NproBACQ2fPRvZhWgAB4ALjZ87a8BBcP9AAAI +/wLvJQQljGEAACIyfLDM7zJ7IQEBgADJyGP/vwAA2iBYe0tloMQqIQT/QSAMFpoBAMiZ0Q8A2iBY +ez7RDwDaIFh7ANEPAAAAAAAA+kBoHaALBQBYe8/RDy4s+OrSiC8BCoAA/MABBd/89QAMuwMLqgEq +1ohZyhAkNnwkNnv6b+gVr/zSAAAAFeOfL1BYZPBqWcARWHqyKHLf0w/IgVh6hylQWGSfJVh6gciu +FePVLFJrsMzsVmsmAsmAAFh6CmP/CgAAAAAc48/+b4gVoApVAPxvSBXgC0UA7RYAIWvlAABZxyX6 +b+gVr/siAC4ye+I2fC96DgAAIjZ70Q8f48Mv8q5x9ov2qwYdr/4iAAAAAABZv9j6rWYVr/6SAGwQ +BBTjuxnjtejjlhlewoAApLQjQn+piOi4CAGCIYAAKjIAeKkCKkJ7HOOtKzEEKkZ/DLoB6jUEKdAE +gABYev3OqSkxBP8hAAwW2QEAyNfRD9owWHrx0Q/aMFh6s9EPAPpAaB2gCwUAWHuD0Q8jRn/RDwAA +bBAE8GDwDe/59QCIIgk5AwmIASgmAoonDwIADwIAKqwwWISl4+NmFQERgAAooAADiAqIjOygBy1Y +BIAA+kBoHaANRQALgABlr+GJJ9MPy5IqmRTKpYqZyawooAADiAqIjOygBy1YBIAA+kBoHaANNQAL +gABlr+HRDwAAAP//XA2gCgUA0Q8AAGwQCB3jWRvjfRbje/XGbAWgGMUA4yzoJdOBAAD4QA3MJzMB +AAw1EaRV6FKeKWbCgACmxClAf/kAEFPiAJ0AKFKdZIH/mxHqCx4NSASAAJkQCiCGCwJlCwJjDQCH +CQJhCQJh7ccICQEKgAD/xsoF4A4VAOPjMB9wCoAAnhOvz/4ghhXv//UA/9cAD3AGRQD+IEYVoADC +AAAAAACKmcmsKKAAA4gKiIzsoActWASAAPpAaB2gDTUAC4AAZa/hKUIgZJDvLUB8LEB9HuNPDdsJ +B7sK7t4IBdhjAACKsi7ggGShOP3H/g2gCBUALwoADY84D/8JB/8KL/0YL/ycL/IbLAoBDNwD8eEg +DefMAQAMywkHuwrsRHwl2GMAAMDQ/I+mHeAMBQCNsO9Snibz/wAALuD//+AEe6IAnQAvUp323+AV +oPj1APHnwA3nZgEAeGF06hIEJkAFAADoRH0m4+EAAFh6gIkT0qDrEgIkgGmAACqiAguqASomAoon +KqwwWIQsyawooAADiAqIjOygBy1YBIAA+kBoHaANRQALgABlr+GJJ2SfFyqZFGWu7//7uA2gCgUA +jBGLEAyAhgxghgsCaQsCZ9EPjxGNEC5Efw/Ahg+ghg0CbQ0Ca9EPmxHqBx4NQASAAJgQCgCGCwJj +CwJhDeCHCAJv6OwACdAEgABZvzlkr6/t4tkZrwKAAORVCAlmwoAA94AAQj/5MgDAsfu3AA3wDAUA +/I+mHae7AQArRHwLuwn3YAEF8AwFAPtjACXv+5oAAAALYIYLQIYKAmcKAmXRDwAAbBAEGOKjAgNH +DDMRqDMrMoQZ4rMosACKsQmICgohjAIKPoiMAwI+/EBoHaANJQALgAAiNoTRDwBsEAQU4pUCA0cM +MxGkMyQyhIpBJkAAKEAI+phoHaCpJQACBT4DAj55gSUY4p8IaAqIjOpUAApYBIAA/EBoHaANJQAL +gAAiNoTRDwAAAAAAAOskAApQBIAAWHpH80BoHa//LgAAAAAAAGwQBFnCtxLiehPimgwCACkiggka +jgOoCoiEC4AAY//rbBAEE+KqIzF+ojLRDwAAABLiuQPoMATuMAWxMJMglCGVIhLitRPieYQgBDMC +kyAS4rPAOoQgBDMCkyAS4rHAMCg3QCg3RCg3SCg3TCM9AXIz7RLirMAwkyDHLxPiqwMjAxLiqoQg +BDQBlCAS4qmEIAQ0AZQgEuKnhCAENAGUIBLipoQgBDQBlCDHL8AxAyMDEuKjhCAENAGUIGP//AAA +ABLioIMgAxMUDzMRkyAS4p3AMCMmAFf/1hDinJEAkgGTApQDBAIwlAQEADCUBQQBMJQGEeKWghAB +6jCiEQHwMcBABOQWAAIAEeKSghAjGgADIgKSEBHikMAhkhAE5DGEBgQBMYQFBAAxhAQEAjGEA4MC +ggGBAADSMAEjAAAQ4oeRAJIBkwKUAwQCMJQEBAAwlAUEATCUBhHigYIQAeowohEB8THAQATkFgAC +ABHieYIQIyoAAyICkhAR4nrAIZIQBOQxhAYEATGEBQQAMYQEBAIxhAODAoIBgQAA0zABMwAAEOJx +kQCSAZMClAMEAjCUBAQAMJQFBAEwlAYR4muCEAHqMKIRAfIxwEAE5BYAAgAR4mCCECNKAAMiApIQ +EeJkwCGSEATkMYQGBAExhAUEADGEBAQCMYQDgwKCAYEAANQwAUMAAABclAFdlAJelANflABDAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAXJABXZACXpAD +X5AAUwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAJyU +AB2QAZ2UAp6UA5+UBAiUBQmUBgqUBwuUAEMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAACckAGdkAKekAcdkAOfkAR4kAV5kAZ6kAd7kABTAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAA3JQAHZAB3ZQC3pQD35QEBJQFBZQGBpQHB5QICJQJCZQKCpQLC5QAQwAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAANyQAd2QAt6QCx2QA9+QBLSQBbWQBraQB7eQCLiQCbmQCrqQC7uQ +AFMAAAAf//yoANIxEP/+CgAAAAAAH//9DADTMRD//goAAAAAAB///XAA1DEQ//4KAAAAAAAA9DAK +AAAAAAD0MAoAAAAAAPQwCgAAAABsEAgnIAeIIhbhK/vCTgXhdwEA5YDxa9cCgAAY4SQugIDmqggH +cN0AAP1TyBWk7h0Ark7t4R8XcAkAAP+ACEugCaUAKqKdC3wKLMLDDKoB6hYCJQf5gACI2PcACPCS +AJ0AL2Ku7OEVF4XBgAAqYq0swn/sqwEEc/0AAP1ABSYiAJ0Antj9QAUuIgCdAC8gFKT/Dw9HLyQU +9eAHrlIAnQD4IEgV54UBAPkAB3FSAJ0A6DwQIgw9AACwSm2pBQgAhgkCYcBQiBKNMu0mHCJL/QAA +6zIBLM8CgACpiJgT82AKQFAKBQDqFgAti0oAAIsQ60sIC+cCgADmzAgF2/0AAOvGnSqQBIAA0Q/q +JAAJ2ASAAOxEAAroBIAAWHwJ0qDRDwDAsAmMNOzWCC37HgAAjSJl39X6QGgdoBvFAPwAIh2gDRUA +WIJ4Y/+///wMDaAKBQAAAI4iZe+wLYCALdw3+uMAFeTdHQDtTQgJUASAAP2gQBXgDBUAWIJrY/+M +wKBZwYEd4MyI2Pkf9sCQCaUAY/+c2iBb+tlj/wYAjieeEYjp+8KkFe/JBQDl6RQnYIEAAAnJAem9 +CApXAoAA6lUMBEBBAACY6QhVMuXlFCbpAQAA/QAIOuIAnQBoqz2oqyu88PugBNPiAJ0A7xICIgx1 +AACwTm3pBQgAhg8CYSvCAQurCOXJBCXbwQAA/WAGzGIAnQDrxgEtwASAAGRQqfUAaB3v+pYAAAAA +AADqJAAO4ASAAOwWBCxYBIAAW/wwizGIE40U6hYALWcCgADsiAgF9P2AANog+wBoHeAMBQBb+/eN +EO2tCAqQBIAA7U0IC/cCgADm7ggG6/0AAC3mndEPCN0M+iBIFeT9HQDTD235BQgghgsCYysSAu9P +DATBAQAA7bsIB4xBAAAu/P9t6QUIQIYLAmUvyQQNqAyomCiMMOjGAS/61gAAKpxAmsH7gAYVoAgF +APmAhB2v/RYAC4gM+cEmFa/72gAonED5gCYVr/yyAGwQBB3gchrgcxzgcS3SuCqhfyzCj6Pd6joM +Du5CgAD9gABGcAsFACvEBCvEBVkWjPpAaB2gCwUAW/yk0Q8AAABsEAQY4GUpgn8qMActkQIukQT9 +IKQVoA8FAOuSACaJEYAA7uz/JpP9AADilQIvdwKAAO67CA5nAoAA/W8ADbAAxgArkQUtkQSxu/+/ +4BWvuwEA65UFL3cCgAD9YAa8YgCdAIyQ7swIDd8CgAALywwLAIcP32DrAAcG8yeAAB7gRymRBSvi +fwmZEanZ7eJ9JYYRgACM0YvQm8CL0Jyxn9Cf0Svif7C7K+Z/9aAGHB+5AQCM2fmjABWvyQUA+QAE +BH8SBQCi0ismOv+iBB3lSQUA6dURJCEBAADk1gctLwKAAOTWBipYBIAA9YAE5CIAnQAl1RDoWAgE +eBsAAOyMQCf6AQAA/eAEY6IAnQDJMulEAAUAgYAAbakFAwCGCQJhKyJCq1j/AAWMYgCdAOgmQiaT +4QAA0Q8vlQX//JgNoAsFAMCl/cAuBaA7JQBZw0rAINEPLeKAjNGL0JvAi9CcsZ/Qn9Er4oKwu/vQ +RhXv/PoAAMDA+w/oFaANFQBYdFrAINEPAAAAAAAAAO/WCSaT4QAA0Q8AyzD6YGgd4FzFAOysNgpw +BIAAbckFCyCGDgJj+GAARfBeRQB+oQ0vrKzTD235BQtAhgQCZSmN++kmQiaT4QAA0Q8AAAAA5CZC +JpPhAADRDwAAbBAEgiMCAkHRDwAAbBAEhSODIBTf6/hAhBWhVQEA6t/pGq7CgADkVAgBgLmAAPsA +BAQ2mDkACYgCKCUEIkJ/0Q8d3+AT3+Ef3+EmQn4rIQQuQn+SYJYho//9YAQF9ss5AAy7Aq9f7yYA +JygFAAAlRn8iRn7rJQQqkASAANEPAABsEASKIGWgUB3f0uoiAyn2woAArt39r+gV4AwVAPyAQAYx +qgEABqoCDcgsCN0oJyUF7cwMBFgFAAD9bQAMP/vFAOuqAQxOQoAACVkCA6oCmiMJiAIoJQTRD48j +G9++Dw9BC/4Rq+stsn8Z37gssn5y2RnZwPMj3g2gDAUAwMAstn8stn76QAgVoABGANjA8wxGDaAM +BQBy0RyNIZrQjiApsn2d4Zwg7CYBJMv9AAD5b6YV7/1aABnfpBjfpKmIqOh4oSDqtn8vgS4AAM2t +KrJ9aqIYLbJ7/W/mFeAASgAAAAAAAADstn8n/ymAAPpACBWv/qYAHN+ViCGsmanp+Q8ADPAMBQAJ +yDj5b8YVr/4qAGwQBPW/IgXgBhUA9EBoHaACNQD2gEADMAAeAACwIihSf+hj93KrgQAA0Q8AbBAE +9EOoFaMjAQDyWgAJOFMdAAQiCoQmgiEFRCgKRBGkItEPbBAEiCcb3331AoIV78cFAOKCCSkwBIAA +6YEVJCCBAADnRAECqQEAAOWFFCETAQAA4oYJIiEBAAD0QVINoApFAAKSCCKGCQsAh+3fbRkoBIAA +baoCBQJhnSCMYMDU4yYCLmYCgAANzAKcIdEPbBAKLiICKiIYDwIA8d2MDec1AQAc32EuIgD9QAgV +4DsFAP9AsBXgClUAWcKGKiISJCAH+j4ABDAHNQD1AAxYkUQBAArIUfUADHCSAJ0AHN9T/k0wFaAL +FQD4f8AV4WpBAPzAaB3gClUA6bk5D0cCgAD4xgALMDsFAOkWACt4BIAAWcJwHN8x6t8zGkgEgAD0 +gAdqEgCdAAxLEaq7LbKe96AL6dIAnQArsp0MTQot0sMNuwHpFgglikmAACwhBx3fOAwMSu/fOB5n +AoAADcwCnLAc3zX+QAgVoz0FAP1g5hXgCQUAmbjptgYrVwKAAJq5/WCmFaAahQCasxnfLO/uAg9G +AoAAnrQptgIHiAIotgEoEggZ3xDv3yYcRwKAAAmICCeGnS4iEioiEA/uAu4mEilYBIAAWOVm9GAE +URIAnQCKJw8CAA8CAI2s+0YAFaALBQDq3gwG6yEAAA7bOVh/zP2+KgWgOwUA7SQADRgEgAD+YGgd +oApVAFnCMtIw0Q8AHt70jejkFggoBAqAAPegBLiSAJ0ADJsRqrsvsp734AVJ0gCdACuynQyfCi/y +ww+7AeSwl2bD/QAAmOjpFggt9+YAAGAAOcAg0Q8pGgAJqgL6QkYVr/m+ACsqAAuqAvpCRhWv+bIA +AAD6AKIdoDsFAOze8hloBIAAWcISYAAUAADqJAACWGEAAPwAAh2gDTUAWIBsaDJCwCDRDwAAAAAA +AP/6PA2gCwUAwKBZv34e3sga3smN6BzexIkY+b/6uJIAnQD//dQNoAsFAMCwwMoM3DT9wQYVr/2a +AB/ezp8UjiDaIP29rAXgDBUA7RYGL3YCgADs7gIA2EEAAO4WBSroBIAAWH9mwCDRDwAAAGwQGJIQ +jiAV3suJI4shiiIqFiIrFiT4JGYV4AQVAPQg5hWgCAUA+CCmFaAMRQD8IUYVoA01AJ0Z9CDGFeAP +JQCfGPW9egXgD6UA/iIGFeANtQD8IiYV4AzFAPwiRhWgCIUA+CHGFaAElQD0IeYVoAl1APghphXg +C1UA+iFmFeAKZQD6IYYVoAvVAPoiZhXgCuUAKhYU9b1SBaAJ9QD4IqYV4AhFAJgUhhYrEiSJFSdh +fiwSIiJhfweZKC9QgKkp+J2IFaOZAQADmQrukgAvUASAACZiPi0SI6juC2AAjhcsEiQtEiIH7igv +UIGuLvidqBWj7gEAA+4KjuAqFhbqEiMtWASAAKjuC2AAjhgsEhYtEiQH7igvUIKuLvidyBWj7gEA +A+4KjuAqFhfqEiItWASAAAjuCAtgAI4ZLBIXLRIWB+4oL1CDri74negVo+4BAAPuCo7gKhYY6hIk +LVgEgACo7gtgAI4aLBIYLRIXB+4oL1CEri74nggVo+4BAAPuCo7gKhYZ6hIWLVgEgACo7gtgAI4b +LBIZLRIYB+4oL1CFri74nigVo+4BAAPuCo7gKhYa6hIXLVgEgAAI7ggLYACOHCwSGi0SGQfuKC9Q +hq4u+J5IFaPuAQAD7gqO4CoWG+oSGC1YBIAAqO4LYACOHSwSGy0SGgfuKC9Qh64u+J5oFaPuAQAD +7gqO4CoWHOoSGS1YBIAAqO4LYACOHiwSHC0SGwfuKC9QiK4u+J6IFaPuAQAD7gou4gAqFh3qEhot +WASAAKjuC2AAjh8sEh0tEhwH7igvUImuLvieqBWj7gEAA+4KLuIAKhYe6hIbLVgEgACo7gtgAC4S +ECwSHi0SHQfuKC9Qiq4u+J7IFaPuAQAD7gou4gAqFh/qEhwtWASAAAjuCAtgAC4SESwSHy0SHgfu +KC9Qi64u+J7oFaPuAQAD7gou4gAqFiDqEh0tWASAAAjuCAtgAC4SEiwSIC0SHwfuKC9QjK4u+J8I +FaPuAQAD7gqO4CoWIeoSHi1YBIAAqO4LYAAsEiEuEhMtEiAvUI0H7igoQvmuLvogZhWj7gEAA+4K +juDqEh8tWASAAJsRqO4LYACMES4SFC0SIS9QjgfuKChC+q4u+iBGFaPuAQAD7gqO4OoSIC1YBIAA +KxYjqO4LYAAuEhUsEiONEwfuKC9Qj64u+J9oFaPuAQAD7gqO4OoSIS04BIAAJxYi6O4IC9gEgAAL +YACOESoWJCkSEi0SFY8VKxITLBIU6BIRJ/hBAADvFgUl2EEAAOsWEyZgQQAA7BYUJEBBAADoFhEm +6EEAAO0WFSTIQQAAKRYSjR+JHIgbjB6LHe8SECRAQQAA6BYLJmBBAADsFg4l2EEAAOsWDSf4QQAA +7xYQJMhBAADpFgwm6EEAAJ0fiRaNGY8a6xIHIiEBAADsEggm6EEAAO0WCSf4QQAA7xYKIqhBAADv +EgQmYEEAAOwWCCXYQQAA6xYHJMghAADpFgYn+/0AAO8WBC/iJgAAiRCPE4sSjpCIk4ySjZGriKfM +qt2v7p6QnZGckpiT0Q8AbBAEKSIV+KAABPA4dQDpjAwBIEEAAPMgAEU/iwUA66QQJVBFAAD5AAXT +YgCdACsKAFm7OywiFSsiFO3NEQlABIAA/EJGFe6APQD9awANsAk1APpCZhXgCiUAbaoMjoQODo7u +hgQkQBEAAA8CANMP0w9tmiHpggQkQEEAAIqBi4KMgwkJjgoKjgsLjgwMjpmAmoGbgpyD60QACVAE +gABb/raKIIgiiSGPIwgIjgkJjg8PjgoKjpognyMpJgHoJgIpQASAABndfQIAhgMCYfgAChXgCbUA +bZoCCACK0Q8AAAAAAAAA/YEAFaALBQBZuwz4QGgdoAlFANMPbZoh6YIEJEBBAACKgYuCjIMJCY4K +Co4LC44MDI6ZgJqBm4Kcg+okAApYBIAAW/6U2kD/+/wNoDyFAABsEAYpIhX4QogVoEYFANMP+IAA +RXWZAQAJZgx0qwGxiComFQYqDOgmFCVRQQAA9oAHs6IAnQDrNAALYASAAFm64PhAaB2gCUUA0w/T +D22aIemCBCRAQQAAioGLgoyDCQmOCgqOCwuODAyOmYCagZuCnIMlLBDqJAAK2ASAAFv+cQZHDPbg +BY7SAJ0A5jQICtAEgAD24GgdoAMFAOQWACpABIAA+MhoHaAJRQAKAmcIQIYKAmUIIIYKAmMIAIbq +DAAJQASAAG2aIemCBCRAQQAAioGLgoyDCQmOCgqOCwuODAyOmYCagZuCnIPqJAAK2ASAAFv+VOpU +AAGYBQAA5mzAIiEBAADvbZpqQASAAIsQCjwRC8sI7HwMCtAEgABZuqjRDwAAAAAAAOs0AApgBIAA +Wbqj0Q8AAAD2YABGMAMFAPwgBhWv/yYAbBAEGN0RGd0PGt0NE90QkyOYIpkh+kAGFaALBQArJhUr +JhTRDwAAAGwQBt4g5OIQKmAEgADnQgcr0ASAAPu5/AXgGDUA40IVKZAEgADncg4i++kAAHj7Jxjc +/gj4CoiAmhOcEu4WASwAIoAAAJMQKrKd7FQACVgEgABZvHlkpcfygqYV4AIFANEPAAAAACviEgub +Uu4WASX/QYAAGtzn4xYAKVgEgADqor8q4ASAAFm8bGSlehrc4Nsg6qLBKuAEgABZvGcjfQXkps9h +mgEAABrc2tsg6qLDKuAEgABZvGD3R+AN44YFABrc1Nsg6qLFKuAEgABZvFpkpsQa3M/bIOqixyrg +BIAAWbxV+0BCiBIAnQArMOXBWPVgK+BiAJ0AabchJTTlixD6gqYV4AIFANEPkxAqspXsVAAJWASA +AFm8SGSnAosQ+oKmFeACBQDRDwCTECqyo+xUAAlYBIAAWbxAZa8a+iBoHaALtQBY4eD6ACId4AMF +AOqzOAUA4YAA6hICK1gEgABZuqzIqRzcsY0RDKw2LNYXZTMljRD8gqYV4AIFANEPLkBuZO7SkxAq +srnsVAAJWASAAFm8KWWuv/ogaB2gG2UAWOHJ+gAiHeACBQDqsjgFAKmAAOoSAitYBIAAWbqWLH0D +KsUoZSLRjRD8gqYV4AIFANEPAACTECqyq+xUAAlYBIAAWbwVZKK3GtyK2yDTD+qilyrgBIAAWbwQ +Za5a+iBoHaALVQBY4bD6ACId4AIFAOqyOAUn6YAA6hICK1gEgABZunwsQG/xgCc+0gCdAGSk34oT ++gCiHeAM1QBY4Y3SoNEPkxAqsrHsVAAJWASAAFm7+mWux/ogaB2gGyUAWOGaZKI1K0BuZLdv6hIC +K1gEgABZumgsQhYKzDYsRhaLEPqCphXgAgUA0Q+TECqyr+xUAAlYBIAAWbvoZKIzGtxd2yDqoqkq +4ASAAFm742WubfogaB2gC+UAWOGEZKHb6hICK1gEgABZulMrfQIqtRSLEPqCphXgAgUA0Q+TECqy +oexUAAlYBIAAWbvUZKIqGtxI2yDqoq0q4ASAAFm7z2SjhxrcRNsg0w/qopsq4ASAAFm7ymWuB/og +aB2gC3UAWOFqZKF1K0BuZLbjGtw5ixLqoucrYASAAFm7wGWmRitAb8DIDLsCK0RvixD6gqYV4AIF +ANEPAACTECqyt+xUAAlYBIAAWbu1ZKHvGtwq2yDTD+qimSrgBIAAWbuwZa2f+iBoHaALZQBY4VBk +oQ0rQG5ktmoa3B+LEuqi5ytgBIAAWbumZKZ5K0BvLAr9DLsBK0RvixD6gqYV4AIFANEPAJMQKrKf +7FQACVgEgABZu5tkobca3BDbINMP6qKTKuAEgABZu5Zkotoa3ArbIOqisyrgBIAAWbuRZKxfGtwG +2yDqorsq4ASAAFm7jGWsTBrcAYsS6qLVK2AEgABZu4dlpFKLESuyEguZUsiZaJIH+SAPYdIAnQCM +ESvGEvKCphXgAgUA0Q+TECqyj+xUAAlYBIAAWbt6ZKF6Gtvu2yDqopEq4ASAAFm7dWWstPogaB2g +CyUAWOEVyqIa2+aLEuqi5ytgBIAAWbttZayUihP6AEId4AzVAFjg99Kg0Q/AINEPAAAA+iBoHaAL +9QBY4Qdkr+rqEgIrWASAAFm51+sSACPgCwAAKsUV+oKmFeACBQDRDwAA+iBoHaAbFQBY4Ptkr7ot +QG5k1QYpQG/xP+GXkgCdAPE/4VfSAJ0A6hICK1gEgABZucUuQhcK7jYuRheLEPqCphXgAgUA0Q8A ++iBoHaALpQBY4Olkr3IvQG7TD2T0duoSAitYBIAAWbm3KEE0+wAPAqIAnQCKE/oBQh3gDNUAWODI +0qDRDwAAAPogaB2gG1UAWODZZK8y6hIBKlgEgADsEgIraASAAFjgOIsQ+oKmFeACBQDRDwAAAPog +aB2gC5UAWODNZK8CKUBuZJQZGtudixLqoucrYASAAFm7I2WiXCtAb40Q/IKmFeAMFQAMuwL6jeYd +4AIFANEPAAAAAAAAAPogaB2gCxUAWOC7ZK66GtuMixLTD+qi5ytgBIAAWbsSZaspihP6ACId4AzV +AFjgnNKg0Q8AAAAA6hICK1gEgABZuYD1QBXykgCdAMcv0Q8A+iBoHaALhQBY4Kf6ACId4AIFAOqy +OAUBSYAALEBuDwIAZMODGtt76xICK2AEgABZuvplom4tQG/A6A7dAi1Eb2UuNY8Q/oKmFeACBQDR +DwDqEgEqWASAAFjgnWWvnCsw5WP6cwAAAAD6IGgdoBsFAFjgjWSuAihAbtMPZIL16hICK1gEgABZ +uVspQhiLECtGFQqZNviDBhXgAgUA0Q8AAPogaB2gCzUAWOB/ZK3KGttQixLTD+qizStgBIAAWbrW +49tVHQcuAACLESuyEgvJUciZaJIH+T/5EdIAnQCOEYwQA70BLeYS/IKmFaACBQDRD2UthI8Q/oKm +FeACBQDRD+oSAitYBIAAWbk6KkU0ghDygqYVoAIFANEPJX0E9LAAFeALBQD6oGgdoIwFAFm4y+oS +AirYBIAAWOCbKzDlwMQMuwL6fCYdp7sBAPp8ph3v5f4ALTDl+iBIFaAOJQAO3QLtNOUrWASAAFm5 +Iisw5fp8hh2v5W4AAIoSWawRLzDif6kUihJZrA7coOoSAiPYEwAAWbqhZKG3wKL9tj4FoDsFAFm+ +Mscv0Q8a2xGLEuqizytgBIAAWbqYZa4+ixErshILyVFokQpokgf5P/Fp0gCdAB7bEgO9AQ7dAo4R +jBAt5hL8gqYVoAIFANEPihP6ASId4AzVAFjgFtKg0Q8AAAD6IGgdoAtFAFjgJ2Ssahra+IsS0w/q +os0rYASAAFm6fuPbAB0FZgAAixErshIL6VHImWiSB/k/7hHSAJ0AjhGMEAO9AS3mEvyCphWgAgUA +0Q8a2ueLEuqi1ytgBIAAWbpuZa2WixErshILmVJokQpokgf5P+wp0gCdAB/a6oIR778CA+gXAADv +JhIm6gEAACzQ5cDhDswCLNTl8oKmFeACBQDRD4oT+gECHeAM1QBY3+jSoNEPI30FIzyAKzDlwMEM +uwILC0f6fKYd7+ASAAAAGtrIixLqos8rYASAAFm6TmWtF4sRK7ISC+lRaJEKaJIH+T/oMdIAnQAd +2ssDvAENzAKNESzWEosQ+oKmFeACBQDRDwAAAAAA9uAAQzALBQD6wGgdoIwFAFm4TMFQ6hICK1gE +gABY4BwrMOUFuwL6fCYdp7sBAPp8ph3v3hIAAAArMOXAyAy7AgsLR/p8ph3v3b4AihP6AOId4AzV +AFjfuNKg0Q+KE/oCAh3gDMUAWN+00qDRD4oT+gFCHeAMxQBY37DSoNEPihP6ASId4AzFAFjfq9Kg +0Q8AihP6AQId4AzFAFjfp9Kg0Q+KE/oCQh3gDMUAWN+j0qDRDwCKE/oCIh3gDMUAWN+e0qDRD4oT ++gDCHeAMxQBY35rSoNEPihP6AOId4AzFAFjfltKg0Q+KE/oAwh3gDNUAWN+R0qDRDwBsEAgjIAfa +IPIgAAHwC4UA7RQACeAEgABYfJ7t2oAVBsmAAIwgDcwCnKAb2n2KJ+gSACnPAoAAC5kI6JYAJQCR +gAAuogwvrDD/wATlYgCdAPFFwA3gAwUAI6UU+0QAFe/MBQAMuwHoogwl2QEAAJup66YIJUjBAAB5 +iV8c2kL9tNIF7/71AJ6gkyfq03p1WCEAAC3CfRnaZJvRmaMown0opgIvwn/rxn0n+AUAAC/GfyMk +BCMkBZMiIyQgIyQhIyQiIyQjkymTKpMrkywjJRryQ2Qd4AIFANEPAADaIFj0CfpA6BWv/l4A2iBY +9AbaIFjz+oonY/9YAI4iZOBTBQ9HaPJowCDRDwAuwoDr5gEmaAsAAJ2jKcKAmaIowoLrxoAkQAUA +ACjGgiMkBCMkBZMiIyQgIyQhIyQiIyQjkymTKpMrkywjJRryQ2Qd4AIFANEPKyAH2iD6IAAF8AwF +APtjABXgDQUAWHudY/+QH9oQnxSOINog/bRaBeAMFQDtFgYvdgKAAOzuAgDYQQAA7hYFKugEgABY +eqfAINEPbBAEiCJlgJ8mIAcX2fEGBkHqMgUrRwKAAKeIK4KeJKwf+bPQBeREHQB0s38ogp0Jawor +ssMLiAHthAAEA8GAABzZ8wwAh21JAggCYYg0HtnzntApIgAc2fTq1gMm2EEAAOzWAizOAoAA6UkC +AeCBAADp1gEpUASAAAuAAAxoEfcAAER39QEA5IadJ5R1AACKJ/oBQh3gDAUA+0QAFaANpQBYbp7S +oNEPwCDRD//+IA2gCAUA6iQACmgEgAD6wwAV4AwFAFh7XsAg0Q8AbBAEhycqeRQf2c744qQV780F +AOhyCCVQBwAA7HILJVKBAADqk3dz2IEAAA27AauZ6MF0dMkBAAAujQHqdRQnUoEAAOqTcXwwBIAA +eaF9mnjvAAULOASAAAcCYQcCYQcCYQcCYQcCYQcCYQcCYQcCYQcCYQcCYRfZs5dghSCTZZRk87Oi +BaAHpQDiZgIqrgKAAAdVAuVmASsQBIAA0Q/AINEPAAAAAAAA94BoHaAIBQD44WYVr/5yAAiaDAq6 +DCqtASqs4PrhBhWv/iIALLxA/OEGFa/99gAAbBAEx48IWAMIOAIISAOoaOgiCAuBCoAAAiIYojLR +DwBsEAQEOAMIWAOoaOgiCAuBCoAAAiIYojLRDwAAbBAEBDgDCFgBCEgDqGjoIggLgQqAAAIiGKIy +0Q8AAABsEAQFSAMIOAEIWAOoaOgiCAuBCoAAAiIYojLRDwAAAGwQBBPZnQMiAtEPAGwQDiMiECgw +BSkKknmJGykiEv8ioAMQhgUA5dmVFOA2gABwlwoqMG5ooRnAINEPAOvZkRS92IAAC5sB+kJGFeAC +BQDRDyMiGB7ZjI06jCIkCgH/pgAOsL1RAO02CiYG0YAAAioCWPM1GNmFLzIRCP8CLzYRiSJkkMkY +2VqYFI4g2iDv2X8Q2EEAAO8WBi92AoAA9cYADzAMFQD+IKYVoA0lAFh58sAg0Q8Ajj6ENxvZb+RC +DidwBQAA6+sCAODBAAD+YcYVr/31APwhphXomx0A6cQCKVAEgAD7gGYd6JkdAPmAJh3omR0A6cQA +INiBAABY8aMoIhIPAgAFiALmiAIJ0ASAAOgmEiJYCwAAWP0z/CQAFaANNQD+AAIdoA8FAOnZWR1Y +BIAA6RYAKVAEgABZvSbAINEPANogWNxGZa8zY/7nKyAH2iD6IAAF8AwFAPtjABXgDQUAWHquY/8a +AABsEAQlMQ3TD9MPDFUR6iQACtgEgABYPGzrpAAFAjmAABjZGCoxDQgAh+i0AAUAaYAAbakCCAJh +KjENbakFBACGCwJh2iD8oGgdoAsFAFg8IikiEir6fwqZAfhCRhXgAgUA0Q/HL9EPAGwQCCMiGBnZ +LigyEQmIAug2ESlQBIAAWPMfJCAH2iD0IAACMAuFAO0UAApgBIAAWHs17KQABQoRgAAZ2RSIIOmI +AgnQBIAA+YAGFaAbpQBZvYEd2Q+MPuoSACpfAoAArbvqtgAmAHmAAOsyEClQBIAAC8AAiifkoA5l +eMEAAI6s/8AHLWIAnQDxRmAN4AQFACSlFPtEABXvzAUADLsB6KIMJdkBAACbqeumCCVIwQAA+QAF +RWIAnQAc2M/9sewF7/71AJ6g5CYHJVghAAD7oAYjogCdAC3CfRnY8JvRmaMown2Yoi/Cf+vGfSf4 +BQAAL8Z/lC6ULyQmECQmESQmEiQmEyQmFCQmFSQmFiQmFyQmGCQmGSQmGiQmHCQmHSQmHiQmHyQk +BCQkBZQiJCQgJCQhJCQiJCQjlCmUKpQrlCwkJRokJRv6YGgdoAsFAPwAAh2gDSUAWPZVwCDRD9og +WPKF+kDoFa/9TgDaIFjygtogWPJ1iidj/w8Y2MsvMhGOIgj/Au82EScBmYAABQlHaJJDwCDRDyjC +gOuGASZ4CwAAn6MuwoCeoi3CguvGgCboBQAA/ZBGFe/88gArIAfaIPogAAXwDAUA+2MAFeANBQBY +eh9j/7Uf2JGfFI4g2iD9sXIF4AwVAO0WBi92AoAA7O4CANhBAADuFgUq6ASAAFh5KcAg0Q8AAABs +EAYZ2ISZEIgg/IBoHeAMFQDjFgIsRgKAAOyIAglQBIAA6BYBKNgEgABYeRzRDwBsEAwrIhgrsgcr +sg4qIhAosCItsCEssCAusBwjsB3vsB4uZgKAAO3MAg92AoAAA+4CLbAA47AfL3YCgAAP7gLvsCMu +ZgKAAOjMAg92AoAA4+4CDmYCgAAPzAL/jwAMNd0BAP0EQCBQM/UAL6ISfvEID+gMZoACLqYSLqIT +fOEIDskMZpACLKYT/azABlAqNQD7oAysICxFAP2gDgQgLmUA/6APbCA/JQD/oBFsYgCdAHPREMCi +/bDsBaA7BQBZu3XHL9EPKLAYKbAZ6rAaLEYCgAAJiALpsBssRgKAAAqIAgiIEQmIArGI+ELGFaAC +BQDRDyMiEGQwcSmwECqwES2wGuywEizOAoAACpkC6rATLM4CgAAMmQLssBkszgKAAAqZAuqwGCSF +KQAACKoRDKoC7LAbLVYCgAANqgIIqhEMqgKxquomFiSEpQAAKSIS69hRFMAogAALmwErJhIsMAUt +CpX9gAsUYgCdAMAg0Q8AACywFC2wFe6wFi5mAoAADcwC7bAXLmYCgAAOzAIIzBENzAL9lqAAUIUF +AC0iEoQ35EIOJuMegAD8JIAV6OwdAP+gRh2v//UA7xYIKVAEgAD9oGYdqM4dAP2gJh2ozB0A7NQA +JcghAADpBgAAwGEAAOiDHgDYQQAAWPBmKCIS5YgCAlgLAADoJhIpUASAAFj79/wiABWgDTUA/gAC +HaAPBQDp2B0dWASAAOkWAClQBIAAWbvqY/81AAAAKrAYLLAZ7bAaLVYCgAAMqgLssBstVgKAAA2q +AgiqEQyqArGq6iYWKVAEgABY4JjAINEPLLAYLbAZ7rAaLmYCgAANzALtsBsuZgKAAA7MAgjMEQ3M +ArHM7CYWKVAEgABY4CnAINEPAAAtsBgusBnvsBou7gKAAA7dAu6wGy7uAoAAD90CCN0RDt0Csd3t +JhYpUASAAFjgT8Ag0Q8AAAAA+mBoHaALZQBY++3AINEPAAAusBgvsBnosBovdgKAAA/uAu+wGy92 +AoAACO4CCO4RD+4Cse7uJhYpUASAAFjfxsAg0Q9sEAgoIAQkIhj3r7AFoBmFAHmBA8Ag0Q+KSv9e +wAzQi+UAL0B4e/HrLCAFGNfY7tfYFn8RgAAlIhIpIhMrMQsIVQElJhKNOauZfeg3LiIRKSYT8qAF +3lIAnQBk4OaK7HynsYjr+8BoHaALBQD8AAIdoA0lAAuAAMCQ6SYRLJAEgADRDwD9r4gFoAolAP5A +CBWgOwUAWbq8KSIQKZAFKgqV+z/7hCIAnQCKSvNf+zTSAJ0AIyIYjTqMIsBB96YADrC9UQDtNgom +BImAANogWPFYH9eoLjIRD+4CLjYRiCJkgIId132dFIkg2iDs16IQ2EEAAOwWBizOAoAA9SYADLAN +JQD4IKYV4AwVAFh4FcAg0Q8c16GN4P/AsBWgClUA9CAGFeA7BQBZupguIhLAkPhCJhXvv/UAD+4B +7iYSLJAEgADRDwDaIFv+62WvSsCQ6SYRLJAEgADRD9ogWNp7Za97Y/6wACsgB9og+iAABfAMBQD7 +YwAV4A0FAFh442P/YQBsEAooIAQqIhgpChjpgQh9OASAAMAg0Q+Lqv9+wAzQjeUALKB4fcHrLSAF +Htd879d8Fv8RgAArIhKaGA67AismEvNgJqNSAJ0AjiyINiUwIPphRBWv9MUA/wALDSVlAQAKCk4q +rNv1QAQFMIS1APWAFFQiAJ0AD7sC+8AARLA8FQD4QYYV4CQlAPpCRhXgKhUA+sJGDaAvVQB/YQp8 +YQf0wCsNIgCdAC4wMCgwMSkgaOowMi92AoAACO4C6DAzL3YCgAAK7gLo7hEEyBkAAOjuAgyCCoAA +9EZEFaGenQD1ICNXUAwFAP0wABQ1rgEACKoCGddMnRmbFomTG9dK5RYHKm5CgAAEmSzost0kg3GA +AJcVJbL8K7L0qojlUhQsRkKAAPlgAEWwDxUAbZlMKVEEh1D/IAAUtYodAOl3CAxHgoAACHcMJ33/ +9ufoFeSaAQAAkQQA+BrodwEMggqAAP2AIBWhd50A6koIA4BxgACIunKJBIm+fpF7q9v9rlYFoAol +APxACBXgOwUAWbofKiAFKyIYmxWaGRzXJY8ViBmJII7w7/B4K2gEgAD4IAYV4AolAPggJhWgOwUA +WboTKCIQKIAFKQqV+R/yVGIAnQCJGIma8z/x9NIAnQD6QGgdoAsFAPwAAh2gDSUAWGhOwCDRDwAA +AO8SCCX8+YAAL/B4LbAF+kImFeCKtQD74BpFIJilAPmgGgQgmbUA+aAZxGIAnQAqCpb7oBlsIgCd +ACwKmf2gIJUiAJ0AwtH8wAgEYA6FAML1/sAHtGIAnQAoMEEsMEAtMDwpMD3vMD4uZgKAAOjMAg7u +AoAACd0CKDA/6TBCLu4CgAAP3QLvMEMuZgKAAOnMAg7uAoAA6N0CDmYCgAAPzAINyAzqIhAkBIuA +AC+iEn3xCA/YDGaAAi2mEi2iE3zRCA3JDGaQAiymE4y8DswC/WGGFaAqVQD6wAR0IgCdAMPR/MAJ +9GIAnQDC4f7AEBQiAJ0AwvL+wB1EYgCdACgQEGSNHWADFQAAAPgAYh3jy+EA/T/rdiIAnQApMCQs +MCXoMCYszgKAAAyZAuwwJyzOAoAACJkCCJkR7JkCBUARAAD5DQANf/T+AAAAAC0wI8DxDf05LbRB +LLBB/CIGHaAqVQD63/elIgCdACgwIfEf+3/SAJ0AKDBBLDBALTA8KTA97zA+LmYCgADozAIO7gKA +AAndAigwP+kwQi7uAoAAD90C7zBDLmYCgADpzAIO7gKAAOjdAg5mAoAAD8wCDckM6iIQJISLgAAv +ohJ98QgP2AxmgAItphItohN80QgNyQxmkAIsphMtMDgvMDmMvOgwOi7uAoAAD90C7zA7Lu4CgAAI +3QLq1o4e7gKAAA/dAu7MAgboBQAALSYWnLz7YWYVr/t6AC4wJC8wJSwwIegwJi92AoAAD+4C7zAn +L3YCgAAI7gII7hEP7gLxgBVGEgCdAC8wTCgwTekwTi/+AoAACP8C6DBPL/4CgAAJ/wII/xHo/wIP +Ex4AACoiEOqiGCeS8YAA/0ASs+IAnQAvthItMEgoMEnpMEou7gKAAAjdAugwSy7uAoAACd0C7tZm +Hu4CgAAI3QItthQoMDYsMDQqMDX8ZvAV4AkFAOm2FS5mAoAACswC6bYTLmYCgAAIzALutgsuZgKA +AA3MAv1hphWv+EIALzA4KDA56TA6L/4CgAAI/wLoMDsv/gKAAAn/Agj/EQj/Au7WTBf4BQAALyYW +/2FmFa/3bgAqIhHTD2ShRYqnK6EeKAqQ+WAH6qIAnQAtCmD/egAVoAolAP2sgAWgOwUAWbkwY/xy +AAD/7oQNr/r1AAAAHNY66RIGLvAEgAD9YAgV4ApVAPggBhXgOwUAWbklLSIS+kIIFaBOBQAO3QIt +JhIuMEErMEAsMDwvMD3tMD4t3gKAAO67Ag5mAoAAD8wCLjA/7zBCLmYCgAANzALtMEMt3gKAAO+7 +Ag5mAoAA7swCDd4CgAANuwIMvQz3v9IAEgCdAC2iEnzRCA3PDGbwAiymEiyiE/uf0TRiAJ0ADLgM +Zoob+0JmFeACBQDRDwAA+iEIFeAJBQApJhEqsgcpPCD7QcgVoAw1AG3KBQkAhgoCYcAg0Q+JrtMP ++SYAFeAMZQAqPCBtyQUKIIYJAmPAINEPHNX/6BIHL3gEgAD/YAgVoAolAPggBhWgOwUAWbjpY/tV +ihgsMQuKp7/M+0PEFevMIQAMzREp3DD5f/WT4gCdAImu5c+qZMjBAABj+YAALDA4LTA57jA6LmYC +gAANzALtMDsuZgKAAA7MAgjMEQ3MAurV5BZgBQAALCYW+2FmFa/9KgAqIhAqohjDsPogBhWn3B0A +/au4BaAKJQBZuMlj+tUvMEwoME0qIhDpME4v/gKAAAj/AugwTy/+AoAACf8C6qIYL/4CgAD55gAP +v/72AAAAbBAEiScrmRTqkgklgEmAAMihWPgu0Q8AbBAEiCIjIAfxAKAN4TMBAMAg0Q8AAIknKJkU +9yHIFaelAQDkkgkkCemAABfVbBXVbvlACdFSAJ0A9GAGOhIAnQAMORGlmSuSngc8CizCw/dgCYpS +AJ0AK5KdDLsBZLDWKSBA9SAIKJCKJQD1IARpEgCdAPWgBCqQCgUA3UD+gQQV4AwVAPpAaB2n6gEA +WHbRJPqXJvpo7iISKZ8CgAD0YABB8A9FAO82nSEZIQAA88dGDeAFBQAqIhKmqyyyJyS0fS6yJp7A +LbImnNEltiblticlU4EAAFm5rSkiEsCB8y8ADPAPBQAJjzhk/8nkJAUpUASAAFm5pcAg0Q8A+sBQ +Fa/97gAc1TiKyGqhfww5EaWZK5KeBz0K7dLDKAQKgAD3YAQaUgCdACuSnQ27AWSwd7CunshlvyiI +QOs8GClQBIAA/6ruBeeIwQD4SAYdoAwVAP6ABhXgDUUAWHa/wCDRDwAAAAD/+wwNoAQFAGP/Cykg +QAiZEPiABhXv+wIAAAAAAAAAAP/7VA2gCwUAwKBZtcoc1RSKyPlf+5CSAJ0A//5IDaALBQDAsMDa +Da00/YEGFe/+DgAAAABsEAaIIiwgB/EAgA3hzAEAwCDRD4knLZkUBQ5H5pIJJoShgAD5wAZpUgCd +AC8gQRvU/eTU/x4YBIAA8exsDeAFRQD2AAId4A0FAOzKEQYluQAApKooop4Lzgou4sP1AAlb4gCd +ACqinQ6qAdug7BYAJQaBgAAvIEFl8PIHDkfvYQgraASAAPpAaB2gDBUAWHZjDDkRpJn1M6YV75h1 +AOgkBSlQBIAAWblLwCDRDwAAAAAAAAD//bANoAYFAB/U3I7498AGeJIAnQAMOhGkqiiinvUAB0Pi +AJ0AKqKdCzgKKILDCKoB5KDWZ0v9AAD54QYV7/3qACogQAiqEPrABhWv/LYAAI+eLfAEJ/AFHtUY +5fAGLu4CgAAH3QLv8Acu7gKAAAXdAgjdEQ/dAg7dASXcZ/SOAArwh5UA9KCAFe/8NgCNYIsQ7NUK +GVAEgAD7YwAV593BAO0kQCroBIAA/MAGFaAMFQBYdk7AINEPAAAs3Ejr3GcpcASAAP7AaB3kux0A +WbhE+0BoHe/7zgD/+2wNoAoFAJ0R/CAGFaAKBQBZtVgf1KKMEI74jREb1J753/jAkgCdAP/6yA2g +CgUAwKDAigjoNPnhBhWv+o4AbBAEiCIjIAfxAIAN4TMBAMAg0Q+JJyiZFOaSCSQHGYAA9akaBeeV +AQD5IAbZUgCdAOTUjBGlmQAADDkRpJkqkp4FPAoswsP3QAaqUgCdACuSnQy7AWSwfS0gQfGrnA3g +CgUA3WD+wQQV5+oBAPpAaB2gDBUAWHX2DDgR9QAARDAPRQD/E6YV7551AO4kBSlQBIAAWbjdwCDR +DwAX1HGKePdABCCSAJ0ADDkRpJkrkp4FPArswsMoBAqAAPdgBApSAJ0AK5KdDLsB5LB1ZWv9AACd +eGW/gY9g6zwYKVAEgAD/qWQFp//BAP5IBh3gDBUA/sAGFaANRQBYdfbAINEPAP/8dA2gBgUAKCBA +CIgQ+MAGFa/8fgAAAPoRIh2v/R4A//zEDaALBQDAoFm1Aop4+V/7qJIAnQD//mANoAsFAADAsMCa +Cak0+OEGFe/+IgAAbBAEiiooohgogAUpCnN5gSaJJyuZFOySCSWAsYAA2yD+AEIdoI3lAFh0p8Ag +0Q8A//+oDaAMBQCIrxvUiOsmCyF4gQAA/wAGFeAMBQDoJgklSOEAAPhBBhXgDSUA/0HmFe+ehQDu +JAUpWASAAFhytMAg0Q9sEASIIsiHwCDRDwAAAAAAiTckIAcqmRT1qEQF4UQBAO2SCSUFQYAA6tQb +Gk8CgAClmSuSngpMCuzCwygECoAA92AEglIAnQArkp0MuwFksIL6QGgdoAxVAP5hBBXgjuUAWHWK ++GEIFeAPBQDoMgkqdwKAAPXAAEdwDUUA7eadJICBgACfO5mAijiYoZ84nzmLPCQwRf9lYAffnLUA +LDQFjS4uLDj/v/r1IgCdAPif+rDSAJ0A+kIIFaALNQBY+DHAINEP2jBZuF9j/9P//WANoA0FAOtM +GClQBIAA/AAiHaANRQBYdYrAINEPAGwQBCkwE/EhIA3g9YUA9SAGeJIAnQDAINEPAACEJ4gwKjAR +hE7iPBgkLXyAAPoAAh3gTAUA6kQEIigPAADoMBIiqLEAAOhEBSrQBIAAWbGRJE0D9I2AFaALBQD6 +gGgdoQwFAFmxjNpQ7DARKVgEgABY99PaQOwwEiHZYQAAWPfQwCDRDwAAAAD8HAIdoAsFAOpEAiIw +CwAA6DASIzMxAADoRAMrUASAAFmxeiRNA/SVgBWgCwUA+oBoHaCMBQBZsXXaYOwwESlYBIAAWPe9 +pTvsMBIqUASAAFj3ucAg0Q8AAIQnhE7AsOowESJIFwAA+yxGHaDsBQDoMBIiOBMAAOiUYyvQBIAA +WbFjJk0F9twAFaALBQD6wGgdoIwFAFmxXdpw7DARIdhhAABY96WlO+wwEitQBIAAWPei6iQAClgE +gABY+RDAINEPAAAAbBAEF9ObFtPrJ3LDJmKJpHcJdxGnZoRt8kBgJaiDHQDwgoAN58TBACwkUott +CwtfKyRTim0KihQqJFSJbSkkVSgkViMkV9EPAAAAAPJK5h3ogx0A+ErGHaBFBQD0SkYd4A8FAP5K +Zh3gLoUA/kqGHa/9hQAtJFXRDwAAAGwQBogi8QFwDec1AQDaIFjtXYkiy5VoMk7AINEPAAAA6iIQ +KVgEgABY1vFoMmmKJ4ys+0YAFaALBQDqzQwGYyEAAA3LOVh0ONKg0Q8AKyAH2iD6IAAF8AwFAPtj +ABXgDQUAWHT+aTKwH9NxnxCOINog/adkBeAMFQDtFgIvdgKAAOzuAgjYBIAA7hYBKugEgABYdAjA +INEPwCDRD2wQNok1hTD3p04FoAQFAPenTAXgCIUA+QiyDeJVCQDbMPomABWhXAUAWbD2+iYAFeAY +ZQDotBEqUASAAFj3UpYQ/CYAFaANJQD7QGgd4A4FAPpAaB2gDxUAWbdHwCDRDykwEGiRT/UgBhES +AJ0AaJQGwCDRDwAAAIg2JHKLCYgRqEQkFmCESoRJ61QAClAEgABY+ifpEmAtfD4AACmQBSoKlXqZ +y/osCBWgCyUAWPdhwCDRDwAAKjITWPoj5KQACtgEgABY+hplr1TaMFj5hWSvnouni74sso782QAH +MA11AP+gBw4iAJ0A/ABiHejsuQD/oAaOIgCdABjTF/1gQCWgDgUALsQRKIK/K3KL+KAARDANJQDm +FgAsRkKAAPlgAEWwDwUAWbcUwCDRDxTTX4c2JEKLCXcRp0QkFmCESodIhEnrVAAKUASAAFj5+WWu +zioSYIqniq4pooDHuAuZASmmgIswCxtCD7sRC5kCKaaAKDIAEtMH/wIAB9ADFQArEmArsAUsCpJ8 +sUOMcmTApNpwWOzVjXJk0KqSGI5w2nDv00AQ2IEAAO8WCi92AoAA88YAD3AMFQD+ISYVoA0lAFhz +lsAg0Q9Y+FbAINEPAGR+nyRyGBrTFIlKiHL7JgAMsLlRAOlGCiQDwYAA2nBY7L4c0w4rQhEMuwIr +RhGNcmTQapIUjnDacO/TCRDYQQAA7xYGL3YCgADzxgAPcAwVAP4gphWgDSUAWHN8wCDRDwAAAAAA +AOpyECvYBIAAWNZFwCDRDwArcAfacPogAAXwDAUA+2MAFeANBQBYdFlj/znacFjV52WvlGP+BgAA +K3AH2nD6IAAF8AwFAPtjABXgDQUAWHRPY/95AGwQBIguIyw4c4EtKSISep8yiy6Is+okAApgBIAA +67zgKugEgAALgACMIu0gBS4AXgAAyNOOLnPp18Ag0Q8AAAAAAAAA/EAIFeAKVQD9pewFoDsFAFm1 +2MAg0Q8AbBAYJRYZlB4rIAcjFh6HNegyBCn4BIAA/+HkFeADFQDyIgYV4bsBAPojBhXgyFEALBYa +/CPIFaDYWQD8I6YV4L95ACsWFSrAAP+DsBWj9vUA/YekFeB3+QD8ImYV7DgdAP4gBh2ge3UA7MIf +JFRCgAAPCEn4IeYVoAAeAACWHxnS0ygSGfwiJhWgDwUA+S/kFeAEBQD7QBG8Z4gBAC8WFAk5DPgi +5hWvmQEAKRYW9QBIMRIAnQCKIvtAVGCSAJ0A8OcQDeAOBQDuFhIjgFGAAAM6AlkCbsBQ8oVADeAG +BQAtEh4t0IMNXUIvEh0rEhr+AGIdoAwlAO/sOQvQBIAAWQJNpqbwgQAN4Ar1ACkSHimSKihsMAmG +OXagbPQhphWkth0A4xYMJdgFAAD6I2YV4AGaAAAALBIT0w8PAgD7gEYYEgCdAC0SHg8CAI3V8b/7 +u1IAnQDrEhMp0ASAAPwiKBWgDhUA7hYSKOgEgABZAnn7QE3gUgCdAP4AYh3gBQUACvU6ZFGhw2CU +HfIhhhXkhh0AKBYbKRIYHtIyHNIz49IzHKAEgAD1IAniEgCdAOsSGyy3AoAAo2YqYp77QFJL4gCd +ACZinQ6YCiiCwwhmAQZrAu/CCC2wBIAA+2BOYBIAnQArFgX34E7QkgCdACkyrhrSePsgTEgSAJ0A +LjKtLaJe7esBB9P9AAD9wEuuYgCdAJrI/cBL1mIAnQCNHiwgFK3MDAxHLCQU9YBNZlIAnQAuEh3I +6ykSFsCD+QBOqOIAnQBkUPIqEhoPAgDIoWRQY+tkAAlQBIAA/ABiHaAdhQBZAmruEg8teASAAOYS +DCK52YAAHNJYLRIV+aQgBeAKBQCa8przmvSa9elpAg9EAoAA6fYALuiCgADo3QIK9sKAAP+mAA6w +G8UA/eAmFeAKVQBZtSorEhf5YEkpUgCdAMAg7BIbKm8CgACj3SzWndEPLhIeLuCD/kUABzAEFQD+ +IoYVr/b6AI/I9+BKIJIAnQDpEhsqNwKAAKNmKGKe+QBKe+IAnQArYp0OTQot0sMNuwHWsPtgSggS +AJ0AsP6eyPrAaB3v+r4AAPybTA3gNgUA//bUDaANBQAvEhJk8HbrEgUpUASAAPwAYh2gHYUAWQIv +GdIhFtIfjhwoEAAmYqAJ7gIZ0fQIHxTmhgsP+wKAAOn/AgR8nIAALBIR7RITI1v/AAAosj8rsX2e +oJ+hnaKco5uk+UCmFaAAbgAsEhEtEhMrYQWIY56gn6GbopijnaScpSasGC0SFYwfAt0Q7RYILmQC +gADsFgkrsD4AAC4SHRjRu/4hiBXgCgUA6hYGL3GCgACeFwj/Av4hRhXgDyUAnxvrZAAJUASAAPwA +Yh2gHYUAWQICix0vEh6JFuYSHiWRQYAAJmCD7/IFJJF5gACIHQZOQOSCGG9zAoAAKBIeKICCCAZA +CmYQjBcG7QL9hgAOcN+hAPOoABawj5EA/YYADnDfiQDjiBAO6IKAAPmmAA6wj5kABIgQCMwCKBIe +ixoNzAKIhPtABhXj/fUAnaKcpRzR1/1AZhWpiAEAmKQY0dOYoS4SC+mcASUwYQAA6RYGJ3P9AADu +FgsvekYAAC8SFPXgLPiSAJ0A9eAtsRIAnQD14C5xkgCdAPXgLzISAJ0A9eAv8pIAnQD14DCzEgCd +APXgMXOSAJ0Ajh3TD2TgTy8SHi/yKmTwRutkAAlQBIAA/ABiHaAdhQBZAcAoEh4b0bWMGvkFSBWj +/fUAnaL9QAYVrAkFAJmj+0AmFemYsQDppgQsRYKAAOimBSUwYQAA62QACVAEgAD8AGIdoB2FAFkB +rh3RpY8YjBn2IUgVoAkFAJkRmRKZE5kUmaT5QKYV7/v1AJuim6OWoO/MAgr2woAADswC7hIeJTBh +AADtzAIA2CEAAOymASDoQQAA6hwEIOAxAABY/8j5QGgd4AgVAOqJOQ0oBIAA6RYhJSM5gAAkFiL6 +ACId4AoFAAm6OOUWIyVjmYAAE9GFjRmEHBjRVR/RhOUSHSongoAA+IYACjYMBQD4IQgVoAoVAOWl +OQrwwoAABfw5+cYADzAJNQD9xgAO8AglAAWYOSgWIA7OAi4WHP2GAA5wBQUA/CPmFaAEfgAAAAAA +AAD/92wNoAYFAMDg//fIDaAGBQCIHfwjyBXkDAUA9mAABzK2KQDxCwAN4AYFAC3SKu3GOQ3bgoAA +LBAA/2AABHDfyQDr3RAOYgKAAOzuAgxFAoAA+cYADzDPwQD1kAAWMI95AP2GAA5w36kA/0CmFaDv +sQDg7hEO68KAAP+mAA6w74EA7IgRD3ZCgAD/BgAMMe9pAATuEf8GAAww77kA7YgCD3JCgAAOvgIM +iAKNGp2gHNETnKEI7gL+xgAPMAglAAjuAp6kGNE+mKIe0T3/QGYVr/YuAAAAAAD6AAId4AYFAP/9 +TA2gDgUAAAAAAAAAmaGUoJ6inqOepJ6lnaadp52onakvEiDlXAElMKEAAP6gEZxiAJ0A62QACVAE +gAD8AIIdoC2FAFkBK+RQUWrOwoAA9KAKYJIAnQArEh/H7/smAAzwDQUA45kCC/0uAACNEywSHo4S +jxGLzCzCEJmhm6n1QAYVoAgFAJiimKafo56knaecpYwU/UEGFa/+JgAtEh0sEhwb0RAMmQLrmQIG +hBmAAPDiQA3v/vUAmaGUoJ6inqOepP9AphWgDQUAnaadp52o/UEmFe/9NgAvEh4iFiUr8hYm8Tgi +8Tos8hXo8TkrNAKAAAYiAibxOy3yG+7yGixEAoAACGYCKPIXL/IZn6Keo52knKabp5iolqWZoZSg +kqnyJKgVr/v2AAAAAAAAAADw4kAN7/v1AJmhlKCbopujm6T7QKYV4AgFAJimmKeYqPlBJhWv+zoA +LBIejRIvwTsmwTkowTguwTrrwhgrNAKAAOb/AgxEAoAACO4CJsIUiMwswhCbpJinlqiZoZ2ilKCc +o5+lnqmMFP1AxhWv+hoAKxId7BIcJYNRgAAb0M7H7/0mAAywDQUA65kCA4DxgACZoZSgnqKeo56k +nqWdpp2nnaj9QSYV7/kyAC4SHiIWJS3iEiziEyviGIjthu4v4hSC7y7iEZ6inaOcpJulmKaWp5+p +maGUoJKo8iSoFa/4VgArEh/H3/smAAzwDAUA45kCA4DxgACZoZSgnaKdo52knaWcppynnKj9QSYV +r/eaAJmhlKCOE/4gKBXgCAUAmKKYo5ikmKaYp5ion6X/QSYVr/cKACoSHhnQoIqlE9A6JRIj5BIi +JUwwgADj0DYTg+GAABzQmoscDLsC+z9GFe/ifgAlEhDA0vetAAr/4wIAAMCl/aEmBaAbxQDuPhEJ +6ASAAFmzZGP25foiyBWgDgUAnhGeEp4TnhRY/rQkFiLlFiMlX2GAAPoiyBWgCwUAWP6nJBYi9CRm +Fe/vWgAvEhH7/7nQkgCdAGP2tRrQV4gcCogC+T9GFa/gngAAwKBZdkbIpxvQeCuwfWSxLCoSFlj+ +n+kSIS1cHgAA+iLIFaALFQBY/pL4JCgV7+3CANxg6hIMKVgEgAD8I8gV4A4VAFj/RPdAaB2v6fIA +AADcYOoSDClYBIAA/CPIFeAONQBY/zz3QGgdr+l2AAAAANxg6hIMKVgEgAD8I8gV4A51AFj/NPdA +aB2v6PYAAAAA3GDqEgwpWASAAPwjyBXgDrUAWP8s90BoHa/odgAAAADcYOoSDClYBIAA/CPIFeAO +xQBY/yT3QGgdr+f2AAAAANxg6hIMKVgEgAD8I8gV4A7VAFj/HPdAaB2v53YAAAAA3GDqEgwpWASA +APwjyBXgDvUAWP8U90BoHa/m9gDrEhMp0ASAAOwSESjoBIAAWP/iY/YxAAArEh6MHu0SGSlQBIAA +WGro0qDRDwAAAAD7oFgFoUsVAFmdeSwaAAysAvugTgWhSxUAWZ15Y/6zAMCwwNoN/TSdyPt/tHCS +AJ0A+kBoHaAbxQD8AAIdoA0VAFhxTmP/oAAAACsSGPpAaB2gDAUA7RIbJdhhAABYcUdj/4TAoFmw +XRzPqI/I+f+w4JIAnQBj/7jaIFvptWP2T4onjR7AwOqsIC7YBIAAWGRy0qDrEhsqZwKAAKPMK8ad +0Q8AAAAAAAD/1wwNoAYFAAAAAN2Q/Z/+BaAKRQD6AwId4A5FAFmyzf/YZA2gBUUAwKBZsEIcz4yP +yB7Pifn/tXiSAJ0A/9tYDaAGBQAAAAD/2vQNoAsFAMDaDf00/YEGFe/a+gAAAABsEAQUz+uCICRC +fxPP6gQiDAMiAtEPAABsEA4kIhTbIOwUAApQBIAAWQ9R1aD1QAgUIgCdABjPgugABQDIQQAACQJh +CQJhCQJhCQJhH8/cHs/cHc/ZjCCdFv4hRhWgCEUA7xYELmYCgAAIyAKYFS9QBy0RAPufqAWh/wEA +48wCD/wCgAAP3QIO3QKdGCkgPfwh5hWgCyUAmx0KmQLpFgwoBAqAAPRgBVGSAJ0AiUcomRTkgJNk +8IEAAIuZjOD/+AId4CSFAO/vAQWCOYAAbQgue8E8KLAALbAHdIEzKuEF76kIDu8CgADtuwgEyQEA +AOm7FX3oBIAA69QABoCpgABj/8oAAAAAAAD7bwAOv/+uAPuPAAxwCQUACJs4ZbBE6xwQKtAEgAD8 +AIIdoA0lAFgfDtEPGs+lKUEp+z/3xSIAnQBj/+wAAAAA//28DaALBQAAACocSvpHwBXgDGUAWazW +Y/9IwnaKuAqNV3fRYirhBa+m5rp6dekBAADr1AAGgZGAAHvBKiiwANMP0w90gSAtsAcPAgAM3RHt +uwgDSQEAAOm7JH3oBIAA69QADv62AAD7jwAM8AgFAAmLOGS/X2P/owAAAAAAAAD7bwAOv/9yAC0g +PQoIQ3jZkymwL2iTjYogCKoRCjoCmrvRDwAAAAAA+68ADr/+GgBsEAYoIAUsIAfBlA8CAPkAEHVh +zAEAKSICZZHDLTABG8745s76HjgEgAD/oUAG0A+lAC4hKGXiV+7O9B5PAoAA9YAK8hIAnQCmmSiS +npwQC8sK9wARlNIAnQArssMqkp0LqwHrFgEljkmAAIro90AOuJIAnQAoYq7tzuYUC/mAACxirS3S +f+3LAQVD/QAA/YALXmIAnQCY6P2AC2ZiAJ0AKSAUpJkJCUcpJBT1IA110gCdAB7O6hvO4Iwg+CAo +FeAKBQAqtjbuzAIObgKAACy2PP2egAWgDkUADt0C7bY1LOgEgADsDx4OUASAAA0CZwxAhg0CZQwg +hg0CYwwAhu0MAAThAQAACuCGHs8zDAJvCsCGDAJtCqCGDAJrCoCGDAJpKiAHKDABLCEJLSEk+CAA +BDCqEQDqqhAMRAKAAAqIAioxAQjdAg7dAhjPJC4hIi2WII0gLJYjKpYkCO4CLpYi/aAAFrAOJQAO +3QItliHsMgMl0HsAAOyWJSTIBwAA6gAVBMphAAAJAIoMfBGmzP+TphXntQEA+WAGiVIAnQDAINEP +iuj3QAfAkgCdAAx5EaaZLZKeC3sKK7LD96AIRNIAnQAtkp0L2wFksPywrZ3o6xYBLfTGAAD8IAYV +oAFWAADqJAAJ2ASAAOxEAAroBIAAWGmp0qDRDwAAAADAsA+pNOnmCC305gAA+kBoHaAbxQD8ACId +oA0VAFhwGGP/wQAA6iQACtgEgABYa1bSoNEPAIsQ+kBoHaAMFQD7YwAV4A2lAFhwDmP/l8CgWa8k +Hs5uiuj5X/D4kA+lAGP/qtogW+h8//k0DaAPpQAAiifrRAAKaASAAPtEABWgDAUAWGM20qDRDwAA +AAD/91wNoAsFAMC4C5sC+kBGFe/9HgAAAAD8IAYVoAoFAFmvDB7OV4rojBAbzlP5X/eYkA+lAP/8 +OA2gCwUAAMCwD600/cEGFe/8AgAAbBAGKCAFJiAH5zQACtgEgAD4AoId4AU1APkAD51hZgEACwhH +aIIUiiIYzkAXzkPkZAAFA8mAAMAg0Q8AKyE9ZbHhiCeDiPsCpBXvzAUA6YILJHCBAAAM7AHsuwgK +fwKAAOwWACXZAQAA8yAN/GIAnQAtiRSj+q/dLYUU+2AN66IAnQDJdclD2TBtSQUHAIYJAmGK4A8C +AA8CAK+q+0AQrGIAnQD7wAYVr/3+AOxqEQMk8QAAB6oIK6KeDwIA92AK2dIAnQAqop0IaworssML +qgFloE/rbBgpUASAAPwAIh2gDTUAWG+wwCDRDwAbzhKJuPcgDKCSAJ0ADEoRB6oILKKe94ANAdIA +nQAqop0ITAoswsMMqgHkoY5k6/0AAC22CGSvrxnOL5mgiCD/nPAF4AsVAOumAixGAoAABYgCmKGI +My/yf/+cNAWoiB0AqP+fo+4AFQVIQQAA/5waBeAIBQCxiOmDHgwP6AAAn6YZzmj5QQYV4BgFAJin +jiAI7hEF7gKeqQxNEafdJdadjiIsIAaJJwvuAuvOXxZgBQAA7CQGJMiBAACIkf0gghXvzAUADJwB +7iYCJENBAADolgEm6MEAAO2VBCZhAQAAfIsiKpEFHc3pqKiYkZ2AjCDrhgIuZgKAAAXMAv0AJhWg +AgUA0Q8dzeGdgIwgG85H64YCLmYCgAAFzAL9ACYVoAIFANEP2iBYaqfSoNEPAAAA//rEDaAKBQBY +ACdj/hcAAPMgaB3gDgUA/wFmFa/3vgDjugwDgbmAAApLFOy8CCvABIAA7Ew2CcgEgADTD23JBQgA +hgkCYYkQqnjrTQwEyQEAAG3ZBQgghgkCY4sQCvwMrLsrvED7wAYV7/aKAMCgWa5fG82pibgYzab5 +P/L4kgCdAP/5/A2gCgUAwKDA2g2dNP1hBhXv+cIAjxAv/ED/wAYV7/WmAAAAbBAGEs2cF84T9ZtK +BaATlQD4UMgVoKYlACoign+nICsign+3GCoihCygCCWgB3bBN4hEwKALgAAFMwxlP9rRDy0ihCki +hyoih/lgAAT7qoEAepkwCuowK0JFw8IMuyirqvqcBhWv/uoALqELLuz4Dg5D7uz8Iuv9AAD/ogAK +v/7OAAAAAAwCAC8ign//xSXQB25bv9xw+gCiHaALBQD+oAAXMP8FAFmwryVc8cpbKApxmBHAoVmm +VfogKBXgCfUACVk2mRAJuwz6ICYV4AoFAFmIhooQClUMZV/XwKFZpkv6DiId4AoFAFmIgGP/ZQAA +bBAGKCAFLyAHwZT5ABTNYf8BAPQgJhWnhQEAmBL1AA+5EgCdAIkiG81U7c1VH6AEgADmzVQckZYA +APXgD0IQB7UA7xYAL9cCgACmqiyingv7Ciuyw/eAFbviAJ0ALKKdC8sB57QABZKJgACO2PfAEviS +AJ0ALGKu6s28FhApgAAvYq0rovPr/AEHQ/0AAPvgD45iAJ0AmNj74A+mYgCdACsgFCkwB6uZCQlH +KSQU9SARtdIAnQAfza2fcIkg/ACCHeAFFQDldgIszgKAAA2ZAplxiDYZzaeMrv+akAWiiB0ACYgB +qMz84GYVoCsFAO4AFQPIQQAACQCKm3cZzTjpdgYh4MEAAOwHHgPAgQAACAJj7uMFA+DBAAAMAmEv +dhCIIOV2EixGAoAADYgCKHYRjDOKrAyMFKyq6nYTI/mBAADuABUD0UEAAAoAiil2Fut2FyHQQQAA +CmCGDwJnCkCGDwJlLTABjzMYzYPxoAUX0ByFAC0gBxXNgPpEhBWg3REA4zEBLuqCgAAI3QItdiCL +ICl2Iix2I/1gABWwDDUADLsC63YhI8gHAADu4wUEykEAAAkCYQkCYS4gByghCfLlJhXgGaUA/uUG +FeALBQDrdiUsRQKAAPkGAAxx7gEA6HYmL3QCgAAOrgIF7gL+5IYVoAm1AOwSAipvAoAApt0p1p35 +gAe5UgCdAMAg0Q8AAAAA//98DaAJhQAuIT1k7gb+IAYV4APuAI7Y98AH4JIAnQAMShGmqiiinvcA +CKPiAJ0ALKKdC0gKKILDCMwB68QABghBgACw6ZnY57QADfB+AAD+IAYV4AFSAOokAAnYBIAA7BIB +KugEgABYZ+XSoNEPAADAwMC6C+s069YILnCmAAD6QGgdoBvFAPwAIh2gDRUAWG5UY//BAADqJAAK +2ASAAFhpktKg0Q8AixD6QGgdoAwVAPtjABXgDbUAWG5KY/+XwKBZrWAdzKqO2Pnf7LiSAJ0AY/+q +AAAA68QACVAEgABb5rX7mjoFr/b+AIonjRHAwOqsIC7YBIAAWGFx0qDRD//1PA2gCwUAAAAAAABb +/vz+IAgV7/QGAP4gBhXgCgUAWa1IHcyTjtiPEBvMj/nf93iSAJ0A//w8DaALBQAAAAD/++ANoAwF +AMDKDOw0/aEGFa/73gAAAABsEArkIgcqUASAAIgi/kDwFa/PBQDlQRUtZwKAAOw8CAIggQAAD0QB +pFTkTEAuWASAAPWAJdKh7gEALbAH7Nz+LbAEgADkgAhm6A0AAMAg0Q8fzHHtFgAlwIEAAJgTHcxs +9QAkmqIAnQDlzGwfIASAAPXAH2ISAJ0ADOsRpbspsp7uFgEmQCEAAPkgJZuiAJ0AK7KdDegKKILD +CLsB57QABaAZgACN+JoU0w/3oCLIkgCdAClSruvM0hSgQYAALlKtL7LzG8xVD+gB6BYCJsv9AAD/ +wB+GYgCdAJm4/8AfxmIAnQAuIBQtYAeu3foghhWn3QEALSQU9aAhbdIAnQAZzMMfzMOOIIg07cxa +Gl8CgADluwgPdgKAAPEABPpQBTUAg2MqISQF7AIoIAcuYQH84EYV4BSFAJRz/OAmFaCIEQDszEUc +QoKAAPkGAAxwBAUA+OAGFaAIJQDsAAUD4EEAAG2KAgwCYS0hCSwgB5R1/uEmFaA4pQDjdggu7QKA +APmmAA6xzAEA7XYGLmQCgAAMqgIPqgKadCkhCQIqAv7AJBWgDAUA5badLN0CgAD5ZgANsA0FAFho +5sAg0Q+IE4iA9YAgFaCJFQD1xgAKN4jBAHmJGZRx78yLFkv9AAD+4AYV4ZkdAPjgRhXgAFIAlHGI +ExnMiJlwiIEIWBSYco82GcyAKCIHFMyAKZIO9QKkFeL/HQAE/wElFgYPmQjvggkkQIEAAPjgZhXv +yQUA6YgBBSAJAADoFgUqJwKAAAT/CAhVCOypCAKpAQAA5fMKdMgJAAAoEgYI/wzqFgQszwKAAASZ +DOSQRG4nAoAA70gIA8hBAACZF/igDsqiAJ0AD1UMBU4U0w9t6QUPAIYJAmGJFQ7PDKdY7IwQJMkB +AABt+QUJIIYMAmOOIAjuERjMVvTgAESwDxUA/yDGFeAMRQAM7AKYlBjMT5yVjGOIjBXMVP+X4gXo +zB0ArIiYlxjMT+8AFQTwgQAA/5icBeAMBQCxzO6DHg4P6AAA/SFGFeAsBQCcm4djhDSMNQhEAe/M +AQvCQoAACEQCBUQClJwoYAkuYAskYAolYAjvzD8fcQKAAOZEEAxDAoAA/QYADDDFMQDuRAIOYcKA *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Mon Nov 19 22:18:19 2018 Return-Path: Delivered-To: svn-src-all@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 4E265112C482; Mon, 19 Nov 2018 22:18:19 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E6DA08ED4C; Mon, 19 Nov 2018 22:18:18 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C82268E; Mon, 19 Nov 2018 22:18:18 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAJMIIu4014398; Mon, 19 Nov 2018 22:18:18 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAJMIIib014397; Mon, 19 Nov 2018 22:18:18 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201811192218.wAJMIIib014397@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 19 Nov 2018 22:18:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340652 - head/rescue/rescue X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/rescue/rescue X-SVN-Commit-Revision: 340652 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E6DA08ED4C X-Spamd-Result: default: False [0.26 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_MEDIUM(0.02)[0.018,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.24)[0.239,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Nov 2018 22:18:19 -0000 Author: emaste Date: Mon Nov 19 22:18:18 2018 New Revision: 340652 URL: https://svnweb.freebsd.org/changeset/base/340652 Log: rescue: set NO_SHARED in Makefile The rescue binary is built statically via the Makefile generated by crunchgen, but that does not trigger other shared/static logic in bsd.prog.mk - in particular disabling retpolineplt with static linking. PR: 233336 Reported by: Charlie Li Sponsored by: The FreeBSD Foundation Modified: head/rescue/rescue/Makefile Modified: head/rescue/rescue/Makefile ============================================================================== --- head/rescue/rescue/Makefile Mon Nov 19 21:59:07 2018 (r340651) +++ head/rescue/rescue/Makefile Mon Nov 19 22:18:18 2018 (r340652) @@ -6,6 +6,7 @@ PACKAGE=rescue MAN= MK_SSP= no +NO_SHARED= yes PROG= rescue BINDIR?=/rescue From owner-svn-src-all@freebsd.org Mon Nov 19 23:54:51 2018 Return-Path: Delivered-To: svn-src-all@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 CA796112F5D4; Mon, 19 Nov 2018 23:54:50 +0000 (UTC) (envelope-from jhibbits@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 6E3FC6B1FF; Mon, 19 Nov 2018 23:54:50 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 362C01108; Mon, 19 Nov 2018 23:54:50 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAJNso8k065342; Mon, 19 Nov 2018 23:54:50 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAJNsnUu065339; Mon, 19 Nov 2018 23:54:49 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201811192354.wAJNsnUu065339@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Mon, 19 Nov 2018 23:54:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340653 - in head/sys/powerpc: fpu include powerpc X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: in head/sys/powerpc: fpu include powerpc X-SVN-Commit-Revision: 340653 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 6E3FC6B1FF X-Spamd-Result: default: False [0.35 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.33)[0.326,0]; NEURAL_SPAM_MEDIUM(0.03)[0.027,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Nov 2018 23:54:51 -0000 Author: jhibbits Date: Mon Nov 19 23:54:49 2018 New Revision: 340653 URL: https://svnweb.freebsd.org/changeset/base/340653 Log: powerpc: Sync icache on SIGILL, in case of cache issues The update of jemalloc to 5.1.0 exposed a cache syncing issue on a Freescale e500 base system. There was already code in the FPU emulator to address this, but it was limited to a single static variable, and did not attempt to sync the cache. This pulls that out to the higher level program exception handler, and syncs the cache. If a SIGILL is hit a second time at the same address, it will be treated as a real illegal instruction, and handled accordingly. Modified: head/sys/powerpc/fpu/fpu_emu.c head/sys/powerpc/include/pcb.h head/sys/powerpc/powerpc/exec_machdep.c Modified: head/sys/powerpc/fpu/fpu_emu.c ============================================================================== --- head/sys/powerpc/fpu/fpu_emu.c Mon Nov 19 22:18:18 2018 (r340652) +++ head/sys/powerpc/fpu/fpu_emu.c Mon Nov 19 23:54:49 2018 (r340653) @@ -189,7 +189,6 @@ fpu_emulate(struct trapframe *frame, struct fpu *fpf) { union instr insn; struct fpemu fe; - static int lastill = 0; int sig; /* initialize insn.is_datasize to tell it is *not* initialized */ @@ -243,17 +242,11 @@ fpu_emulate(struct trapframe *frame, struct fpu *fpf) opc_disasm(frame->srr0, insn.i_int); } #endif - /* - * XXXX retry an illegal insn once due to cache issues. - */ - if (lastill == frame->srr0) { - sig = SIGILL; + sig = SIGILL; #ifdef DEBUG - if (fpe_debug & FPE_EX) - kdb_enter(KDB_WHY_UNSET, "illegal instruction"); + if (fpe_debug & FPE_EX) + kdb_enter(KDB_WHY_UNSET, "illegal instruction"); #endif - } - lastill = frame->srr0; break; } Modified: head/sys/powerpc/include/pcb.h ============================================================================== --- head/sys/powerpc/include/pcb.h Mon Nov 19 22:18:18 2018 (r340652) +++ head/sys/powerpc/include/pcb.h Mon Nov 19 23:54:49 2018 (r340653) @@ -89,6 +89,7 @@ struct pcb { register_t dbcr0; } booke; } pcb_cpu; + vm_offset_t pcb_lastill; /* Last illegal instruction */ }; #endif Modified: head/sys/powerpc/powerpc/exec_machdep.c ============================================================================== --- head/sys/powerpc/powerpc/exec_machdep.c Mon Nov 19 22:18:18 2018 (r340652) +++ head/sys/powerpc/powerpc/exec_machdep.c Mon Nov 19 23:54:49 2018 (r340653) @@ -94,6 +94,8 @@ __FBSDID("$FreeBSD$"); #include #include +#include + #ifdef FPU_EMU #include #endif @@ -1099,6 +1101,14 @@ ppc_instr_emulate(struct trapframe *frame, struct pcb } sig = fpu_emulate(frame, &pcb->pcb_fpu); #endif + if (sig == SIGILL) { + if (pcb->pcb_lastill != frame->srr0) { + /* Allow a second chance, in case of cache sync issues. */ + sig = 0; + pmap_sync_icache(PCPU_GET(curpmap), frame->srr0, 4); + pcb->pcb_lastill = frame->srr0; + } + } return (sig); } From owner-svn-src-all@freebsd.org Mon Nov 19 23:56:34 2018 Return-Path: Delivered-To: svn-src-all@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 7D541112F665; Mon, 19 Nov 2018 23:56:34 +0000 (UTC) (envelope-from marius@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 1F1A66B371; Mon, 19 Nov 2018 23:56:34 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EEB56110E; Mon, 19 Nov 2018 23:56:33 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAJNuXoL065479; Mon, 19 Nov 2018 23:56:33 GMT (envelope-from marius@FreeBSD.org) Received: (from marius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAJNuXPn065478; Mon, 19 Nov 2018 23:56:33 GMT (envelope-from marius@FreeBSD.org) Message-Id: <201811192356.wAJNuXPn065478@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: marius set sender to marius@FreeBSD.org using -f From: Marius Strobl Date: Mon, 19 Nov 2018 23:56:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340654 - head/sys/dev/sdhci X-SVN-Group: head X-SVN-Commit-Author: marius X-SVN-Commit-Paths: head/sys/dev/sdhci X-SVN-Commit-Revision: 340654 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 1F1A66B371 X-Spamd-Result: default: False [0.35 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.33)[0.334,0]; NEURAL_SPAM_MEDIUM(0.02)[0.018,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Nov 2018 23:56:34 -0000 Author: marius Date: Mon Nov 19 23:56:33 2018 New Revision: 340654 URL: https://svnweb.freebsd.org/changeset/base/340654 Log: For consistency within the front-end, prefer SDHCI_{READ,WRITE}_{2,4}() to sdhci_acpi_{read,write}_{2,4}() in the sdhci_acpi_set_uhs_timing() added in r340543. Modified: head/sys/dev/sdhci/sdhci_acpi.c Modified: head/sys/dev/sdhci/sdhci_acpi.c ============================================================================== --- head/sys/dev/sdhci/sdhci_acpi.c Mon Nov 19 23:54:49 2018 (r340653) +++ head/sys/dev/sdhci/sdhci_acpi.c Mon Nov 19 23:56:33 2018 (r340654) @@ -203,7 +203,7 @@ sdhci_acpi_set_uhs_timing(device_t dev, struct sdhci_s enum mmc_bus_timing timing; bus = slot->bus; - old_timing = sdhci_acpi_read_2(bus, slot, SDHCI_HOST_CONTROL2); + old_timing = SDHCI_READ_2(bus, slot, SDHCI_HOST_CONTROL2); old_timing &= SDHCI_CTRL2_UHS_MASK; sdhci_generic_set_uhs_timing(dev, slot); @@ -220,19 +220,19 @@ sdhci_acpi_set_uhs_timing(device_t dev, struct sdhci_s timing = ios->timing; if (old_timing == SDHCI_CTRL2_UHS_SDR104 && timing == bus_timing_hs) - sdhci_acpi_write_2(bus, slot, SDHCI_HOST_CONTROL2, - sdhci_acpi_read_2(bus, slot, SDHCI_HOST_CONTROL2) & + SDHCI_WRITE_2(bus, slot, SDHCI_HOST_CONTROL2, + SDHCI_READ_2(bus, slot, SDHCI_HOST_CONTROL2) & ~SDHCI_CTRL2_SAMPLING_CLOCK); if (ios->clock > SD_SDR50_MAX && old_timing != SDHCI_CTRL2_MMC_HS400 && timing == bus_timing_mmc_hs400) { - sdhci_acpi_write_2(bus, slot, SDHCI_HOST_CONTROL2, - sdhci_acpi_read_2(bus, slot, SDHCI_HOST_CONTROL2) | + SDHCI_WRITE_2(bus, slot, SDHCI_HOST_CONTROL2, + SDHCI_READ_2(bus, slot, SDHCI_HOST_CONTROL2) | SDHCI_CTRL2_SAMPLING_CLOCK); - sdhci_acpi_write_4(bus, slot, SDHCI_AMD_RESET_DLL_REG, + SDHCI_WRITE_4(bus, slot, SDHCI_AMD_RESET_DLL_REG, 0x40003210); DELAY(20); - sdhci_acpi_write_4(bus, slot, SDHCI_AMD_RESET_DLL_REG, + SDHCI_WRITE_4(bus, slot, SDHCI_AMD_RESET_DLL_REG, 0x40033210); } } From owner-svn-src-all@freebsd.org Tue Nov 20 00:06:54 2018 Return-Path: Delivered-To: svn-src-all@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 853BC112FF8B; Tue, 20 Nov 2018 00:06:54 +0000 (UTC) (envelope-from tmunro@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 121B76B96A; Tue, 20 Nov 2018 00:06:54 +0000 (UTC) (envelope-from tmunro@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DCF0112BD; Tue, 20 Nov 2018 00:06:53 +0000 (UTC) (envelope-from tmunro@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAK06rui070630; Tue, 20 Nov 2018 00:06:53 GMT (envelope-from tmunro@FreeBSD.org) Received: (from tmunro@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAK06rcl070629; Tue, 20 Nov 2018 00:06:53 GMT (envelope-from tmunro@FreeBSD.org) Message-Id: <201811200006.wAK06rcl070629@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tmunro set sender to tmunro@FreeBSD.org using -f From: Thomas Munro Date: Tue, 20 Nov 2018 00:06:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340655 - head/usr.bin/pom X-SVN-Group: head X-SVN-Commit-Author: tmunro X-SVN-Commit-Paths: head/usr.bin/pom X-SVN-Commit-Revision: 340655 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 121B76B96A X-Spamd-Result: default: False [0.35 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.33)[0.334,0]; NEURAL_SPAM_MEDIUM(0.02)[0.018,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Nov 2018 00:06:54 -0000 Author: tmunro Date: Tue Nov 20 00:06:53 2018 New Revision: 340655 URL: https://svnweb.freebsd.org/changeset/base/340655 Log: pom: Fix fencepost bugs. Under some conditions pom would report "waning" and then "full", show higher percentages than it should, and get confused by DST. Fix. Before: 2018.01.30: The Moon is Waxing Gibbous (97% of Full) 2018.01.31: The Moon is Waning Gibbous (100% of Full) 2018.02.01: The Moon is Full 2018.02.02: The Moon is Waning Gibbous (98% of Full) After: 2018.01.30: The Moon is Waxing Gibbous (96% of Full) 2018.01.31: The Moon is Waxing Gibbous (99% of Full) 2018.02.01: The Moon is Full 2018.02.02: The Moon is Waning Gibbous (97% of Full) PR: 231705 Submitted by: Andrew Gierth Approved by: allanjude (mentor) MFC after: 2 weeks Differential Revision: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=231705 Modified: head/usr.bin/pom/pom.c Modified: head/usr.bin/pom/pom.c ============================================================================== --- head/usr.bin/pom/pom.c Mon Nov 19 23:56:33 2018 (r340654) +++ head/usr.bin/pom/pom.c Tue Nov 20 00:06:53 2018 (r340655) @@ -135,11 +135,13 @@ main(int argc, char **argv) tmd.tm_hour = 0; tmd.tm_min = 0; tmd.tm_sec = 0; + tmd.tm_isdst = -1; } if (otime != NULL) { tmd.tm_hour = strtol(otime, NULL, 10); tmd.tm_min = strtol(otime + 3, NULL, 10); tmd.tm_sec = strtol(otime + 6, NULL, 10); + tmd.tm_isdst = -1; } tt = mktime(&tmd); } @@ -149,19 +151,19 @@ main(int argc, char **argv) (GMT.tm_min / 60.0) + (GMT.tm_sec / 3600.0)) / 24.0); for (cnt = EPOCH; cnt < GMT.tm_year; ++cnt) days += isleap(1900 + cnt) ? 366 : 365; - today = potm(days) + .5; + today = potm(days); if (pflag) { (void)printf("%1.0f\n", today); return (0); } (void)printf("The Moon is "); - if ((int)today == 100) + if (today >= 99.5) (void)printf("Full\n"); - else if (!(int)today) + else if (today < 0.5) (void)printf("New\n"); else { tomorrow = potm(days + 1); - if ((int)today == 50) + if (today >= 49.5 && today < 50.5) (void)printf("%s\n", tomorrow > today ? "at the First Quarter" : "at the Last Quarter"); else { From owner-svn-src-all@freebsd.org Tue Nov 20 00:08:34 2018 Return-Path: Delivered-To: svn-src-all@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 1A3BE11300A9; Tue, 20 Nov 2018 00:08:34 +0000 (UTC) (envelope-from marius@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 B1B666BB4B; Tue, 20 Nov 2018 00:08:33 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 78B3B12C1; Tue, 20 Nov 2018 00:08:33 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAK08Xbm070756; Tue, 20 Nov 2018 00:08:33 GMT (envelope-from marius@FreeBSD.org) Received: (from marius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAK08XsX070755; Tue, 20 Nov 2018 00:08:33 GMT (envelope-from marius@FreeBSD.org) Message-Id: <201811200008.wAK08XsX070755@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: marius set sender to marius@FreeBSD.org using -f From: Marius Strobl Date: Tue, 20 Nov 2018 00:08:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340656 - head/sys/sparc64/sparc64 X-SVN-Group: head X-SVN-Commit-Author: marius X-SVN-Commit-Paths: head/sys/sparc64/sparc64 X-SVN-Commit-Revision: 340656 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B1B666BB4B X-Spamd-Result: default: False [0.35 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.33)[0.326,0]; NEURAL_SPAM_MEDIUM(0.03)[0.027,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Nov 2018 00:08:34 -0000 Author: marius Date: Tue Nov 20 00:08:33 2018 New Revision: 340656 URL: https://svnweb.freebsd.org/changeset/base/340656 Log: Given that the idea of D15374 was to "make memmove a first class citizen", provide a _MEMMOVE extension of _MEMCPY that deals with overlap based on the previous bcopy(9) implementation and use the former for bcopy(9) and memmove(9). This addresses my D15374 review comment, avoiding extra MOVs in case of memmove(9) and trashing the stack pointer. Modified: head/sys/sparc64/sparc64/support.S Modified: head/sys/sparc64/sparc64/support.S ============================================================================== --- head/sys/sparc64/sparc64/support.S Tue Nov 20 00:06:53 2018 (r340655) +++ head/sys/sparc64/sparc64/support.S Tue Nov 20 00:08:33 2018 (r340656) @@ -207,6 +207,30 @@ __FBSDID("$FreeBSD$"); 6: /* + * Extension of _MEMCPY dealing with overlap, but unaware of ASIs. + * Used for bcopy() and memmove(). + */ +#define _MEMMOVE(dst, src, len) \ + /* Check for overlap, and copy backwards if so. */ \ + sub dst, src, %g1 ; \ + cmp %g1, len ; \ + bgeu,a,pt %xcc, 2f ; \ + nop ; \ + /* Copy backwards. */ \ + add src, len, src ; \ + add dst, len, dst ; \ +1: deccc 1, len ; \ + bl,pn %xcc, 3f ; \ + dec 1, src ; \ + ldub [src], %g1 ; \ + dec 1, dst ; \ + ba %xcc, 1b ; \ + stb %g1, [dst] ; \ +2: /* Do the fast version. */ \ + _MEMCPY(dst, src, len, EMPTY, EMPTY, EMPTY, EMPTY) ; \ +3: + +/* * void ascopy(u_long asi, vm_offset_t src, vm_offset_t dst, size_t len) */ ENTRY(ascopy) @@ -265,49 +289,14 @@ ENTRY(bcmp) END(bcmp) /* - * void *memmove(void *dst, const void *src, size_t len) * void bcopy(const void *src, void *dst, size_t len) */ -ENTRY(memmove) - /* - * Swap src/dst for memmove/bcopy differences - */ - mov %o0, %o6 - mov %o1, %o0 - mov %o6, %o1 -ALTENTRY(bcopy) - /* - * Check for overlap, and copy backwards if so. - */ - sub %o1, %o0, %g1 - cmp %g1, %o2 - bgeu,a,pt %xcc, 3f +ENTRY(bcopy) + _MEMMOVE(%o1, %o0, %o2) + retl nop +END(bcopy) - /* - * Copy backwards. - */ - add %o0, %o2, %o0 - add %o1, %o2, %o1 -1: deccc 1, %o2 - bl,a,pn %xcc, 2f - nop - dec 1, %o0 - ldub [%o0], %g1 - dec 1, %o1 - ba %xcc, 1b - stb %g1, [%o1] -2: retl - mov %o6, %o0 - - /* - * Do the fast version. - */ -3: _MEMCPY(%o1, %o0, %o2, EMPTY, EMPTY, EMPTY, EMPTY) - retl - mov %o6, %o0 -END(memmove) - /* * void bzero(void *b, size_t len) */ @@ -335,6 +324,16 @@ ENTRY(memcpy) retl nop END(memcpy) + +/* + * void *memmove(void *dst, const void *src, size_t len) + */ +ENTRY(memmove) + mov %o0, %o3 + _MEMMOVE(%o3, %o1, %o2) + retl + nop +END(memmove) /* * void *memset(void *b, int c, size_t len) From owner-svn-src-all@freebsd.org Tue Nov 20 00:14:49 2018 Return-Path: Delivered-To: svn-src-all@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 06C81113041C; Tue, 20 Nov 2018 00:14:49 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from d.mail.sonic.net (d.mail.sonic.net [64.142.111.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 48E2B6BFE1; Tue, 20 Nov 2018 00:14:48 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from helicon.physics.ucla.edu (helicon.physics.ucla.edu [169.232.156.253]) (authenticated bits=0) by d.mail.sonic.net (8.15.1/8.15.1) with ESMTPSA id wAK03eMY030679 (version=TLSv1.2 cipher=AES128-SHA bits=128 verify=NOT); Mon, 19 Nov 2018 16:03:41 -0800 Subject: Re: svn commit: r340653 - in head/sys/powerpc: fpu include powerpc To: Justin Hibbits , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201811192354.wAJNsnUu065339@repo.freebsd.org> From: Nathan Whitehorn Openpgp: preference=signencrypt Autocrypt: addr=nwhitehorn@freebsd.org; keydata= xsFNBFuARN8BEADLKYsG3l1aq/M21R59I/5EsEfvtvd15ZJ9lDHcWPuxzIfGnu2LMpe5PrFP e/Y4bcsPrlB4S3I3ooIUDvoEEsDeqgqlZod3QevOK/RjLqiqx1i/4mKnobJ++3ppyVVIccgN sUrj786OYCFCI/W+uWw7cbKewNeaL//Z/TDKlHLkssiy6qmZbNQ0ZjcMLJKUesk4eVg2TtTD HNe42ZuxbUC9iLYieO4c7kQB4qiFhagDRiObXrLzvm2MQYeAaNVRqID+mfI75TWrQ+t98iVu mHvFu461eeteq59jg6H/IL07ACxL+HzEVM+D6tPtPrz7ppr3wiZL5Cu17yu0nAx0nhJTV8ZB qza1rOVun0x65S14L41XD2HkmBDxTaRlTg8ypnkLFo8kh+MEq4k67apL/DUGcaUjKy2TVUC7 3igLO/DwQHrkWx2RrOmS3xS0TgGXVmB47nq2Zveo3fcjporQK63n2sbLkS70cfAJAJ9KHEIx u9am44iW5Ku3+mVLgQYybtcUxlk/Jw/BA5V6KUcDQMd5kTm0MyagziqMaT+57ceYxwRBK4HC DCLRpSOHV81/YzyL5vnwfHsxADm3091rd0uwr8uRCQn7wLvlcFyp/JKSFkVnE1oo7UE4QQJZ GbSJyvj7GdXu0LdghALcMj/thdb+js4D3UuCaAMecgVSscxEIQARAQABzS5OYXRoYW4gV2hp dGVob3JuIDxud2hpdGVob3JuQGljZWN1YmUud2lzYy5lZHU+wsGOBBMBCAA4FiEEPWQg+qgh ST6Avw1hOLZNlGaE6HcFAluAUl4CGwMFCwkIBwIGFQoJCAsCBBYCAwECHgECF4AACgkQOLZN lGaE6HeHFw//fN2CzkiW1yedjLGEQ3uXRMgu6geRgWdtkgg/pOhn5OLSQI4R59kjvHNHHqln 1QYdxe63lsbe+7CRsTKuke3/mgsQ1h6n7cCzsoXVP3eLtWjshAz7spwUcdRRFTSbwkMzKcRn plpr+ByZDw98vnpQo10J5xYmf6if6wcEpVlazwnC5G1gHktM4X0jrlAUKSgVx7MG8o4G6af9 7MQJINAG6g6+BlBH3u5fmPunKi9qgHsZxKnTZneD2mO5u2x6p1qmqybvfvWI5UEvktPeEext JBeXXqdex+HWmAbLYznLUoBloBl+fW5Lo9VapkcGubvGC0WLr/gYuamAApwoFpa4/SBqgmHr JSsPqoDtheWt9oYzuYkYW5+tpJQoDVdG3KCOQJSYZIbNT8HyviFY32ZSn6gIn2qP/5E+rA8J +6/57XCZXPazE4FiPNbwY/OwZoi7w0yRKcdmJoSoC/GdjtQbjyeARbAaHIcudeU/bB3paGS2 rHkoW4iR5TnK/V/QJvNT4KC6Dw3m6pfBIzsF+smcyjz+MzBFQNvSOtG4kJQooKcMsThas8oX VTx+WsqNAVOeQKTOU74jlUYKm5+w5aIOJbc8jg1LlTWJus1SxYtxT9lgNwOCUhE/j6Ueq9jG V9POWg31C44akWmnK8rS4PImUBsPKwtxUNM6BhfZRbtIjQ7OwU0EW4BFQQEQAOLKFtg6us0A LA7LtvjxIskIgqFJjHw2ka/UtdJ432P9kvmBq7z4v0+m/gkxCOOG0yDi2Cv/ALJobsyb56tb U6MU0SRjTio35S2jit369B1BDC2TLNF337sUquUx0l4wkEXEBefvLRYouF8BRbkgjveg7sA4 NjsiduQx92vPJnBoaH2OWxqDbr5X6kF5cx9jPrKUJ4ZqH/raE/SSDhtow4aKO0nWbteVGck1 5W1X/S8KziPXKazxCQ8qprQRTAehsdG/bSbWD95hp3TAlEbl4N4UqqS7n4jCZunCeii2TDZH Vvx/lpFAT2ezx646p2PUmH5hpiVMgbY5uHcyahwNf+eNOO7gotnNYoieoLw4fUeTYOq+s3IN isCB4iovQcZOCYSzmwRolQRggX0tBSenR6Pgp38YjVIkWvMHhxbVifAusjvVbm/GQeA2MaCt kog53Iyfo7ri9DeNpVuRc/47BxHi8JtdyyGgLO13Ajcwc6V7KLeDmw/SXJAMssuWQlXzs8Og spNvtymBh5rq4TlxAY65L3Yv/yh0izEztOJO3Ob9y3gLrp7TeDI0EO9SyGuFXbgWY/NXlDwW HWguMgO7DWM/KxeaMYyHfnffIeQ6uhM21y42I7NV11mWwycv/XJkID3fd7GWBecakdYnYI/7 FYMDHmsUQPmSMkbqCqYcZe47ABEBAAHCwXYEGAEIACAWIQQ9ZCD6qCFJPoC/DWE4tk2UZoTo dwUCW4BFQQIbDAAKCRA4tk2UZoTod2RbEACbQ2bwJ3++bvqclErbekf7BXYja37/HxGE67q3 9xf28hen8vWGtXwq4bWmZT5H8bBqXigA4bUU4nN4X3xEDfTyqkQMuDTnnwT7Y61B4QEqhi4a q4adf/KP0l1UCg4CJ0KS931Han+VbiuUcbadu1ZX37Ef6g/hG+mt59FeXDMU0rers2Bpr8zB 8ywojAsVC92kvOHLsCQtdCsPzC+R6B1bY6/Re9slM1NBd+2k4BUVhYu8Fb8Ir37OmN0aGQzY uRczfrmR/OV5/1+g5XeYSFbq/0Q3KkFWLHfimff8lb9GRWrdvOUpYyGluv49b/G5o9lSxPwX yBfaoVi/WDDfJ/XJw9H90XK68TYxPfEQkeuLEEzg+Bz3Zeduyo2Zx4S5apLqAbv0RzduXgIG YZVPu8R4ya8nQWHeUpot17lt8SL7yFkMJaAXk27QqUAaxjqnGBLn70YMWXFGySfvjgaR1Ftu /S/HSKqH7m8aFYZftqs7ZojXNdqGHZKRrIx6hRUYuZQM8uxHDweF4jF+QIwYIUmtry5h8iti Sjt9KHjpkH3Wz5o1mk6cbFNN+wgpHplDl/iZMZjFskTAJfEsYHVSSm21zcYvvogrbqYvciMT ty65+0A8Gz9tMbcNx9ePaGoM+9jeFehrzTjdaiTiC+umSd/Y29DCW4OBMr1VfufVVKbfAQ== Message-ID: <5bb6d4a3-57e0-6008-3e6a-4bad77fd3108@freebsd.org> Date: Mon, 19 Nov 2018 16:03:40 -0800 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:60.0) Gecko/20100101 Thunderbird/60.3.0 MIME-Version: 1.0 In-Reply-To: <201811192354.wAJNsnUu065339@repo.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Content-Language: en-US X-Sonic-CAuth: UmFuZG9tSVbaCRoI4LQ5ztd+H4sMh+2u2Wi1nDMrETb2PyVsBCE6jnFvxLZL5lP4o7q/lFjA9lEoKX17fwPHFOJ47n2ia3rzfKfQbLYBbU4= X-Sonic-ID: C;WEimvFfs6BGe5P+mSH5B5g== M;NFzevFfs6BGe5P+mSH5B5g== X-Spam-Flag: No X-Sonic-Spam-Details: 0.0/5.0 by cerberusd X-Rspamd-Queue-Id: 48E2B6BFE1 X-Spamd-Result: default: False [0.09 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_HAM_MEDIUM(-0.39)[-0.392,0]; NEURAL_SPAM_SHORT(0.48)[0.481,0]; ASN(0.00)[asn:7065, ipnet:64.142.96.0/19, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Nov 2018 00:14:49 -0000 Is this reasonable? What if the junk in the cache happened to be a *valid* instruction? Won't this approach result in silent corruption and later failure? -Nathan On 11/19/18 3:54 PM, Justin Hibbits wrote: > Author: jhibbits > Date: Mon Nov 19 23:54:49 2018 > New Revision: 340653 > URL: https://svnweb.freebsd.org/changeset/base/340653 > > Log: > powerpc: Sync icache on SIGILL, in case of cache issues > > The update of jemalloc to 5.1.0 exposed a cache syncing issue on a Freescale > e500 base system. There was already code in the FPU emulator to address > this, but it was limited to a single static variable, and did not attempt to > sync the cache. This pulls that out to the higher level program exception > handler, and syncs the cache. > > If a SIGILL is hit a second time at the same address, it will be treated as > a real illegal instruction, and handled accordingly. > > Modified: > head/sys/powerpc/fpu/fpu_emu.c > head/sys/powerpc/include/pcb.h > head/sys/powerpc/powerpc/exec_machdep.c > > Modified: head/sys/powerpc/fpu/fpu_emu.c > ============================================================================== > --- head/sys/powerpc/fpu/fpu_emu.c Mon Nov 19 22:18:18 2018 (r340652) > +++ head/sys/powerpc/fpu/fpu_emu.c Mon Nov 19 23:54:49 2018 (r340653) > @@ -189,7 +189,6 @@ fpu_emulate(struct trapframe *frame, struct fpu *fpf) > { > union instr insn; > struct fpemu fe; > - static int lastill = 0; > int sig; > > /* initialize insn.is_datasize to tell it is *not* initialized */ > @@ -243,17 +242,11 @@ fpu_emulate(struct trapframe *frame, struct fpu *fpf) > opc_disasm(frame->srr0, insn.i_int); > } > #endif > - /* > - * XXXX retry an illegal insn once due to cache issues. > - */ > - if (lastill == frame->srr0) { > - sig = SIGILL; > + sig = SIGILL; > #ifdef DEBUG > - if (fpe_debug & FPE_EX) > - kdb_enter(KDB_WHY_UNSET, "illegal instruction"); > + if (fpe_debug & FPE_EX) > + kdb_enter(KDB_WHY_UNSET, "illegal instruction"); > #endif > - } > - lastill = frame->srr0; > break; > } > > > Modified: head/sys/powerpc/include/pcb.h > ============================================================================== > --- head/sys/powerpc/include/pcb.h Mon Nov 19 22:18:18 2018 (r340652) > +++ head/sys/powerpc/include/pcb.h Mon Nov 19 23:54:49 2018 (r340653) > @@ -89,6 +89,7 @@ struct pcb { > register_t dbcr0; > } booke; > } pcb_cpu; > + vm_offset_t pcb_lastill; /* Last illegal instruction */ > }; > #endif > > > Modified: head/sys/powerpc/powerpc/exec_machdep.c > ============================================================================== > --- head/sys/powerpc/powerpc/exec_machdep.c Mon Nov 19 22:18:18 2018 (r340652) > +++ head/sys/powerpc/powerpc/exec_machdep.c Mon Nov 19 23:54:49 2018 (r340653) > @@ -94,6 +94,8 @@ __FBSDID("$FreeBSD$"); > #include > #include > > +#include > + > #ifdef FPU_EMU > #include > #endif > @@ -1099,6 +1101,14 @@ ppc_instr_emulate(struct trapframe *frame, struct pcb > } > sig = fpu_emulate(frame, &pcb->pcb_fpu); > #endif > + if (sig == SIGILL) { > + if (pcb->pcb_lastill != frame->srr0) { > + /* Allow a second chance, in case of cache sync issues. */ > + sig = 0; > + pmap_sync_icache(PCPU_GET(curpmap), frame->srr0, 4); > + pcb->pcb_lastill = frame->srr0; > + } > + } > > return (sig); > } > From owner-svn-src-all@freebsd.org Tue Nov 20 00:43:15 2018 Return-Path: Delivered-To: svn-src-all@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 9A2B01131029; Tue, 20 Nov 2018 00:43:15 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.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 3E7836D0A6; Tue, 20 Nov 2018 00:43:15 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 198F11934; Tue, 20 Nov 2018 00:43:15 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAK0hEs2091430; Tue, 20 Nov 2018 00:43:14 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAK0hErJ091429; Tue, 20 Nov 2018 00:43:14 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201811200043.wAK0hErJ091429@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Tue, 20 Nov 2018 00:43:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r340657 - releng/12.0/sys/dev/pci X-SVN-Group: releng X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: releng/12.0/sys/dev/pci X-SVN-Commit-Revision: 340657 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 3E7836D0A6 X-Spamd-Result: default: False [0.42 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.41)[0.405,0]; NEURAL_SPAM_MEDIUM(0.02)[0.018,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Nov 2018 00:43:15 -0000 Author: brooks Date: Tue Nov 20 00:43:14 2018 New Revision: 340657 URL: https://svnweb.freebsd.org/changeset/base/340657 Log: MFS r340643: MFC r340489-r340490 r340489: Fix freebsd32 support for PCIOCGETCONF. This fixes regresssions in pciconf -l and some ports as reported on freebsd-current: https://lists.freebsd.org/pipermail/freebsd-current/2018-November/072144.html Reported by: jbeich Reviewed by: kib (also proposed an idential patch) Tested by: jbeich Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D18011 r340490: Fix stray tab. Reported by: jbeich MFC with: r340489 Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D18011 Approved by: re (gjb) Modified: releng/12.0/sys/dev/pci/pci_user.c Directory Properties: releng/12.0/ (props changed) Modified: releng/12.0/sys/dev/pci/pci_user.c ============================================================================== --- releng/12.0/sys/dev/pci/pci_user.c Tue Nov 20 00:08:33 2018 (r340656) +++ releng/12.0/sys/dev/pci/pci_user.c Tue Nov 20 00:43:14 2018 (r340657) @@ -945,6 +945,9 @@ pci_ioctl(struct cdev *dev, u_long cmd, caddr_t data, if (!(flag & FWRITE)) { switch (cmd) { case PCIOCGETCONF: +#ifdef COMPAT_FREEBSD32 + case PCIOCGETCONF32: +#endif #ifdef PRE7_COMPAT case PCIOCGETCONF_OLD: #ifdef COMPAT_FREEBSD32 @@ -962,6 +965,9 @@ pci_ioctl(struct cdev *dev, u_long cmd, caddr_t data, switch (cmd) { case PCIOCGETCONF: +#ifdef COMPAT_FREEBSD32 + case PCIOCGETCONF32: +#endif #ifdef PRE7_COMPAT case PCIOCGETCONF_OLD: #ifdef COMPAT_FREEBSD32 From owner-svn-src-all@freebsd.org Tue Nov 20 00:55:53 2018 Return-Path: Delivered-To: svn-src-all@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 EAA961131404; Tue, 20 Nov 2018 00:55:52 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.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 8DFFB6D6FC; Tue, 20 Nov 2018 00:55:52 +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 6B5A31AD9; Tue, 20 Nov 2018 00:55:52 +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 wAK0tqdl096785; Tue, 20 Nov 2018 00:55:52 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAK0tpnm096782; Tue, 20 Nov 2018 00:55:51 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201811200055.wAK0tpnm096782@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 20 Nov 2018 00:55:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r340658 - in stable/12/sys: dev/mrsas kern X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in stable/12/sys: dev/mrsas kern X-SVN-Commit-Revision: 340658 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 8DFFB6D6FC X-Spamd-Result: default: False [0.34 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-0.01)[-0.012,0]; NEURAL_SPAM_SHORT(0.35)[0.351,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Nov 2018 00:55:53 -0000 Author: markj Date: Tue Nov 20 00:55:51 2018 New Revision: 340658 URL: https://svnweb.freebsd.org/changeset/base/340658 Log: MFC r340192: Use plain atomic_{add,subtract} when that's sufficient. Modified: stable/12/sys/dev/mrsas/mrsas.h stable/12/sys/kern/uipc_mqueue.c stable/12/sys/kern/vfs_bio.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/mrsas/mrsas.h ============================================================================== --- stable/12/sys/dev/mrsas/mrsas.h Tue Nov 20 00:43:14 2018 (r340657) +++ stable/12/sys/dev/mrsas/mrsas.h Tue Nov 20 00:55:51 2018 (r340658) @@ -612,8 +612,8 @@ typedef union { #define mrsas_atomic_read(v) atomic_load_acq_int(&(v)->val) #define mrsas_atomic_set(v,i) atomic_store_rel_int(&(v)->val, i) -#define mrsas_atomic_dec(v) atomic_fetchadd_int(&(v)->val, -1) -#define mrsas_atomic_inc(v) atomic_fetchadd_int(&(v)->val, 1) +#define mrsas_atomic_dec(v) atomic_subtract_int(&(v)->val, 1) +#define mrsas_atomic_inc(v) atomic_add_int(&(v)->val, 1) /* IOCInit Request message */ typedef struct _MPI2_IOC_INIT_REQUEST { Modified: stable/12/sys/kern/uipc_mqueue.c ============================================================================== --- stable/12/sys/kern/uipc_mqueue.c Tue Nov 20 00:43:14 2018 (r340657) +++ stable/12/sys/kern/uipc_mqueue.c Tue Nov 20 00:55:51 2018 (r340658) @@ -393,7 +393,7 @@ mqnode_free(struct mqfs_node *node) static __inline void mqnode_addref(struct mqfs_node *node) { - atomic_fetchadd_int(&node->mn_refcount, 1); + atomic_add_int(&node->mn_refcount, 1); } static __inline void Modified: stable/12/sys/kern/vfs_bio.c ============================================================================== --- stable/12/sys/kern/vfs_bio.c Tue Nov 20 00:43:14 2018 (r340657) +++ stable/12/sys/kern/vfs_bio.c Tue Nov 20 00:55:51 2018 (r340658) @@ -1656,7 +1656,7 @@ buf_alloc(struct bufdomain *bd) if (freebufs > 0) bp = uma_zalloc(buf_zone, M_NOWAIT); if (bp == NULL) { - atomic_fetchadd_int(&bd->bd_freebuffers, 1); + atomic_add_int(&bd->bd_freebuffers, 1); bufspace_daemon_wakeup(bd); counter_u64_add(numbufallocfails, 1); return (NULL); From owner-svn-src-all@freebsd.org Tue Nov 20 00:56:56 2018 Return-Path: Delivered-To: svn-src-all@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 1A0FD113147C; Tue, 20 Nov 2018 00:56:56 +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 B45686D83F; Tue, 20 Nov 2018 00:56:55 +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 955841ADA; Tue, 20 Nov 2018 00:56:55 +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 wAK0utn9096919; Tue, 20 Nov 2018 00:56:55 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAK0utEd096917; Tue, 20 Nov 2018 00:56:55 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201811200056.wAK0utEd096917@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 20 Nov 2018 00:56:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r340659 - in stable/12/sys: kern vm X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in stable/12/sys: kern vm X-SVN-Commit-Revision: 340659 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B45686D83F X-Spamd-Result: default: False [0.34 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-0.01)[-0.012,0]; NEURAL_SPAM_SHORT(0.35)[0.351,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Nov 2018 00:56:56 -0000 Author: markj Date: Tue Nov 20 00:56:54 2018 New Revision: 340659 URL: https://svnweb.freebsd.org/changeset/base/340659 Log: MFC r340205: Avoid specifying VM_PROT_EXECUTE in mappings from pipe_map and exec_map. Modified: stable/12/sys/kern/sys_pipe.c stable/12/sys/vm/vm_kern.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/kern/sys_pipe.c ============================================================================== --- stable/12/sys/kern/sys_pipe.c Tue Nov 20 00:55:51 2018 (r340658) +++ stable/12/sys/kern/sys_pipe.c Tue Nov 20 00:56:54 2018 (r340659) @@ -509,9 +509,8 @@ retry: size = round_page(size); buffer = (caddr_t) vm_map_min(pipe_map); - error = vm_map_find(pipe_map, NULL, 0, - (vm_offset_t *) &buffer, size, 0, VMFS_ANY_SPACE, - VM_PROT_ALL, VM_PROT_ALL, 0); + error = vm_map_find(pipe_map, NULL, 0, (vm_offset_t *)&buffer, size, 0, + VMFS_ANY_SPACE, VM_PROT_RW, VM_PROT_RW, 0); if (error != KERN_SUCCESS) { if ((cpipe->pipe_buffer.buffer == NULL) && (size > SMALL_PIPE_SIZE)) { Modified: stable/12/sys/vm/vm_kern.c ============================================================================== --- stable/12/sys/vm/vm_kern.c Tue Nov 20 00:55:51 2018 (r340658) +++ stable/12/sys/vm/vm_kern.c Tue Nov 20 00:56:54 2018 (r340659) @@ -650,8 +650,8 @@ kmap_alloc_wait(vm_map_t map, vm_size_t size) map->needs_wakeup = TRUE; vm_map_unlock_and_wait(map, 0); } - vm_map_insert(map, NULL, 0, addr, addr + size, VM_PROT_ALL, - VM_PROT_ALL, MAP_ACC_CHARGED); + vm_map_insert(map, NULL, 0, addr, addr + size, VM_PROT_RW, VM_PROT_RW, + MAP_ACC_CHARGED); vm_map_unlock(map); return (addr); } From owner-svn-src-all@freebsd.org Tue Nov 20 00:57:26 2018 Return-Path: Delivered-To: svn-src-all@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 3E93A11314E4; Tue, 20 Nov 2018 00:57:26 +0000 (UTC) (envelope-from chmeeedalf@gmail.com) Received: from mail-lf1-f43.google.com (mail-lf1-f43.google.com [209.85.167.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 741986D977; Tue, 20 Nov 2018 00:57:25 +0000 (UTC) (envelope-from chmeeedalf@gmail.com) Received: by mail-lf1-f43.google.com with SMTP id a16so140709lfg.3; Mon, 19 Nov 2018 16:57:25 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=RH4N6AxcRodRpzAn/ivc5wqk6Qye9auOzX/L5QAEhxo=; b=d/4+qjGt7B7cLXlVCe/HLSs+EE/yACQpUr8OToa9FdEasWHt5WqyKoGk9fMgp3zZMs phXlKXuplFizx2gyQFJfW++mwNPajVu+KizUAFUCYTwdOb6elNxfBKXKIY9qgFUtBRMY QXVDlCq9Aa3WZ6FxfXB2iUICbawQB1RSKThERwzuW7Wk7vIl7i/hjXqjBL0wbL2J7XcF IvWeyfvR4/bEZYWSEU2ARdfDqm441rN1aBG3Cigs2ZBvFsZMDRQo+iF2tlohWH46sEhE tBRUSkokR9zAtdeAjFoAUs2eK32DwuR1FtKasklj8aXaWRTpfOvkwHWW22cn9tIJKxWY BO4w== X-Gm-Message-State: AGRZ1gJZNfUTDrSrj2VsCrg13m9viCfqQCSS2JE6NrZC/kCAAFLciYto AtKpAlp1YLpciHr5fQpguQI0TJZ8luTKdjMgd+DzwDg7 X-Google-Smtp-Source: AJdET5eq5isxxSVvyJ4XntNzFr7KI6yoveYxtmNWClLb24ySDjGRurd1LzytIz4HrWD9ODzoSM8RA1fgZcblrETdu48= X-Received: by 2002:a19:9904:: with SMTP id b4mr11365582lfe.95.1542675126913; Mon, 19 Nov 2018 16:52:06 -0800 (PST) MIME-Version: 1.0 References: <201811192354.wAJNsnUu065339@repo.freebsd.org> <5bb6d4a3-57e0-6008-3e6a-4bad77fd3108@freebsd.org> In-Reply-To: <5bb6d4a3-57e0-6008-3e6a-4bad77fd3108@freebsd.org> From: Justin Hibbits Date: Mon, 19 Nov 2018 18:51:55 -0600 Message-ID: Subject: Re: svn commit: r340653 - in head/sys/powerpc: fpu include powerpc To: Nathan Whitehorn Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org X-Rspamd-Queue-Id: 741986D977 X-Spamd-Result: default: False [-3.02 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.99)[-0.990,0]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; RCVD_TLS_LAST(0.00)[]; DMARC_NA(0.00)[freebsd.org]; TO_DN_SOME(0.00)[]; IP_SCORE(-1.03)[ipnet: 209.85.128.0/17(-3.41), asn: 15169(-1.65), country: US(-0.09)]; MX_GOOD(-0.01)[cached: alt3.gmail-smtp-in.l.google.com]; NEURAL_HAM_SHORT(-0.98)[-0.983,0]; RCVD_IN_DNSWL_NONE(0.00)[43.167.85.209.list.dnswl.org : 127.0.5.0]; FORGED_SENDER(0.30)[jhibbits@freebsd.org,chmeeedalf@gmail.com]; R_DKIM_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; FROM_NEQ_ENVFROM(0.00)[jhibbits@freebsd.org,chmeeedalf@gmail.com]; RCVD_COUNT_TWO(0.00)[2] X-Rspamd-Server: mx1.freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Nov 2018 00:57:26 -0000 Well, this is to allow a retry in case the cache wasn't properly flushed already. This came about because the blrl instruction in the GOT was seen as an illegal instruction, and it didn't seem to matter if I synced in pmap_enter(), it would still SIGILL probabilistically. Since this block was already present for a reason it made sense to make it actually functional, since it does solve that problem. I don't know if there's yet another hardware errata on the e500, regarding caching, because I would expect a page load like this to get synced no matter the load address. - Justin On Mon, Nov 19, 2018, 18:14 Nathan Whitehorn Is this reasonable? What if the junk in the cache happened to be a > *valid* instruction? Won't this approach result in silent corruption and > later failure? > -Nathan > > On 11/19/18 3:54 PM, Justin Hibbits wrote: > > Author: jhibbits > > Date: Mon Nov 19 23:54:49 2018 > > New Revision: 340653 > > URL: https://svnweb.freebsd.org/changeset/base/340653 > > > > Log: > > powerpc: Sync icache on SIGILL, in case of cache issues > > > > The update of jemalloc to 5.1.0 exposed a cache syncing issue on a > Freescale > > e500 base system. There was already code in the FPU emulator to > address > > this, but it was limited to a single static variable, and did not > attempt to > > sync the cache. This pulls that out to the higher level program > exception > > handler, and syncs the cache. > > > > If a SIGILL is hit a second time at the same address, it will be > treated as > > a real illegal instruction, and handled accordingly. > > > > Modified: > > head/sys/powerpc/fpu/fpu_emu.c > > head/sys/powerpc/include/pcb.h > > head/sys/powerpc/powerpc/exec_machdep.c > > > > Modified: head/sys/powerpc/fpu/fpu_emu.c > > > ============================================================================== > > --- head/sys/powerpc/fpu/fpu_emu.c Mon Nov 19 22:18:18 2018 > (r340652) > > +++ head/sys/powerpc/fpu/fpu_emu.c Mon Nov 19 23:54:49 2018 > (r340653) > > @@ -189,7 +189,6 @@ fpu_emulate(struct trapframe *frame, struct fpu *fpf) > > { > > union instr insn; > > struct fpemu fe; > > - static int lastill = 0; > > int sig; > > > > /* initialize insn.is_datasize to tell it is *not* initialized */ > > @@ -243,17 +242,11 @@ fpu_emulate(struct trapframe *frame, struct fpu > *fpf) > > opc_disasm(frame->srr0, insn.i_int); > > } > > #endif > > - /* > > - * XXXX retry an illegal insn once due to cache issues. > > - */ > > - if (lastill == frame->srr0) { > > - sig = SIGILL; > > + sig = SIGILL; > > #ifdef DEBUG > > - if (fpe_debug & FPE_EX) > > - kdb_enter(KDB_WHY_UNSET, "illegal > instruction"); > > + if (fpe_debug & FPE_EX) > > + kdb_enter(KDB_WHY_UNSET, "illegal instruction"); > > #endif > > - } > > - lastill = frame->srr0; > > break; > > } > > > > > > Modified: head/sys/powerpc/include/pcb.h > > > ============================================================================== > > --- head/sys/powerpc/include/pcb.h Mon Nov 19 22:18:18 2018 > (r340652) > > +++ head/sys/powerpc/include/pcb.h Mon Nov 19 23:54:49 2018 > (r340653) > > @@ -89,6 +89,7 @@ struct pcb { > > register_t dbcr0; > > } booke; > > } pcb_cpu; > > + vm_offset_t pcb_lastill; /* Last illegal instruction */ > > }; > > #endif > > > > > > Modified: head/sys/powerpc/powerpc/exec_machdep.c > > > ============================================================================== > > --- head/sys/powerpc/powerpc/exec_machdep.c Mon Nov 19 22:18:18 2018 > (r340652) > > +++ head/sys/powerpc/powerpc/exec_machdep.c Mon Nov 19 23:54:49 2018 > (r340653) > > @@ -94,6 +94,8 @@ __FBSDID("$FreeBSD$"); > > #include > > #include > > > > +#include > > + > > #ifdef FPU_EMU > > #include > > #endif > > @@ -1099,6 +1101,14 @@ ppc_instr_emulate(struct trapframe *frame, struct > pcb > > } > > sig = fpu_emulate(frame, &pcb->pcb_fpu); > > #endif > > + if (sig == SIGILL) { > > + if (pcb->pcb_lastill != frame->srr0) { > > + /* Allow a second chance, in case of cache sync > issues. */ > > + sig = 0; > > + pmap_sync_icache(PCPU_GET(curpmap), frame->srr0, > 4); > > + pcb->pcb_lastill = frame->srr0; > > + } > > + } > > > > return (sig); > > } > > > > From owner-svn-src-all@freebsd.org Tue Nov 20 01:12:22 2018 Return-Path: Delivered-To: svn-src-all@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 A7EAA1131CA9; Tue, 20 Nov 2018 01:12:22 +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 4E20F6E270; Tue, 20 Nov 2018 01:12:22 +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 30E2D1DF8; Tue, 20 Nov 2018 01:12:22 +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 wAK1CMVN007354; Tue, 20 Nov 2018 01:12:22 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAK1CL9m007353; Tue, 20 Nov 2018 01:12:21 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201811200112.wAK1CL9m007353@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 20 Nov 2018 01:12:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r340660 - in stable/11/sys: kern vm X-SVN-Group: stable-11 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in stable/11/sys: kern vm X-SVN-Commit-Revision: 340660 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4E20F6E270 X-Spamd-Result: default: False [0.34 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-0.01)[-0.012,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.35)[0.351,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Nov 2018 01:12:22 -0000 Author: markj Date: Tue Nov 20 01:12:21 2018 New Revision: 340660 URL: https://svnweb.freebsd.org/changeset/base/340660 Log: MFC r340205: Avoid specifying VM_PROT_EXECUTE in mappings from pipe_map and exec_map. Modified: stable/11/sys/kern/sys_pipe.c stable/11/sys/vm/vm_kern.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/kern/sys_pipe.c ============================================================================== --- stable/11/sys/kern/sys_pipe.c Tue Nov 20 00:56:54 2018 (r340659) +++ stable/11/sys/kern/sys_pipe.c Tue Nov 20 01:12:21 2018 (r340660) @@ -511,9 +511,8 @@ retry: size = round_page(size); buffer = (caddr_t) vm_map_min(pipe_map); - error = vm_map_find(pipe_map, NULL, 0, - (vm_offset_t *) &buffer, size, 0, VMFS_ANY_SPACE, - VM_PROT_ALL, VM_PROT_ALL, 0); + error = vm_map_find(pipe_map, NULL, 0, (vm_offset_t *)&buffer, size, 0, + VMFS_ANY_SPACE, VM_PROT_RW, VM_PROT_RW, 0); if (error != KERN_SUCCESS) { if ((cpipe->pipe_buffer.buffer == NULL) && (size > SMALL_PIPE_SIZE)) { Modified: stable/11/sys/vm/vm_kern.c ============================================================================== --- stable/11/sys/vm/vm_kern.c Tue Nov 20 00:56:54 2018 (r340659) +++ stable/11/sys/vm/vm_kern.c Tue Nov 20 01:12:21 2018 (r340660) @@ -461,8 +461,8 @@ kmap_alloc_wait(vm_map_t map, vm_size_t size) map->needs_wakeup = TRUE; vm_map_unlock_and_wait(map, 0); } - vm_map_insert(map, NULL, 0, addr, addr + size, VM_PROT_ALL, - VM_PROT_ALL, MAP_ACC_CHARGED); + vm_map_insert(map, NULL, 0, addr, addr + size, VM_PROT_RW, VM_PROT_RW, + MAP_ACC_CHARGED); vm_map_unlock(map); return (addr); } From owner-svn-src-all@freebsd.org Tue Nov 20 01:52:46 2018 Return-Path: Delivered-To: svn-src-all@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 D62EF1135FA9; Tue, 20 Nov 2018 01:52:46 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.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 6CC1070BE9; Tue, 20 Nov 2018 01:52:46 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4D63D26C7; Tue, 20 Nov 2018 01:52:46 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAK1qkf0027879; Tue, 20 Nov 2018 01:52:46 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAK1qk4k027878; Tue, 20 Nov 2018 01:52:46 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201811200152.wAK1qk4k027878@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Tue, 20 Nov 2018 01:52:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340661 - head/sys/fs/nfsserver X-SVN-Group: head X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: head/sys/fs/nfsserver X-SVN-Commit-Revision: 340661 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 6CC1070BE9 X-Spamd-Result: default: False [0.42 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_MEDIUM(0.02)[0.018,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.41)[0.405,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Nov 2018 01:52:47 -0000 Author: rmacklem Date: Tue Nov 20 01:52:45 2018 New Revision: 340661 URL: https://svnweb.freebsd.org/changeset/base/340661 Log: r304026 added code that started statistics gathering for an operation before the operation number (the variable called "op") was sanity checked. This patch moves the code down to below the range sanity check for "op". Modified: head/sys/fs/nfsserver/nfs_nfsdsocket.c Modified: head/sys/fs/nfsserver/nfs_nfsdsocket.c ============================================================================== --- head/sys/fs/nfsserver/nfs_nfsdsocket.c Tue Nov 20 01:12:21 2018 (r340660) +++ head/sys/fs/nfsserver/nfs_nfsdsocket.c Tue Nov 20 01:52:45 2018 (r340661) @@ -766,11 +766,6 @@ nfsrvd_compound(struct nfsrv_descript *nd, int isdgram *repp = *tl; op = fxdr_unsigned(int, *tl); NFSD_DEBUG(4, "op=%d\n", op); - - binuptime(&start_time); - nfsrvd_statstart(op, &start_time); - statsinprog = 1; - if (op < NFSV4OP_ACCESS || (op >= NFSV4OP_NOPS && (nd->nd_flag & ND_NFSV41) == 0) || (op >= NFSV41_NOPS && (nd->nd_flag & ND_NFSV41) != 0)) { @@ -782,6 +777,11 @@ nfsrvd_compound(struct nfsrv_descript *nd, int isdgram } else { repp++; } + + binuptime(&start_time); + nfsrvd_statstart(op, &start_time); + statsinprog = 1; + if (i == 0) op0 = op; if (i == numops - 1) From owner-svn-src-all@freebsd.org Tue Nov 20 01:56:35 2018 Return-Path: Delivered-To: svn-src-all@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 4C5FA113667F; Tue, 20 Nov 2018 01:56:35 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.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 E7AA87109E; Tue, 20 Nov 2018 01:56:34 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C7DBB26DD; Tue, 20 Nov 2018 01:56:34 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAK1uYpW028224; Tue, 20 Nov 2018 01:56:34 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAK1uY8S028223; Tue, 20 Nov 2018 01:56:34 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201811200156.wAK1uY8S028223@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Tue, 20 Nov 2018 01:56:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340662 - head/sys/fs/nfs X-SVN-Group: head X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: head/sys/fs/nfs X-SVN-Commit-Revision: 340662 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E7AA87109E X-Spamd-Result: default: False [0.42 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_MEDIUM(0.02)[0.018,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.41)[0.405,0]; NEURAL_HAM_LONG(-0.00)[-0.003,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Nov 2018 01:56:35 -0000 Author: rmacklem Date: Tue Nov 20 01:56:34 2018 New Revision: 340662 URL: https://svnweb.freebsd.org/changeset/base/340662 Log: nfsm_advance() would panic() when the offs argument was negative. The code assumed that this would indicate a corrupted mbuf chain, but it could simply be caused by bogus RPC message data. This patch replaces the panic() with a printf() plus error return. MFC after: 1 week Modified: head/sys/fs/nfs/nfs_commonsubs.c Modified: head/sys/fs/nfs/nfs_commonsubs.c ============================================================================== --- head/sys/fs/nfs/nfs_commonsubs.c Tue Nov 20 01:52:45 2018 (r340661) +++ head/sys/fs/nfs/nfs_commonsubs.c Tue Nov 20 01:56:34 2018 (r340662) @@ -725,10 +725,14 @@ nfsm_advance(struct nfsrv_descript *nd, int offs, int if (offs == 0) goto out; /* - * A negative offs should be considered a serious problem. + * A negative offs might indicate a corrupted mbuf chain and, + * as such, a printf is logged. */ - if (offs < 0) - panic("nfsrv_advance"); + if (offs < 0) { + printf("nfsrv_advance: negative offs\n"); + error = EBADRPC; + goto out; + } /* * If left == -1, calculate it here. From owner-svn-src-all@freebsd.org Tue Nov 20 01:59:58 2018 Return-Path: Delivered-To: svn-src-all@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 6C9F41136D11; Tue, 20 Nov 2018 01:59:58 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.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 0CAE47159B; Tue, 20 Nov 2018 01:59:58 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D6D302709; Tue, 20 Nov 2018 01:59:57 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAK1xvHD028409; Tue, 20 Nov 2018 01:59:57 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAK1xvjj028408; Tue, 20 Nov 2018 01:59:57 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201811200159.wAK1xvjj028408@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Tue, 20 Nov 2018 01:59:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340663 - head/sys/fs/nfsserver X-SVN-Group: head X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: head/sys/fs/nfsserver X-SVN-Commit-Revision: 340663 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 0CAE47159B X-Spamd-Result: default: False [0.52 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_MEDIUM(0.02)[0.018,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.51)[0.507,0]; NEURAL_HAM_LONG(-0.00)[-0.003,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Nov 2018 01:59:58 -0000 Author: rmacklem Date: Tue Nov 20 01:59:57 2018 New Revision: 340663 URL: https://svnweb.freebsd.org/changeset/base/340663 Log: Improve sanity checking for the dircount hint argument to NFSv3's ReaddirPlus and NFSv4's Readdir operations. The code checked for a zero argument, but did not check for a very large value. This patch clips dircount at the server's maximum data size. MFC after: 1 week Modified: head/sys/fs/nfsserver/nfs_nfsdport.c Modified: head/sys/fs/nfsserver/nfs_nfsdport.c ============================================================================== --- head/sys/fs/nfsserver/nfs_nfsdport.c Tue Nov 20 01:56:34 2018 (r340662) +++ head/sys/fs/nfsserver/nfs_nfsdport.c Tue Nov 20 01:59:57 2018 (r340663) @@ -2107,9 +2107,15 @@ nfsrvd_readdirplus(struct nfsrv_descript *nd, int isdg * cookie) should be in the reply. At least one client "hints" 0, * so I set it to cnt for that case. I also round it up to the * next multiple of DIRBLKSIZ. + * Since the size of a Readdirplus directory entry reply will always + * be greater than a directory entry returned by VOP_READDIR(), it + * does not make sense to read more than NFS_SRVMAXDATA() via + * VOP_READDIR(). */ if (siz <= 0) siz = cnt; + else if (siz > NFS_SRVMAXDATA(nd)) + siz = NFS_SRVMAXDATA(nd); siz = ((siz + DIRBLKSIZ - 1) & ~(DIRBLKSIZ - 1)); if (nd->nd_flag & ND_NFSV4) { From owner-svn-src-all@freebsd.org Tue Nov 20 02:08:35 2018 Return-Path: Delivered-To: svn-src-all@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 8FED211378DE; Tue, 20 Nov 2018 02:08:35 +0000 (UTC) (envelope-from rmacklem@uoguelph.ca) Received: from CAN01-QB1-obe.outbound.protection.outlook.com (mail-eopbgr660047.outbound.protection.outlook.com [40.107.66.47]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (Client CN "mail.protection.outlook.com", Issuer "GlobalSign Organization Validation CA - SHA256 - G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1168E71E7E; Tue, 20 Nov 2018 02:08:33 +0000 (UTC) (envelope-from rmacklem@uoguelph.ca) Received: from YTOPR0101MB1162.CANPRD01.PROD.OUTLOOK.COM (52.132.50.155) by YTOPR0101MB2187.CANPRD01.PROD.OUTLOOK.COM (52.132.48.154) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1294.26; Tue, 20 Nov 2018 02:08:26 +0000 Received: from YTOPR0101MB1162.CANPRD01.PROD.OUTLOOK.COM ([fe80::9c71:6eb6:1bff:727b]) by YTOPR0101MB1162.CANPRD01.PROD.OUTLOOK.COM ([fe80::9c71:6eb6:1bff:727b%5]) with mapi id 15.20.1294.045; Tue, 20 Nov 2018 02:08:26 +0000 From: Rick Macklem To: Rick Macklem , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Subject: Re: svn commit: r340661 - head/sys/fs/nfsserver Thread-Topic: svn commit: r340661 - head/sys/fs/nfsserver Thread-Index: AQHUgHPGJVIWZzJhUUyXdP8brmipMaVX6et5 Date: Tue, 20 Nov 2018 02:08:26 +0000 Message-ID: References: <201811200152.wAK1qk4k027878@repo.freebsd.org> In-Reply-To: <201811200152.wAK1qk4k027878@repo.freebsd.org> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=rmacklem@uoguelph.ca; x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; YTOPR0101MB2187; 6:9zs71kiXKrvrSQYKoJ+NlzWXsg3n3uJtvEa5wdr3POJXOcQLpjV8/AReYLertKp0WBpU6YLgJjWFPTlIAdXUJMca7VRz0tPP0U01WAg7n50V2UnYB6DaNp5b2LPtbqcb6wWAjnsPhdbtrBD8Qn7WSv+e/m/XMRkPUBpaihuD69EdPKo2GH7bGqhnSC+jAddhYZUu85n9MUvuM/LhkPxuNOMyFPtMXd6vpS9tBjb8ML9OENvR3OKWHf6eBseXrLAY9g03RppJZralVj+ohWCGHgAL3logX3w8O+tOfu6Ueyj+B+ROauBVGtWB4iEvn5XXhWuKgaPU7rIvhF6ZKBrYM1JPEvlqto0o4i3x9zpDrgRR80XNNaLmVZnJIX7Ranfb4RiBqrbMuWjsDpLxAQCDOh+P/7kIyS9ZkBweASJ1bIy+YELiGERb9U305wg8MDaWt+qmyQctmDx+QBeRn2cZMQ==; 5:d6ZjsLDn4pAMJI/XJpMDLwyd2PODg/jjFbpyaEgVT9A3ax8kG0Ss/LCTPdKvGsUMW2ztiIr8s1niqUWIY1x7+xpe9TUM3s05rjCy0InOFh3gspYXzUxakUunuvR+pvjM0l8N7JJ0f/1LqioXSJuvDbbgD5gcqzc2ABf900o6keI=; 7:TKMbggDkZ7A5x0oQPSFjFvDuR9L6iUo2R8iWK2vveQszjq+pAWYBH6/+q8szuhUioGJLBImprpFrG5M9IItmqf4YPFLEwEnqrVxWIuXfIsJvYarGTJXXysVe/ivqp9fNOj2G11IcGrX3JlddIEzEVg== x-ms-exchange-antispam-srfa-diagnostics: SOS; x-ms-office365-filtering-correlation-id: c02de492-e4ef-4657-1160-08d64e8d0ee1 x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390098)(7020095)(4652040)(8989299)(5600074)(711020)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(2017052603328)(7153060)(7193020); SRVR:YTOPR0101MB2187; x-ms-traffictypediagnostic: YTOPR0101MB2187: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(56005881305849); x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(6040522)(2401047)(5005006)(8121501046)(3231442)(944501410)(52105112)(10201501046)(3002001)(93006095)(93001095)(148016)(149066)(150057)(6041310)(20161123560045)(20161123562045)(20161123564045)(201703131423095)(201702281529075)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(201708071742011)(7699051)(76991095); SRVR:YTOPR0101MB2187; BCL:0; PCL:0; RULEID:; SRVR:YTOPR0101MB2187; x-forefront-prvs: 08626BE3A5 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(346002)(396003)(39860400002)(136003)(366004)(376002)(189003)(199004)(6506007)(14454004)(7696005)(2900100001)(74316002)(76176011)(102836004)(256004)(71200400001)(966005)(71190400001)(5660300001)(68736007)(2906002)(110136005)(86362001)(2201001)(33656002)(74482002)(316002)(786003)(106356001)(478600001)(46003)(9686003)(53936002)(476003)(6306002)(6436002)(105586002)(55016002)(11346002)(446003)(6246003)(8936002)(8676002)(2501003)(81156014)(81166006)(25786009)(97736004)(186003)(450100002)(229853002)(486006)(305945005)(99286004); DIR:OUT; SFP:1101; SCL:1; SRVR:YTOPR0101MB2187; H:YTOPR0101MB1162.CANPRD01.PROD.OUTLOOK.COM; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: uoguelph.ca does not designate permitted sender hosts) x-microsoft-antispam-message-info: zsMGht5C9ZpCkDkUsF922tNKyXSdTINxoj+W6dNezn01CX2RxXPKFH0PIvoG3r6ETTgZylpWLhoGUK/or/2WC+7d6CgyCBmNZJXdM9CaLE9LRZ94GWUq3SVnaRt+b3PbM+pin422I9DTS44d9rTMVqFR+FjnoeaiYmnJ23Uu78kPkAzhOmOjgvGeGkotO15AuR1HBdWLul9JpykwWVpgTjOFYtTM4Fnq9BnWb3L4bnTuibSU2dZhtJ/T+ztCqeSXVuylq2uicKURO5p63OnpPCg+RTs5zRn3X2epRZdLGUxQiXyYqwuhdUnQhz+ZWb/jKh7DNEXRz0IR9tqv+NnJ1lyZUjEux+TFWHbSx5l/oS8= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: uoguelph.ca X-MS-Exchange-CrossTenant-Network-Message-Id: c02de492-e4ef-4657-1160-08d64e8d0ee1 X-MS-Exchange-CrossTenant-originalarrivaltime: 20 Nov 2018 02:08:26.4999 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: be62a12b-2cad-49a1-a5fa-85f4f3156a7d X-MS-Exchange-Transport-CrossTenantHeadersStamped: YTOPR0101MB2187 X-Rspamd-Queue-Id: 1168E71E7E X-Spamd-Result: default: False [-3.86 / 15.00]; ARC_NA(0.00)[]; TO_DN_EQ_ADDR_SOME(0.00)[]; NEURAL_HAM_MEDIUM(-0.98)[-0.978,0]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_SPF_ALLOW(-0.20)[+ip4:40.107.0.0/17]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[uoguelph.ca]; NEURAL_HAM_LONG(-0.96)[-0.962,0]; TO_DN_SOME(0.00)[]; RCVD_COUNT_THREE(0.00)[3]; MX_GOOD(-0.01)[mx2.hc184-76.ca.iphmx.com,mx1.hc184-76.ca.iphmx.com,mx2.hc184-76.ca.iphmx.com,mx1.hc184-76.ca.iphmx.com,mx2.hc184-76.ca.iphmx.com,mx1.hc184-76.ca.iphmx.com,mx2.hc184-76.ca.iphmx.com,mx1.hc184-76.ca.iphmx.com,mx2.hc184-76.ca.iphmx.com,mx1.hc184-76.ca.iphmx.com,mx2.hc184-76.ca.iphmx.com,mx1.hc184-76.ca.iphmx.com,mx2.hc184-76.ca.iphmx.com,mx1.hc184-76.ca.iphmx.com,mx2.hc184-76.ca.iphmx.com,mx1.hc184-76.ca.iphmx.com,mx2.hc184-76.ca.iphmx.com,mx1.hc184-76.ca.iphmx.com,mx2.hc184-76.ca.iphmx.com,mx1.hc184-76.ca.iphmx.com,mx2.hc184-76.ca.iphmx.com,mx1.hc184-76.ca.iphmx.com,mx2.hc184-76.ca.iphmx.com,mx1.hc184-76.ca.iphmx.com,mx2.hc184-76.ca.iphmx.com,mx1.hc184-76.ca.iphmx.com,mx2.hc184-76.ca.iphmx.com,mx1.hc184-76.ca.iphmx.com,mx2.hc184-76.ca.iphmx.com,mx1.hc184-76.ca.iphmx.com]; NEURAL_HAM_SHORT(-0.91)[-0.912,0]; RCVD_IN_DNSWL_NONE(0.00)[47.66.107.40.list.dnswl.org : 127.0.3.0]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:8075, ipnet:40.64.0.0/10, country:US]; IP_SCORE(-0.70)[ipnet: 40.64.0.0/10(-1.60), asn: 8075(-1.80), country: US(-0.09)] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Nov 2018 02:08:35 -0000 >Author: rmacklem >Date: Tue Nov 20 01:52:45 2018 >New Revision: 340661 >URL: https://svnweb.freebsd.org/changeset/base/340661 > >Log: > r304026 added code that started statistics gathering for an operation > before the operation number (the variable called "op") was sanity checke= d. > This patch moves the code down to below the range sanity check for "op". I missed... MFC: 1 week Discussed with: emaste (the Discussed with should also have been on r340662 and r340663) rick [commit stuff snipped] From owner-svn-src-all@freebsd.org Tue Nov 20 07:11:24 2018 Return-Path: Delivered-To: svn-src-all@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 A89581102E41; Tue, 20 Nov 2018 07:11:24 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 50E087D617; Tue, 20 Nov 2018 07:11:24 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 30C3F6116; Tue, 20 Nov 2018 07:11:24 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAK7BOGr092248; Tue, 20 Nov 2018 07:11:24 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAK7BOcX092247; Tue, 20 Nov 2018 07:11:24 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201811200711.wAK7BOcX092247@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Tue, 20 Nov 2018 07:11:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340664 - head/sys/sys X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/sys X-SVN-Commit-Revision: 340664 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 50E087D617 X-Spamd-Result: default: False [0.50 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.00)[0.001,0]; NEURAL_SPAM_MEDIUM(0.03)[0.027,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.48)[0.475,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Nov 2018 07:11:24 -0000 Author: imp Date: Tue Nov 20 07:11:23 2018 New Revision: 340664 URL: https://svnweb.freebsd.org/changeset/base/340664 Log: Ensure that all values of ns, us and ms work for {n,u,m}stosbt Integer overflows and wrong constants limited the accuracy of these functions and created situatiosn where sbttoXs(Xstosbt(Y)) != Y. This was especailly true in the ns case where we had millions of values that were wrong. Instead, used fixed constants because there's no way to say ceil(X) for integer math. Document what these crazy constants are. Also, use a shift one fewer left to avoid integer overflow causing incorrect results, and adjust the equasion accordingly. Document this. Allow times >= 1s to be well defined for these conversion functions (at least the Xstosbt). There's too many users in the tree that they work for >= 1s. This fixes a failure on boot to program firmware on the mlx4 NIC. There was a msleep(1000) in the code. Prior to my recent rounding changes, msleep(1000) worked, but msleep(1001) did not because the old code rounded to just below 2^64 and the new code rounds to just above it (overflowing, causing the msleep(1000) to really sleep 1ms). A test program to test all cases will be committed shortly. The test exaustively tries every value (thanks to bde for the test). Sponsored by: Netflix, Inc Differential Revision: https://reviews.freebsd.org/D18051 Modified: head/sys/sys/time.h Modified: head/sys/sys/time.h ============================================================================== --- head/sys/sys/time.h Tue Nov 20 01:59:57 2018 (r340663) +++ head/sys/sys/time.h Tue Nov 20 07:11:23 2018 (r340664) @@ -162,9 +162,24 @@ sbttobt(sbintime_t _sbt) * large roundoff errors which sbttons() and nstosbt() avoid. Millisecond and * microsecond functions are also provided for completeness. * - * These functions return the smallest sbt larger or equal to the number of - * seconds requested so that sbttoX(Xtosbt(y)) == y. The 1 << 32 - 1 term added - * transforms the >> 32 from floor() to ceil(). + * These functions return the smallest sbt larger or equal to the + * number of seconds requested so that sbttoX(Xtosbt(y)) == y. Unlike + * top of second computations below, which require that we tick at the + * top of second, these need to be rounded up so we do whatever for at + * least as long as requested. + * + * The naive computation we'd do is this + * ((unit * 2^64 / SIFACTOR) + 2^32-1) >> 32 + * However, that overflows. Instead, we compute + * ((unit * 2^63 / SIFACTOR) + 2^31-1) >> 32 + * and use pre-computed constants that are the ceil of the 2^63 / SIFACTOR + * term to ensure we are using exactly the right constant. We use the lesser + * evil of ull rather than a uint64_t cast to ensure we have well defined + * right shift semantics. With these changes, we get all the ns, us and ms + * conversions back and forth right. + * Note: This file is used for both kernel and userland includes, so we can't + * rely on KASSERT being defined, nor can we pollute the namespace by including + * assert.h. */ static __inline int64_t sbttons(sbintime_t _sbt) @@ -176,8 +191,18 @@ sbttons(sbintime_t _sbt) static __inline sbintime_t nstosbt(int64_t _ns) { + sbintime_t sb = 0; - return ((_ns * (((uint64_t)1 << 63) / 500000000) + (1ull << 32) - 1) >> 32); +#ifdef KASSERT + KASSERT(_ns >= 0, ("Negative values illegal for nstosbt: %jd", _ns)); +#endif + if (_ns >= SBT_1S) { + sb = (_ns / 1000000000) * SBT_1S; + _ns = _ns % 1000000000; + } + /* 9223372037 = ceil(2^63 / 1000000000) */ + sb += ((_ns * 9223372037ull) + 0x7fffffff) >> 31; + return (sb); } static __inline int64_t @@ -190,8 +215,18 @@ sbttous(sbintime_t _sbt) static __inline sbintime_t ustosbt(int64_t _us) { + sbintime_t sb = 0; - return ((_us * (((uint64_t)1 << 63) / 500000) + (1ull << 32) - 1) >> 32); +#ifdef KASSERT + KASSERT(_us >= 0, ("Negative values illegal for ustosbt: %jd", _us)); +#endif + if (_us >= SBT_1S) { + sb = (_us / 1000000) * SBT_1S; + _us = _us % 1000000; + } + /* 9223372036855 = ceil(2^63 / 1000000) */ + sb += ((_us * 9223372036855ull) + 0x7fffffff) >> 31; + return (sb); } static __inline int64_t @@ -204,8 +239,18 @@ sbttoms(sbintime_t _sbt) static __inline sbintime_t mstosbt(int64_t _ms) { + sbintime_t sb = 0; - return ((_ms * (((uint64_t)1 << 63) / 500) + (1ull << 32) - 1) >> 32); +#ifdef KASSERT + KASSERT(_ms >= 0, ("Negative values illegal for mstosbt: %jd", _ms)); +#endif + if (_ms >= SBT_1S) { + sb = (_ms / 1000) * SBT_1S; + _ms = _ms % 1000; + } + /* 9223372036854776 = ceil(2^63 / 1000) */ + sb += ((_ms * 9223372036854776ull) + 0x7fffffff) >> 31; + return (sb); } /*- From owner-svn-src-all@freebsd.org Tue Nov 20 10:01:57 2018 Return-Path: Delivered-To: svn-src-all@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 A2DD71108B66; Tue, 20 Nov 2018 10:01:57 +0000 (UTC) (envelope-from 0mp@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 3CE6183E08; Tue, 20 Nov 2018 10:01:57 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1DF4F7C20; Tue, 20 Nov 2018 10:01:57 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAKA1vKf080538; Tue, 20 Nov 2018 10:01:57 GMT (envelope-from 0mp@FreeBSD.org) Received: (from 0mp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAKA1uxh080537; Tue, 20 Nov 2018 10:01:56 GMT (envelope-from 0mp@FreeBSD.org) Message-Id: <201811201001.wAKA1uxh080537@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: 0mp set sender to 0mp@FreeBSD.org using -f From: Mateusz Piotrowski <0mp@FreeBSD.org> Date: Tue, 20 Nov 2018 10:01:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340668 - head/share/man/man7 X-SVN-Group: head X-SVN-Commit-Author: 0mp X-SVN-Commit-Paths: head/share/man/man7 X-SVN-Commit-Revision: 340668 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 3CE6183E08 X-Spamd-Result: default: False [0.66 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.65)[0.648,0]; NEURAL_HAM_LONG(-0.00)[-0.003,0]; NEURAL_SPAM_MEDIUM(0.02)[0.018,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Nov 2018 10:01:57 -0000 Author: 0mp (ports committer) Date: Tue Nov 20 10:01:56 2018 New Revision: 340668 URL: https://svnweb.freebsd.org/changeset/base/340668 Log: ports(7): Do not mention deprecated WITH_OPENSSL_PORT. Reviewed by: eadler Approved by: krion (mentor, implicit), mat (mentor, implicit) Differential Revision: https://reviews.freebsd.org/D18045 Modified: head/share/man/man7/ports.7 Modified: head/share/man/man7/ports.7 ============================================================================== --- head/share/man/man7/ports.7 Tue Nov 20 09:35:37 2018 (r340667) +++ head/share/man/man7/ports.7 Tue Nov 20 10:01:56 2018 (r340668) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 16, 2018 +.Dd November 20, 2018 .Dt PORTS 7 .Os .Sh NAME @@ -506,12 +506,6 @@ and the .Fx Porter's Handbook. .Bl -tag -width ".Va WITH_GHOSTSCRIPT_VER" -.It Va WITH_OPENSSL_PORT -.Pq Vt bool -If set, causes ports that make use of OpenSSL to use the OpenSSL from -ports -.Pq if available -instead of the OpenSSL from the base system. .It Va WITH_DEBUG .Pq Vt bool If set, debugging symbols are installed for ports binaries. From owner-svn-src-all@freebsd.org Tue Nov 20 10:43:19 2018 Return-Path: Delivered-To: svn-src-all@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 71F86110D43A; Tue, 20 Nov 2018 10:43:19 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 16CC685B92; Tue, 20 Nov 2018 10:43:19 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EC64A10438; Tue, 20 Nov 2018 10:43:18 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAKAhIih005135; Tue, 20 Nov 2018 10:43:18 GMT (envelope-from eugen@FreeBSD.org) Received: (from eugen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAKAhI6B005134; Tue, 20 Nov 2018 10:43:18 GMT (envelope-from eugen@FreeBSD.org) Message-Id: <201811201043.wAKAhI6B005134@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eugen set sender to eugen@FreeBSD.org using -f From: Eugene Grosbein Date: Tue, 20 Nov 2018 10:43:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r340669 - stable/12/sys/netinet X-SVN-Group: stable-12 X-SVN-Commit-Author: eugen X-SVN-Commit-Paths: stable/12/sys/netinet X-SVN-Commit-Revision: 340669 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 16CC685B92 X-Spamd-Result: default: False [0.61 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-0.01)[-0.012,0]; NEURAL_SPAM_SHORT(0.62)[0.617,0]; NEURAL_SPAM_LONG(0.01)[0.007,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Nov 2018 10:43:19 -0000 Author: eugen Date: Tue Nov 20 10:43:18 2018 New Revision: 340669 URL: https://svnweb.freebsd.org/changeset/base/340669 Log: MFC r339558: New sysctl: net.inet.icmp.error_keeptags Currently, icmp_error() function copies FIB number from original packet into generated ICMP response but not mbuf_tags(9) chain. This prevents us from easily matching ICMP responses corresponding to tagged original packets by means of packet filter such as ipfw(8). For example, ICMP "time-exceeded in-transit" packets usually generated in response to traceroute probes lose tags attached to original packets. This change adds new sysctl net.inet.icmp.error_keeptags that defaults to 0 to avoid extra overhead when this feature not needed. Set net.inet.icmp.error_keeptags=1 to make icmp_error() copy mbuf_tags from original packet to generated ICMP response. PR: 215874 Modified: stable/12/sys/netinet/ip_icmp.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/netinet/ip_icmp.c ============================================================================== --- stable/12/sys/netinet/ip_icmp.c Tue Nov 20 10:01:56 2018 (r340668) +++ stable/12/sys/netinet/ip_icmp.c Tue Nov 20 10:43:18 2018 (r340669) @@ -158,6 +158,12 @@ SYSCTL_INT(_net_inet_icmp, OID_AUTO, tstamprepl, CTLFL &VNET_NAME(icmptstamprepl), 0, "Respond to ICMP Timestamp packets"); +VNET_DEFINE_STATIC(int, error_keeptags) = 0; +#define V_error_keeptags VNET(error_keeptags) +SYSCTL_INT(_net_inet_icmp, OID_AUTO, error_keeptags, CTLFLAG_VNET | CTLFLAG_RW, + &VNET_NAME(error_keeptags), 0, + "ICMP error response keeps copy of mbuf_tags of original packet"); + #ifdef ICMPPRINTFS int icmpprintfs = 0; #endif @@ -370,6 +376,10 @@ stdreply: icmpelen = max(8, min(V_icmp_quotelen, ntohs nip->ip_p = IPPROTO_ICMP; nip->ip_tos = 0; nip->ip_off = 0; + + if (V_error_keeptags) + m_tag_copy_chain(m, n, M_NOWAIT); + icmp_reflect(m); freeit: From owner-svn-src-all@freebsd.org Tue Nov 20 10:44:50 2018 Return-Path: Delivered-To: svn-src-all@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 96295110D520; Tue, 20 Nov 2018 10:44:50 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3673F85D19; Tue, 20 Nov 2018 10:44:50 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 15B521043C; Tue, 20 Nov 2018 10:44:50 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAKAin8d005279; Tue, 20 Nov 2018 10:44:49 GMT (envelope-from eugen@FreeBSD.org) Received: (from eugen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAKAindQ005278; Tue, 20 Nov 2018 10:44:49 GMT (envelope-from eugen@FreeBSD.org) Message-Id: <201811201044.wAKAindQ005278@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eugen set sender to eugen@FreeBSD.org using -f From: Eugene Grosbein Date: Tue, 20 Nov 2018 10:44:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r340670 - stable/11/sys/netinet X-SVN-Group: stable-11 X-SVN-Commit-Author: eugen X-SVN-Commit-Paths: stable/11/sys/netinet X-SVN-Commit-Revision: 340670 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 3673F85D19 X-Spamd-Result: default: False [0.61 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-0.01)[-0.012,0]; NEURAL_SPAM_LONG(0.01)[0.007,0]; NEURAL_SPAM_SHORT(0.62)[0.617,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Nov 2018 10:44:50 -0000 Author: eugen Date: Tue Nov 20 10:44:49 2018 New Revision: 340670 URL: https://svnweb.freebsd.org/changeset/base/340670 Log: MFC r339558: New sysctl: net.inet.icmp.error_keeptags Currently, icmp_error() function copies FIB number from original packet into generated ICMP response but not mbuf_tags(9) chain. This prevents us from easily matching ICMP responses corresponding to tagged original packets by means of packet filter such as ipfw(8). For example, ICMP "time-exceeded in-transit" packets usually generated in response to traceroute probes lose tags attached to original packets. This change adds new sysctl net.inet.icmp.error_keeptags that defaults to 0 to avoid extra overhead when this feature not needed. Set net.inet.icmp.error_keeptags=1 to make icmp_error() copy mbuf_tags from original packet to generated ICMP response. PR: 215874 Modified: stable/11/sys/netinet/ip_icmp.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/netinet/ip_icmp.c ============================================================================== --- stable/11/sys/netinet/ip_icmp.c Tue Nov 20 10:43:18 2018 (r340669) +++ stable/11/sys/netinet/ip_icmp.c Tue Nov 20 10:44:49 2018 (r340670) @@ -155,6 +155,12 @@ SYSCTL_INT(_net_inet_icmp, OID_AUTO, tstamprepl, CTLFL &VNET_NAME(icmptstamprepl), 0, "Respond to ICMP Timestamp packets"); +VNET_DEFINE_STATIC(int, error_keeptags) = 0; +#define V_error_keeptags VNET(error_keeptags) +SYSCTL_INT(_net_inet_icmp, OID_AUTO, error_keeptags, CTLFLAG_VNET | CTLFLAG_RW, + &VNET_NAME(error_keeptags), 0, + "ICMP error response keeps copy of mbuf_tags of original packet"); + #ifdef ICMPPRINTFS int icmpprintfs = 0; #endif @@ -367,6 +373,10 @@ stdreply: icmpelen = max(8, min(V_icmp_quotelen, ntohs nip->ip_p = IPPROTO_ICMP; nip->ip_tos = 0; nip->ip_off = 0; + + if (V_error_keeptags) + m_tag_copy_chain(m, n, M_NOWAIT); + icmp_reflect(m); freeit: From owner-svn-src-all@freebsd.org Tue Nov 20 10:45:47 2018 Return-Path: Delivered-To: svn-src-all@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 143F1110D602; Tue, 20 Nov 2018 10:45:47 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AFB7585E73; Tue, 20 Nov 2018 10:45:46 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 908C81043F; Tue, 20 Nov 2018 10:45:46 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAKAjk4v005393; Tue, 20 Nov 2018 10:45:46 GMT (envelope-from eugen@FreeBSD.org) Received: (from eugen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAKAjkkc005392; Tue, 20 Nov 2018 10:45:46 GMT (envelope-from eugen@FreeBSD.org) Message-Id: <201811201045.wAKAjkkc005392@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eugen set sender to eugen@FreeBSD.org using -f From: Eugene Grosbein Date: Tue, 20 Nov 2018 10:45:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r340671 - stable/10/sys/netinet X-SVN-Group: stable-10 X-SVN-Commit-Author: eugen X-SVN-Commit-Paths: stable/10/sys/netinet X-SVN-Commit-Revision: 340671 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: AFB7585E73 X-Spamd-Result: default: False [0.61 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-0.01)[-0.012,0]; NEURAL_SPAM_SHORT(0.62)[0.617,0]; NEURAL_SPAM_LONG(0.01)[0.007,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Nov 2018 10:45:47 -0000 Author: eugen Date: Tue Nov 20 10:45:46 2018 New Revision: 340671 URL: https://svnweb.freebsd.org/changeset/base/340671 Log: MFC r339558: New sysctl: net.inet.icmp.error_keeptags Currently, icmp_error() function copies FIB number from original packet into generated ICMP response but not mbuf_tags(9) chain. This prevents us from easily matching ICMP responses corresponding to tagged original packets by means of packet filter such as ipfw(8). For example, ICMP "time-exceeded in-transit" packets usually generated in response to traceroute probes lose tags attached to original packets. This change adds new sysctl net.inet.icmp.error_keeptags that defaults to 0 to avoid extra overhead when this feature not needed. Set net.inet.icmp.error_keeptags=1 to make icmp_error() copy mbuf_tags from original packet to generated ICMP response. PR: 215874 Modified: stable/10/sys/netinet/ip_icmp.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/netinet/ip_icmp.c ============================================================================== --- stable/10/sys/netinet/ip_icmp.c Tue Nov 20 10:44:49 2018 (r340670) +++ stable/10/sys/netinet/ip_icmp.c Tue Nov 20 10:45:46 2018 (r340671) @@ -148,6 +148,12 @@ static VNET_DEFINE(int, icmptstamprepl) = 1; SYSCTL_INT(_net_inet_icmp, OID_AUTO, tstamprepl, CTLFLAG_RW, &VNET_NAME(icmptstamprepl), 0, "Respond to ICMP Timestamp packets"); +VNET_DEFINE_STATIC(int, error_keeptags) = 0; +#define V_error_keeptags VNET(error_keeptags) +SYSCTL_INT(_net_inet_icmp, OID_AUTO, error_keeptags, CTLFLAG_VNET | CTLFLAG_RW, + &VNET_NAME(error_keeptags), 0, + "ICMP error response keeps copy of mbuf_tags of original packet"); + #ifdef ICMPPRINTFS int icmpprintfs = 0; #endif @@ -347,6 +353,10 @@ stdreply: icmpelen = max(8, min(V_icmp_quotelen, ntohs nip->ip_p = IPPROTO_ICMP; nip->ip_tos = 0; nip->ip_off = 0; + + if (V_error_keeptags) + m_tag_copy_chain(m, n, M_NOWAIT); + icmp_reflect(m); freeit: From owner-svn-src-all@freebsd.org Tue Nov 20 11:19:03 2018 Return-Path: Delivered-To: svn-src-all@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 6CCD611217EC; Tue, 20 Nov 2018 11:19:03 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 14161870DB; Tue, 20 Nov 2018 11:19:03 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E925510943; Tue, 20 Nov 2018 11:19:02 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAKBJ2hF020995; Tue, 20 Nov 2018 11:19:02 GMT (envelope-from eugen@FreeBSD.org) Received: (from eugen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAKBJ2aC020994; Tue, 20 Nov 2018 11:19:02 GMT (envelope-from eugen@FreeBSD.org) Message-Id: <201811201119.wAKBJ2aC020994@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eugen set sender to eugen@FreeBSD.org using -f From: Eugene Grosbein Date: Tue, 20 Nov 2018 11:19:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r340672 - stable/10/sys/netinet X-SVN-Group: stable-10 X-SVN-Commit-Author: eugen X-SVN-Commit-Paths: stable/10/sys/netinet X-SVN-Commit-Revision: 340672 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 14161870DB X-Spamd-Result: default: False [0.12 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.06)[-0.058,0]; NEURAL_SPAM_LONG(0.01)[0.007,0]; NEURAL_SPAM_MEDIUM(0.17)[0.172,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Nov 2018 11:19:03 -0000 Author: eugen Date: Tue Nov 20 11:19:02 2018 New Revision: 340672 URL: https://svnweb.freebsd.org/changeset/base/340672 Log: Unbreak build after r340671. This is direct commit to stable/10. Modified: stable/10/sys/netinet/ip_icmp.c Modified: stable/10/sys/netinet/ip_icmp.c ============================================================================== --- stable/10/sys/netinet/ip_icmp.c Tue Nov 20 10:45:46 2018 (r340671) +++ stable/10/sys/netinet/ip_icmp.c Tue Nov 20 11:19:02 2018 (r340672) @@ -148,7 +148,7 @@ static VNET_DEFINE(int, icmptstamprepl) = 1; SYSCTL_INT(_net_inet_icmp, OID_AUTO, tstamprepl, CTLFLAG_RW, &VNET_NAME(icmptstamprepl), 0, "Respond to ICMP Timestamp packets"); -VNET_DEFINE_STATIC(int, error_keeptags) = 0; +static VNET_DEFINE(int, error_keeptags) = 0; #define V_error_keeptags VNET(error_keeptags) SYSCTL_INT(_net_inet_icmp, OID_AUTO, error_keeptags, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(error_keeptags), 0, From owner-svn-src-all@freebsd.org Tue Nov 20 11:23:34 2018 Return-Path: Delivered-To: svn-src-all@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 9F3621121B96; Tue, 20 Nov 2018 11:23:34 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 41E3D875DC; Tue, 20 Nov 2018 11:23:34 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 24A3110AEC; Tue, 20 Nov 2018 11:23:34 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAKBNY70025649; Tue, 20 Nov 2018 11:23:34 GMT (envelope-from eugen@FreeBSD.org) Received: (from eugen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAKBNYNs025648; Tue, 20 Nov 2018 11:23:34 GMT (envelope-from eugen@FreeBSD.org) Message-Id: <201811201123.wAKBNYNs025648@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eugen set sender to eugen@FreeBSD.org using -f From: Eugene Grosbein Date: Tue, 20 Nov 2018 11:23:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r340673 - stable/11/sys/netinet X-SVN-Group: stable-11 X-SVN-Commit-Author: eugen X-SVN-Commit-Paths: stable/11/sys/netinet X-SVN-Commit-Revision: 340673 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 41E3D875DC X-Spamd-Result: default: False [0.12 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.06)[-0.058,0]; NEURAL_SPAM_LONG(0.01)[0.007,0]; NEURAL_SPAM_MEDIUM(0.17)[0.172,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Nov 2018 11:23:34 -0000 Author: eugen Date: Tue Nov 20 11:23:33 2018 New Revision: 340673 URL: https://svnweb.freebsd.org/changeset/base/340673 Log: Unbreak build after r340670. This is direct commit to stable/11. Modified: stable/11/sys/netinet/ip_icmp.c Modified: stable/11/sys/netinet/ip_icmp.c ============================================================================== --- stable/11/sys/netinet/ip_icmp.c Tue Nov 20 11:19:02 2018 (r340672) +++ stable/11/sys/netinet/ip_icmp.c Tue Nov 20 11:23:33 2018 (r340673) @@ -155,7 +155,7 @@ SYSCTL_INT(_net_inet_icmp, OID_AUTO, tstamprepl, CTLFL &VNET_NAME(icmptstamprepl), 0, "Respond to ICMP Timestamp packets"); -VNET_DEFINE_STATIC(int, error_keeptags) = 0; +static VNET_DEFINE(int, error_keeptags) = 0; #define V_error_keeptags VNET(error_keeptags) SYSCTL_INT(_net_inet_icmp, OID_AUTO, error_keeptags, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(error_keeptags), 0, From owner-svn-src-all@freebsd.org Tue Nov 20 14:18:58 2018 Return-Path: Delivered-To: svn-src-all@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 4F8EA1130E3C; Tue, 20 Nov 2018 14:18:58 +0000 (UTC) (envelope-from tijl@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 E46216F31A; Tue, 20 Nov 2018 14:18:57 +0000 (UTC) (envelope-from tijl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C5776126FB; Tue, 20 Nov 2018 14:18:57 +0000 (UTC) (envelope-from tijl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAKEIvKk012784; Tue, 20 Nov 2018 14:18:57 GMT (envelope-from tijl@FreeBSD.org) Received: (from tijl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAKEIvui012783; Tue, 20 Nov 2018 14:18:57 GMT (envelope-from tijl@FreeBSD.org) Message-Id: <201811201418.wAKEIvui012783@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tijl set sender to tijl@FreeBSD.org using -f From: Tijl Coosemans Date: Tue, 20 Nov 2018 14:18:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340674 - head/sys/compat/linux X-SVN-Group: head X-SVN-Commit-Author: tijl X-SVN-Commit-Paths: head/sys/compat/linux X-SVN-Commit-Revision: 340674 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E46216F31A X-Spamd-Result: default: False [0.43 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.30)[0.304,0]; NEURAL_HAM_LONG(-0.00)[-0.003,0]; NEURAL_SPAM_MEDIUM(0.13)[0.126,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Nov 2018 14:18:58 -0000 Author: tijl Date: Tue Nov 20 14:18:57 2018 New Revision: 340674 URL: https://svnweb.freebsd.org/changeset/base/340674 Log: Fix another user address dereference in linux_sendmsg syscall. This was hidden behind the LINUX_CMSG_NXTHDR macro which dereferences its second argument. Stop using the macro as well as LINUX_CMSG_FIRSTHDR. Use the size field of the kernel copy of the control message header to obtain the next control message. PR: 217901 MFC after: 2 days X-MFC-With: r340631 Modified: head/sys/compat/linux/linux_socket.c Modified: head/sys/compat/linux/linux_socket.c ============================================================================== --- head/sys/compat/linux/linux_socket.c Tue Nov 20 11:23:33 2018 (r340673) +++ head/sys/compat/linux/linux_socket.c Tue Nov 20 14:18:57 2018 (r340674) @@ -1096,6 +1096,7 @@ linux_sendmsg_common(struct thread *td, l_int s, struc sa_family_t sa_family; void *data; l_size_t len; + l_size_t clen; int error; error = copyin(msghdr, &linux_msg, sizeof(linux_msg)); @@ -1127,7 +1128,7 @@ linux_sendmsg_common(struct thread *td, l_int s, struc control = NULL; - if ((ptr_cmsg = LINUX_CMSG_FIRSTHDR(&linux_msg)) != NULL) { + if (linux_msg.msg_controllen >= sizeof(struct l_cmsghdr)) { error = kern_getsockname(td, s, &sa, &datalen); if (error != 0) goto bad; @@ -1140,6 +1141,8 @@ linux_sendmsg_common(struct thread *td, l_int s, struc data = mtod(control, void *); datalen = 0; + ptr_cmsg = PTRIN(linux_msg.msg_control); + clen = linux_msg.msg_controllen; do { error = copyin(ptr_cmsg, &linux_cmsg, sizeof(struct l_cmsghdr)); @@ -1147,7 +1150,8 @@ linux_sendmsg_common(struct thread *td, l_int s, struc goto bad; error = EINVAL; - if (linux_cmsg.cmsg_len < sizeof(struct l_cmsghdr)) + if (linux_cmsg.cmsg_len < sizeof(struct l_cmsghdr) || + linux_cmsg.cmsg_len > clen) goto bad; if (datalen + CMSG_HDRSZ > MCLBYTES) @@ -1199,7 +1203,14 @@ linux_sendmsg_common(struct thread *td, l_int s, struc cmsg->cmsg_len = CMSG_LEN(len); data = (char *)data + CMSG_SPACE(len); datalen += CMSG_SPACE(len); - } while ((ptr_cmsg = LINUX_CMSG_NXTHDR(&linux_msg, ptr_cmsg))); + + if (clen <= LINUX_CMSG_ALIGN(linux_cmsg.cmsg_len)) + break; + + clen -= LINUX_CMSG_ALIGN(linux_cmsg.cmsg_len); + ptr_cmsg = (struct l_cmsghdr *)((char *)ptr_cmsg + + LINUX_CMSG_ALIGN(linux_cmsg.cmsg_len)); + } while(clen >= sizeof(struct l_cmsghdr)); control->m_len = datalen; if (datalen == 0) { From owner-svn-src-all@freebsd.org Tue Nov 20 14:52:44 2018 Return-Path: Delivered-To: svn-src-all@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 D49161131FB3; Tue, 20 Nov 2018 14:52:44 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.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 79C55707ED; Tue, 20 Nov 2018 14:52:44 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5AAF212D61; Tue, 20 Nov 2018 14:52:44 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAKEqiaD032835; Tue, 20 Nov 2018 14:52:44 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAKEqib1032834; Tue, 20 Nov 2018 14:52:44 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201811201452.wAKEqib1032834@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 20 Nov 2018 14:52:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340675 - head/libexec/rtld-elf X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/libexec/rtld-elf X-SVN-Commit-Revision: 340675 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 79C55707ED X-Spamd-Result: default: False [0.54 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.41)[0.414,0]; NEURAL_HAM_LONG(-0.00)[-0.003,0]; NEURAL_SPAM_MEDIUM(0.13)[0.126,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Nov 2018 14:52:45 -0000 Author: kib Date: Tue Nov 20 14:52:43 2018 New Revision: 340675 URL: https://svnweb.freebsd.org/changeset/base/340675 Log: rtld: when immediate bind mode is requested, process irelocs in PLT immediately after other PLT relocs. Otherwise, if the object has relro page, we write to readonly page, and we would need to use mprotect(2) two more times to fix it. Note that resolve_object_ifunc() does nothing when called second time, so there is no need to avoid existing call. Reported and tested by: emaste PR: 233333 Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/libexec/rtld-elf/rtld.c Modified: head/libexec/rtld-elf/rtld.c ============================================================================== --- head/libexec/rtld-elf/rtld.c Tue Nov 20 14:18:57 2018 (r340674) +++ head/libexec/rtld-elf/rtld.c Tue Nov 20 14:52:43 2018 (r340675) @@ -142,6 +142,7 @@ static int relocate_object(Obj_Entry *obj, bool bind_n int flags, RtldLockState *lockstate); static int relocate_objects(Obj_Entry *, bool, Obj_Entry *, int, RtldLockState *); +static int resolve_object_ifunc(Obj_Entry *, bool, int, RtldLockState *); static int resolve_objects_ifunc(Obj_Entry *first, bool bind_now, int flags, RtldLockState *lockstate); static int rtld_dirname(const char *, char *); @@ -2885,9 +2886,11 @@ relocate_object(Obj_Entry *obj, bool bind_now, Obj_Ent if (reloc_plt(obj) == -1) return (-1); /* Relocate the jump slots if we are doing immediate binding. */ - if (obj->bind_now || bind_now) - if (reloc_jmpslots(obj, flags, lockstate) == -1) + if (obj->bind_now || bind_now) { + if (reloc_jmpslots(obj, flags, lockstate) == -1 || + resolve_object_ifunc(obj, true, flags, lockstate) == -1) return (-1); + } /* * Process the non-PLT IFUNC relocations. The relocations are From owner-svn-src-all@freebsd.org Tue Nov 20 14:58:42 2018 Return-Path: Delivered-To: svn-src-all@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 2BBD51132177; Tue, 20 Nov 2018 14:58:42 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.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 C6C8370A63; Tue, 20 Nov 2018 14:58:41 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A4C0912D69; Tue, 20 Nov 2018 14:58:41 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAKEwfPZ033154; Tue, 20 Nov 2018 14:58:41 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAKEwftP033152; Tue, 20 Nov 2018 14:58:41 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201811201458.wAKEwftP033152@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Tue, 20 Nov 2018 14:58:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340676 - in head/sys: kern sys X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: in head/sys: kern sys X-SVN-Commit-Revision: 340676 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C6C8370A63 X-Spamd-Result: default: False [0.54 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.41)[0.414,0]; NEURAL_HAM_LONG(-0.00)[-0.003,0]; NEURAL_SPAM_MEDIUM(0.13)[0.126,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Nov 2018 14:58:42 -0000 Author: mjg Date: Tue Nov 20 14:58:41 2018 New Revision: 340676 URL: https://svnweb.freebsd.org/changeset/base/340676 Log: Implement unr64 Important users of unr like tmpfs or pipes can get away with just ever-increasing counters, making the overhead of managing the state for 32 bit counters a pessimization. Change it to an atomic variable. This can be further sped up by making the counts variable "allocate" ranges and store them per-cpu. Reviewed by: kib Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D18054 Modified: head/sys/kern/subr_unit.c head/sys/sys/systm.h Modified: head/sys/kern/subr_unit.c ============================================================================== --- head/sys/kern/subr_unit.c Tue Nov 20 14:52:43 2018 (r340675) +++ head/sys/kern/subr_unit.c Tue Nov 20 14:58:41 2018 (r340676) @@ -98,6 +98,19 @@ static struct mtx unitmtx; MTX_SYSINIT(unit, &unitmtx, "unit# allocation", MTX_DEF); +#ifdef UNR64_LOCKED +uint64_t +alloc_unr64(struct unrhdr64 *unr64) +{ + uint64_t item; + + mtx_lock(&unitmtx); + item = unr64->counter++; + mtx_unlock(&unitmtx); + return (item); +} +#endif + #else /* ...USERLAND */ #include Modified: head/sys/sys/systm.h ============================================================================== --- head/sys/sys/systm.h Tue Nov 20 14:52:43 2018 (r340675) +++ head/sys/sys/systm.h Tue Nov 20 14:58:41 2018 (r340676) @@ -523,6 +523,32 @@ int alloc_unr_specific(struct unrhdr *uh, u_int item); int alloc_unrl(struct unrhdr *uh); void free_unr(struct unrhdr *uh, u_int item); +#if defined(__mips__) || defined(__powerpc__) +#define UNR64_LOCKED +#endif + +struct unrhdr64 { + uint64_t counter; +}; + +static __inline void +new_unrhdr64(struct unrhdr64 *unr64, uint64_t low) +{ + + unr64->counter = low; +} + +#ifdef UNR64_LOCKED +uint64_t alloc_unr64(struct unrhdr64 *); +#else +static __inline uint64_t +alloc_unr64(struct unrhdr64 *unr64) +{ + + return (atomic_fetchadd_64(&unr64->counter, 1)); +} +#endif + void intr_prof_stack_use(struct thread *td, struct trapframe *frame); void counted_warning(unsigned *counter, const char *msg); From owner-svn-src-all@freebsd.org Tue Nov 20 14:59:28 2018 Return-Path: Delivered-To: svn-src-all@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 2711D11321FF; Tue, 20 Nov 2018 14:59:28 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.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 C15A170BD4; Tue, 20 Nov 2018 14:59:27 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8857F12D6C; Tue, 20 Nov 2018 14:59:27 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAKExR6L033229; Tue, 20 Nov 2018 14:59:27 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAKExRob033228; Tue, 20 Nov 2018 14:59:27 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201811201459.wAKExRob033228@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Tue, 20 Nov 2018 14:59:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340677 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 340677 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C15A170BD4 X-Spamd-Result: default: False [0.57 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.00)[0.001,0]; NEURAL_SPAM_SHORT(0.43)[0.425,0]; NEURAL_SPAM_MEDIUM(0.14)[0.143,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Nov 2018 14:59:28 -0000 Author: mjg Date: Tue Nov 20 14:59:27 2018 New Revision: 340677 URL: https://svnweb.freebsd.org/changeset/base/340677 Log: pipe: use unr64 Reviewed by: kib Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D18054 Modified: head/sys/kern/sys_pipe.c Modified: head/sys/kern/sys_pipe.c ============================================================================== --- head/sys/kern/sys_pipe.c Tue Nov 20 14:58:41 2018 (r340676) +++ head/sys/kern/sys_pipe.c Tue Nov 20 14:59:27 2018 (r340677) @@ -244,7 +244,7 @@ static int pipe_zone_init(void *mem, int size, int fla static void pipe_zone_fini(void *mem, int size); static uma_zone_t pipe_zone; -static struct unrhdr *pipeino_unr; +static struct unrhdr64 pipeino_unr; static dev_t pipedev_ino; SYSINIT(vfs, SI_SUB_VFS, SI_ORDER_ANY, pipeinit, NULL); @@ -257,8 +257,7 @@ pipeinit(void *dummy __unused) pipe_zone_ctor, NULL, pipe_zone_init, pipe_zone_fini, UMA_ALIGN_PTR, 0); KASSERT(pipe_zone != NULL, ("pipe_zone not initialized")); - pipeino_unr = new_unrhdr(1, INT32_MAX, NULL); - KASSERT(pipeino_unr != NULL, ("pipe fake inodes not initialized")); + new_unrhdr64(&pipeino_unr, 1); pipedev_ino = devfs_alloc_cdp_inode(); KASSERT(pipedev_ino > 0, ("pipe dev inode not initialized")); } @@ -390,8 +389,6 @@ pipe_dtor(struct pipe *dpipe) funsetown(&peer->pipe_sigio); pipeclose(peer); } - if (ino != 0 && ino != (ino_t)-1) - free_unr(pipeino_unr, ino); } /* @@ -639,7 +636,7 @@ pipe_create(struct pipe *pipe, int backing) (void)pipespace_new(pipe, PIPE_SIZE); } - pipe->pipe_ino = -1; + pipe->pipe_ino = alloc_unr64(&pipeino_unr); } /* ARGSUSED */ @@ -1461,7 +1458,6 @@ pipe_stat(struct file *fp, struct stat *ub, struct ucr struct thread *td) { struct pipe *pipe; - int new_unr; #ifdef MAC int error; #endif @@ -1482,23 +1478,6 @@ pipe_stat(struct file *fp, struct stat *ub, struct ucr return (vnops.fo_stat(fp, ub, active_cred, td)); } - /* - * Lazily allocate an inode number for the pipe. Most pipe - * users do not call fstat(2) on the pipe, which means that - * postponing the inode allocation until it is must be - * returned to userland is useful. If alloc_unr failed, - * assign st_ino zero instead of returning an error. - * Special pipe_ino values: - * -1 - not yet initialized; - * 0 - alloc_unr failed, return 0 as st_ino forever. - */ - if (pipe->pipe_ino == (ino_t)-1) { - new_unr = alloc_unr(pipeino_unr); - if (new_unr != -1) - pipe->pipe_ino = new_unr; - else - pipe->pipe_ino = 0; - } PIPE_UNLOCK(pipe); bzero(ub, sizeof(*ub)); From owner-svn-src-all@freebsd.org Tue Nov 20 15:08:08 2018 Return-Path: Delivered-To: svn-src-all@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 03B43113269C; Tue, 20 Nov 2018 15:08:08 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 42E51711AD; Tue, 20 Nov 2018 15:08:07 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id wAKF7uWY065222 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Tue, 20 Nov 2018 17:07:59 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua wAKF7uWY065222 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id wAKF7uFC065221; Tue, 20 Nov 2018 17:07:56 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Tue, 20 Nov 2018 17:07:56 +0200 From: Konstantin Belousov To: Mateusz Guzik Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r340676 - in head/sys: kern sys Message-ID: <20181120150756.GD2378@kib.kiev.ua> References: <201811201458.wAKEwftP033152@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201811201458.wAKEwftP033152@repo.freebsd.org> User-Agent: Mutt/1.10.1 (2018-07-13) X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on tom.home X-Rspamd-Queue-Id: 42E51711AD X-Spamd-Result: default: False [-5.21 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; FREEMAIL_FROM(0.00)[gmail.com]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; HAS_XAW(0.00)[]; NEURAL_HAM_LONG(-1.00)[-0.998,0]; R_SPF_SOFTFAIL(0.00)[~all]; RCVD_COUNT_THREE(0.00)[3]; TO_DN_SOME(0.00)[]; MX_GOOD(-0.01)[cached: alt3.gmail-smtp-in.l.google.com]; NEURAL_HAM_SHORT(-0.99)[-0.987,0]; IP_SCORE(-2.22)[ip: (-2.87), ipnet: 2001:470::/32(-4.57), asn: 6939(-3.58), country: US(-0.09)]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:6939, ipnet:2001:470::/32, country:US]; RCVD_TLS_LAST(0.00)[]; DMARC_POLICY_SOFTFAIL(0.10)[gmail.com : No valid SPF, No valid DKIM,none] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Nov 2018 15:08:08 -0000 On Tue, Nov 20, 2018 at 02:58:41PM +0000, Mateusz Guzik wrote: > Author: mjg > Date: Tue Nov 20 14:58:41 2018 > New Revision: 340676 > URL: https://svnweb.freebsd.org/changeset/base/340676 > > Log: > Implement unr64 > > Important users of unr like tmpfs or pipes can get away with just > ever-increasing counters, making the overhead of managing the state > for 32 bit counters a pessimization. > > Change it to an atomic variable. This can be further sped up by making > the counts variable "allocate" ranges and store them per-cpu. > > Reviewed by: kib > Sponsored by: The FreeBSD Foundation > Differential Revision: https://reviews.freebsd.org/D18054 > > Modified: > head/sys/kern/subr_unit.c > head/sys/sys/systm.h > > Modified: head/sys/kern/subr_unit.c > ============================================================================== > --- head/sys/kern/subr_unit.c Tue Nov 20 14:52:43 2018 (r340675) > +++ head/sys/kern/subr_unit.c Tue Nov 20 14:58:41 2018 (r340676) > @@ -98,6 +98,19 @@ static struct mtx unitmtx; > > MTX_SYSINIT(unit, &unitmtx, "unit# allocation", MTX_DEF); > > +#ifdef UNR64_LOCKED > +uint64_t > +alloc_unr64(struct unrhdr64 *unr64) > +{ > + uint64_t item; > + > + mtx_lock(&unitmtx); > + item = unr64->counter++; > + mtx_unlock(&unitmtx); > + return (item); > +} > +#endif > + > #else /* ...USERLAND */ > > #include > > Modified: head/sys/sys/systm.h > ============================================================================== > --- head/sys/sys/systm.h Tue Nov 20 14:52:43 2018 (r340675) > +++ head/sys/sys/systm.h Tue Nov 20 14:58:41 2018 (r340676) > @@ -523,6 +523,32 @@ int alloc_unr_specific(struct unrhdr *uh, u_int item); > int alloc_unrl(struct unrhdr *uh); > void free_unr(struct unrhdr *uh, u_int item); > > +#if defined(__mips__) || defined(__powerpc__) Please note what I asked about this #ifdefs in the review. mips and powerpc machine/atomic.h should define some symbol like __ATOMIC_NO_64_OPS and this case should be handled in less arch-explicit manner. > +#define UNR64_LOCKED > +#endif > + > +struct unrhdr64 { > + uint64_t counter; > +}; > + > +static __inline void > +new_unrhdr64(struct unrhdr64 *unr64, uint64_t low) > +{ > + > + unr64->counter = low; > +} > + > +#ifdef UNR64_LOCKED > +uint64_t alloc_unr64(struct unrhdr64 *); > +#else > +static __inline uint64_t > +alloc_unr64(struct unrhdr64 *unr64) > +{ > + > + return (atomic_fetchadd_64(&unr64->counter, 1)); > +} > +#endif > + > void intr_prof_stack_use(struct thread *td, struct trapframe *frame); > > void counted_warning(unsigned *counter, const char *msg); From owner-svn-src-all@freebsd.org Tue Nov 20 15:12:38 2018 Return-Path: Delivered-To: svn-src-all@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 3FBF11132947; Tue, 20 Nov 2018 15:12:38 +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 D79D9715F6; Tue, 20 Nov 2018 15:12:37 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9F2AC1308E; Tue, 20 Nov 2018 15:12:37 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAKFCb73042990; Tue, 20 Nov 2018 15:12:37 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAKFCbv4042989; Tue, 20 Nov 2018 15:12:37 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201811201512.wAKFCbv4042989@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 20 Nov 2018 15:12:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340678 - head/sys/arm64/arm64 X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/arm64/arm64 X-SVN-Commit-Revision: 340678 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D79D9715F6 X-Spamd-Result: default: False [0.57 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.00)[0.001,0]; NEURAL_SPAM_MEDIUM(0.14)[0.143,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.43)[0.425,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Nov 2018 15:12:38 -0000 Author: markj Date: Tue Nov 20 15:12:37 2018 New Revision: 340678 URL: https://svnweb.freebsd.org/changeset/base/340678 Log: Handle kernel superpage mappings in pmap_remove_l2(). PR: 233088 Reviewed by: alc, andrew, kib Tested by: sbruno MFC after: 3 days Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D17981 Modified: head/sys/arm64/arm64/pmap.c Modified: head/sys/arm64/arm64/pmap.c ============================================================================== --- head/sys/arm64/arm64/pmap.c Tue Nov 20 14:59:27 2018 (r340677) +++ head/sys/arm64/arm64/pmap.c Tue Nov 20 15:12:37 2018 (r340678) @@ -2382,8 +2382,40 @@ pmap_pv_insert_l2(pmap_t pmap, vm_offset_t va, pd_entr return (true); } +static void +pmap_remove_kernel_l2(pmap_t pmap, pt_entry_t *l2, vm_offset_t va) +{ + pt_entry_t newl2, oldl2; + vm_page_t ml3; + vm_paddr_t ml3pa; + + KASSERT(!VIRT_IN_DMAP(va), ("removing direct mapping of %#lx", va)); + KASSERT(pmap == kernel_pmap, ("pmap %p is not kernel_pmap", pmap)); + PMAP_LOCK_ASSERT(pmap, MA_OWNED); + + ml3 = pmap_remove_pt_page(pmap, va); + if (ml3 == NULL) + panic("pmap_remove_kernel_l2: Missing pt page"); + + ml3pa = VM_PAGE_TO_PHYS(ml3); + newl2 = ml3pa | L2_TABLE; + + /* + * Initialize the page table page. + */ + pagezero((void *)PHYS_TO_DMAP(ml3pa)); + + /* + * Demote the mapping. The caller must have already invalidated the + * mapping (i.e., the "break" in break-before-make). + */ + oldl2 = pmap_load_store(l2, newl2); + KASSERT(oldl2 == 0, ("%s: found existing mapping at %p: %#lx", + __func__, l2, oldl2)); +} + /* - * pmap_remove_l2: do the things to unmap a level 2 superpage in a process + * pmap_remove_l2: Do the things to unmap a level 2 superpage. */ static int pmap_remove_l2(pmap_t pmap, pt_entry_t *l2, vm_offset_t sva, @@ -2419,16 +2451,18 @@ pmap_remove_l2(pmap_t pmap, pt_entry_t *l2, vm_offset_ vm_page_aflag_clear(m, PGA_WRITEABLE); } } - KASSERT(pmap != kernel_pmap, - ("Attempting to remove an l2 kernel page")); - ml3 = pmap_remove_pt_page(pmap, sva); - if (ml3 != NULL) { - pmap_resident_count_dec(pmap, 1); - KASSERT(ml3->wire_count == NL3PG, - ("pmap_remove_l2: l3 page wire count error")); - ml3->wire_count = 1; - vm_page_unwire_noq(ml3); - pmap_add_delayed_free_list(ml3, free, FALSE); + if (pmap == kernel_pmap) { + pmap_remove_kernel_l2(pmap, l2, sva); + } else { + ml3 = pmap_remove_pt_page(pmap, sva); + if (ml3 != NULL) { + pmap_resident_count_dec(pmap, 1); + KASSERT(ml3->wire_count == NL3PG, + ("pmap_remove_l2: l3 page wire count error")); + ml3->wire_count = 1; + vm_page_unwire_noq(ml3); + pmap_add_delayed_free_list(ml3, free, FALSE); + } } return (pmap_unuse_pt(pmap, sva, l1e, free)); } From owner-svn-src-all@freebsd.org Tue Nov 20 15:14:32 2018 Return-Path: Delivered-To: svn-src-all@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 8F9881132A0B; Tue, 20 Nov 2018 15:14:32 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 32E81717BF; Tue, 20 Nov 2018 15:14:32 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EA40D13096; Tue, 20 Nov 2018 15:14:31 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAKFEVJL043125; Tue, 20 Nov 2018 15:14:31 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAKFEVqP043123; Tue, 20 Nov 2018 15:14:31 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201811201514.wAKFEVqP043123@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Tue, 20 Nov 2018 15:14:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340679 - head/sys/fs/tmpfs X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/fs/tmpfs X-SVN-Commit-Revision: 340679 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 32E81717BF X-Spamd-Result: default: False [0.57 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.00)[0.001,0]; NEURAL_SPAM_MEDIUM(0.14)[0.143,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.43)[0.425,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Nov 2018 15:14:32 -0000 Author: mjg Date: Tue Nov 20 15:14:30 2018 New Revision: 340679 URL: https://svnweb.freebsd.org/changeset/base/340679 Log: tmpfs: use unr64 for inode numbers Sponsored by: The FreeBSD Foundation Modified: head/sys/fs/tmpfs/tmpfs.h head/sys/fs/tmpfs/tmpfs_subr.c head/sys/fs/tmpfs/tmpfs_vfsops.c Modified: head/sys/fs/tmpfs/tmpfs.h ============================================================================== --- head/sys/fs/tmpfs/tmpfs.h Tue Nov 20 15:12:37 2018 (r340678) +++ head/sys/fs/tmpfs/tmpfs.h Tue Nov 20 15:14:30 2018 (r340679) @@ -353,7 +353,7 @@ struct tmpfs_mount { ino_t tm_nodes_max; /* unrhdr used to allocate inode numbers */ - struct unrhdr * tm_ino_unr; + struct unrhdr64 tm_ino_unr; /* Number of nodes currently that are in use. */ ino_t tm_nodes_inuse; Modified: head/sys/fs/tmpfs/tmpfs_subr.c ============================================================================== --- head/sys/fs/tmpfs/tmpfs_subr.c Tue Nov 20 15:12:37 2018 (r340678) +++ head/sys/fs/tmpfs/tmpfs_subr.c Tue Nov 20 15:14:30 2018 (r340679) @@ -230,7 +230,7 @@ tmpfs_alloc_node(struct mount *mp, struct tmpfs_mount nnode->tn_uid = uid; nnode->tn_gid = gid; nnode->tn_mode = mode; - nnode->tn_id = alloc_unr(tmp->tm_ino_unr); + nnode->tn_id = alloc_unr64(&tmp->tm_ino_unr); nnode->tn_refcount = 1; /* Type-specific initialization. */ @@ -368,13 +368,6 @@ tmpfs_free_node_locked(struct tmpfs_mount *tmp, struct panic("tmpfs_free_node: type %p %d", node, (int)node->tn_type); } - /* - * If we are unmounting there is no need for going through the overhead - * of freeing the inodes from the unr individually, so free them all in - * one go later. - */ - if (!detach) - free_unr(tmp->tm_ino_unr, node->tn_id); uma_zfree(tmp->tm_node_pool, node); TMPFS_LOCK(tmp); tmpfs_free_tmp(tmp); Modified: head/sys/fs/tmpfs/tmpfs_vfsops.c ============================================================================== --- head/sys/fs/tmpfs/tmpfs_vfsops.c Tue Nov 20 15:12:37 2018 (r340678) +++ head/sys/fs/tmpfs/tmpfs_vfsops.c Tue Nov 20 15:14:30 2018 (r340679) @@ -231,7 +231,7 @@ tmpfs_mount(struct mount *mp) tmp->tm_pages_max = pages; tmp->tm_pages_used = 0; - tmp->tm_ino_unr = new_unrhdr(2, INT_MAX, &tmp->tm_allnode_lock); + new_unrhdr64(&tmp->tm_ino_unr, 2); tmp->tm_dirent_pool = uma_zcreate("TMPFS dirent", sizeof(struct tmpfs_dirent), NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, 0); @@ -248,7 +248,6 @@ tmpfs_mount(struct mount *mp) if (error != 0 || root == NULL) { uma_zdestroy(tmp->tm_node_pool); uma_zdestroy(tmp->tm_dirent_pool); - delete_unrhdr(tmp->tm_ino_unr); free(tmp, M_TMPFSMNT); return (error); } @@ -343,8 +342,6 @@ tmpfs_free_tmp(struct tmpfs_mount *tmp) uma_zdestroy(tmp->tm_dirent_pool); uma_zdestroy(tmp->tm_node_pool); - clear_unrhdr(tmp->tm_ino_unr); - delete_unrhdr(tmp->tm_ino_unr); mtx_destroy(&tmp->tm_allnode_lock); MPASS(tmp->tm_pages_used == 0); From owner-svn-src-all@freebsd.org Tue Nov 20 15:28:47 2018 Return-Path: Delivered-To: svn-src-all@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 153AB1132E7F; Tue, 20 Nov 2018 15:28:47 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: from mail-qt1-x841.google.com (mail-qt1-x841.google.com [IPv6:2607:f8b0:4864:20::841]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 600B471E33; Tue, 20 Nov 2018 15:28:46 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: by mail-qt1-x841.google.com with SMTP id k12so389149qtf.7; Tue, 20 Nov 2018 07:28:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=B4HBmYYkinLMOkjvB2w+eLrncZ9/NG2Z9ajE346LV2g=; b=l7V1921QXaBPBHG8szjTbTQT7fD4iiKkE23go6HkNzVUUCD158jJPoQHqmzPucts2H PsDUMkeUK8HltuLtNqgsFzDzralwwNba25CSU5oKtAhFj5jzIA25bajtAY52QkUF256l I+Lh3/J5pnF/xVjuft570ngjiV6qHiCfrE51QWRf2ZlT6mXjjKt9w49kEUuWDb8moARS uVozVq2uaqibrCCs5NjgCsrqIXFYk4q6jwMVT3kSO7B1H1S+wu+odk2xt0+avxfuIk/+ a6izqaKVe1/JEFkhAHjZx6KOBPvyZDzoOIKF7OyxqQoyZ+uQ8NLR57Fqj/EjtxvA7V/7 YYCQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=B4HBmYYkinLMOkjvB2w+eLrncZ9/NG2Z9ajE346LV2g=; b=pwk8qp2wZpVmdebjT2GZ9TjHG3PfK3vOx6LB0BH0etm17kPXqO4WKeIvuv+QGBvDuP 8mUEOS+PcdlwaK6HQlVNczsFlsqugHmmPi4cmNe5AJ7co9WgMGaa2HSfux0zZRcrmmHe fvHeQG7kM7L09UwvjS4SKTyR8M9hAWuZF/llnpOQ5IXfQxqMm15vbnHK/f9rU39gMlPe NSb3hAi0kdDbyI+rxKarsZCCJyzsQkFmqiDinChr1xQlLQrxlu3AxM0sMea3SGWNUW8P cZ0VqDJ1AkoI5WdGWYOGD77pexDCW8q1reLbu9HAGNcVQ9gO8wqRqgLHJ02DtosWtlKu eZNg== X-Gm-Message-State: AGRZ1gIQXPaAQSIQclKPY4O9FDdsLIwEGW84kJbF0EPJDCvuHy+2mxdM jmgOxhgF0IAjojL8TQtilgz1GdGpdQI8WVbZBzQ= X-Google-Smtp-Source: AJdET5fzi10XqtW2k4I61qgwwFGIZkZ30PFPGwRZ16glh2wZT6SCxt91qaTE4xGe454+w4oIMeC30PnbgwazWOiIzmc= X-Received: by 2002:ac8:46c6:: with SMTP id h6mr2289981qto.315.1542727725829; Tue, 20 Nov 2018 07:28:45 -0800 (PST) MIME-Version: 1.0 Received: by 2002:ac8:784:0:0:0:0:0 with HTTP; Tue, 20 Nov 2018 07:28:45 -0800 (PST) In-Reply-To: <20181120150756.GD2378@kib.kiev.ua> References: <201811201458.wAKEwftP033152@repo.freebsd.org> <20181120150756.GD2378@kib.kiev.ua> From: Mateusz Guzik Date: Tue, 20 Nov 2018 16:28:45 +0100 Message-ID: Subject: Re: svn commit: r340676 - in head/sys: kern sys To: Konstantin Belousov Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 600B471E33 X-Spamd-Result: default: False [-3.62 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.96)[-0.964,0]; R_DKIM_ALLOW(-0.20)[gmail.com]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36]; FREEMAIL_FROM(0.00)[gmail.com]; MIME_GOOD(-0.10)[text/plain]; NEURAL_HAM_LONG(-0.89)[-0.894,0]; TO_DN_SOME(0.00)[]; NEURAL_HAM_SHORT(-0.60)[-0.598,0]; RCVD_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; MX_GOOD(-0.01)[cached: alt3.gmail-smtp-in.l.google.com]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; RCVD_IN_DNSWL_NONE(0.00)[1.4.8.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.0]; FREEMAIL_TO(0.00)[gmail.com]; FROM_EQ_ENVFROM(0.00)[]; RCVD_TLS_LAST(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; IP_SCORE(-0.16)[ip: (3.29), ipnet: 2607:f8b0::/32(-2.37), asn: 15169(-1.61), country: US(-0.09)] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Nov 2018 15:28:47 -0000 On 11/20/18, Konstantin Belousov wrote: > On Tue, Nov 20, 2018 at 02:58:41PM +0000, Mateusz Guzik wrote: >> Author: mjg >> Date: Tue Nov 20 14:58:41 2018 >> New Revision: 340676 >> URL: https://svnweb.freebsd.org/changeset/base/340676 >> >> Log: >> Implement unr64 >> >> Important users of unr like tmpfs or pipes can get away with just >> ever-increasing counters, making the overhead of managing the state >> for 32 bit counters a pessimization. >> >> Change it to an atomic variable. This can be further sped up by making >> the counts variable "allocate" ranges and store them per-cpu. >> >> Reviewed by: kib >> Sponsored by: The FreeBSD Foundation >> Differential Revision: https://reviews.freebsd.org/D18054 >> >> Modified: >> head/sys/kern/subr_unit.c >> head/sys/sys/systm.h >> >> Modified: head/sys/kern/subr_unit.c >> ============================================================================== >> --- head/sys/kern/subr_unit.c Tue Nov 20 14:52:43 2018 (r340675) >> +++ head/sys/kern/subr_unit.c Tue Nov 20 14:58:41 2018 (r340676) >> @@ -98,6 +98,19 @@ static struct mtx unitmtx; >> >> MTX_SYSINIT(unit, &unitmtx, "unit# allocation", MTX_DEF); >> >> +#ifdef UNR64_LOCKED >> +uint64_t >> +alloc_unr64(struct unrhdr64 *unr64) >> +{ >> + uint64_t item; >> + >> + mtx_lock(&unitmtx); >> + item = unr64->counter++; >> + mtx_unlock(&unitmtx); >> + return (item); >> +} >> +#endif >> + >> #else /* ...USERLAND */ >> >> #include >> >> Modified: head/sys/sys/systm.h >> ============================================================================== >> --- head/sys/sys/systm.h Tue Nov 20 14:52:43 2018 (r340675) >> +++ head/sys/sys/systm.h Tue Nov 20 14:58:41 2018 (r340676) >> @@ -523,6 +523,32 @@ int alloc_unr_specific(struct unrhdr *uh, u_int >> item); >> int alloc_unrl(struct unrhdr *uh); >> void free_unr(struct unrhdr *uh, u_int item); >> >> +#if defined(__mips__) || defined(__powerpc__) > Please note what I asked about this #ifdefs in the review. mips > and powerpc machine/atomic.h should define some symbol like > __ATOMIC_NO_64_OPS and this case should be handled in less arch-explicit > manner. > Right, should have mentioned that in the commit message. Anyhow, mips has some degree of 64 bit ops even for 32 bits so this becomes more iffy. In particular it does have atomic_add_64. I don't have a good way to test mips atomics and since non-atomic version for powerpc was needed anyway I decided not to try to add one. With this in place a global macro would have to explicitly indicate lack of fetchadd, not 64 ops. So I think the current state is good enough for now. Imo in the long run 64 bit ops should just get emulated with a lock protected code in general manner. -- Mateusz Guzik From owner-svn-src-all@freebsd.org Tue Nov 20 15:35:46 2018 Return-Path: Delivered-To: svn-src-all@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 BF448113333F; Tue, 20 Nov 2018 15:35:46 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail105.syd.optusnet.com.au (mail105.syd.optusnet.com.au [211.29.132.249]) by mx1.freebsd.org (Postfix) with ESMTP id 2AB3A72541; Tue, 20 Nov 2018 15:35:43 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from [192.168.0.102] (c110-21-101-228.carlnfd1.nsw.optusnet.com.au [110.21.101.228]) by mail105.syd.optusnet.com.au (Postfix) with ESMTPS id 5644B10588AE; Wed, 21 Nov 2018 02:35:32 +1100 (AEDT) Date: Wed, 21 Nov 2018 02:35:32 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Warner Losh cc: Bruce Evans , Andriy Gapon , "Rodney W. Grimes" , Allan Jude , Warner Losh , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r340450 - head/sys/sys In-Reply-To: Message-ID: <20181120225901.H1386@besplex.bde.org> References: <201811190104.wAJ14CaE059062@pdx.rh.CN85.dnsmgr.net> <5e227743-6463-d395-f2ba-da8d4ba248ca@FreeBSD.org> <20181120005944.B1050@besplex.bde.org> <20181120014951.J1250@besplex.bde.org> <20181120023823.M1428@besplex.bde.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.2 cv=FNpr/6gs c=1 sm=1 tr=0 a=PalzARQSbocsUSjMRkwAPg==:117 a=PalzARQSbocsUSjMRkwAPg==:17 a=kj9zAlcOel0A:10 a=PO7r1zJSAAAA:8 a=6I5d2MoRAAAA:8 a=fsi5WZZrgbGlQf9aq78A:9 a=5ABlwM8w8ixAeB2D:21 a=wwMOKTSRVD5hy9iK:21 a=CjuIK1q_8ugA:10 a=IjZwj45LgO3ly-622nXo:22 X-Rspamd-Queue-Id: 2AB3A72541 X-Spamd-Result: default: False [-0.43 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.09)[-0.085,0]; RCVD_IN_DNSWL_LOW(-0.10)[249.132.29.211.list.dnswl.org : 127.0.5.1]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:211.29.132.0/23]; FREEMAIL_FROM(0.00)[optusnet.com.au]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[optusnet.com.au]; NEURAL_HAM_LONG(-0.39)[-0.392,0]; NEURAL_SPAM_SHORT(0.37)[0.368,0]; TO_MATCH_ENVRCPT_SOME(0.00)[]; MX_GOOD(-0.01)[extmail.optusnet.com.au]; RCPT_COUNT_SEVEN(0.00)[9]; IP_SCORE(-0.01)[country: AU(-0.05)]; RCVD_NO_TLS_LAST(0.10)[]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[optusnet.com.au]; ASN(0.00)[asn:4804, ipnet:211.28.0.0/14, country:AU]; FREEMAIL_CC(0.00)[optusnet.com.au]; RCVD_COUNT_TWO(0.00)[2] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Nov 2018 15:35:47 -0000 On Mon, 19 Nov 2018, Warner Losh wrote: > On Mon, Nov 19, 2018 at 9:05 AM Bruce Evans wrote: > >> On Tue, 20 Nov 2018, Bruce Evans wrote: >> >>> On Tue, 20 Nov 2018, Bruce Evans wrote: >>> >>>> On Mon, 19 Nov 2018, Warner Losh wrote: >>> ... >>> I found my test program. >>> >>>>> But I think I understand the problem now. >>>>> >>>>> mstosbt(1000) is overflowing with my change, but not without because >> we're >>>>> adding 2^32 to a number that's ~900 away from overflowing changing a >> very >>>> >>>> This value is just invalid. Negative values are obviously invalid. >>>> Positive >>>> values of more than 1 second are invalid. In the old version, values of >>>> precisely 1 second don't overflow since the scale factor is rounded >> down; >>>> the result is just 1 unit lower than 1 second. Overflow (actually >>>> truncation) >>>> occurs at 1 unit above 1 second. E.g., sbttoms(mstosbt(1000)) was 999 >> and >>>> sbttoms(mstosbt(1001)) was 0. Now in my fixed version, >>>> sbttoms(mstosbt(1000)) >>>> is truncated to 0 and sbttoms(mstosbt(1001)) is truncated to 1. This remains very broken. I just noticed that the inverse functions don't support sbt's much larger than 1 second either. E.g., sbttons multiplies by 1 billion, so it overflows for sbt's larger than 4.29 seconds. It is better to not support times larger than 1 second in these functions than to pessimize them all. You only pessimized some of them. The inverse functions still overflow at small values; the direct functions still overflow at large values. >> Here are all uses of these functions in kern outside of sys/time.h: >> >> XX arm/arm/mpcore_timer.c: sc->et.et_min_period = nstosbt(20); >> >> OK since 20 ns is less than 1 second. >> >> XX cddl/compat/opensolaris/sys/kcondvar.h: return >> (cv_timedwait_sbt(cvp, mp, nstosbt(tim), nstosbt(res), 0)); >> XX cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_tx.c: >> pause_sbt("dmu_tx_delay", nstosbt(wakeup), >> XX cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_tx.c: >> nstosbt(zfs_delay_resolution_ns), C_ABSOLUTE); >> XX cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c: sbintime_t sleep = >> nstosbt((zilog->zl_last_lwb_latency * pct) / 100); >> XX compat/linuxkpi/common/include/linux/delay.h: >> pause_sbt("lnxsleep", mstosbt(ms), 0, C_HARDCLOCK); >> XX compat/linuxkpi/common/src/linux_hrtimer.c: >> nstosbt(hrtimer->expires), nstosbt(hrtimer->precision), 0); >> XX compat/linuxkpi/common/src/linux_hrtimer.c: >> callout_reset_sbt(&hrtimer->callout, nstosbt(ktime_to_ns(time)), >> XX compat/linuxkpi/common/src/linux_hrtimer.c: nstosbt(nsec), >> hrtimer_call_handler, hrtimer, 0); >> XX compat/linuxkpi/common/src/linux_hrtimer.c: >> callout_reset_sbt(&hrtimer->callout, nstosbt(ktime_to_ns(interval)), >> XX compat/linuxkpi/common/src/linux_hrtimer.c: >> nstosbt(hrtimer->precision), hrtimer_call_handler, hrtimer, 0); >> XX compat/linuxkpi/common/src/linux_schedule.c: ret = >> -pause_sbt("lnxsleep", mstosbt(ms), 0, C_HARDCLOCK | C_CATCH); >> >> All of the above might are broken unless their timeout arg is restricted to >> less than 1 second. >> >> Also, at least the sleep and pause calls in the above probably have a >> style bug in knowing about sbt's at all. More important functions >> like msleep() hide the use of sbt's and use fuzzier scale factors like >> tick_sbt. > > Yes. It's for these users I'm fixing the >= 1s cases. These functions are broken in FreeBSD-11 and FreeBSD-12 too. They were last correct in FreeBSD-10, where there weren't so many linuxkpi functions, but where the zfs code is similar except it is missing the overflow bugs. E.g., where the above does nstosbt(wakeup), FreeBSD-10 does wakeup * SBT_1NS. SBT_1NS is 4, but the infinite-precision scale factor is 4.294967296. The sloppy scale factor is gives large absolute errors for large args, but at least it doesn't overflow for merely large args; it does overflow for huge args. Maybe zfs's wakeup arg is always less that 1 second, so it wasn't broken by blind conversion to use nstosbt(), but that is unclear. Conversions in the other direction are very rare, at least using the conversion functions instead of divisions by SBT_*. sbttous() is used once in dev/ow and once in kern_sysctl.c; sbttoms() is used once in kern_sysctl.c; sbttons() is never used. Thus the overflow in sbttons() doesn't matter, and overflow in kern_sysctl.c's misuse of sbttous() only occurs at 4294+ seconds. > >> XX dev/iicbus/nxprtc.c: pause_sbt("nxpotp", mstosbt(100), >> mstosbt(10), 0); >> XX dev/iicbus/nxprtc.c: pause_sbt("nxpbat", mstosbt(100), 0, 0); >> >> OK since 100 ms is less than 1 second. >> >> XX kern/kern_sysctl.c: sb = ustosbt(tt); >> XX kern/kern_sysctl.c: sb = mstosbt(tt); >> >> Recently added bugs. The args is supplied by applications so can be far >> above >> 1 second. >> >> Also, these functions have a bogus API that takes uint64_t args. sbt's >> can't represent that high, and the API doesn't support failure, so callers >> have the burden of passing valid values. It is easiest to only support >> args >> up to 1 second and require the caller to handle seconds. > > It's just as easy to cope. No, it is not. In your next committed versions, all functions still overflow, just at larger values. >> Lots of itimer and select() code handle the corresponding problem for >> timevals and timespecs almost correctly. Timevals and timespecs already >> have the seconds part separate and itimer and select() syscalls do validity >> checking on the fractional seconds, so there is no problem converting the >> fractional sections to an sbt. Howver, the seconds part has type time_t >> and this can be int64_t, which sbt's cannot represent. Also, POSIX doesn't >> permit failure for seconds values that are representable by time_t. The >> almost correct handling is to split up large seconds values in some cases >> and break POSIX conformance by silently reducing the seconds value in >> other cases. The reduction is usually to INT32_MAX / 2. This allows >> adding 2 limited values but it is not obvious that this is enough since >> rounding up twice or just adding 2 more would give overflow. > > Right, that's beyond the scope of what I'm fixing. Better fix the overflows in FreeBSD-11 and FreeBSD-12 (or get their author to fix them) before adding complications. > https://reviews.freebsd.org/D18051 > > Contains the changes. They address all the actual problems you've raised, > but I'm going to disagree that 'ull' is bogus. For FreeBSD, it's fine and > it's a lot more readable than the alternatives. I can't quote it in mail from there, but saw a committed version which I don't like, though it passes my tests. I said that long long is an abomination. 'ull' doesn't even have any effect in this case. It was last needed for gcc -std=before-c99 on i386, since C before C99 doesn't have the abomination and gcc warns about constants that are so large that there type is [unsigned] long long. There are no such constants on 64-bit arches, but there are some on 32-bit arches. clang is too broken to warn about this. Now kern.pre.mk enforces std=c99 although this is wrong (gnu99 is needed, as in userland), so the warning never occurs even for gcc. If you don't use explicitly typed constants, then constants automatically have the correct type. This is long long or unsigned long long for large constants on i386 -- there is no way to avoid the abomination then. But on amd64, the correct type for large constants is long or unsigned long. You might need ull constants to get unsigned arithmetic instead of signed arithmetic, where the natural type of the large constants is only long or long long. Your comments allude to this. But the conversions are too simple or bogusly typed to need this here -- almost all variable types are uint64_t although things overflow at about UINT32_MAX, so the natural arithmetic is uint64_t except on exotic unsupported/unsupportable arches where uint64_t has lower rank than int (then uint64_t promotes to only int, so there may be sign extension bugs, but using explicit unsigned long long constants gives some further promotions to unsigned long long). Using 'ull' is also a lexical style bug. Old code consistently uses LL. This was needed for the obfuscation given by using large decimal constants 10-15 years ago before -std was c99. This gives signed constants, and old code also consistently bogusly casts these constants to uint64_t to ensure unsigned arithmetic (except on the exotic arches). Bugs in the committed version: XX Log: XX Ensure that all values of ns, us and ms work for {n,u,m}stosbt All values don't work. E.g., since nstosbt multiplies a 64-bit unsigned value by approx. 4 and the result is a signed 64-bit value, values larger than about 1/8 of the maximum in ns overflow to a garbage negative sbt value. XX Also, use a shift one fewer left to avoid integer overflow causing XX incorrect results, and adjust the equasion accordingly. Document this. I'm not sure how this helps. When I tried it with my most accurate version, it reduced the accuracy of sbt values from +-1 in sbt units to +-2, for the obvious reason than the sloppy shift loses 1 bit. XX A test program to test all cases will be committed shortly. The test XX exaustively tries every value (thanks to bde for the test). Testing all 2**64 cases given by pretending to support times above 1 second makes exhaustive testing impossible. XX Modified: head/sys/sys/time.h XX ============================================================================== XX --- head/sys/sys/time.h Tue Nov 20 01:59:57 2018 (r340663) XX +++ head/sys/sys/time.h Tue Nov 20 07:11:23 2018 (r340664) XX @@ -162,9 +162,24 @@ sbttobt(sbintime_t _sbt) XX * large roundoff errors which sbttons() and nstosbt() avoid. Millisecond and XX * microsecond functions are also provided for completeness. XX * XX - * These functions return the smallest sbt larger or equal to the number of XX - * seconds requested so that sbttoX(Xtosbt(y)) == y. The 1 << 32 - 1 term added XX - * transforms the >> 32 from floor() to ceil(). XX + * These functions return the smallest sbt larger or equal to the XX + * number of seconds requested so that sbttoX(Xtosbt(y)) == y. Unlike No, these functions return an sbt that is much larger than the perfectly rounded one. See my old mail for the details, and for a variant that does perfect rounding. XX + * The naive computation we'd do is this XX + * ((unit * 2^64 / SIFACTOR) + 2^32-1) >> 32 XX + * However, that overflows. Instead, we compute XX + * ((unit * 2^63 / SIFACTOR) + 2^31-1) >> 32 XX + * and use pre-computed constants that are the ceil of the 2^63 / SIFACTOR XX + * term to ensure we are using exactly the right constant. We use the lesser XX + * evil of ull rather than a uint64_t cast to ensure we have well defined XX + * right shift semantics. With these changes, we get all the ns, us and ms XX + * conversions back and forth right. XX + * Note: This file is used for both kernel and userland includes, so we can't XX + * rely on KASSERT being defined, nor can we pollute the namespace by including XX + * assert.h. Many style bugs: - this comment has fancy formatting, but it is not protected by '/*-'. - this comment misformats sentence breaks as 1 spaces. Old comments in this file were carefully formatted to use 2 spaces. There is no need to calculate these constants manually. ISTR spending many mails instructing ian@ about their previous correct caclulation. The KASSERTs are never defined in the kernel either. See below. XX */ XX static __inline int64_t XX sbttons(sbintime_t _sbt) XX @@ -176,8 +191,18 @@ sbttons(sbintime_t _sbt) XX static __inline sbintime_t XX nstosbt(int64_t _ns) XX { XX + sbintime_t sb = 0; Style bug: initialization in declaration. XX XX - return ((_ns * (((uint64_t)1 << 63) / 500000000) + (1ull << 32) - 1) >> 32); XX +#ifdef KASSERT XX + KASSERT(_ns >= 0, ("Negative values illegal for nstosbt: %jd", _ns)); XX +#endif KASSERT is never defined here in correct kernel code, due to standard namespace pollution. Correct kernel code includes first, and in the kernel includes this file. KASSERT is not defined then. Correct kernel code includes second. It takes chumminess with the misimplementation to get KASSERT defined here. has grown much more massive and disgusting pollution than , but not enough for it to be self-sufficient. First you have to provide a replacement for that includes almost everything in it except . Include that and then . defines KASSERT early. It includes in is grosser pollution section later. This includes , and KASSERT is defined before it is used in this case. XX + if (_ns >= SBT_1S) { XX + sb = (_ns / 1000000000) * SBT_1S; XX + _ns = _ns % 1000000000; XX + } Not too pessimal since this case is rarely reached. XX + /* 9223372037 = ceil(2^63 / 1000000000) */ XX + sb += ((_ns * 9223372037ull) + 0x7fffffff) >> 31; This is harder to understand than my versions. First I fix the obfuscations and other style bugs in it: - contrary to what I said above, everything isn't uint64_t, so there is a sign extension bug in practice which the explicit unsigned long long constant fixes in an ugly way. _ns is only int64_t, and the natural constant is not unsigned, so the multiplication by the natural constant overflows to a negative value at about 0.5 seconds and then the shift is signed and messes up the negative value some more - however, there is no need to reduce the powers of 2 by 1. Cleaned up version with manually calculated multiplicative constant: /* 18446744973 = ceil(2**64 / 10**9) */ sb += (_ns * (uint64_t)18446744973 + 0xffffffff) >> 32; (Also remove comments about reducing the powers by 1.) Cleaned up version with the compiler calculating the multiplicative constant: sb += (_ns * (((uint64_t)1 << 63) / 500000000 + 1) + 0xffffffff) >> 32; The additive constant is harder to understand. Rounding up the multiplicative constant gives an increment that is higher than the infinite-precision value before the addition and the shift, but the shift often loses the extras. The additive constant keeps enough extras. The resulting sbt is often too high, but the important case when _ns = 0 is not converted to a nonzero sbt like some of my versions do. Since rounding up to the ceiling increases the multiplier by ~0.3 in units of 2**32, when _ns = 10**9-1, the increase from the scaling is ~300e8 and the increase from the additive constant is ~2**32 for a total increase of not much more than 1.1*2**32 in units of 2**32 or 1.1 in sbt units. This means that the sbt value is often 1 higher than the correctly rounded ceiling. The versions that round down the multiplier reduce it by ~0.7 in units of 2**32 and need an additive correction of about 4 sbt units to compensate. Most or all of my versions added this even when _ns = 0 when it is too much. It is not obvious that converting sbt values that are 1.1 units too high back to nanoseconds restores the original value (by rounding down). Increasing the multiplier by 1 more gives sbt values that are only 0.2 units higher than 1.1 when _ns = 10**9-1, but breaks the conversion back in 85% of cases (not just for large _ns). XX + return (sb); XX } XX XX static __inline int64_t XX ... Similarly. Bruce From owner-svn-src-all@freebsd.org Tue Nov 20 15:53:24 2018 Return-Path: Delivered-To: svn-src-all@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 4B4381133B57 for ; Tue, 20 Nov 2018 15:53:24 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-it1-x12b.google.com (mail-it1-x12b.google.com [IPv6:2607:f8b0:4864:20::12b]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 32C8773148 for ; Tue, 20 Nov 2018 15:53:23 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-it1-x12b.google.com with SMTP id h65so4226436ith.3 for ; Tue, 20 Nov 2018 07:53:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=w4vuG4uBzBVv621d+yxonx8CORiDGFCyoV+I547NDdI=; b=tI4XN7630T2j26bhXzmF3fPRBwInLyp/ODWkZUnk4AgbC3M+ZhWDKuuiWN463WqfOo ZGeLgUrAFBO6ig6wXCS5kQ6BpRCuJszKhrVXKfl8vUnca4b3l5Tft3qdkLFnInfAL7Sc M85rHqrx8pl0siBW9OsLtUrqItEZ3OP9ltoUwaxc/JxceXOwJzPu7vCDoOOoXBsUazVr 9N61IryixxqSvxzSYYD2EWzHlMbZDAx/WZXsPvYRYc2DZdKbwIXHu3+yuMzEy9QbuNzS Q2YSmss13ZcmRT4OwzhazqxcRT3LXYBNONUTVkJLUVoNRjR6UPt9jzcSOvU8BBMhM44h /JEw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=w4vuG4uBzBVv621d+yxonx8CORiDGFCyoV+I547NDdI=; b=XzhJNoWleS7ysNAPCMwctWpIzIABP4D42GehntFniXFG0+GIDUgC+JjgQPvp6iatqJ EUdmfK9/eihS8ZiKHh0c+MLKMqwhQFOHzxrrFzPgyz+jx+zEqyz1vJsQSyliM2LfZ/tA RmKZ8FPNwUoTd25RLI35+q9tvVstpcvbNAn9oO2VhHAv7H2cEe6juP2B91+jDNaJKVo9 s74TsVfOj2G2bUjiR8F25ZtNPgsq/ILI1RVcnPMpO18kpSKZPVifTpWlLnUZY7HH0PAy Iz1ZWxf/ctiqBl7ing4DLXdEq1hkSCAe2W4uPhTgVdbUpIJbm2uUxP7iTHsduKSeWwmY B60A== X-Gm-Message-State: AA+aEWYgh6ybj9T0zyC8455lc2tDpUzkc3b4Xr99617R22gYphfak1Ey Pk943B0kGEyCv37NEukYyHgsomQETRwTAFLkKnJbdQ== X-Google-Smtp-Source: AFSGD/UsxcdAgKPjBYpZPTGmDaJ0YlAK5+K8sIleh10qQTrDbOSpxq1cF3g/9mlDG2oamLBNWrn5kTqjundk+HiyjzY= X-Received: by 2002:a02:3da:: with SMTP id e87mr1935345jae.78.1542729202152; Tue, 20 Nov 2018 07:53:22 -0800 (PST) MIME-Version: 1.0 References: <201811201458.wAKEwftP033152@repo.freebsd.org> <20181120150756.GD2378@kib.kiev.ua> In-Reply-To: From: Warner Losh Date: Tue, 20 Nov 2018 08:53:11 -0700 Message-ID: Subject: Re: svn commit: r340676 - in head/sys: kern sys To: Mateusz Guzik Cc: Konstantin Belousov , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org X-Rspamd-Queue-Id: 32C8773148 X-Spamd-Result: default: False [-4.78 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; R_DKIM_ALLOW(-0.20)[bsdimp-com.20150623.gappssmtp.com]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; NEURAL_HAM_LONG(-1.00)[-0.997,0]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[svn-src-all@freebsd.org]; DMARC_NA(0.00)[bsdimp.com]; RCPT_COUNT_FIVE(0.00)[5]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[bsdimp-com.20150623.gappssmtp.com:+]; MX_GOOD(-0.01)[cached: ALT1.aspmx.l.google.com]; RCVD_IN_DNSWL_NONE(0.00)[b.2.1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.0]; NEURAL_HAM_SHORT(-0.99)[-0.991,0]; R_SPF_NA(0.00)[]; FORGED_SENDER(0.30)[imp@bsdimp.com,wlosh@bsdimp.com]; FREEMAIL_TO(0.00)[gmail.com]; RCVD_TLS_LAST(0.00)[]; IP_SCORE(-1.79)[ip: (-4.87), ipnet: 2607:f8b0::/32(-2.36), asn: 15169(-1.61), country: US(-0.09)]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; FROM_NEQ_ENVFROM(0.00)[imp@bsdimp.com,wlosh@bsdimp.com]; FREEMAIL_CC(0.00)[gmail.com] X-Rspamd-Server: mx1.freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Nov 2018 15:53:24 -0000 On Tue, Nov 20, 2018 at 8:28 AM Mateusz Guzik wrote: > On 11/20/18, Konstantin Belousov wrote: > > On Tue, Nov 20, 2018 at 02:58:41PM +0000, Mateusz Guzik wrote: > >> Author: mjg > >> Date: Tue Nov 20 14:58:41 2018 > >> New Revision: 340676 > >> URL: https://svnweb.freebsd.org/changeset/base/340676 > >> > >> Log: > >> Implement unr64 > >> > >> Important users of unr like tmpfs or pipes can get away with just > >> ever-increasing counters, making the overhead of managing the state > >> for 32 bit counters a pessimization. > >> > >> Change it to an atomic variable. This can be further sped up by making > >> the counts variable "allocate" ranges and store them per-cpu. > >> > >> Reviewed by: kib > >> Sponsored by: The FreeBSD Foundation > >> Differential Revision: https://reviews.freebsd.org/D18054 > >> > >> Modified: > >> head/sys/kern/subr_unit.c > >> head/sys/sys/systm.h > >> > >> Modified: head/sys/kern/subr_unit.c > >> > ============================================================================== > >> --- head/sys/kern/subr_unit.c Tue Nov 20 14:52:43 2018 > (r340675) > >> +++ head/sys/kern/subr_unit.c Tue Nov 20 14:58:41 2018 > (r340676) > >> @@ -98,6 +98,19 @@ static struct mtx unitmtx; > >> > >> MTX_SYSINIT(unit, &unitmtx, "unit# allocation", MTX_DEF); > >> > >> +#ifdef UNR64_LOCKED > >> +uint64_t > >> +alloc_unr64(struct unrhdr64 *unr64) > >> +{ > >> + uint64_t item; > >> + > >> + mtx_lock(&unitmtx); > >> + item = unr64->counter++; > >> + mtx_unlock(&unitmtx); > >> + return (item); > >> +} > >> +#endif > >> + > >> #else /* ...USERLAND */ > >> > >> #include > >> > >> Modified: head/sys/sys/systm.h > >> > ============================================================================== > >> --- head/sys/sys/systm.h Tue Nov 20 14:52:43 2018 (r340675) > >> +++ head/sys/sys/systm.h Tue Nov 20 14:58:41 2018 (r340676) > >> @@ -523,6 +523,32 @@ int alloc_unr_specific(struct unrhdr *uh, u_int > >> item); > >> int alloc_unrl(struct unrhdr *uh); > >> void free_unr(struct unrhdr *uh, u_int item); > >> > >> +#if defined(__mips__) || defined(__powerpc__) > > Please note what I asked about this #ifdefs in the review. mips > > and powerpc machine/atomic.h should define some symbol like > > __ATOMIC_NO_64_OPS and this case should be handled in less arch-explicit > > manner. > > > > Right, should have mentioned that in the commit message. > > Anyhow, mips has some degree of 64 bit ops even for 32 bits so > this becomes more iffy. In particular it does have atomic_add_64. > I don't have a good way to test mips atomics and since non-atomic > version for powerpc was needed anyway I decided not to try to > add one. > I thought the 64-bit stuff was not present in true 32-bit mips at all. You need the lld/scd instructions to do 64-bit atomics which are only available in a 64-bit environment (eg n32 or n64 execution). They throw a fatal machine error if you execute them in o32 land. And I think the proper ifdef for this is defined(mips) && !defined(__mips_n64) && !defined(__mips_n32) or something horrible like that to not pessimize 64-bit executions. > With this in place a global macro would have to explicitly indicate > lack of fetchadd, not 64 ops. So I think the current state is good > enough for now. Imo in the long run 64 bit ops should just get > emulated with a lock protected code in general manner. > We already do this for ARM. On armv4/5, there are no atomic instructions at all, so we emulate them by doing the normal operation with interrupts disabled. Since there's no MP designs from that era we support, this works out well. For most MIPS designs, this would work well too since the 32-bit mips designs we support are mostly UP (though to be fair, one can build 32-bit kernels for our 64-bit stuff, but they could cope with the lock). Warner From owner-svn-src-all@freebsd.org Tue Nov 20 16:06:44 2018 Return-Path: Delivered-To: svn-src-all@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 7199C11342A6; Tue, 20 Nov 2018 16:06:44 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CF51E739B2; Tue, 20 Nov 2018 16:06:43 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id wAKG6gnL067433; Tue, 20 Nov 2018 08:06:42 -0800 (PST) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id wAKG6gu5067432; Tue, 20 Nov 2018 08:06:42 -0800 (PST) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201811201606.wAKG6gu5067432@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r340678 - head/sys/arm64/arm64 In-Reply-To: <201811201512.wAKFCbv4042989@repo.freebsd.org> To: Mark Johnston Date: Tue, 20 Nov 2018 08:06:42 -0800 (PST) CC: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Rspamd-Queue-Id: CF51E739B2 X-Spamd-Result: default: False [1.23 / 15.00]; ARC_NA(0.00)[]; HAS_REPLYTO(0.00)[rgrimes@freebsd.org]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[dnsmgr.net]; REPLYTO_DOM_NEQ_FROM_DOM(0.00)[]; AUTH_NA(1.00)[]; NEURAL_SPAM_MEDIUM(0.57)[0.570,0]; RCVD_COUNT_THREE(0.00)[3]; IP_SCORE(-0.02)[country: US(-0.09)]; MX_GOOD(-0.01)[cached: pdx.rh.CN85.dnsmgr.net]; NEURAL_SPAM_LONG(0.55)[0.553,0]; NEURAL_HAM_SHORT(-0.76)[-0.760,0]; R_SPF_NA(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:13868, ipnet:69.59.192.0/19, country:US]; MID_RHS_MATCH_FROM(0.00)[] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Nov 2018 16:06:44 -0000 > Author: markj > Date: Tue Nov 20 15:12:37 2018 > New Revision: 340678 > URL: https://svnweb.freebsd.org/changeset/base/340678 > > Log: > Handle kernel superpage mappings in pmap_remove_l2(). > > PR: 233088 > Reviewed by: alc, andrew, kib > Tested by: sbruno > MFC after: 3 days > Sponsored by: The FreeBSD Foundation > Differential Revision: https://reviews.freebsd.org/D17981 Mark, If this is the fix for the aarch64/arm64 build cluster failure could you *please* make sure it gets MFC and MFS to releng/12 before this thursdays builds of RC2? Ie, about the next 24 hours? Consider this an RE approval for immediate MFC to stable/12 so that you can send an MFS RFA to merge it to releng/12 which well take another re to approve. Thanks, Rod Modified: > head/sys/arm64/arm64/pmap.c > > Modified: head/sys/arm64/arm64/pmap.c > ============================================================================== > --- head/sys/arm64/arm64/pmap.c Tue Nov 20 14:59:27 2018 (r340677) > +++ head/sys/arm64/arm64/pmap.c Tue Nov 20 15:12:37 2018 (r340678) > @@ -2382,8 +2382,40 @@ pmap_pv_insert_l2(pmap_t pmap, vm_offset_t va, pd_entr > return (true); > } > > +static void > +pmap_remove_kernel_l2(pmap_t pmap, pt_entry_t *l2, vm_offset_t va) > +{ > + pt_entry_t newl2, oldl2; > + vm_page_t ml3; > + vm_paddr_t ml3pa; > + > + KASSERT(!VIRT_IN_DMAP(va), ("removing direct mapping of %#lx", va)); > + KASSERT(pmap == kernel_pmap, ("pmap %p is not kernel_pmap", pmap)); > + PMAP_LOCK_ASSERT(pmap, MA_OWNED); > + > + ml3 = pmap_remove_pt_page(pmap, va); > + if (ml3 == NULL) > + panic("pmap_remove_kernel_l2: Missing pt page"); > + > + ml3pa = VM_PAGE_TO_PHYS(ml3); > + newl2 = ml3pa | L2_TABLE; > + > + /* > + * Initialize the page table page. > + */ > + pagezero((void *)PHYS_TO_DMAP(ml3pa)); > + > + /* > + * Demote the mapping. The caller must have already invalidated the > + * mapping (i.e., the "break" in break-before-make). > + */ > + oldl2 = pmap_load_store(l2, newl2); > + KASSERT(oldl2 == 0, ("%s: found existing mapping at %p: %#lx", > + __func__, l2, oldl2)); > +} > + > /* > - * pmap_remove_l2: do the things to unmap a level 2 superpage in a process > + * pmap_remove_l2: Do the things to unmap a level 2 superpage. > */ > static int > pmap_remove_l2(pmap_t pmap, pt_entry_t *l2, vm_offset_t sva, > @@ -2419,16 +2451,18 @@ pmap_remove_l2(pmap_t pmap, pt_entry_t *l2, vm_offset_ > vm_page_aflag_clear(m, PGA_WRITEABLE); > } > } > - KASSERT(pmap != kernel_pmap, > - ("Attempting to remove an l2 kernel page")); > - ml3 = pmap_remove_pt_page(pmap, sva); > - if (ml3 != NULL) { > - pmap_resident_count_dec(pmap, 1); > - KASSERT(ml3->wire_count == NL3PG, > - ("pmap_remove_l2: l3 page wire count error")); > - ml3->wire_count = 1; > - vm_page_unwire_noq(ml3); > - pmap_add_delayed_free_list(ml3, free, FALSE); > + if (pmap == kernel_pmap) { > + pmap_remove_kernel_l2(pmap, l2, sva); > + } else { > + ml3 = pmap_remove_pt_page(pmap, sva); > + if (ml3 != NULL) { > + pmap_resident_count_dec(pmap, 1); > + KASSERT(ml3->wire_count == NL3PG, > + ("pmap_remove_l2: l3 page wire count error")); > + ml3->wire_count = 1; > + vm_page_unwire_noq(ml3); > + pmap_add_delayed_free_list(ml3, free, FALSE); > + } > } > return (pmap_unuse_pt(pmap, sva, l1e, free)); > } > > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Tue Nov 20 16:35:54 2018 Return-Path: Delivered-To: svn-src-all@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 A59C1113531A; Tue, 20 Nov 2018 16:35:54 +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 4937F74F2B; Tue, 20 Nov 2018 16:35:54 +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 29F2D13DBC; Tue, 20 Nov 2018 16:35:54 +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 wAKGZscg084579; Tue, 20 Nov 2018 16:35:54 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAKGZsnc084578; Tue, 20 Nov 2018 16:35:54 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201811201635.wAKGZsnc084578@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 20 Nov 2018 16:35:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r340680 - stable/12/sys/arm64/arm64 X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/12/sys/arm64/arm64 X-SVN-Commit-Revision: 340680 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4937F74F2B X-Spamd-Result: default: False [0.33 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.13)[0.127,0]; NEURAL_SPAM_MEDIUM(0.19)[0.189,0]; NEURAL_SPAM_LONG(0.01)[0.010,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Nov 2018 16:35:54 -0000 Author: markj Date: Tue Nov 20 16:35:53 2018 New Revision: 340680 URL: https://svnweb.freebsd.org/changeset/base/340680 Log: MFC r340678: Handle kernel superpage mappings in pmap_remove_l2(). Modified: stable/12/sys/arm64/arm64/pmap.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/arm64/arm64/pmap.c ============================================================================== --- stable/12/sys/arm64/arm64/pmap.c Tue Nov 20 15:14:30 2018 (r340679) +++ stable/12/sys/arm64/arm64/pmap.c Tue Nov 20 16:35:53 2018 (r340680) @@ -2382,8 +2382,40 @@ pmap_pv_insert_l2(pmap_t pmap, vm_offset_t va, pd_entr return (true); } +static void +pmap_remove_kernel_l2(pmap_t pmap, pt_entry_t *l2, vm_offset_t va) +{ + pt_entry_t newl2, oldl2; + vm_page_t ml3; + vm_paddr_t ml3pa; + + KASSERT(!VIRT_IN_DMAP(va), ("removing direct mapping of %#lx", va)); + KASSERT(pmap == kernel_pmap, ("pmap %p is not kernel_pmap", pmap)); + PMAP_LOCK_ASSERT(pmap, MA_OWNED); + + ml3 = pmap_remove_pt_page(pmap, va); + if (ml3 == NULL) + panic("pmap_remove_kernel_l2: Missing pt page"); + + ml3pa = VM_PAGE_TO_PHYS(ml3); + newl2 = ml3pa | L2_TABLE; + + /* + * Initialize the page table page. + */ + pagezero((void *)PHYS_TO_DMAP(ml3pa)); + + /* + * Demote the mapping. The caller must have already invalidated the + * mapping (i.e., the "break" in break-before-make). + */ + oldl2 = pmap_load_store(l2, newl2); + KASSERT(oldl2 == 0, ("%s: found existing mapping at %p: %#lx", + __func__, l2, oldl2)); +} + /* - * pmap_remove_l2: do the things to unmap a level 2 superpage in a process + * pmap_remove_l2: Do the things to unmap a level 2 superpage. */ static int pmap_remove_l2(pmap_t pmap, pt_entry_t *l2, vm_offset_t sva, @@ -2419,16 +2451,18 @@ pmap_remove_l2(pmap_t pmap, pt_entry_t *l2, vm_offset_ vm_page_aflag_clear(m, PGA_WRITEABLE); } } - KASSERT(pmap != kernel_pmap, - ("Attempting to remove an l2 kernel page")); - ml3 = pmap_remove_pt_page(pmap, sva); - if (ml3 != NULL) { - pmap_resident_count_dec(pmap, 1); - KASSERT(ml3->wire_count == NL3PG, - ("pmap_remove_l2: l3 page wire count error")); - ml3->wire_count = 1; - vm_page_unwire_noq(ml3); - pmap_add_delayed_free_list(ml3, free, FALSE); + if (pmap == kernel_pmap) { + pmap_remove_kernel_l2(pmap, l2, sva); + } else { + ml3 = pmap_remove_pt_page(pmap, sva); + if (ml3 != NULL) { + pmap_resident_count_dec(pmap, 1); + KASSERT(ml3->wire_count == NL3PG, + ("pmap_remove_l2: l3 page wire count error")); + ml3->wire_count = 1; + vm_page_unwire_noq(ml3); + pmap_add_delayed_free_list(ml3, free, FALSE); + } } return (pmap_unuse_pt(pmap, sva, l1e, free)); } From owner-svn-src-all@freebsd.org Tue Nov 20 16:54:44 2018 Return-Path: Delivered-To: svn-src-all@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 28C3C1136003; Tue, 20 Nov 2018 16:54:44 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C32CC75D4D; Tue, 20 Nov 2018 16:54:43 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A11F714102; Tue, 20 Nov 2018 16:54:43 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAKGshxY094439; Tue, 20 Nov 2018 16:54:43 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAKGshll094437; Tue, 20 Nov 2018 16:54:43 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201811201654.wAKGshll094437@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Tue, 20 Nov 2018 16:54:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340681 - in head/stand/i386: btx/btx btx/btxldr gptboot X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: in head/stand/i386: btx/btx btx/btxldr gptboot X-SVN-Commit-Revision: 340681 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C32CC75D4D X-Spamd-Result: default: False [0.31 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.19)[0.186,0]; NEURAL_HAM_LONG(-0.00)[-0.003,0]; NEURAL_SPAM_MEDIUM(0.13)[0.126,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Nov 2018 16:54:44 -0000 Author: emaste Date: Tue Nov 20 16:54:42 2018 New Revision: 340681 URL: https://svnweb.freebsd.org/changeset/base/340681 Log: stand: remove CLANG_NO_IAS from btx and gptboot Many components under stand/ had CLANG_NO_IAS added when Clang's Integrated Assembler (IAS) did not handle .codeNN directives. Clang gained support quite some time ago, and we can now build stand/ with IAS. Note that in some cases there are small differences in the generated output, so CLANG_NO_IAS should be removed only after testing (or after finding no differences in the output). PR: 205250, 233094 Sponsored by: The FreeBSD Foundation Modified: head/stand/i386/btx/btx/Makefile head/stand/i386/btx/btxldr/Makefile head/stand/i386/gptboot/Makefile Modified: head/stand/i386/btx/btx/Makefile ============================================================================== --- head/stand/i386/btx/btx/Makefile Tue Nov 20 16:35:53 2018 (r340680) +++ head/stand/i386/btx/btx/Makefile Tue Nov 20 16:54:42 2018 (r340681) @@ -29,6 +29,3 @@ ORG= 0x9000 LDFLAGS+=${LDFLAGS_BIN} .include - -# XXX: clang integrated-as doesn't grok .codeNN directives yet -CFLAGS.btx.S= ${CLANG_NO_IAS} Modified: head/stand/i386/btx/btxldr/Makefile ============================================================================== --- head/stand/i386/btx/btxldr/Makefile Tue Nov 20 16:35:53 2018 (r340680) +++ head/stand/i386/btx/btxldr/Makefile Tue Nov 20 16:54:42 2018 (r340681) @@ -17,6 +17,3 @@ ORG=${LOADER_ADDRESS} LDFLAGS+=${LDFLAGS_BIN} .include - -# XXX: clang integrated-as doesn't grok .codeNN directives yet -CFLAGS.btxldr.S= ${CLANG_NO_IAS} Modified: head/stand/i386/gptboot/Makefile ============================================================================== --- head/stand/i386/gptboot/Makefile Tue Nov 20 16:35:53 2018 (r340680) +++ head/stand/i386/gptboot/Makefile Tue Nov 20 16:54:42 2018 (r340681) @@ -63,6 +63,3 @@ gptboot.out: ${BTXCRT} gptboot.o sio.o crc32.o drv.o c ${LD} ${LD_FLAGS} -Ttext ${ORG2} -o ${.TARGET} ${.ALLSRC} ${LIBSA32} .include - -# XXX: clang integrated-as doesn't grok .codeNN directives yet -CFLAGS.gptldr.S= ${CLANG_NO_IAS} From owner-svn-src-all@freebsd.org Tue Nov 20 17:01:56 2018 Return-Path: Delivered-To: svn-src-all@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 DB914113676B; Tue, 20 Nov 2018 17:01:56 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.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 7F28F76693; Tue, 20 Nov 2018 17:01:56 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 61C161426D; Tue, 20 Nov 2018 17:01:56 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAKH1uFC096847; Tue, 20 Nov 2018 17:01:56 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAKH1uBG096846; Tue, 20 Nov 2018 17:01:56 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201811201701.wAKH1uBG096846@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Tue, 20 Nov 2018 17:01:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r340682 - stable/12/sys/amd64/include X-SVN-Group: stable-12 X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: stable/12/sys/amd64/include X-SVN-Commit-Revision: 340682 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 7F28F76693 X-Spamd-Result: default: False [0.32 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.01)[0.007,0]; NEURAL_SPAM_MEDIUM(0.17)[0.172,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.14)[0.138,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Nov 2018 17:01:57 -0000 Author: mjg Date: Tue Nov 20 17:01:55 2018 New Revision: 340682 URL: https://svnweb.freebsd.org/changeset/base/340682 Log: MFC r339449: amd64: relax constraints in curthread and curpcb This makes the compiler less likely to reload the content from %gs. The 'P' modifier drops all synteax prefixes and 'n' constraint treats input as a known at compilation time immediate integer. Example reloading victim was spinlock_enter. Modified: stable/12/sys/amd64/include/pcpu.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/amd64/include/pcpu.h ============================================================================== --- stable/12/sys/amd64/include/pcpu.h Tue Nov 20 16:54:42 2018 (r340681) +++ stable/12/sys/amd64/include/pcpu.h Tue Nov 20 17:01:55 2018 (r340682) @@ -227,8 +227,7 @@ __curthread(void) { struct thread *td; - __asm("movq %%gs:%1,%0" : "=r" (td) - : "m" (*(char *)OFFSETOF_CURTHREAD)); + __asm("movq %%gs:%P1,%0" : "=r" (td) : "n" (OFFSETOF_CURTHREAD)); return (td); } #ifdef __clang__ @@ -242,7 +241,7 @@ __curpcb(void) { struct pcb *pcb; - __asm("movq %%gs:%1,%0" : "=r" (pcb) : "m" (*(char *)OFFSETOF_CURPCB)); + __asm("movq %%gs:%P1,%0" : "=r" (pcb) : "n" (OFFSETOF_CURPCB)); return (pcb); } #define curpcb (__curpcb()) From owner-svn-src-all@freebsd.org Tue Nov 20 17:05:34 2018 Return-Path: Delivered-To: svn-src-all@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 E96AA113690D; Tue, 20 Nov 2018 17:05:33 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 85E7076952; Tue, 20 Nov 2018 17:05:33 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6665E142A6; Tue, 20 Nov 2018 17:05:33 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAKH5XnC000349; Tue, 20 Nov 2018 17:05:33 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAKH5XRt000348; Tue, 20 Nov 2018 17:05:33 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201811201705.wAKH5XRt000348@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Tue, 20 Nov 2018 17:05:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-svnadmin@freebsd.org Subject: svn commit: r340683 - svnadmin/conf X-SVN-Group: svnadmin X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: svnadmin/conf X-SVN-Commit-Revision: 340683 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 85E7076952 X-Spamd-Result: default: False [0.28 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.18)[0.179,0]; NEURAL_HAM_LONG(-0.01)[-0.006,0]; NEURAL_SPAM_MEDIUM(0.11)[0.109,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Nov 2018 17:05:34 -0000 Author: emaste Date: Tue Nov 20 17:05:32 2018 New Revision: 340683 URL: https://svnweb.freebsd.org/changeset/base/340683 Log: Release bwidawsk from mentorship. Modified: svnadmin/conf/mentors Modified: svnadmin/conf/mentors ============================================================================== --- svnadmin/conf/mentors Tue Nov 20 17:01:55 2018 (r340682) +++ svnadmin/conf/mentors Tue Nov 20 17:05:32 2018 (r340683) @@ -14,7 +14,6 @@ achim scottl Co-mentor: emaste anish neel Co-mentor: grehan bcran eadler brd allanjude Co-mentor: bapt -bwidawsk emaste def pjd eri ae Co-mentor: thompsa gordon delphij Co-mentor: emaste From owner-svn-src-all@freebsd.org Tue Nov 20 17:10:46 2018 Return-Path: Delivered-To: svn-src-all@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 6B4C91136BD3; Tue, 20 Nov 2018 17:10:46 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0D91676CE4; Tue, 20 Nov 2018 17:10:46 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E2E50142BF; Tue, 20 Nov 2018 17:10:45 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAKHAj07000805; Tue, 20 Nov 2018 17:10:45 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAKHAimp000800; Tue, 20 Nov 2018 17:10:44 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201811201710.wAKHAimp000800@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Tue, 20 Nov 2018 17:10:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r340684 - in stable/12: . lib/libc/amd64/string sys/amd64/amd64 X-SVN-Group: stable-12 X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: in stable/12: . lib/libc/amd64/string sys/amd64/amd64 X-SVN-Commit-Revision: 340684 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 0D91676CE4 X-Spamd-Result: default: False [0.37 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.01)[0.014,0]; NEURAL_SPAM_MEDIUM(0.21)[0.206,0]; NEURAL_SPAM_SHORT(0.15)[0.151,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Nov 2018 17:10:46 -0000 Author: mjg Date: Tue Nov 20 17:10:44 2018 New Revision: 340684 URL: https://svnweb.freebsd.org/changeset/base/340684 Log: MFC r339531,r339579,r340252,r340463,r340464,340472,r340587 amd64: tidy up memset to have rax set earlier for small sizes amd64: finish the tail in memset with an overlapping store amd64: align memset buffers to 16 bytes before using rep stos amd64: convert libc bzero to a C func to avoid future bloat amd64: sync up libc memset with the kernel version amd64: handle small memset buffers with overlapping stores Fix -DNO_CLEAN amd64 build after r340463 Added: stable/12/lib/libc/amd64/string/bzero.c - copied unchanged from r340463, head/lib/libc/amd64/string/bzero.c Deleted: stable/12/lib/libc/amd64/string/bzero.S Modified: stable/12/Makefile.inc1 stable/12/lib/libc/amd64/string/Makefile.inc stable/12/lib/libc/amd64/string/memset.S stable/12/sys/amd64/amd64/support.S Directory Properties: stable/12/ (props changed) Modified: stable/12/Makefile.inc1 ============================================================================== --- stable/12/Makefile.inc1 Tue Nov 20 17:05:32 2018 (r340683) +++ stable/12/Makefile.inc1 Tue Nov 20 17:10:44 2018 (r340684) @@ -948,6 +948,13 @@ _cleanobj_fast_depend_hack: .PHONY ${LIBCOMPAT:D${LIBCOMPAT_OBJTOP}/lib/libc/.depend.${f}.*}; \ fi .endfor +# 20181115 r340463 bzero reimplemented as .c + @if [ -e "${OBJTOP}/lib/libc/.depend.bzero.o" ] && \ + egrep -qw 'bzero\.[sS]' ${OBJTOP}/lib/libc/.depend.bzero.o; then \ + echo "Removing stale dependencies for bzero"; \ + rm -f ${OBJTOP}/lib/libc/.depend.bzero.* \ + ${LIBCOMPAT:D${LIBCOMPAT_OBJTOP}/lib/libc/.depend.bzero.*}; \ + fi # 20181009 track migration from ntp's embedded libevent to updated one @if [ -e "${OBJTOP}/usr.sbin/ntp/libntpevent/.depend.bufferevent_openssl.o" ] && \ egrep -q 'contrib/ntp/sntp/libevent/bufferevent_openssl.c' \ Modified: stable/12/lib/libc/amd64/string/Makefile.inc ============================================================================== --- stable/12/lib/libc/amd64/string/Makefile.inc Tue Nov 20 17:05:32 2018 (r340683) +++ stable/12/lib/libc/amd64/string/Makefile.inc Tue Nov 20 17:10:44 2018 (r340684) @@ -2,7 +2,6 @@ MDSRCS+= \ bcmp.S \ - bzero.S \ memcmp.S \ memcpy.S \ memmove.S \ Copied: stable/12/lib/libc/amd64/string/bzero.c (from r340463, head/lib/libc/amd64/string/bzero.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/12/lib/libc/amd64/string/bzero.c Tue Nov 20 17:10:44 2018 (r340684, copy of r340463, head/lib/libc/amd64/string/bzero.c) @@ -0,0 +1,15 @@ +/*- + * Public domain. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include + +void +bzero(void *b, size_t len) +{ + + memset(b, 0, len); +} Modified: stable/12/lib/libc/amd64/string/memset.S ============================================================================== --- stable/12/lib/libc/amd64/string/memset.S Tue Nov 20 17:05:32 2018 (r340683) +++ stable/12/lib/libc/amd64/string/memset.S Tue Nov 20 17:10:44 2018 (r340684) @@ -31,101 +31,112 @@ #include __FBSDID("$FreeBSD$"); -.macro MEMSET bzero erms -.if \bzero == 1 - movq %rsi,%rcx - movq %rsi,%rdx - xorl %eax,%eax -.else - movq %rdi,%r9 +#define ALIGN_TEXT .p2align 4,0x90 /* 16-byte alignment, nop filled */ + +.macro MEMSET erms + movq %rdi,%rax movq %rdx,%rcx movzbq %sil,%r8 - movabs $0x0101010101010101,%rax - imulq %r8,%rax -.endif + movabs $0x0101010101010101,%r10 + imulq %r8,%r10 cmpq $32,%rcx - jb 1016f + jbe 101632f cmpq $256,%rcx ja 1256f -1032: - movq %rax,(%rdi) - movq %rax,8(%rdi) - movq %rax,16(%rdi) - movq %rax,24(%rdi) +103200: + movq %r10,(%rdi) + movq %r10,8(%rdi) + movq %r10,16(%rdi) + movq %r10,24(%rdi) leaq 32(%rdi),%rdi subq $32,%rcx cmpq $32,%rcx - jae 1032b - cmpb $0,%cl - je 1000f -1016: + ja 103200b cmpb $16,%cl - jl 1008f - movq %rax,(%rdi) - movq %rax,8(%rdi) - subb $16,%cl - jz 1000f - leaq 16(%rdi),%rdi -1008: + ja 201632f + movq %r10,-16(%rdi,%rcx) + movq %r10,-8(%rdi,%rcx) + ret + ALIGN_TEXT +101632: + cmpb $16,%cl + jl 100816f +201632: + movq %r10,(%rdi) + movq %r10,8(%rdi) + movq %r10,-16(%rdi,%rcx) + movq %r10,-8(%rdi,%rcx) + ret + ALIGN_TEXT +100816: cmpb $8,%cl - jl 1004f - movq %rax,(%rdi) - subb $8,%cl - jz 1000f - leaq 8(%rdi),%rdi -1004: + jl 100408f + movq %r10,(%rdi) + movq %r10,-8(%rdi,%rcx) + ret + ALIGN_TEXT +100408: cmpb $4,%cl - jl 1002f - movl %eax,(%rdi) - subb $4,%cl - jz 1000f - leaq 4(%rdi),%rdi -1002: + jl 100204f + movl %r10d,(%rdi) + movl %r10d,-4(%rdi,%rcx) + ret + ALIGN_TEXT +100204: cmpb $2,%cl - jl 1001f - movw %ax,(%rdi) - subb $2,%cl - jz 1000f - leaq 2(%rdi),%rdi -1001: - cmpb $1,%cl - jl 1000f - movb %al,(%rdi) -1000: -.if \bzero == 0 - movq %r9,%rax -.endif + jl 100001f + movw %r10w,(%rdi) + movw %r10w,-2(%rdi,%rcx) ret - + ALIGN_TEXT +100001: + cmpb $0,%cl + je 100000f + movb %r10b,(%rdi) +100000: + ret + ALIGN_TEXT 1256: + movq %rdi,%r9 + movq %r10,%rax + testl $15,%edi + jnz 3f +1: .if \erms == 1 rep stosb + movq %r9,%rax .else + movq %rcx,%rdx shrq $3,%rcx rep stosq - movq %rdx,%rcx - andb $7,%cl - jne 1004b -.endif -.if \bzero == 0 movq %r9,%rax + andl $7,%edx + jnz 2f + ret +2: + movq %r10,-8(%rdi,%rdx) .endif ret + ALIGN_TEXT +3: + movq %r10,(%rdi) + movq %r10,8(%rdi) + movq %rdi,%r8 + andq $15,%r8 + leaq -16(%rcx,%r8),%rcx + neg %r8 + leaq 16(%rdi,%r8),%rdi + jmp 1b .endm -#ifndef BZERO + ENTRY(memset) - MEMSET bzero=0 erms=0 + MEMSET erms=0 END(memset) -#else -ENTRY(bzero) - MEMSET bzero=1 erms=0 -END(bzero) -#endif .section .note.GNU-stack,"",%progbits Modified: stable/12/sys/amd64/amd64/support.S ============================================================================== --- stable/12/sys/amd64/amd64/support.S Tue Nov 20 17:05:32 2018 (r340683) +++ stable/12/sys/amd64/amd64/support.S Tue Nov 20 17:10:44 2018 (r340684) @@ -452,82 +452,112 @@ END(memcpy_erms) */ .macro MEMSET erms PUSH_FRAME_POINTER - movq %rdi,%r9 + movq %rdi,%rax movq %rdx,%rcx movzbq %sil,%r8 - movabs $0x0101010101010101,%rax - imulq %r8,%rax + movabs $0x0101010101010101,%r10 + imulq %r8,%r10 cmpq $32,%rcx - jb 1016f + jbe 101632f cmpq $256,%rcx ja 1256f -1032: - movq %rax,(%rdi) - movq %rax,8(%rdi) - movq %rax,16(%rdi) - movq %rax,24(%rdi) +103200: + movq %r10,(%rdi) + movq %r10,8(%rdi) + movq %r10,16(%rdi) + movq %r10,24(%rdi) leaq 32(%rdi),%rdi subq $32,%rcx cmpq $32,%rcx - jae 1032b - cmpb $0,%cl - je 1000f -1016: + ja 103200b cmpb $16,%cl - jl 1008f - movq %rax,(%rdi) - movq %rax,8(%rdi) - subb $16,%cl - jz 1000f - leaq 16(%rdi),%rdi -1008: + ja 201632f + movq %r10,-16(%rdi,%rcx) + movq %r10,-8(%rdi,%rcx) + POP_FRAME_POINTER + ret + ALIGN_TEXT +101632: + cmpb $16,%cl + jl 100816f +201632: + movq %r10,(%rdi) + movq %r10,8(%rdi) + movq %r10,-16(%rdi,%rcx) + movq %r10,-8(%rdi,%rcx) + POP_FRAME_POINTER + ret + ALIGN_TEXT +100816: cmpb $8,%cl - jl 1004f - movq %rax,(%rdi) - subb $8,%cl - jz 1000f - leaq 8(%rdi),%rdi -1004: + jl 100408f + movq %r10,(%rdi) + movq %r10,-8(%rdi,%rcx) + POP_FRAME_POINTER + ret + ALIGN_TEXT +100408: cmpb $4,%cl - jl 1002f - movl %eax,(%rdi) - subb $4,%cl - jz 1000f - leaq 4(%rdi),%rdi -1002: + jl 100204f + movl %r10d,(%rdi) + movl %r10d,-4(%rdi,%rcx) + POP_FRAME_POINTER + ret + ALIGN_TEXT +100204: cmpb $2,%cl - jl 1001f - movw %ax,(%rdi) - subb $2,%cl - jz 1000f - leaq 2(%rdi),%rdi -1001: - cmpb $1,%cl - jl 1000f - movb %al,(%rdi) -1000: - movq %r9,%rax + jl 100001f + movw %r10w,(%rdi) + movw %r10w,-2(%rdi,%rcx) POP_FRAME_POINTER ret ALIGN_TEXT +100001: + cmpb $0,%cl + je 100000f + movb %r10b,(%rdi) +100000: + POP_FRAME_POINTER + ret + ALIGN_TEXT 1256: + movq %rdi,%r9 + movq %r10,%rax + testl $15,%edi + jnz 3f +1: .if \erms == 1 rep stosb + movq %r9,%rax .else + movq %rcx,%rdx shrq $3,%rcx rep stosq - movq %rdx,%rcx - andb $7,%cl - jne 1004b -.endif movq %r9,%rax + andl $7,%edx + jnz 2f POP_FRAME_POINTER ret +2: + movq %r10,-8(%rdi,%rdx) +.endif + POP_FRAME_POINTER + ret + ALIGN_TEXT +3: + movq %r10,(%rdi) + movq %r10,8(%rdi) + movq %rdi,%r8 + andq $15,%r8 + leaq -16(%rcx,%r8),%rcx + neg %r8 + leaq 16(%rdi,%r8),%rdi + jmp 1b .endm ENTRY(memset_std) From owner-svn-src-all@freebsd.org Tue Nov 20 17:43:25 2018 Return-Path: Delivered-To: svn-src-all@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 285171137B5D; Tue, 20 Nov 2018 17:43: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 BE498780FE; Tue, 20 Nov 2018 17:43: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 9F6181496D; Tue, 20 Nov 2018 17:43: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 wAKHhOrw021014; Tue, 20 Nov 2018 17:43:24 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAKHhOBE021013; Tue, 20 Nov 2018 17:43:24 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201811201743.wAKHhOBE021013@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 20 Nov 2018 17:43:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r340685 - releng/12.0/sys/arm64/arm64 X-SVN-Group: releng X-SVN-Commit-Author: markj X-SVN-Commit-Paths: releng/12.0/sys/arm64/arm64 X-SVN-Commit-Revision: 340685 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: BE498780FE X-Spamd-Result: default: False [0.55 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.40)[0.404,0]; NEURAL_SPAM_MEDIUM(0.14)[0.143,0]; NEURAL_SPAM_LONG(0.00)[0.001,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Nov 2018 17:43:25 -0000 Author: markj Date: Tue Nov 20 17:43:24 2018 New Revision: 340685 URL: https://svnweb.freebsd.org/changeset/base/340685 Log: MFstable/12 r340680: Handle kernel superpage mappings in pmap_remove_l2(). PR: 233088 Approved by: re (gjb) Modified: releng/12.0/sys/arm64/arm64/pmap.c Directory Properties: releng/12.0/ (props changed) Modified: releng/12.0/sys/arm64/arm64/pmap.c ============================================================================== --- releng/12.0/sys/arm64/arm64/pmap.c Tue Nov 20 17:10:44 2018 (r340684) +++ releng/12.0/sys/arm64/arm64/pmap.c Tue Nov 20 17:43:24 2018 (r340685) @@ -2382,8 +2382,40 @@ pmap_pv_insert_l2(pmap_t pmap, vm_offset_t va, pd_entr return (true); } +static void +pmap_remove_kernel_l2(pmap_t pmap, pt_entry_t *l2, vm_offset_t va) +{ + pt_entry_t newl2, oldl2; + vm_page_t ml3; + vm_paddr_t ml3pa; + + KASSERT(!VIRT_IN_DMAP(va), ("removing direct mapping of %#lx", va)); + KASSERT(pmap == kernel_pmap, ("pmap %p is not kernel_pmap", pmap)); + PMAP_LOCK_ASSERT(pmap, MA_OWNED); + + ml3 = pmap_remove_pt_page(pmap, va); + if (ml3 == NULL) + panic("pmap_remove_kernel_l2: Missing pt page"); + + ml3pa = VM_PAGE_TO_PHYS(ml3); + newl2 = ml3pa | L2_TABLE; + + /* + * Initialize the page table page. + */ + pagezero((void *)PHYS_TO_DMAP(ml3pa)); + + /* + * Demote the mapping. The caller must have already invalidated the + * mapping (i.e., the "break" in break-before-make). + */ + oldl2 = pmap_load_store(l2, newl2); + KASSERT(oldl2 == 0, ("%s: found existing mapping at %p: %#lx", + __func__, l2, oldl2)); +} + /* - * pmap_remove_l2: do the things to unmap a level 2 superpage in a process + * pmap_remove_l2: Do the things to unmap a level 2 superpage. */ static int pmap_remove_l2(pmap_t pmap, pt_entry_t *l2, vm_offset_t sva, @@ -2419,16 +2451,18 @@ pmap_remove_l2(pmap_t pmap, pt_entry_t *l2, vm_offset_ vm_page_aflag_clear(m, PGA_WRITEABLE); } } - KASSERT(pmap != kernel_pmap, - ("Attempting to remove an l2 kernel page")); - ml3 = pmap_remove_pt_page(pmap, sva); - if (ml3 != NULL) { - pmap_resident_count_dec(pmap, 1); - KASSERT(ml3->wire_count == NL3PG, - ("pmap_remove_l2: l3 page wire count error")); - ml3->wire_count = 1; - vm_page_unwire_noq(ml3); - pmap_add_delayed_free_list(ml3, free, FALSE); + if (pmap == kernel_pmap) { + pmap_remove_kernel_l2(pmap, l2, sva); + } else { + ml3 = pmap_remove_pt_page(pmap, sva); + if (ml3 != NULL) { + pmap_resident_count_dec(pmap, 1); + KASSERT(ml3->wire_count == NL3PG, + ("pmap_remove_l2: l3 page wire count error")); + ml3->wire_count = 1; + vm_page_unwire_noq(ml3); + pmap_add_delayed_free_list(ml3, free, FALSE); + } } return (pmap_unuse_pt(pmap, sva, l1e, free)); } From owner-svn-src-all@freebsd.org Tue Nov 20 18:10:57 2018 Return-Path: Delivered-To: svn-src-all@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 477A61138945; Tue, 20 Nov 2018 18:10: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 B5FF479ECC; Tue, 20 Nov 2018 18:10:56 +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 8E1F914CF3; Tue, 20 Nov 2018 18:10:56 +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 wAKIAuSI033569; Tue, 20 Nov 2018 18:10:56 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAKIAuc3033568; Tue, 20 Nov 2018 18:10:56 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201811201810.wAKIAuc3033568@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 20 Nov 2018 18:10:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340686 - head/sbin/dumpon X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sbin/dumpon X-SVN-Commit-Revision: 340686 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B5FF479ECC X-Spamd-Result: default: False [0.52 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.40)[0.398,0]; NEURAL_HAM_LONG(-0.00)[-0.003,0]; NEURAL_SPAM_MEDIUM(0.13)[0.126,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Nov 2018 18:10:57 -0000 Author: markj Date: Tue Nov 20 18:10:56 2018 New Revision: 340686 URL: https://svnweb.freebsd.org/changeset/base/340686 Log: Avoid clobbering a user-specified -g value after r340547. CID: 1396919 MFC with: r340547 Modified: head/sbin/dumpon/dumpon.c Modified: head/sbin/dumpon/dumpon.c ============================================================================== --- head/sbin/dumpon/dumpon.c Tue Nov 20 17:43:24 2018 (r340685) +++ head/sbin/dumpon/dumpon.c Tue Nov 20 18:10:56 2018 (r340686) @@ -475,12 +475,15 @@ main(int argc, char *argv[]) if (inet_aton(client, &ndconf.ndc_client) == 0) errx(EX_USAGE, "invalid client address '%s'", client); - gateway = find_gateway(argv[0]); if (gateway == NULL) { - if (verbose) - printf("failed to look up gateway for %s\n", - server); - gateway = server; + gateway = find_gateway(argv[0]); + if (gateway == NULL) { + if (verbose) + printf( + "failed to look up gateway for %s\n", + server); + gateway = server; + } } if (inet_aton(gateway, &ndconf.ndc_gateway) == 0) errx(EX_USAGE, "invalid gateway address '%s'", gateway); From owner-svn-src-all@freebsd.org Tue Nov 20 18:13:19 2018 Return-Path: Delivered-To: svn-src-all@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 162471138BB6; Tue, 20 Nov 2018 18:13: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 A62C47A29B; Tue, 20 Nov 2018 18:13:18 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 86AD814E5E; Tue, 20 Nov 2018 18:13:18 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAKIDI7G038474; Tue, 20 Nov 2018 18:13:18 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAKIDIH1038473; Tue, 20 Nov 2018 18:13:18 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201811201813.wAKIDIH1038473@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 20 Nov 2018 18:13:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340687 - head/tests/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/tests/sys/netinet X-SVN-Commit-Revision: 340687 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A62C47A29B X-Spamd-Result: default: False [0.52 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.40)[0.398,0]; NEURAL_HAM_LONG(-0.00)[-0.003,0]; NEURAL_SPAM_MEDIUM(0.13)[0.126,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Nov 2018 18:13:19 -0000 Author: markj Date: Tue Nov 20 18:13:18 2018 New Revision: 340687 URL: https://svnweb.freebsd.org/changeset/base/340687 Log: Plug a trivial memory leak. CID: 1396911 MFC with: r340485 Modified: head/tests/sys/netinet/ip_reass_test.c Modified: head/tests/sys/netinet/ip_reass_test.c ============================================================================== --- head/tests/sys/netinet/ip_reass_test.c Tue Nov 20 18:10:56 2018 (r340686) +++ head/tests/sys/netinet/ip_reass_test.c Tue Nov 20 18:13:18 2018 (r340687) @@ -264,6 +264,8 @@ ATF_TC_BODY(ip_reass__multiple_last_fragments, tc) ATF_REQUIRE(error == 0); free_lopacket(packet1); free_lopacket(packet2); + free_lopacket(packet3); + free_lopacket(packet4); } /* From owner-svn-src-all@freebsd.org Tue Nov 20 18:14:23 2018 Return-Path: Delivered-To: svn-src-all@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 320311138C70; Tue, 20 Nov 2018 18:14:23 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-it1-f173.google.com (mail-it1-f173.google.com [209.85.166.173]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9722F7A412; Tue, 20 Nov 2018 18:14:22 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-it1-f173.google.com with SMTP id b5so4994644iti.2; Tue, 20 Nov 2018 10:14:22 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:reply-to :from:date:message-id:subject:to:cc; bh=49PuKrxNKVPxlxODeco04r+haK/WDb0DmdjzQmpMfgs=; b=swaadKdCQzAIDOpx2TyuuiM/KoS/H6CzNdtE8qj7rLSvrKKAJ1XevWu6cLfB5ekevc UmyO972pe0d79CgXQBGf6idtAG+xRes4KV1b5Eh/JkUpyN5fBg0mGuvrGwFmpqUJcIDM VP9TgIC/AEUrYTbqJEbZgUM1P1c4bjf4/L/618cCUktBvLAZewagJegn+UAvA30C0WQH qIOtTRDVqzPHU79DaAnpSSNCIhivxS6dTStIv9j0uSbAknokfRTJxEtwN/UG14ZCjnPP rhYUT9hfF98mJc/PMf4gJtKQkhTe7QAt+wEy6gFl6LzETjWAA+B2F6b8hHNJcvO+Qeb2 IL9g== X-Gm-Message-State: AGRZ1gJ3AA89V1rsloUUZwGaRaatmCl5AOvImXN/6f/Zljv/zpVovGXz jMEvTr/nwX8ZbPrWixorjG7GM2M4 X-Google-Smtp-Source: AFSGD/UmXfnnMRF2A2muvXiYBy/nBmBEVX2X8IHhG0PxXiGfKbmPj3DIkdm/Q0IOAd8xOcyX/L6FxA== X-Received: by 2002:a24:1947:: with SMTP id b68mr3105037itb.70.1542737655856; Tue, 20 Nov 2018 10:14:15 -0800 (PST) Received: from mail-it1-f178.google.com (mail-it1-f178.google.com. [209.85.166.178]) by smtp.gmail.com with ESMTPSA id y9sm8892887ioj.63.2018.11.20.10.14.15 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 20 Nov 2018 10:14:15 -0800 (PST) Received: by mail-it1-f178.google.com with SMTP id x19so4793284itl.1; Tue, 20 Nov 2018 10:14:15 -0800 (PST) X-Received: by 2002:a24:7296:: with SMTP id x144-v6mr2843898itc.166.1542737655262; Tue, 20 Nov 2018 10:14:15 -0800 (PST) MIME-Version: 1.0 References: <201811121120.wACBKxMt061432@repo.freebsd.org> In-Reply-To: <201811121120.wACBKxMt061432@repo.freebsd.org> Reply-To: cem@freebsd.org From: Conrad Meyer Date: Tue, 20 Nov 2018 10:14:04 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r340360 - in head: sbin/ipfw sys/netinet6 sys/netpfil/ipfw/nptv6 To: "Andrey V. Elsukov" Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 9722F7A412 X-Spamd-Result: default: False [-3.99 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; HAS_REPLYTO(0.00)[cem@freebsd.org]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; RCVD_TLS_LAST(0.00)[]; DMARC_NA(0.00)[freebsd.org]; TO_DN_SOME(0.00)[]; REPLYTO_ADDR_EQ_FROM(0.00)[]; NEURAL_HAM_LONG(-0.99)[-0.992,0]; RCVD_COUNT_THREE(0.00)[4]; IP_SCORE(-1.03)[ipnet: 209.85.128.0/17(-3.46), asn: 15169(-1.61), country: US(-0.09)]; MX_GOOD(-0.01)[cached: alt3.gmail-smtp-in.l.google.com]; NEURAL_HAM_SHORT(-0.97)[-0.974,0]; RCVD_IN_DNSWL_NONE(0.00)[173.166.85.209.list.dnswl.org : 127.0.5.0]; NEURAL_HAM_MEDIUM(-0.98)[-0.981,0]; FORGED_SENDER(0.30)[cem@freebsd.org,csecem@gmail.com]; R_DKIM_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; TAGGED_FROM(0.00)[]; FROM_NEQ_ENVFROM(0.00)[cem@freebsd.org,csecem@gmail.com] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Nov 2018 18:14:23 -0000 Hi Andrey, On Mon, Nov 12, 2018 at 3:21 AM Andrey V. Elsukov wrote: > > Author: ae > Date: Mon Nov 12 11:20:59 2018 > New Revision: 340360 > URL: https://svnweb.freebsd.org/changeset/base/340360 > > Log: > Add ability to use dynamic external prefix in ipfw_nptv6 module. > > ... > Modified: head/sbin/ipfw/nptv6.c > ============================================================================== > --- head/sbin/ipfw/nptv6.c Mon Nov 12 07:14:34 2018 (r340359) > +++ head/sbin/ipfw/nptv6.c Mon Nov 12 11:20:59 2018 (r340360) > ... > @@ -245,13 +261,14 @@ check_prefix: > if ((flags & NPTV6_HAS_INTPREFIX) != NPTV6_HAS_INTPREFIX) > errx(EX_USAGE, "int_prefix required"); > if ((flags & NPTV6_HAS_EXTPREFIX) != NPTV6_HAS_EXTPREFIX) > - errx(EX_USAGE, "ext_prefix required"); > + errx(EX_USAGE, "ext_prefix or ext_if required"); > if ((flags & NPTV6_HAS_PREFIXLEN) != NPTV6_HAS_PREFIXLEN) > errx(EX_USAGE, "prefixlen required"); > > n2mask(&mask, cfg->plen); > APPLY_MASK(&cfg->internal, &mask); > - APPLY_MASK(&cfg->external, &mask); > + if ((cfg->flags & NPTV6_DYNAMIC_PREFIX) == 0) > + APPLY_MASK(&cfg->external, &mask); Coverity points out that APPLY_MASK() is a macro composed of multiple statements, and only the first statement will be conditional on the if () expression. This means that effectively, the final three words of mask will be applied to cfg->external unconditionally. CID is 1396914. I would suggest using the do { } while (0) construct in the APPLY_MASK macro to fix the issue. Best, Conrad From owner-svn-src-all@freebsd.org Tue Nov 20 18:14:35 2018 Return-Path: Delivered-To: svn-src-all@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 E89581138CA0; Tue, 20 Nov 2018 18:14:34 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7F3497A4D5; Tue, 20 Nov 2018 18:14:34 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 831E814E60; Tue, 20 Nov 2018 18:14:31 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAKIEV3M038571; Tue, 20 Nov 2018 18:14:31 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAKIEUJe038566; Tue, 20 Nov 2018 18:14:30 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201811201814.wAKIEUJe038566@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Tue, 20 Nov 2018 18:14:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r340688 - in releng/12.0: . lib/libc/amd64/string sys/amd64/amd64 X-SVN-Group: releng X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: in releng/12.0: . lib/libc/amd64/string sys/amd64/amd64 X-SVN-Commit-Revision: 340688 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 7F3497A4D5 X-Spamd-Result: default: False [0.57 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.00)[0.004,0]; NEURAL_SPAM_SHORT(0.41)[0.410,0]; NEURAL_SPAM_MEDIUM(0.16)[0.160,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Nov 2018 18:14:35 -0000 Author: mjg Date: Tue Nov 20 18:14:30 2018 New Revision: 340688 URL: https://svnweb.freebsd.org/changeset/base/340688 Log: MFC r339531,r339579,r340252,r340463,r340464,340472,r340587 amd64: tidy up memset to have rax set earlier for small sizes amd64: finish the tail in memset with an overlapping store amd64: align memset buffers to 16 bytes before using rep stos amd64: convert libc bzero to a C func to avoid future bloat amd64: sync up libc memset with the kernel version amd64: handle small memset buffers with overlapping stores Fix -DNO_CLEAN amd64 build after r340463 Approved by: re (gjb) Added: releng/12.0/lib/libc/amd64/string/bzero.c - copied unchanged from r340684, stable/12/lib/libc/amd64/string/bzero.c Deleted: releng/12.0/lib/libc/amd64/string/bzero.S Modified: releng/12.0/Makefile.inc1 releng/12.0/lib/libc/amd64/string/Makefile.inc releng/12.0/lib/libc/amd64/string/memset.S releng/12.0/sys/amd64/amd64/support.S Directory Properties: releng/12.0/ (props changed) Modified: releng/12.0/Makefile.inc1 ============================================================================== --- releng/12.0/Makefile.inc1 Tue Nov 20 18:13:18 2018 (r340687) +++ releng/12.0/Makefile.inc1 Tue Nov 20 18:14:30 2018 (r340688) @@ -948,6 +948,13 @@ _cleanobj_fast_depend_hack: .PHONY ${LIBCOMPAT:D${LIBCOMPAT_OBJTOP}/lib/libc/.depend.${f}.*}; \ fi .endfor +# 20181115 r340463 bzero reimplemented as .c + @if [ -e "${OBJTOP}/lib/libc/.depend.bzero.o" ] && \ + egrep -qw 'bzero\.[sS]' ${OBJTOP}/lib/libc/.depend.bzero.o; then \ + echo "Removing stale dependencies for bzero"; \ + rm -f ${OBJTOP}/lib/libc/.depend.bzero.* \ + ${LIBCOMPAT:D${LIBCOMPAT_OBJTOP}/lib/libc/.depend.bzero.*}; \ + fi # 20181009 track migration from ntp's embedded libevent to updated one @if [ -e "${OBJTOP}/usr.sbin/ntp/libntpevent/.depend.bufferevent_openssl.o" ] && \ egrep -q 'contrib/ntp/sntp/libevent/bufferevent_openssl.c' \ Modified: releng/12.0/lib/libc/amd64/string/Makefile.inc ============================================================================== --- releng/12.0/lib/libc/amd64/string/Makefile.inc Tue Nov 20 18:13:18 2018 (r340687) +++ releng/12.0/lib/libc/amd64/string/Makefile.inc Tue Nov 20 18:14:30 2018 (r340688) @@ -2,7 +2,6 @@ MDSRCS+= \ bcmp.S \ - bzero.S \ memcmp.S \ memcpy.S \ memmove.S \ Copied: releng/12.0/lib/libc/amd64/string/bzero.c (from r340684, stable/12/lib/libc/amd64/string/bzero.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ releng/12.0/lib/libc/amd64/string/bzero.c Tue Nov 20 18:14:30 2018 (r340688, copy of r340684, stable/12/lib/libc/amd64/string/bzero.c) @@ -0,0 +1,15 @@ +/*- + * Public domain. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include + +void +bzero(void *b, size_t len) +{ + + memset(b, 0, len); +} Modified: releng/12.0/lib/libc/amd64/string/memset.S ============================================================================== --- releng/12.0/lib/libc/amd64/string/memset.S Tue Nov 20 18:13:18 2018 (r340687) +++ releng/12.0/lib/libc/amd64/string/memset.S Tue Nov 20 18:14:30 2018 (r340688) @@ -31,101 +31,112 @@ #include __FBSDID("$FreeBSD$"); -.macro MEMSET bzero erms -.if \bzero == 1 - movq %rsi,%rcx - movq %rsi,%rdx - xorl %eax,%eax -.else - movq %rdi,%r9 +#define ALIGN_TEXT .p2align 4,0x90 /* 16-byte alignment, nop filled */ + +.macro MEMSET erms + movq %rdi,%rax movq %rdx,%rcx movzbq %sil,%r8 - movabs $0x0101010101010101,%rax - imulq %r8,%rax -.endif + movabs $0x0101010101010101,%r10 + imulq %r8,%r10 cmpq $32,%rcx - jb 1016f + jbe 101632f cmpq $256,%rcx ja 1256f -1032: - movq %rax,(%rdi) - movq %rax,8(%rdi) - movq %rax,16(%rdi) - movq %rax,24(%rdi) +103200: + movq %r10,(%rdi) + movq %r10,8(%rdi) + movq %r10,16(%rdi) + movq %r10,24(%rdi) leaq 32(%rdi),%rdi subq $32,%rcx cmpq $32,%rcx - jae 1032b - cmpb $0,%cl - je 1000f -1016: + ja 103200b cmpb $16,%cl - jl 1008f - movq %rax,(%rdi) - movq %rax,8(%rdi) - subb $16,%cl - jz 1000f - leaq 16(%rdi),%rdi -1008: + ja 201632f + movq %r10,-16(%rdi,%rcx) + movq %r10,-8(%rdi,%rcx) + ret + ALIGN_TEXT +101632: + cmpb $16,%cl + jl 100816f +201632: + movq %r10,(%rdi) + movq %r10,8(%rdi) + movq %r10,-16(%rdi,%rcx) + movq %r10,-8(%rdi,%rcx) + ret + ALIGN_TEXT +100816: cmpb $8,%cl - jl 1004f - movq %rax,(%rdi) - subb $8,%cl - jz 1000f - leaq 8(%rdi),%rdi -1004: + jl 100408f + movq %r10,(%rdi) + movq %r10,-8(%rdi,%rcx) + ret + ALIGN_TEXT +100408: cmpb $4,%cl - jl 1002f - movl %eax,(%rdi) - subb $4,%cl - jz 1000f - leaq 4(%rdi),%rdi -1002: + jl 100204f + movl %r10d,(%rdi) + movl %r10d,-4(%rdi,%rcx) + ret + ALIGN_TEXT +100204: cmpb $2,%cl - jl 1001f - movw %ax,(%rdi) - subb $2,%cl - jz 1000f - leaq 2(%rdi),%rdi -1001: - cmpb $1,%cl - jl 1000f - movb %al,(%rdi) -1000: -.if \bzero == 0 - movq %r9,%rax -.endif + jl 100001f + movw %r10w,(%rdi) + movw %r10w,-2(%rdi,%rcx) ret - + ALIGN_TEXT +100001: + cmpb $0,%cl + je 100000f + movb %r10b,(%rdi) +100000: + ret + ALIGN_TEXT 1256: + movq %rdi,%r9 + movq %r10,%rax + testl $15,%edi + jnz 3f +1: .if \erms == 1 rep stosb + movq %r9,%rax .else + movq %rcx,%rdx shrq $3,%rcx rep stosq - movq %rdx,%rcx - andb $7,%cl - jne 1004b -.endif -.if \bzero == 0 movq %r9,%rax + andl $7,%edx + jnz 2f + ret +2: + movq %r10,-8(%rdi,%rdx) .endif ret + ALIGN_TEXT +3: + movq %r10,(%rdi) + movq %r10,8(%rdi) + movq %rdi,%r8 + andq $15,%r8 + leaq -16(%rcx,%r8),%rcx + neg %r8 + leaq 16(%rdi,%r8),%rdi + jmp 1b .endm -#ifndef BZERO + ENTRY(memset) - MEMSET bzero=0 erms=0 + MEMSET erms=0 END(memset) -#else -ENTRY(bzero) - MEMSET bzero=1 erms=0 -END(bzero) -#endif .section .note.GNU-stack,"",%progbits Modified: releng/12.0/sys/amd64/amd64/support.S ============================================================================== --- releng/12.0/sys/amd64/amd64/support.S Tue Nov 20 18:13:18 2018 (r340687) +++ releng/12.0/sys/amd64/amd64/support.S Tue Nov 20 18:14:30 2018 (r340688) @@ -452,82 +452,112 @@ END(memcpy_erms) */ .macro MEMSET erms PUSH_FRAME_POINTER - movq %rdi,%r9 + movq %rdi,%rax movq %rdx,%rcx movzbq %sil,%r8 - movabs $0x0101010101010101,%rax - imulq %r8,%rax + movabs $0x0101010101010101,%r10 + imulq %r8,%r10 cmpq $32,%rcx - jb 1016f + jbe 101632f cmpq $256,%rcx ja 1256f -1032: - movq %rax,(%rdi) - movq %rax,8(%rdi) - movq %rax,16(%rdi) - movq %rax,24(%rdi) +103200: + movq %r10,(%rdi) + movq %r10,8(%rdi) + movq %r10,16(%rdi) + movq %r10,24(%rdi) leaq 32(%rdi),%rdi subq $32,%rcx cmpq $32,%rcx - jae 1032b - cmpb $0,%cl - je 1000f -1016: + ja 103200b cmpb $16,%cl - jl 1008f - movq %rax,(%rdi) - movq %rax,8(%rdi) - subb $16,%cl - jz 1000f - leaq 16(%rdi),%rdi -1008: + ja 201632f + movq %r10,-16(%rdi,%rcx) + movq %r10,-8(%rdi,%rcx) + POP_FRAME_POINTER + ret + ALIGN_TEXT +101632: + cmpb $16,%cl + jl 100816f +201632: + movq %r10,(%rdi) + movq %r10,8(%rdi) + movq %r10,-16(%rdi,%rcx) + movq %r10,-8(%rdi,%rcx) + POP_FRAME_POINTER + ret + ALIGN_TEXT +100816: cmpb $8,%cl - jl 1004f - movq %rax,(%rdi) - subb $8,%cl - jz 1000f - leaq 8(%rdi),%rdi -1004: + jl 100408f + movq %r10,(%rdi) + movq %r10,-8(%rdi,%rcx) + POP_FRAME_POINTER + ret + ALIGN_TEXT +100408: cmpb $4,%cl - jl 1002f - movl %eax,(%rdi) - subb $4,%cl - jz 1000f - leaq 4(%rdi),%rdi -1002: + jl 100204f + movl %r10d,(%rdi) + movl %r10d,-4(%rdi,%rcx) + POP_FRAME_POINTER + ret + ALIGN_TEXT +100204: cmpb $2,%cl - jl 1001f - movw %ax,(%rdi) - subb $2,%cl - jz 1000f - leaq 2(%rdi),%rdi -1001: - cmpb $1,%cl - jl 1000f - movb %al,(%rdi) -1000: - movq %r9,%rax + jl 100001f + movw %r10w,(%rdi) + movw %r10w,-2(%rdi,%rcx) POP_FRAME_POINTER ret ALIGN_TEXT +100001: + cmpb $0,%cl + je 100000f + movb %r10b,(%rdi) +100000: + POP_FRAME_POINTER + ret + ALIGN_TEXT 1256: + movq %rdi,%r9 + movq %r10,%rax + testl $15,%edi + jnz 3f +1: .if \erms == 1 rep stosb + movq %r9,%rax .else + movq %rcx,%rdx shrq $3,%rcx rep stosq - movq %rdx,%rcx - andb $7,%cl - jne 1004b -.endif movq %r9,%rax + andl $7,%edx + jnz 2f POP_FRAME_POINTER ret +2: + movq %r10,-8(%rdi,%rdx) +.endif + POP_FRAME_POINTER + ret + ALIGN_TEXT +3: + movq %r10,(%rdi) + movq %r10,8(%rdi) + movq %rdi,%r8 + andq $15,%r8 + leaq -16(%rcx,%r8),%rcx + neg %r8 + leaq 16(%rdi,%r8),%rdi + jmp 1b .endm ENTRY(memset_std) From owner-svn-src-all@freebsd.org Tue Nov 20 18:38:29 2018 Return-Path: Delivered-To: svn-src-all@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 D8C461139391; Tue, 20 Nov 2018 18:38:29 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 786BF7B04C; Tue, 20 Nov 2018 18:38:29 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 59831151AA; Tue, 20 Nov 2018 18:38:29 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAKIcTs3049096; Tue, 20 Nov 2018 18:38:29 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAKIcTEs049094; Tue, 20 Nov 2018 18:38:29 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201811201838.wAKIcTEs049094@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Tue, 20 Nov 2018 18:38:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340689 - in head: sbin/ipfw sys/netinet X-SVN-Group: head X-SVN-Commit-Author: ae X-SVN-Commit-Paths: in head: sbin/ipfw sys/netinet X-SVN-Commit-Revision: 340689 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 786BF7B04C X-Spamd-Result: default: False [0.43 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_MEDIUM(0.13)[0.126,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.31)[0.310,0]; NEURAL_HAM_LONG(-0.00)[-0.003,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Nov 2018 18:38:30 -0000 Author: ae Date: Tue Nov 20 18:38:28 2018 New Revision: 340689 URL: https://svnweb.freebsd.org/changeset/base/340689 Log: Make multiline APPLY_MASK() macro to be function-like. Reported by: cem MFC after: 1 week Modified: head/sbin/ipfw/ipv6.c head/sys/netinet/ip_fw.h Modified: head/sbin/ipfw/ipv6.c ============================================================================== --- head/sbin/ipfw/ipv6.c Tue Nov 20 18:14:30 2018 (r340688) +++ head/sbin/ipfw/ipv6.c Tue Nov 20 18:38:28 2018 (r340689) @@ -401,7 +401,7 @@ fill_ip6(ipfw_insn_ip6 *cmd, char *av, int cblen, stru n2mask(&d[1], masklen); } - APPLY_MASK(d, &d[1]) /* mask base address with mask */ + APPLY_MASK(d, &d[1]); /* mask base address with mask */ av = q; Modified: head/sys/netinet/ip_fw.h ============================================================================== --- head/sys/netinet/ip_fw.h Tue Nov 20 18:14:30 2018 (r340688) +++ head/sys/netinet/ip_fw.h Tue Nov 20 18:38:28 2018 (r340689) @@ -551,11 +551,12 @@ typedef struct _ipfw_insn_nat { } ipfw_insn_nat; /* Apply ipv6 mask on ipv6 addr */ -#define APPLY_MASK(addr,mask) \ +#define APPLY_MASK(addr,mask) do { \ (addr)->__u6_addr.__u6_addr32[0] &= (mask)->__u6_addr.__u6_addr32[0]; \ (addr)->__u6_addr.__u6_addr32[1] &= (mask)->__u6_addr.__u6_addr32[1]; \ (addr)->__u6_addr.__u6_addr32[2] &= (mask)->__u6_addr.__u6_addr32[2]; \ - (addr)->__u6_addr.__u6_addr32[3] &= (mask)->__u6_addr.__u6_addr32[3]; + (addr)->__u6_addr.__u6_addr32[3] &= (mask)->__u6_addr.__u6_addr32[3]; \ +} while (0) /* Structure for ipv6 */ typedef struct _ipfw_insn_ip6 { From owner-svn-src-all@freebsd.org Tue Nov 20 18:59:51 2018 Return-Path: Delivered-To: svn-src-all@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 9699B1139FDC; Tue, 20 Nov 2018 18:59:50 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.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 43B087C507; Tue, 20 Nov 2018 18:59:50 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 23CDE154FC; Tue, 20 Nov 2018 18:59:50 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAKIxoZQ060703; Tue, 20 Nov 2018 18:59:50 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAKIxgXI060663; Tue, 20 Nov 2018 18:59:42 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <201811201859.wAKIxgXI060663@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Tue, 20 Nov 2018 18:59:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r340690 - in vendor-crypto/openssl/dist: . apps crypto crypto/async/arch crypto/bio crypto/bn crypto/bn/asm crypto/conf crypto/ct crypto/dsa crypto/ec crypto/engine crypto/err crypto/ev... X-SVN-Group: vendor-crypto X-SVN-Commit-Author: jkim X-SVN-Commit-Paths: in vendor-crypto/openssl/dist: . apps crypto crypto/async/arch crypto/bio crypto/bn crypto/bn/asm crypto/conf crypto/ct crypto/dsa crypto/ec crypto/engine crypto/err crypto/evp crypto/include/internal... X-SVN-Commit-Revision: 340690 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 43B087C507 X-Spamd-Result: default: False [0.52 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.01)[0.012,0]; NEURAL_SPAM_SHORT(0.31)[0.309,0]; NEURAL_SPAM_MEDIUM(0.19)[0.194,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Nov 2018 18:59:51 -0000 Author: jkim Date: Tue Nov 20 18:59:41 2018 New Revision: 340690 URL: https://svnweb.freebsd.org/changeset/base/340690 Log: Import OpenSSL 1.1.1a. Added: vendor-crypto/openssl/dist/crypto/getenv.c (contents, props changed) vendor-crypto/openssl/dist/doc/man3/SSL_get_peer_tmp_key.pod Deleted: vendor-crypto/openssl/dist/doc/man3/SSL_CTX_set_client_CA_list.pod vendor-crypto/openssl/dist/doc/man3/SSL_get_client_CA_list.pod vendor-crypto/openssl/dist/doc/man3/SSL_get_server_tmp_key.pod Modified: vendor-crypto/openssl/dist/CHANGES vendor-crypto/openssl/dist/Configure vendor-crypto/openssl/dist/INSTALL vendor-crypto/openssl/dist/NEWS vendor-crypto/openssl/dist/README vendor-crypto/openssl/dist/apps/app_rand.c vendor-crypto/openssl/dist/apps/apps.c vendor-crypto/openssl/dist/apps/apps.h vendor-crypto/openssl/dist/apps/ca.c vendor-crypto/openssl/dist/apps/ocsp.c vendor-crypto/openssl/dist/apps/openssl.cnf vendor-crypto/openssl/dist/apps/opt.c vendor-crypto/openssl/dist/apps/rehash.c vendor-crypto/openssl/dist/apps/rsa.c vendor-crypto/openssl/dist/apps/s_cb.c vendor-crypto/openssl/dist/apps/s_server.c vendor-crypto/openssl/dist/apps/speed.c vendor-crypto/openssl/dist/apps/x509.c vendor-crypto/openssl/dist/crypto/LPdir_unix.c vendor-crypto/openssl/dist/crypto/async/arch/async_posix.h vendor-crypto/openssl/dist/crypto/bio/b_sock2.c vendor-crypto/openssl/dist/crypto/bio/bio_lib.c vendor-crypto/openssl/dist/crypto/bio/bss_log.c vendor-crypto/openssl/dist/crypto/bn/asm/x86_64-gcc.c vendor-crypto/openssl/dist/crypto/bn/bn_exp.c vendor-crypto/openssl/dist/crypto/bn/bn_lib.c vendor-crypto/openssl/dist/crypto/build.info vendor-crypto/openssl/dist/crypto/conf/conf_api.c vendor-crypto/openssl/dist/crypto/conf/conf_mod.c vendor-crypto/openssl/dist/crypto/cryptlib.c vendor-crypto/openssl/dist/crypto/ct/ct_log.c vendor-crypto/openssl/dist/crypto/dsa/dsa_gen.c vendor-crypto/openssl/dist/crypto/dsa/dsa_ossl.c vendor-crypto/openssl/dist/crypto/ec/ec_ameth.c vendor-crypto/openssl/dist/crypto/ec/ec_mult.c vendor-crypto/openssl/dist/crypto/ec/ec_pmeth.c vendor-crypto/openssl/dist/crypto/ec/ecdh_kdf.c vendor-crypto/openssl/dist/crypto/engine/eng_devcrypto.c vendor-crypto/openssl/dist/crypto/engine/eng_list.c vendor-crypto/openssl/dist/crypto/err/openssl.txt vendor-crypto/openssl/dist/crypto/evp/e_aes.c vendor-crypto/openssl/dist/crypto/evp/e_rc2.c vendor-crypto/openssl/dist/crypto/evp/pmeth_lib.c vendor-crypto/openssl/dist/crypto/include/internal/ec_int.h vendor-crypto/openssl/dist/crypto/include/internal/rand_int.h vendor-crypto/openssl/dist/crypto/kdf/hkdf.c vendor-crypto/openssl/dist/crypto/mem_sec.c vendor-crypto/openssl/dist/crypto/o_fopen.c vendor-crypto/openssl/dist/crypto/pkcs12/p12_mutl.c vendor-crypto/openssl/dist/crypto/poly1305/poly1305_ieee754.c vendor-crypto/openssl/dist/crypto/rand/drbg_ctr.c vendor-crypto/openssl/dist/crypto/rand/drbg_lib.c vendor-crypto/openssl/dist/crypto/rand/rand_err.c vendor-crypto/openssl/dist/crypto/rand/rand_lcl.h vendor-crypto/openssl/dist/crypto/rand/rand_lib.c vendor-crypto/openssl/dist/crypto/rand/rand_unix.c vendor-crypto/openssl/dist/crypto/rand/randfile.c vendor-crypto/openssl/dist/crypto/rsa/rsa_lib.c vendor-crypto/openssl/dist/crypto/rsa/rsa_meth.c vendor-crypto/openssl/dist/crypto/rsa/rsa_ossl.c vendor-crypto/openssl/dist/crypto/sha/asm/keccak1600-s390x.pl vendor-crypto/openssl/dist/crypto/sha/asm/sha512p8-ppc.pl vendor-crypto/openssl/dist/crypto/siphash/siphash.c vendor-crypto/openssl/dist/crypto/sm2/sm2_crypt.c vendor-crypto/openssl/dist/crypto/sm2/sm2_sign.c vendor-crypto/openssl/dist/crypto/ui/ui_openssl.c vendor-crypto/openssl/dist/crypto/x509/by_dir.c vendor-crypto/openssl/dist/crypto/x509/by_file.c vendor-crypto/openssl/dist/crypto/x509/x509_vfy.c vendor-crypto/openssl/dist/doc/man1/ca.pod vendor-crypto/openssl/dist/doc/man1/enc.pod vendor-crypto/openssl/dist/doc/man1/openssl.pod vendor-crypto/openssl/dist/doc/man1/req.pod vendor-crypto/openssl/dist/doc/man1/rsa.pod vendor-crypto/openssl/dist/doc/man1/s_server.pod vendor-crypto/openssl/dist/doc/man1/storeutl.pod vendor-crypto/openssl/dist/doc/man1/x509.pod vendor-crypto/openssl/dist/doc/man3/DES_random_key.pod vendor-crypto/openssl/dist/doc/man3/EVP_DigestInit.pod vendor-crypto/openssl/dist/doc/man3/EVP_PKEY_CTX_ctrl.pod vendor-crypto/openssl/dist/doc/man3/EVP_PKEY_CTX_set_hkdf_md.pod vendor-crypto/openssl/dist/doc/man3/EVP_PKEY_CTX_set_rsa_pss_keygen_md.pod vendor-crypto/openssl/dist/doc/man3/EVP_PKEY_set1_RSA.pod vendor-crypto/openssl/dist/doc/man3/EVP_aes.pod vendor-crypto/openssl/dist/doc/man3/EVP_aria.pod vendor-crypto/openssl/dist/doc/man3/EVP_bf_cbc.pod vendor-crypto/openssl/dist/doc/man3/EVP_camellia.pod vendor-crypto/openssl/dist/doc/man3/EVP_cast5_cbc.pod vendor-crypto/openssl/dist/doc/man3/EVP_des.pod vendor-crypto/openssl/dist/doc/man3/EVP_idea_cbc.pod vendor-crypto/openssl/dist/doc/man3/EVP_md5.pod vendor-crypto/openssl/dist/doc/man3/EVP_rc2_cbc.pod vendor-crypto/openssl/dist/doc/man3/EVP_rc5_32_12_16_cbc.pod vendor-crypto/openssl/dist/doc/man3/EVP_seed_cbc.pod vendor-crypto/openssl/dist/doc/man3/EVP_sm4_cbc.pod vendor-crypto/openssl/dist/doc/man3/OPENSSL_VERSION_NUMBER.pod vendor-crypto/openssl/dist/doc/man3/RSA_meth_new.pod vendor-crypto/openssl/dist/doc/man3/SSL_CTX_set0_CA_list.pod vendor-crypto/openssl/dist/doc/man3/SSL_CTX_set1_curves.pod vendor-crypto/openssl/dist/doc/man3/SSL_CTX_set_quiet_shutdown.pod vendor-crypto/openssl/dist/doc/man3/SSL_get_error.pod vendor-crypto/openssl/dist/doc/man3/SSL_get_peer_signature_nid.pod vendor-crypto/openssl/dist/doc/man3/SSL_set_bio.pod vendor-crypto/openssl/dist/doc/man3/SSL_set_shutdown.pod vendor-crypto/openssl/dist/doc/man3/SSL_shutdown.pod vendor-crypto/openssl/dist/doc/man7/RAND_DRBG.pod vendor-crypto/openssl/dist/e_os.h vendor-crypto/openssl/dist/include/internal/cryptlib.h vendor-crypto/openssl/dist/include/internal/tsan_assist.h vendor-crypto/openssl/dist/include/openssl/cryptoerr.h vendor-crypto/openssl/dist/include/openssl/ec.h vendor-crypto/openssl/dist/include/openssl/ocsp.h vendor-crypto/openssl/dist/include/openssl/opensslv.h vendor-crypto/openssl/dist/include/openssl/rand_drbg.h vendor-crypto/openssl/dist/include/openssl/randerr.h vendor-crypto/openssl/dist/include/openssl/rsa.h vendor-crypto/openssl/dist/include/openssl/ssl.h vendor-crypto/openssl/dist/include/openssl/symhacks.h vendor-crypto/openssl/dist/include/openssl/tls1.h vendor-crypto/openssl/dist/ssl/d1_lib.c vendor-crypto/openssl/dist/ssl/record/rec_layer_d1.c vendor-crypto/openssl/dist/ssl/record/record.h vendor-crypto/openssl/dist/ssl/record/record_locl.h vendor-crypto/openssl/dist/ssl/record/ssl3_record.c vendor-crypto/openssl/dist/ssl/s3_cbc.c vendor-crypto/openssl/dist/ssl/s3_enc.c vendor-crypto/openssl/dist/ssl/s3_lib.c vendor-crypto/openssl/dist/ssl/ssl_cert.c vendor-crypto/openssl/dist/ssl/ssl_ciph.c vendor-crypto/openssl/dist/ssl/ssl_lib.c vendor-crypto/openssl/dist/ssl/ssl_locl.h vendor-crypto/openssl/dist/ssl/statem/extensions.c vendor-crypto/openssl/dist/ssl/statem/extensions_clnt.c vendor-crypto/openssl/dist/ssl/statem/statem.c vendor-crypto/openssl/dist/ssl/statem/statem_clnt.c vendor-crypto/openssl/dist/ssl/statem/statem_lib.c vendor-crypto/openssl/dist/ssl/statem/statem_locl.h vendor-crypto/openssl/dist/ssl/statem/statem_srvr.c vendor-crypto/openssl/dist/ssl/t1_lib.c vendor-crypto/openssl/dist/ssl/tls13_enc.c Modified: vendor-crypto/openssl/dist/CHANGES ============================================================================== --- vendor-crypto/openssl/dist/CHANGES Tue Nov 20 18:38:28 2018 (r340689) +++ vendor-crypto/openssl/dist/CHANGES Tue Nov 20 18:59:41 2018 (r340690) @@ -7,6 +7,42 @@ https://github.com/openssl/openssl/commits/ and pick the appropriate release branch. + Changes between 1.1.1 and 1.1.1a [20 Nov 2018] + + *) Timing vulnerability in DSA signature generation + + The OpenSSL DSA signature algorithm has been shown to be vulnerable to a + timing side channel attack. An attacker could use variations in the signing + algorithm to recover the private key. + + This issue was reported to OpenSSL on 16th October 2018 by Samuel Weiser. + (CVE-2018-0734) + [Paul Dale] + + *) Timing vulnerability in ECDSA signature generation + + The OpenSSL ECDSA signature algorithm has been shown to be vulnerable to a + timing side channel attack. An attacker could use variations in the signing + algorithm to recover the private key. + + This issue was reported to OpenSSL on 25th October 2018 by Samuel Weiser. + (CVE-2018-0735) + [Paul Dale] + + *) Added EVP_PKEY_ECDH_KDF_X9_63 and ecdh_KDF_X9_63() as replacements for + the EVP_PKEY_ECDH_KDF_X9_62 KDF type and ECDH_KDF_X9_62(). The old names + are retained for backwards compatibility. + [Antoine Salon] + + *) Fixed the issue that RAND_add()/RAND_seed() silently discards random input + if its length exceeds 4096 bytes. The limit has been raised to a buffer size + of two gigabytes and the error handling improved. + + This issue was reported to OpenSSL by Dr. Falko Strenzke. It has been + categorized as a normal bug, not a security issue, because the DRBG reseeds + automatically and is fully functional even without additional randomness + provided by the application. + Changes between 1.1.0i and 1.1.1 [11 Sep 2018] *) Add a new ClientHello callback. Provides a callback interface that gives @@ -13103,4 +13139,3 @@ des-cbc 3624.96k 5258.21k 5530.91k *) A minor bug in ssl/s3_clnt.c where there would always be 4 0 bytes sent in the client random. [Edward Bishop ] - Modified: vendor-crypto/openssl/dist/Configure ============================================================================== --- vendor-crypto/openssl/dist/Configure Tue Nov 20 18:38:28 2018 (r340689) +++ vendor-crypto/openssl/dist/Configure Tue Nov 20 18:59:41 2018 (r340690) @@ -1013,13 +1013,18 @@ if (scalar(@seed_sources) == 0) { if (scalar(grep { $_ eq 'none' } @seed_sources) > 0) { die "Cannot seed with none and anything else" if scalar(@seed_sources) > 1; warn <<_____ if scalar(@seed_sources) == 1; -You have selected the --with-rand-seed=none option, which effectively disables -automatic reseeding of the OpenSSL random generator. All operations depending -on the random generator such as creating keys will not work unless the random -generator is seeded manually by the application. -Please read the 'Note on random number generation' section in the INSTALL -instructions and the RAND_DRBG(7) manual page for more details. +============================== WARNING =============================== +You have selected the --with-rand-seed=none option, which effectively +disables automatic reseeding of the OpenSSL random generator. +All operations depending on the random generator such as creating keys +will not work unless the random generator is seeded manually by the +application. + +Please read the 'Note on random number generation' section in the +INSTALL instructions and the RAND_DRBG(7) manual page for more details. +============================== WARNING =============================== + _____ } push @{$config{openssl_other_defines}}, @@ -2174,6 +2179,16 @@ EOF # Massage the result + # If the user configured no-shared, we allow no shared sources + if ($disabled{shared}) { + foreach (keys %{$unified_info{shared_sources}}) { + foreach (keys %{$unified_info{shared_sources}->{$_}}) { + delete $unified_info{sources}->{$_}; + } + } + $unified_info{shared_sources} = {}; + } + # If we depend on a header file or a perl module, add an inclusion of # its directory to allow smoothe inclusion foreach my $dest (keys %{$unified_info{depends}}) { @@ -2198,8 +2213,8 @@ EOF next unless defined($unified_info{includes}->{$dest}->{$k}); my @incs = reverse @{$unified_info{includes}->{$dest}->{$k}}; foreach my $obj (grep /\.o$/, - (keys %{$unified_info{sources}->{$dest}}, - keys %{$unified_info{shared_sources}->{$dest}})) { + (keys %{$unified_info{sources}->{$dest} // {}}, + keys %{$unified_info{shared_sources}->{$dest} // {}})) { foreach my $inc (@incs) { unshift @{$unified_info{includes}->{$obj}->{$k}}, $inc unless grep { $_ eq $inc } @{$unified_info{includes}->{$obj}->{$k}}; @@ -2238,6 +2253,42 @@ EOF [ @{$unified_info{includes}->{$dest}->{source}} ]; } } + + # For convenience collect information regarding directories where + # files are generated, those generated files and the end product + # they end up in where applicable. Then, add build rules for those + # directories + my %loopinfo = ( "lib" => [ @{$unified_info{libraries}} ], + "dso" => [ @{$unified_info{engines}} ], + "bin" => [ @{$unified_info{programs}} ], + "script" => [ @{$unified_info{scripts}} ] ); + foreach my $type (keys %loopinfo) { + foreach my $product (@{$loopinfo{$type}}) { + my %dirs = (); + my $pd = dirname($product); + + foreach (@{$unified_info{sources}->{$product} // []}, + @{$unified_info{shared_sources}->{$product} // []}) { + my $d = dirname($_); + + # We don't want to create targets for source directories + # when building out of source + next if ($config{sourcedir} ne $config{builddir} + && $d =~ m|^\Q$config{sourcedir}\E|); + # We already have a "test" target, and the current directory + # is just silly to make a target for + next if $d eq "test" || $d eq "."; + + $dirs{$d} = 1; + push @{$unified_info{dirinfo}->{$d}->{deps}}, $_ + if $d ne $pd; + } + foreach (keys %dirs) { + push @{$unified_info{dirinfo}->{$_}->{products}->{$type}}, + $product; + } + } + } } # For the schemes that need it, we provide the old *_obj configs @@ -2712,10 +2763,16 @@ print <<"EOF"; ********************************************************************** *** *** -*** If you want to report a building issue, please include the *** -*** output from this command: *** +*** OpenSSL has been successfully configured *** *** *** -*** perl configdata.pm --dump *** +*** If you encounter a problem while building, please open an *** +*** issue on GitHub *** +*** and include the output from the following command: *** +*** *** +*** perl configdata.pm --dump *** +*** *** +*** (If you are new to OpenSSL, you might want to consult the *** +*** 'Troubleshooting' section in the INSTALL file first) *** *** *** ********************************************************************** EOF Modified: vendor-crypto/openssl/dist/INSTALL ============================================================================== --- vendor-crypto/openssl/dist/INSTALL Tue Nov 20 18:38:28 2018 (r340689) +++ vendor-crypto/openssl/dist/INSTALL Tue Nov 20 18:59:41 2018 (r340690) @@ -614,8 +614,8 @@ Windows, and as a comma separated list of libraries on VMS. RANLIB The library archive indexer. - RC The Windows resources manipulator. - RCFLAGS Flags for the Windows reources manipulator. + RC The Windows resource compiler. + RCFLAGS Flags for the Windows resource compiler. RM The command to remove files and directories. These cannot be mixed with compiling / linking flags given @@ -969,7 +969,7 @@ BUILDFILE Use a different build file name than the platform default - ("Makefile" on Unixly platforms, "makefile" on native Windows, + ("Makefile" on Unix-like platforms, "makefile" on native Windows, "descrip.mms" on OpenVMS). This requires that there is a corresponding build file template. See Configurations/README for further information. @@ -1171,7 +1171,7 @@ part of the file name, i.e. for OpenSSL 1.1.x, 1.1 is somehow part of the name. - On most POSIXly platforms, shared libraries are named libcrypto.so.1.1 + On most POSIX platforms, shared libraries are named libcrypto.so.1.1 and libssl.so.1.1. on Cygwin, shared libraries are named cygcrypto-1.1.dll and cygssl-1.1.dll @@ -1202,7 +1202,7 @@ The seeding method can be configured using the --with-rand-seed option, which can be used to specify a comma separated list of seed methods. However in most cases OpenSSL will choose a suitable default method, - so it is not necessary to explicitely provide this option. Note also + so it is not necessary to explicitly provide this option. Note also that not all methods are available on all platforms. I) On operating systems which provide a suitable randomness source (in Modified: vendor-crypto/openssl/dist/NEWS ============================================================================== --- vendor-crypto/openssl/dist/NEWS Tue Nov 20 18:38:28 2018 (r340689) +++ vendor-crypto/openssl/dist/NEWS Tue Nov 20 18:59:41 2018 (r340690) @@ -5,6 +5,11 @@ This file gives a brief overview of the major changes between each OpenSSL release. For more details please read the CHANGES file. + Major changes between OpenSSL 1.1.1 and OpenSSL 1.1.1a [20 Nov 2018] + + o Timing vulnerability in DSA signature generation (CVE-2018-0734) + o Timing vulnerability in ECDSA signature generation (CVE-2018-0735) + Major changes between OpenSSL 1.1.0i and OpenSSL 1.1.1 [11 Sep 2018] o Support for TLSv1.3 added (see https://wiki.openssl.org/index.php/TLS1.3 Modified: vendor-crypto/openssl/dist/README ============================================================================== --- vendor-crypto/openssl/dist/README Tue Nov 20 18:38:28 2018 (r340689) +++ vendor-crypto/openssl/dist/README Tue Nov 20 18:59:41 2018 (r340690) @@ -1,5 +1,5 @@ - OpenSSL 1.1.1 11 Sep 2018 + OpenSSL 1.1.1a 20 Nov 2018 Copyright (c) 1998-2018 The OpenSSL Project Copyright (c) 1995-1998 Eric A. Young, Tim J. Hudson Modified: vendor-crypto/openssl/dist/apps/app_rand.c ============================================================================== --- vendor-crypto/openssl/dist/apps/app_rand.c Tue Nov 20 18:38:28 2018 (r340689) +++ vendor-crypto/openssl/dist/apps/app_rand.c Tue Nov 20 18:59:41 2018 (r340690) @@ -1,5 +1,5 @@ /* - * Copyright 1995-2017 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -26,7 +26,6 @@ void app_RAND_load_conf(CONF *c, const char *section) if (RAND_load_file(randfile, -1) < 0) { BIO_printf(bio_err, "Can't load %s into RNG\n", randfile); ERR_print_errors(bio_err); - return; } if (save_rand_file == NULL) save_rand_file = OPENSSL_strdup(randfile); Modified: vendor-crypto/openssl/dist/apps/apps.c ============================================================================== --- vendor-crypto/openssl/dist/apps/apps.c Tue Nov 20 18:38:28 2018 (r340689) +++ vendor-crypto/openssl/dist/apps/apps.c Tue Nov 20 18:59:41 2018 (r340690) @@ -1831,6 +1831,12 @@ X509_NAME *parse_name(const char *cp, long chtype, int opt_getprog(), typestr); continue; } + if (*valstr == '\0') { + BIO_printf(bio_err, + "%s: No value provided for Subject Attribute %s, skipped\n", + opt_getprog(), typestr); + continue; + } if (!X509_NAME_add_entry_by_NID(n, nid, chtype, valstr, strlen((char *)valstr), -1, ismulti ? -1 : 0)) Modified: vendor-crypto/openssl/dist/apps/apps.h ============================================================================== --- vendor-crypto/openssl/dist/apps/apps.h Tue Nov 20 18:38:28 2018 (r340689) +++ vendor-crypto/openssl/dist/apps/apps.h Tue Nov 20 18:59:41 2018 (r340690) @@ -369,7 +369,7 @@ typedef struct string_int_pair_st { # define OPT_FMT_SMIME (1L << 3) # define OPT_FMT_ENGINE (1L << 4) # define OPT_FMT_MSBLOB (1L << 5) -# define OPT_FMT_NETSCAPE (1L << 6) +/* (1L << 6) was OPT_FMT_NETSCAPE, but wasn't used */ # define OPT_FMT_NSS (1L << 7) # define OPT_FMT_TEXT (1L << 8) # define OPT_FMT_HTTP (1L << 9) @@ -378,8 +378,8 @@ typedef struct string_int_pair_st { # define OPT_FMT_PDS (OPT_FMT_PEMDER | OPT_FMT_SMIME) # define OPT_FMT_ANY ( \ OPT_FMT_PEMDER | OPT_FMT_PKCS12 | OPT_FMT_SMIME | \ - OPT_FMT_ENGINE | OPT_FMT_MSBLOB | OPT_FMT_NETSCAPE | \ - OPT_FMT_NSS | OPT_FMT_TEXT | OPT_FMT_HTTP | OPT_FMT_PVK) + OPT_FMT_ENGINE | OPT_FMT_MSBLOB | OPT_FMT_NSS | \ + OPT_FMT_TEXT | OPT_FMT_HTTP | OPT_FMT_PVK) char *opt_progname(const char *argv0); char *opt_getprog(void); Modified: vendor-crypto/openssl/dist/apps/ca.c ============================================================================== --- vendor-crypto/openssl/dist/apps/ca.c Tue Nov 20 18:38:28 2018 (r340689) +++ vendor-crypto/openssl/dist/apps/ca.c Tue Nov 20 18:59:41 2018 (r340690) @@ -605,7 +605,7 @@ end_of_options: /* * outdir is a directory spec, but access() for VMS demands a * filename. We could use the DEC C routine to convert the - * directory syntax to Unixly, and give that to app_isdir, + * directory syntax to Unix, and give that to app_isdir, * but for now the fopen will catch the error if it's not a * directory */ @@ -976,7 +976,7 @@ end_of_options: BIO_printf(bio_err, "Write out database with %d new entries\n", sk_X509_num(cert_sk)); - if (!rand_ser + if (serialfile != NULL && !save_serial(serialfile, "new", serial, NULL)) goto end; @@ -1044,7 +1044,8 @@ end_of_options: if (sk_X509_num(cert_sk)) { /* Rename the database and the serial file */ - if (!rotate_serial(serialfile, "new", "old")) + if (serialfile != NULL + && !rotate_serial(serialfile, "new", "old")) goto end; if (!rotate_index(dbfile, "new", "old")) @@ -1177,10 +1178,9 @@ end_of_options: } /* we have a CRL number that need updating */ - if (crlnumberfile != NULL) - if (!rand_ser - && !save_serial(crlnumberfile, "new", crlnumber, NULL)) - goto end; + if (crlnumberfile != NULL + && !save_serial(crlnumberfile, "new", crlnumber, NULL)) + goto end; BN_free(crlnumber); crlnumber = NULL; @@ -1195,9 +1195,10 @@ end_of_options: PEM_write_bio_X509_CRL(Sout, crl); - if (crlnumberfile != NULL) /* Rename the crlnumber file */ - if (!rotate_serial(crlnumberfile, "new", "old")) - goto end; + /* Rename the crlnumber file */ + if (crlnumberfile != NULL + && !rotate_serial(crlnumberfile, "new", "old")) + goto end; } /*****************************************************************/ Modified: vendor-crypto/openssl/dist/apps/ocsp.c ============================================================================== --- vendor-crypto/openssl/dist/apps/ocsp.c Tue Nov 20 18:38:28 2018 (r340689) +++ vendor-crypto/openssl/dist/apps/ocsp.c Tue Nov 20 18:59:41 2018 (r340690) @@ -950,6 +950,7 @@ static void spawn_loop(void) sleep(30); break; case 0: /* child */ + OPENSSL_free(kidpids); signal(SIGINT, SIG_DFL); signal(SIGTERM, SIG_DFL); if (termsig) @@ -976,6 +977,7 @@ static void spawn_loop(void) } /* The loop above can only break on termsig */ + OPENSSL_free(kidpids); syslog(LOG_INFO, "terminating on signal: %d", termsig); killall(0, kidpids); } Modified: vendor-crypto/openssl/dist/apps/openssl.cnf ============================================================================== --- vendor-crypto/openssl/dist/apps/openssl.cnf Tue Nov 20 18:38:28 2018 (r340689) +++ vendor-crypto/openssl/dist/apps/openssl.cnf Tue Nov 20 18:59:41 2018 (r340690) @@ -10,7 +10,6 @@ # This definition stops the following lines choking if HOME isn't # defined. HOME = . -RANDFILE = $ENV::HOME/.rnd # Extra OBJECT IDENTIFIER info: #oid_file = $ENV::HOME/.oid @@ -57,7 +56,6 @@ crlnumber = $dir/crlnumber # the current crl number # must be commented out to leave a V1 CRL crl = $dir/crl.pem # The current CRL private_key = $dir/private/cakey.pem# The private key -RANDFILE = $dir/private/.rand # private random number file x509_extensions = usr_cert # The extensions to add to the cert Modified: vendor-crypto/openssl/dist/apps/opt.c ============================================================================== --- vendor-crypto/openssl/dist/apps/opt.c Tue Nov 20 18:38:28 2018 (r340689) +++ vendor-crypto/openssl/dist/apps/opt.c Tue Nov 20 18:59:41 2018 (r340690) @@ -168,7 +168,6 @@ static OPT_PAIR formats[] = { {"smime", OPT_FMT_SMIME}, {"engine", OPT_FMT_ENGINE}, {"msblob", OPT_FMT_MSBLOB}, - {"netscape", OPT_FMT_NETSCAPE}, {"nss", OPT_FMT_NSS}, {"text", OPT_FMT_TEXT}, {"http", OPT_FMT_HTTP}, Modified: vendor-crypto/openssl/dist/apps/rehash.c ============================================================================== --- vendor-crypto/openssl/dist/apps/rehash.c Tue Nov 20 18:38:28 2018 (r340689) +++ vendor-crypto/openssl/dist/apps/rehash.c Tue Nov 20 18:59:41 2018 (r340690) @@ -1,6 +1,6 @@ /* * Copyright 2015-2018 The OpenSSL Project Authors. All Rights Reserved. - * Copyright (c) 2013-2014 Timo Teräs + * Copyright (c) 2013-2014 Timo Teräs * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy Modified: vendor-crypto/openssl/dist/apps/rsa.c ============================================================================== --- vendor-crypto/openssl/dist/apps/rsa.c Tue Nov 20 18:38:28 2018 (r340689) +++ vendor-crypto/openssl/dist/apps/rsa.c Tue Nov 20 18:59:41 2018 (r340690) @@ -38,8 +38,8 @@ typedef enum OPTION_choice { const OPTIONS rsa_options[] = { {"help", OPT_HELP, '-', "Display this summary"}, - {"inform", OPT_INFORM, 'f', "Input format, one of DER NET PEM"}, - {"outform", OPT_OUTFORM, 'f', "Output format, one of DER NET PEM PVK"}, + {"inform", OPT_INFORM, 'f', "Input format, one of DER PEM"}, + {"outform", OPT_OUTFORM, 'f', "Output format, one of DER PEM PVK"}, {"in", OPT_IN, 's', "Input file"}, {"out", OPT_OUT, '>', "Output file"}, {"pubin", OPT_PUBIN, '-', "Expect a public key in input file"}, @@ -269,6 +269,9 @@ int rsa_main(int argc, char **argv) } else if (outformat == FORMAT_MSBLOB || outformat == FORMAT_PVK) { EVP_PKEY *pk; pk = EVP_PKEY_new(); + if (pk == NULL) + goto end; + EVP_PKEY_set1_RSA(pk, rsa); if (outformat == FORMAT_PVK) { if (pubin) { Modified: vendor-crypto/openssl/dist/apps/s_cb.c ============================================================================== --- vendor-crypto/openssl/dist/apps/s_cb.c Tue Nov 20 18:38:28 2018 (r340689) +++ vendor-crypto/openssl/dist/apps/s_cb.c Tue Nov 20 18:59:41 2018 (r340690) @@ -394,7 +394,8 @@ int ssl_print_groups(BIO *out, SSL *s, int noshared) int ssl_print_tmp_key(BIO *out, SSL *s) { EVP_PKEY *key; - if (!SSL_get_server_tmp_key(s, &key)) + + if (!SSL_get_peer_tmp_key(s, &key)) return 1; BIO_puts(out, "Server Temp Key: "); switch (EVP_PKEY_id(key)) { Modified: vendor-crypto/openssl/dist/apps/s_server.c ============================================================================== --- vendor-crypto/openssl/dist/apps/s_server.c Tue Nov 20 18:38:28 2018 (r340689) +++ vendor-crypto/openssl/dist/apps/s_server.c Tue Nov 20 18:59:41 2018 (r340690) @@ -193,9 +193,8 @@ static int psk_find_session_cb(SSL *ssl, const unsigne if (strlen(psk_identity) != identity_len || memcmp(psk_identity, identity, identity_len) != 0) { - BIO_printf(bio_s_out, - "PSK warning: client identity not what we expected" - " (got '%s' expected '%s')\n", identity, psk_identity); + *sess = NULL; + return 1; } if (psksess != NULL) { @@ -1622,6 +1621,11 @@ int s_server_main(int argc, char *argv[]) goto end; } #endif + if (early_data && (www > 0 || rev)) { + BIO_printf(bio_err, + "Can't use -early_data in combination with -www, -WWW, -HTTP, or -rev\n"); + goto end; + } #ifndef OPENSSL_NO_SCTP if (protocol == IPPROTO_SCTP) { Modified: vendor-crypto/openssl/dist/apps/speed.c ============================================================================== --- vendor-crypto/openssl/dist/apps/speed.c Tue Nov 20 18:38:28 2018 (r340689) +++ vendor-crypto/openssl/dist/apps/speed.c Tue Nov 20 18:59:41 2018 (r340690) @@ -2896,7 +2896,7 @@ int speed_main(int argc, char **argv) if (rsa_count <= 1) { /* if longer than 10s, don't do any more */ - for (testnum++; testnum < EC_NUM; testnum++) + for (testnum++; testnum < ECDSA_NUM; testnum++) ecdsa_doit[testnum] = 0; } } Modified: vendor-crypto/openssl/dist/apps/x509.c ============================================================================== --- vendor-crypto/openssl/dist/apps/x509.c Tue Nov 20 18:38:28 2018 (r340689) +++ vendor-crypto/openssl/dist/apps/x509.c Tue Nov 20 18:59:41 2018 (r340690) @@ -67,10 +67,10 @@ typedef enum OPTION_choice { const OPTIONS x509_options[] = { {"help", OPT_HELP, '-', "Display this summary"}, {"inform", OPT_INFORM, 'f', - "Input format - default PEM (one of DER, NET or PEM)"}, + "Input format - default PEM (one of DER or PEM)"}, {"in", OPT_IN, '<', "Input file - default stdin"}, {"outform", OPT_OUTFORM, 'f', - "Output format - default PEM (one of DER, NET or PEM)"}, + "Output format - default PEM (one of DER or PEM)"}, {"out", OPT_OUT, '>', "Output file - default stdout"}, {"keyform", OPT_KEYFORM, 'F', "Private key format - default PEM"}, {"passin", OPT_PASSIN, 's', "Private key password/pass-phrase source"}, Modified: vendor-crypto/openssl/dist/crypto/LPdir_unix.c ============================================================================== --- vendor-crypto/openssl/dist/crypto/LPdir_unix.c Tue Nov 20 18:38:28 2018 (r340689) +++ vendor-crypto/openssl/dist/crypto/LPdir_unix.c Tue Nov 20 18:59:41 2018 (r340690) @@ -51,7 +51,7 @@ #endif /* - * The POSIXly macro for the maximum number of characters in a file path is + * The POSIX macro for the maximum number of characters in a file path is * NAME_MAX. However, some operating systems use PATH_MAX instead. * Therefore, it seems natural to first check for PATH_MAX and use that, and * if it doesn't exist, use NAME_MAX. Modified: vendor-crypto/openssl/dist/crypto/async/arch/async_posix.h ============================================================================== --- vendor-crypto/openssl/dist/crypto/async/arch/async_posix.h Tue Nov 20 18:38:28 2018 (r340689) +++ vendor-crypto/openssl/dist/crypto/async/arch/async_posix.h Tue Nov 20 18:59:41 2018 (r340690) @@ -17,7 +17,8 @@ # include -# if _POSIX_VERSION >= 200112L +# if _POSIX_VERSION >= 200112L \ + && (_POSIX_VERSION < 200809L || defined(__GLIBC__)) # include Modified: vendor-crypto/openssl/dist/crypto/bio/b_sock2.c ============================================================================== --- vendor-crypto/openssl/dist/crypto/bio/b_sock2.c Tue Nov 20 18:38:28 2018 (r340689) +++ vendor-crypto/openssl/dist/crypto/bio/b_sock2.c Tue Nov 20 18:59:41 2018 (r340690) @@ -133,7 +133,9 @@ int BIO_connect(int sock, const BIO_ADDR *addr, int op */ int BIO_bind(int sock, const BIO_ADDR *addr, int options) { +# ifndef OPENSSL_SYS_WINDOWS int on = 1; +# endif if (sock == -1) { BIOerr(BIO_F_BIO_BIND, BIO_R_INVALID_SOCKET); Modified: vendor-crypto/openssl/dist/crypto/bio/bio_lib.c ============================================================================== --- vendor-crypto/openssl/dist/crypto/bio/bio_lib.c Tue Nov 20 18:38:28 2018 (r340689) +++ vendor-crypto/openssl/dist/crypto/bio/bio_lib.c Tue Nov 20 18:59:41 2018 (r340690) @@ -52,7 +52,7 @@ static long bio_call_callback(BIO *b, int oper, const argi = (int)len; } - if (inret && (oper & BIO_CB_RETURN) && bareoper != BIO_CB_CTRL) { + if (inret > 0 && (oper & BIO_CB_RETURN) && bareoper != BIO_CB_CTRL) { if (*processed > INT_MAX) return -1; inret = *processed; @@ -60,7 +60,7 @@ static long bio_call_callback(BIO *b, int oper, const ret = b->callback(b, oper, argp, argi, argl, inret); - if (ret >= 0 && (oper & BIO_CB_RETURN) && bareoper != BIO_CB_CTRL) { + if (ret > 0 && (oper & BIO_CB_RETURN) && bareoper != BIO_CB_CTRL) { *processed = (size_t)ret; ret = 1; } Modified: vendor-crypto/openssl/dist/crypto/bio/bss_log.c ============================================================================== --- vendor-crypto/openssl/dist/crypto/bio/bss_log.c Tue Nov 20 18:38:28 2018 (r340689) +++ vendor-crypto/openssl/dist/crypto/bio/bss_log.c Tue Nov 20 18:59:41 2018 (r340690) @@ -408,4 +408,9 @@ static void xcloselog(BIO *bp) # endif /* Unix */ +#else /* NO_SYSLOG */ +const BIO_METHOD *BIO_s_log(void) +{ + return NULL; +} #endif /* NO_SYSLOG */ Modified: vendor-crypto/openssl/dist/crypto/bn/asm/x86_64-gcc.c ============================================================================== --- vendor-crypto/openssl/dist/crypto/bn/asm/x86_64-gcc.c Tue Nov 20 18:38:28 2018 (r340689) +++ vendor-crypto/openssl/dist/crypto/bn/asm/x86_64-gcc.c Tue Nov 20 18:59:41 2018 (r340690) @@ -1,5 +1,5 @@ /* - * Copyright 2002-2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2002-2018 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -63,12 +63,6 @@ * very much like 64-bit code compiled with no-asm on the same * machine. */ - -# if defined(_WIN64) || !defined(__LP64__) -# define BN_ULONG unsigned long long -# else -# define BN_ULONG unsigned long -# endif # undef mul # undef mul_add Modified: vendor-crypto/openssl/dist/crypto/bn/bn_exp.c ============================================================================== --- vendor-crypto/openssl/dist/crypto/bn/bn_exp.c Tue Nov 20 18:38:28 2018 (r340689) +++ vendor-crypto/openssl/dist/crypto/bn/bn_exp.c Tue Nov 20 18:59:41 2018 (r340690) @@ -1077,7 +1077,7 @@ int BN_mod_exp_mont_consttime(BIGNUM *rr, const BIGNUM * is not only slower but also makes each bit vulnerable to * EM (and likely other) side-channel attacks like One&Done * (for details see "One&Done: A Single-Decryption EM-Based - * Attack on OpenSSL’s Constant-Time Blinded RSA" by M. Alam, + * Attack on OpenSSL's Constant-Time Blinded RSA" by M. Alam, * H. Khan, M. Dey, N. Sinha, R. Callan, A. Zajic, and * M. Prvulovic, in USENIX Security'18) */ Modified: vendor-crypto/openssl/dist/crypto/bn/bn_lib.c ============================================================================== --- vendor-crypto/openssl/dist/crypto/bn/bn_lib.c Tue Nov 20 18:38:28 2018 (r340689) +++ vendor-crypto/openssl/dist/crypto/bn/bn_lib.c Tue Nov 20 18:59:41 2018 (r340690) @@ -767,26 +767,30 @@ void BN_consttime_swap(BN_ULONG condition, BIGNUM *a, b->neg ^= t; /*- - * Idea behind BN_FLG_STATIC_DATA is actually to - * indicate that data may not be written to. - * Intention is actually to treat it as it's - * read-only data, and some (if not most) of it does - * reside in read-only segment. In other words - * observation of BN_FLG_STATIC_DATA in - * BN_consttime_swap should be treated as fatal - * condition. It would either cause SEGV or - * effectively cause data corruption. - * BN_FLG_MALLOCED refers to BN structure itself, - * and hence must be preserved. Remaining flags are - * BN_FLG_CONSTIME and BN_FLG_SECURE. Latter must be - * preserved, because it determines how x->d was - * allocated and hence how to free it. This leaves - * BN_FLG_CONSTTIME that one can do something about. - * To summarize it's sufficient to mask and swap - * BN_FLG_CONSTTIME alone. BN_FLG_STATIC_DATA should - * be treated as fatal. + * BN_FLG_STATIC_DATA: indicates that data may not be written to. Intention + * is actually to treat it as it's read-only data, and some (if not most) + * of it does reside in read-only segment. In other words observation of + * BN_FLG_STATIC_DATA in BN_consttime_swap should be treated as fatal + * condition. It would either cause SEGV or effectively cause data + * corruption. + * + * BN_FLG_MALLOCED: refers to BN structure itself, and hence must be + * preserved. + * + * BN_FLG_SECURE: must be preserved, because it determines how x->d was + * allocated and hence how to free it. + * + * BN_FLG_CONSTTIME: sufficient to mask and swap + * + * BN_FLG_FIXED_TOP: indicates that we haven't called bn_correct_top() on + * the data, so the d array may be padded with additional 0 values (i.e. + * top could be greater than the minimal value that it could be). We should + * be swapping it */ - t = ((a->flags ^ b->flags) & BN_FLG_CONSTTIME) & condition; + +#define BN_CONSTTIME_SWAP_FLAGS (BN_FLG_CONSTTIME | BN_FLG_FIXED_TOP) + + t = ((a->flags ^ b->flags) & BN_CONSTTIME_SWAP_FLAGS) & condition; a->flags ^= t; b->flags ^= t; Modified: vendor-crypto/openssl/dist/crypto/build.info ============================================================================== --- vendor-crypto/openssl/dist/crypto/build.info Tue Nov 20 18:38:28 2018 (r340689) +++ vendor-crypto/openssl/dist/crypto/build.info Tue Nov 20 18:59:41 2018 (r340690) @@ -2,7 +2,7 @@ LIBS=../libcrypto SOURCE[../libcrypto]=\ cryptlib.c mem.c mem_dbg.c cversion.c ex_data.c cpt_err.c \ ebcdic.c uid.c o_time.c o_str.c o_dir.c o_fopen.c ctype.c \ - threads_pthread.c threads_win.c threads_none.c \ + threads_pthread.c threads_win.c threads_none.c getenv.c \ o_init.c o_fips.c mem_sec.c init.c {- $target{cpuid_asm_src} -} \ {- $target{uplink_aux_src} -} EXTRA= ../ms/uplink-x86.pl ../ms/uplink.c ../ms/applink.c \ Modified: vendor-crypto/openssl/dist/crypto/conf/conf_api.c ============================================================================== --- vendor-crypto/openssl/dist/crypto/conf/conf_api.c Tue Nov 20 18:38:28 2018 (r340689) +++ vendor-crypto/openssl/dist/crypto/conf/conf_api.c Tue Nov 20 18:59:41 2018 (r340690) @@ -10,6 +10,7 @@ /* Part of the code in here was originally in conf.c, which is now removed */ #include "e_os.h" +#include "internal/cryptlib.h" #include #include #include @@ -82,7 +83,7 @@ char *_CONF_get_string(const CONF *conf, const char *s if (v != NULL) return v->value; if (strcmp(section, "ENV") == 0) { - p = getenv(name); + p = ossl_safe_getenv(name); if (p != NULL) return p; } @@ -95,7 +96,7 @@ char *_CONF_get_string(const CONF *conf, const char *s else return NULL; } else - return getenv(name); + return ossl_safe_getenv(name); } static unsigned long conf_value_hash(const CONF_VALUE *v) Modified: vendor-crypto/openssl/dist/crypto/conf/conf_mod.c ============================================================================== --- vendor-crypto/openssl/dist/crypto/conf/conf_mod.c Tue Nov 20 18:38:28 2018 (r340689) +++ vendor-crypto/openssl/dist/crypto/conf/conf_mod.c Tue Nov 20 18:59:41 2018 (r340690) @@ -480,11 +480,8 @@ char *CONF_get1_default_config_file(void) char *file, *sep = ""; int len; - if (!OPENSSL_issetugid()) { - file = getenv("OPENSSL_CONF"); - if (file) - return OPENSSL_strdup(file); - } + if ((file = ossl_safe_getenv("OPENSSL_CONF")) != NULL) + return OPENSSL_strdup(file); len = strlen(X509_get_default_cert_area()); #ifndef OPENSSL_SYS_VMS Modified: vendor-crypto/openssl/dist/crypto/cryptlib.c ============================================================================== --- vendor-crypto/openssl/dist/crypto/cryptlib.c Tue Nov 20 18:38:28 2018 (r340689) +++ vendor-crypto/openssl/dist/crypto/cryptlib.c Tue Nov 20 18:59:41 2018 (r340690) @@ -204,7 +204,7 @@ int OPENSSL_isservice(void) if (_OPENSSL_isservice.p == NULL) { HANDLE mod = GetModuleHandle(NULL); - FARPROC f; + FARPROC f = NULL; if (mod != NULL) f = GetProcAddress(mod, "_OPENSSL_isservice"); Modified: vendor-crypto/openssl/dist/crypto/ct/ct_log.c ============================================================================== --- vendor-crypto/openssl/dist/crypto/ct/ct_log.c Tue Nov 20 18:38:28 2018 (r340689) +++ vendor-crypto/openssl/dist/crypto/ct/ct_log.c Tue Nov 20 18:59:41 2018 (r340690) @@ -137,7 +137,7 @@ static int ctlog_new_from_conf(CTLOG **ct_log, const C int CTLOG_STORE_load_default_file(CTLOG_STORE *store) { - const char *fpath = getenv(CTLOG_FILE_EVP); + const char *fpath = ossl_safe_getenv(CTLOG_FILE_EVP); if (fpath == NULL) fpath = CTLOG_FILE; Modified: vendor-crypto/openssl/dist/crypto/dsa/dsa_gen.c ============================================================================== --- vendor-crypto/openssl/dist/crypto/dsa/dsa_gen.c Tue Nov 20 18:38:28 2018 (r340689) +++ vendor-crypto/openssl/dist/crypto/dsa/dsa_gen.c Tue Nov 20 18:59:41 2018 (r340690) @@ -327,6 +327,12 @@ int dsa_builtin_paramgen2(DSA *ret, size_t L, size_t N if (mctx == NULL) goto err; + /* make sure L > N, otherwise we'll get trapped in an infinite loop */ + if (L <= N) { + DSAerr(DSA_F_DSA_BUILTIN_PARAMGEN2, DSA_R_INVALID_PARAMETERS); + goto err; + } + if (evpmd == NULL) { if (N == 160) evpmd = EVP_sha1(); Modified: vendor-crypto/openssl/dist/crypto/dsa/dsa_ossl.c ============================================================================== --- vendor-crypto/openssl/dist/crypto/dsa/dsa_ossl.c Tue Nov 20 18:38:28 2018 (r340689) +++ vendor-crypto/openssl/dist/crypto/dsa/dsa_ossl.c Tue Nov 20 18:59:41 2018 (r340690) @@ -9,6 +9,7 @@ #include #include "internal/cryptlib.h" +#include "internal/bn_int.h" #include #include #include "dsa_locl.h" @@ -23,6 +24,8 @@ static int dsa_do_verify(const unsigned char *dgst, in DSA_SIG *sig, DSA *dsa); static int dsa_init(DSA *dsa); static int dsa_finish(DSA *dsa); +static BIGNUM *dsa_mod_inverse_fermat(const BIGNUM *k, const BIGNUM *q, + BN_CTX *ctx); static DSA_METHOD openssl_dsa_meth = { "OpenSSL DSA method", @@ -178,9 +181,9 @@ static int dsa_sign_setup(DSA *dsa, BN_CTX *ctx_in, { BN_CTX *ctx = NULL; BIGNUM *k, *kinv = NULL, *r = *rp; - BIGNUM *l, *m; + BIGNUM *l; int ret = 0; - int q_bits; + int q_bits, q_words; if (!dsa->p || !dsa->q || !dsa->g) { DSAerr(DSA_F_DSA_SIGN_SETUP, DSA_R_MISSING_PARAMETERS); @@ -189,8 +192,7 @@ static int dsa_sign_setup(DSA *dsa, BN_CTX *ctx_in, k = BN_new(); l = BN_new(); - m = BN_new(); - if (k == NULL || l == NULL || m == NULL) + if (k == NULL || l == NULL) goto err; if (ctx_in == NULL) { @@ -201,9 +203,9 @@ static int dsa_sign_setup(DSA *dsa, BN_CTX *ctx_in, /* Preallocate space */ q_bits = BN_num_bits(dsa->q); - if (!BN_set_bit(k, q_bits) - || !BN_set_bit(l, q_bits) - || !BN_set_bit(m, q_bits)) + q_words = bn_get_top(dsa->q); + if (!bn_wexpand(k, q_words + 2) + || !bn_wexpand(l, q_words + 2)) goto err; /* Get random k */ @@ -221,6 +223,7 @@ static int dsa_sign_setup(DSA *dsa, BN_CTX *ctx_in, } while (BN_is_zero(k)); BN_set_flags(k, BN_FLG_CONSTTIME); + BN_set_flags(l, BN_FLG_CONSTTIME); if (dsa->flags & DSA_FLAG_CACHE_MONT_P) { if (!BN_MONT_CTX_set_locked(&dsa->method_mont_p, @@ -238,14 +241,17 @@ static int dsa_sign_setup(DSA *dsa, BN_CTX *ctx_in, * small timing information leakage. We then choose the sum that is * one bit longer than the modulus. * - * TODO: revisit the BN_copy aiming for a memory access agnostic - * conditional copy. + * There are some concerns about the efficacy of doing this. More + * specificly refer to the discussion starting with: + * https://github.com/openssl/openssl/pull/7486#discussion_r228323705 + * The fix is to rework BN so these gymnastics aren't required. */ if (!BN_add(l, k, dsa->q) - || !BN_add(m, l, dsa->q) - || !BN_copy(k, BN_num_bits(l) > q_bits ? l : m)) + || !BN_add(k, l, dsa->q)) goto err; + BN_consttime_swap(BN_is_bit_set(l, q_bits), k, l, q_words + 2); + if ((dsa)->meth->bn_mod_exp != NULL) { if (!dsa->meth->bn_mod_exp(dsa, r, dsa->g, k, dsa->p, ctx, dsa->method_mont_p)) @@ -258,8 +264,8 @@ static int dsa_sign_setup(DSA *dsa, BN_CTX *ctx_in, if (!BN_mod(r, r, dsa->q, ctx)) goto err; - /* Compute part of 's = inv(k) (m + xr) mod q' */ - if ((kinv = BN_mod_inverse(NULL, k, dsa->q, ctx)) == NULL) + /* Compute part of 's = inv(k) (m + xr) mod q' */ + if ((kinv = dsa_mod_inverse_fermat(k, dsa->q, ctx)) == NULL) goto err; BN_clear_free(*kinvp); @@ -273,7 +279,6 @@ static int dsa_sign_setup(DSA *dsa, BN_CTX *ctx_in, BN_CTX_free(ctx); BN_clear_free(k); BN_clear_free(l); - BN_clear_free(m); return ret; } @@ -392,4 +397,32 @@ static int dsa_finish(DSA *dsa) { BN_MONT_CTX_free(dsa->method_mont_p); return 1; +} + +/* + * Compute the inverse of k modulo q. + * Since q is prime, Fermat's Little Theorem applies, which reduces this to + * mod-exp operation. Both the exponent and modulus are public information + * so a mod-exp that doesn't leak the base is sufficient. A newly allocated + * BIGNUM is returned which the caller must free. + */ +static BIGNUM *dsa_mod_inverse_fermat(const BIGNUM *k, const BIGNUM *q, + BN_CTX *ctx) +{ + BIGNUM *res = NULL; + BIGNUM *r, *e; + + if ((r = BN_new()) == NULL) + return NULL; + + BN_CTX_start(ctx); + if ((e = BN_CTX_get(ctx)) != NULL + && BN_set_word(r, 2) + && BN_sub(e, q, r) + && BN_mod_exp_mont(r, k, e, q, ctx, NULL)) + res = r; + else + BN_free(r); + BN_CTX_end(ctx); + return res; } Modified: vendor-crypto/openssl/dist/crypto/ec/ec_ameth.c ============================================================================== --- vendor-crypto/openssl/dist/crypto/ec/ec_ameth.c Tue Nov 20 18:38:28 2018 (r340689) +++ vendor-crypto/openssl/dist/crypto/ec/ec_ameth.c Tue Nov 20 18:59:41 2018 (r340690) @@ -699,7 +699,7 @@ static int ecdh_cms_set_kdf_param(EVP_PKEY_CTX *pctx, if (EVP_PKEY_CTX_set_ecdh_cofactor_mode(pctx, cofactor) <= 0) return 0; - if (EVP_PKEY_CTX_set_ecdh_kdf_type(pctx, EVP_PKEY_ECDH_KDF_X9_62) <= 0) + if (EVP_PKEY_CTX_set_ecdh_kdf_type(pctx, EVP_PKEY_ECDH_KDF_X9_63) <= 0) return 0; kdf_md = EVP_get_digestbynid(kdfmd_nid); @@ -864,7 +864,7 @@ static int ecdh_cms_encrypt(CMS_RecipientInfo *ri) ecdh_nid = NID_dh_cofactor_kdf; if (kdf_type == EVP_PKEY_ECDH_KDF_NONE) { - kdf_type = EVP_PKEY_ECDH_KDF_X9_62; + kdf_type = EVP_PKEY_ECDH_KDF_X9_63; if (EVP_PKEY_CTX_set_ecdh_kdf_type(pctx, kdf_type) <= 0) goto err; } else Modified: vendor-crypto/openssl/dist/crypto/ec/ec_mult.c ============================================================================== --- vendor-crypto/openssl/dist/crypto/ec/ec_mult.c Tue Nov 20 18:38:28 2018 (r340689) +++ vendor-crypto/openssl/dist/crypto/ec/ec_mult.c Tue Nov 20 18:59:41 2018 (r340690) @@ -206,8 +206,8 @@ int ec_scalar_mul_ladder(const EC_GROUP *group, EC_POI */ cardinality_bits = BN_num_bits(cardinality); group_top = bn_get_top(cardinality); - if ((bn_wexpand(k, group_top + 1) == NULL) - || (bn_wexpand(lambda, group_top + 1) == NULL)) { + if ((bn_wexpand(k, group_top + 2) == NULL) + || (bn_wexpand(lambda, group_top + 2) == NULL)) { ECerr(EC_F_EC_SCALAR_MUL_LADDER, ERR_R_BN_LIB); goto err; } @@ -244,7 +244,7 @@ int ec_scalar_mul_ladder(const EC_GROUP *group, EC_POI * k := scalar + 2*cardinality */ kbit = BN_is_bit_set(lambda, cardinality_bits); - BN_consttime_swap(kbit, k, lambda, group_top + 1); + BN_consttime_swap(kbit, k, lambda, group_top + 2); group_top = bn_get_top(group->field); if ((bn_wexpand(s->X, group_top) == NULL) Modified: vendor-crypto/openssl/dist/crypto/ec/ec_pmeth.c ============================================================================== --- vendor-crypto/openssl/dist/crypto/ec/ec_pmeth.c Tue Nov 20 18:38:28 2018 (r340689) +++ vendor-crypto/openssl/dist/crypto/ec/ec_pmeth.c Tue Nov 20 18:59:41 2018 (r340690) @@ -209,7 +209,7 @@ static int pkey_ec_kdf_derive(EVP_PKEY_CTX *ctx, if (!pkey_ec_derive(ctx, ktmp, &ktmplen)) goto err; /* Do KDF stuff */ - if (!ECDH_KDF_X9_62(key, *keylen, ktmp, ktmplen, + if (!ecdh_KDF_X9_63(key, *keylen, ktmp, ktmplen, dctx->kdf_ukm, dctx->kdf_ukmlen, dctx->kdf_md)) goto err; rv = 1; @@ -281,7 +281,7 @@ static int pkey_ec_ctrl(EVP_PKEY_CTX *ctx, int type, i case EVP_PKEY_CTRL_EC_KDF_TYPE: if (p1 == -2) return dctx->kdf_type; - if (p1 != EVP_PKEY_ECDH_KDF_NONE && p1 != EVP_PKEY_ECDH_KDF_X9_62) + if (p1 != EVP_PKEY_ECDH_KDF_NONE && p1 != EVP_PKEY_ECDH_KDF_X9_63) return -2; dctx->kdf_type = p1; return 1; Modified: vendor-crypto/openssl/dist/crypto/ec/ecdh_kdf.c ============================================================================== --- vendor-crypto/openssl/dist/crypto/ec/ecdh_kdf.c Tue Nov 20 18:38:28 2018 (r340689) +++ vendor-crypto/openssl/dist/crypto/ec/ecdh_kdf.c Tue Nov 20 18:59:41 2018 (r340690) @@ -1,5 +1,5 @@ /* - * Copyright 2015-2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2015-2018 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -10,12 +10,13 @@ #include #include #include +#include "ec_lcl.h" -/* Key derivation function from X9.62/SECG */ +/* Key derivation function from X9.63/SECG */ /* Way more than we will ever need */ #define ECDH_KDF_MAX (1 << 30) -int ECDH_KDF_X9_62(unsigned char *out, size_t outlen, +int ecdh_KDF_X9_63(unsigned char *out, size_t outlen, const unsigned char *Z, size_t Zlen, const unsigned char *sinfo, size_t sinfolen, const EVP_MD *md) @@ -65,4 +66,16 @@ int ECDH_KDF_X9_62(unsigned char *out, size_t outlen, err: EVP_MD_CTX_free(mctx); return rv; +} + +/*- + * The old name for ecdh_KDF_X9_63 + * Retained for ABI compatibility + */ +int ECDH_KDF_X9_62(unsigned char *out, size_t outlen, + const unsigned char *Z, size_t Zlen, + const unsigned char *sinfo, size_t sinfolen, + const EVP_MD *md) +{ + return ecdh_KDF_X9_63(out, outlen, Z, Zlen, sinfo, sinfolen, md); } Modified: vendor-crypto/openssl/dist/crypto/engine/eng_devcrypto.c ============================================================================== --- vendor-crypto/openssl/dist/crypto/engine/eng_devcrypto.c Tue Nov 20 18:38:28 2018 (r340689) +++ vendor-crypto/openssl/dist/crypto/engine/eng_devcrypto.c Tue Nov 20 18:59:41 2018 (r340690) @@ -28,6 +28,13 @@ # define CHECK_BSD_STYLE_MACROS #endif +/* + * ONE global file descriptor for all sessions. This allows operations + * such as digest session data copying (see digest_copy()), but is also + * saner... why re-open /dev/crypto for every session? + */ +static int cfd; + /****************************************************************************** * * Ciphers @@ -39,7 +46,6 @@ *****/ struct cipher_ctx { - int cfd; struct session_op sess; /* to pass from init to do_cipher */ @@ -69,7 +75,7 @@ static const struct cipher_data_st { { NID_aes_192_cbc, 16, 192 / 8, 16, EVP_CIPH_CBC_MODE, CRYPTO_AES_CBC }, { NID_aes_256_cbc, 16, 256 / 8, 16, EVP_CIPH_CBC_MODE, CRYPTO_AES_CBC }, #ifndef OPENSSL_NO_RC4 - { NID_rc4, 1, 16, 0, CRYPTO_ARC4 }, + { NID_rc4, 1, 16, 0, EVP_CIPH_STREAM_CIPHER, CRYPTO_ARC4 }, *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Tue Nov 20 19:00:21 2018 Return-Path: Delivered-To: svn-src-all@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 11FB1113A05E; Tue, 20 Nov 2018 19:00:21 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.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 A7D657C653; Tue, 20 Nov 2018 19:00:20 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7199E15501; Tue, 20 Nov 2018 19:00:20 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAKJ0KBQ060827; Tue, 20 Nov 2018 19:00:20 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAKJ0KAN060826; Tue, 20 Nov 2018 19:00:20 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <201811201900.wAKJ0KAN060826@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Tue, 20 Nov 2018 19:00:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r340691 - vendor-crypto/openssl/1.1.1a X-SVN-Group: vendor-crypto X-SVN-Commit-Author: jkim X-SVN-Commit-Paths: vendor-crypto/openssl/1.1.1a X-SVN-Commit-Revision: 340691 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A7D657C653 X-Spamd-Result: default: False [0.41 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.31)[0.310,0]; NEURAL_HAM_LONG(-0.01)[-0.006,0]; NEURAL_SPAM_MEDIUM(0.11)[0.109,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Nov 2018 19:00:21 -0000 Author: jkim Date: Tue Nov 20 19:00:20 2018 New Revision: 340691 URL: https://svnweb.freebsd.org/changeset/base/340691 Log: Tag OpenSSL 1.1.1a. Added: vendor-crypto/openssl/1.1.1a/ - copied from r340690, vendor-crypto/openssl/dist/ From owner-svn-src-all@freebsd.org Tue Nov 20 19:01:24 2018 Return-Path: Delivered-To: svn-src-all@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 571C9113A227; Tue, 20 Nov 2018 19:01:24 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.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 08FC47C987; Tue, 20 Nov 2018 19:01:24 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DE3621554B; Tue, 20 Nov 2018 19:01:23 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAKJ1Nk8061726; Tue, 20 Nov 2018 19:01:23 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAKJ1IwI061696; Tue, 20 Nov 2018 19:01:18 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <201811201901.wAKJ1IwI061696@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Tue, 20 Nov 2018 19:01:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r340692 - in vendor-crypto/openssl/dist-1.0.2: . apps crypto crypto/bio crypto/bn crypto/bn/asm crypto/conf crypto/dsa crypto/ec crypto/engine crypto/pkcs12 crypto/pkcs7 crypto/rand cry... X-SVN-Group: vendor-crypto X-SVN-Commit-Author: jkim X-SVN-Commit-Paths: in vendor-crypto/openssl/dist-1.0.2: . apps crypto crypto/bio crypto/bn crypto/bn/asm crypto/conf crypto/dsa crypto/ec crypto/engine crypto/pkcs12 crypto/pkcs7 crypto/rand crypto/rsa crypto/ui crypto/... X-SVN-Commit-Revision: 340692 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 08FC47C987 X-Spamd-Result: default: False [0.52 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.01)[0.012,0]; NEURAL_SPAM_MEDIUM(0.19)[0.194,0]; NEURAL_SPAM_SHORT(0.31)[0.309,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Nov 2018 19:01:24 -0000 Author: jkim Date: Tue Nov 20 19:01:17 2018 New Revision: 340692 URL: https://svnweb.freebsd.org/changeset/base/340692 Log: Import OpenSSL 1.0.2q. Added: vendor-crypto/openssl/dist-1.0.2/crypto/getenv.c (contents, props changed) Modified: vendor-crypto/openssl/dist-1.0.2/CHANGES vendor-crypto/openssl/dist-1.0.2/FREEBSD-upgrade vendor-crypto/openssl/dist-1.0.2/Makefile vendor-crypto/openssl/dist-1.0.2/NEWS vendor-crypto/openssl/dist-1.0.2/README vendor-crypto/openssl/dist-1.0.2/apps/req.c vendor-crypto/openssl/dist-1.0.2/config vendor-crypto/openssl/dist-1.0.2/crypto/Makefile vendor-crypto/openssl/dist-1.0.2/crypto/bio/b_sock.c vendor-crypto/openssl/dist-1.0.2/crypto/bn/asm/x86_64-gcc.c vendor-crypto/openssl/dist-1.0.2/crypto/bn/bn_blind.c vendor-crypto/openssl/dist-1.0.2/crypto/bn/bn_lib.c vendor-crypto/openssl/dist-1.0.2/crypto/bn/bn_mod.c vendor-crypto/openssl/dist-1.0.2/crypto/bn/bn_mont.c vendor-crypto/openssl/dist-1.0.2/crypto/bn/bn_mul.c vendor-crypto/openssl/dist-1.0.2/crypto/bn/bn_sqr.c vendor-crypto/openssl/dist-1.0.2/crypto/bn/bn_x931p.c vendor-crypto/openssl/dist-1.0.2/crypto/bn_int.h vendor-crypto/openssl/dist-1.0.2/crypto/conf/Makefile vendor-crypto/openssl/dist-1.0.2/crypto/conf/conf_api.c vendor-crypto/openssl/dist-1.0.2/crypto/conf/conf_mod.c vendor-crypto/openssl/dist-1.0.2/crypto/cryptlib.h vendor-crypto/openssl/dist-1.0.2/crypto/dsa/dsa_gen.c vendor-crypto/openssl/dist-1.0.2/crypto/dsa/dsa_ossl.c vendor-crypto/openssl/dist-1.0.2/crypto/ec/ec_lcl.h vendor-crypto/openssl/dist-1.0.2/crypto/ec/ec_lib.c vendor-crypto/openssl/dist-1.0.2/crypto/ec/ec_mult.c vendor-crypto/openssl/dist-1.0.2/crypto/engine/eng_list.c vendor-crypto/openssl/dist-1.0.2/crypto/opensslconf.h vendor-crypto/openssl/dist-1.0.2/crypto/opensslv.h vendor-crypto/openssl/dist-1.0.2/crypto/pkcs12/p12_init.c vendor-crypto/openssl/dist-1.0.2/crypto/pkcs7/pk7_lib.c vendor-crypto/openssl/dist-1.0.2/crypto/rand/Makefile vendor-crypto/openssl/dist-1.0.2/crypto/rand/md_rand.c vendor-crypto/openssl/dist-1.0.2/crypto/rand/rand_lcl.h vendor-crypto/openssl/dist-1.0.2/crypto/rand/rand_lib.c vendor-crypto/openssl/dist-1.0.2/crypto/rand/randfile.c vendor-crypto/openssl/dist-1.0.2/crypto/rsa/rsa_eay.c vendor-crypto/openssl/dist-1.0.2/crypto/ui/ui_openssl.c vendor-crypto/openssl/dist-1.0.2/crypto/x509/by_dir.c vendor-crypto/openssl/dist-1.0.2/crypto/x509/by_file.c vendor-crypto/openssl/dist-1.0.2/crypto/x509/x509_vfy.c vendor-crypto/openssl/dist-1.0.2/crypto/x509v3/v3_purp.c vendor-crypto/openssl/dist-1.0.2/doc/apps/crl.pod vendor-crypto/openssl/dist-1.0.2/doc/apps/req.pod vendor-crypto/openssl/dist-1.0.2/doc/apps/s_server.pod vendor-crypto/openssl/dist-1.0.2/doc/crypto/EVP_DigestSignInit.pod vendor-crypto/openssl/dist-1.0.2/doc/crypto/EVP_DigestVerifyInit.pod vendor-crypto/openssl/dist-1.0.2/doc/crypto/OPENSSL_VERSION_NUMBER.pod vendor-crypto/openssl/dist-1.0.2/engines/e_capi.c vendor-crypto/openssl/dist-1.0.2/ssl/d1_pkt.c vendor-crypto/openssl/dist-1.0.2/ssl/ssl_ciph.c vendor-crypto/openssl/dist-1.0.2/ssl/ssl_lib.c vendor-crypto/openssl/dist-1.0.2/ssl/t1_lib.c vendor-crypto/openssl/dist-1.0.2/util/domd vendor-crypto/openssl/dist-1.0.2/util/libeay.num Modified: vendor-crypto/openssl/dist-1.0.2/CHANGES ============================================================================== --- vendor-crypto/openssl/dist-1.0.2/CHANGES Tue Nov 20 19:00:20 2018 (r340691) +++ vendor-crypto/openssl/dist-1.0.2/CHANGES Tue Nov 20 19:01:17 2018 (r340692) @@ -7,6 +7,36 @@ https://github.com/openssl/openssl/commits/ and pick the appropriate release branch. + Changes between 1.0.2p and 1.0.2q [20 Nov 2018] + + *) Microarchitecture timing vulnerability in ECC scalar multiplication + + OpenSSL ECC scalar multiplication, used in e.g. ECDSA and ECDH, has been + shown to be vulnerable to a microarchitecture timing side channel attack. + An attacker with sufficient access to mount local timing attacks during + ECDSA signature generation could recover the private key. + + This issue was reported to OpenSSL on 26th October 2018 by Alejandro + Cabrera Aldaya, Billy Brumley, Sohaib ul Hassan, Cesar Pereida Garcia and + Nicola Tuveri. + (CVE-2018-5407) + [Billy Brumley] + + *) Timing vulnerability in DSA signature generation + + The OpenSSL DSA signature algorithm has been shown to be vulnerable to a + timing side channel attack. An attacker could use variations in the signing + algorithm to recover the private key. + + This issue was reported to OpenSSL on 16th October 2018 by Samuel Weiser. + (CVE-2018-0734) + [Paul Dale] + + *) Resolve a compatibility issue in EC_GROUP handling with the FIPS Object + Module, accidentally introduced while backporting security fixes from the + development branch and hindering the use of ECC in FIPS mode. + [Nicola Tuveri] + Changes between 1.0.2o and 1.0.2p [14 Aug 2018] *) Client DoS due to large DH parameter Modified: vendor-crypto/openssl/dist-1.0.2/FREEBSD-upgrade ============================================================================== --- vendor-crypto/openssl/dist-1.0.2/FREEBSD-upgrade Tue Nov 20 19:00:20 2018 (r340691) +++ vendor-crypto/openssl/dist-1.0.2/FREEBSD-upgrade Tue Nov 20 19:01:17 2018 (r340692) @@ -11,8 +11,8 @@ First, read http://wiki.freebsd.org/SubversionPrimer/V # Xlist setenv XLIST /FreeBSD/work/openssl/svn-FREEBSD-files/FREEBSD-Xlist setenv FSVN "svn+ssh://repo.freebsd.org/base" -setenv OSSLVER 1.0.2p -# OSSLTAG format: v1_0_2p +setenv OSSLVER 1.0.2q +# OSSLTAG format: v1_0_2q ###setenv OSSLTAG v`echo ${OSSLVER} | tr . _` Modified: vendor-crypto/openssl/dist-1.0.2/Makefile ============================================================================== --- vendor-crypto/openssl/dist-1.0.2/Makefile Tue Nov 20 19:00:20 2018 (r340691) +++ vendor-crypto/openssl/dist-1.0.2/Makefile Tue Nov 20 19:01:17 2018 (r340692) @@ -4,18 +4,18 @@ ## Makefile for OpenSSL ## -VERSION=1.0.2p +VERSION=1.0.2q MAJOR=1 MINOR=0.2 SHLIB_VERSION_NUMBER=1.0.0 SHLIB_VERSION_HISTORY= SHLIB_MAJOR=1 SHLIB_MINOR=0.0 -SHLIB_EXT= -PLATFORM=dist -OPTIONS= no-ec_nistp_64_gcc_128 no-gmp no-jpake no-krb5 no-libunbound no-md2 no-rc5 no-rfc3779 no-sctp no-shared no-ssl-trace no-ssl2 no-store no-unit-test no-weak-ssl-ciphers no-zlib no-zlib-dynamic static-engine -CONFIGURE_ARGS=dist -SHLIB_TARGET= +SHLIB_EXT=.so.$(SHLIB_MAJOR).$(SHLIB_MINOR) +PLATFORM=linux-x86_64 +OPTIONS=-Wa,--noexecstack no-ec_nistp_64_gcc_128 no-gmp no-jpake no-krb5 no-libunbound no-md2 no-rc5 no-rfc3779 no-sctp no-shared no-ssl-trace no-ssl2 no-store no-unit-test no-weak-ssl-ciphers no-zlib no-zlib-dynamic static-engine +CONFIGURE_ARGS=linux-x86_64 -Wa,--noexecstack +SHLIB_TARGET=linux-shared # HERE indicates where this Makefile lives. This can be used to indicate # where sub-Makefiles are expected to be. Currently has very limited usage, @@ -59,11 +59,11 @@ OPENSSLDIR=/usr/local/ssl # equal 4. # PKCS1_CHECK - pkcs1 tests. -CC= cc -CFLAG= -O +CC= gcc +CFLAG= -DOPENSSL_THREADS -D_REENTRANT -DDSO_DLFCN -DHAVE_DLFCN_H -Wa,--noexecstack -m64 -DL_ENDIAN -O3 -Wall -DOPENSSL_IA32_SSE2 -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_BN_ASM_GF2m -DRC4_ASM -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DMD5_ASM -DAES_ASM -DVPAES_ASM -DBSAES_ASM -DWHIRLPOOL_ASM -DGHASH_ASM -DECP_NISTZ256_ASM DEPFLAG= -DOPENSSL_NO_EC_NISTP_64_GCC_128 -DOPENSSL_NO_GMP -DOPENSSL_NO_JPAKE -DOPENSSL_NO_LIBUNBOUND -DOPENSSL_NO_MD2 -DOPENSSL_NO_RC5 -DOPENSSL_NO_RFC3779 -DOPENSSL_NO_SCTP -DOPENSSL_NO_SSL_TRACE -DOPENSSL_NO_SSL2 -DOPENSSL_NO_STORE -DOPENSSL_NO_UNIT_TEST -DOPENSSL_NO_WEAK_SSL_CIPHERS PEX_LIBS= -EX_LIBS= +EX_LIBS= -ldl EXE_EXT= ARFLAGS= AR= ar $(ARFLAGS) r @@ -73,7 +73,7 @@ NM= nm PERL= /usr/bin/perl TAR= tar TARFLAGS= --no-recursion -MAKEDEPPROG= cc +MAKEDEPPROG= gcc LIBDIR=lib # We let the C compiler driver to take care of .s files. This is done in @@ -89,23 +89,23 @@ ASFLAG=$(CFLAG) PROCESSOR= # CPUID module collects small commonly used assembler snippets -CPUID_OBJ= mem_clr.o -BN_ASM= bn_asm.o -EC_ASM= +CPUID_OBJ= x86_64cpuid.o +BN_ASM= x86_64-gcc.o x86_64-mont.o x86_64-mont5.o x86_64-gf2m.o rsaz_exp.o rsaz-x86_64.o rsaz-avx2.o +EC_ASM= ecp_nistz256.o ecp_nistz256-x86_64.o DES_ENC= des_enc.o fcrypt_b.o -AES_ENC= aes_core.o aes_cbc.o +AES_ENC= aes-x86_64.o vpaes-x86_64.o bsaes-x86_64.o aesni-x86_64.o aesni-sha1-x86_64.o aesni-sha256-x86_64.o aesni-mb-x86_64.o BF_ENC= bf_enc.o CAST_ENC= c_enc.o -RC4_ENC= rc4_enc.o rc4_skey.o +RC4_ENC= rc4-x86_64.o rc4-md5-x86_64.o RC5_ENC= rc5_enc.o -MD5_ASM_OBJ= -SHA1_ASM_OBJ= +MD5_ASM_OBJ= md5-x86_64.o +SHA1_ASM_OBJ= sha1-x86_64.o sha256-x86_64.o sha512-x86_64.o sha1-mb-x86_64.o sha256-mb-x86_64.o RMD160_ASM_OBJ= -WP_ASM_OBJ= wp_block.o -CMLL_ENC= camellia.o cmll_misc.o cmll_cbc.o -MODES_ASM_OBJ= +WP_ASM_OBJ= wp-x86_64.o +CMLL_ENC= cmll-x86_64.o cmll_misc.o +MODES_ASM_OBJ= ghash-x86_64.o aesni-gcm-x86_64.o ENGINES_ASM_OBJ= -PERLASM_SCHEME= +PERLASM_SCHEME= elf # KRB5 stuff KRB5_INCLUDES= @@ -177,8 +177,8 @@ LIBS= libcrypto.a libssl.a SHARED_CRYPTO=libcrypto$(SHLIB_EXT) SHARED_SSL=libssl$(SHLIB_EXT) SHARED_LIBS= -SHARED_LIBS_LINK_EXTS= -SHARED_LDFLAGS= +SHARED_LIBS_LINK_EXTS=.so.$(SHLIB_MAJOR) .so +SHARED_LDFLAGS=-m64 GENERAL= Makefile BASENAME= openssl Modified: vendor-crypto/openssl/dist-1.0.2/NEWS ============================================================================== --- vendor-crypto/openssl/dist-1.0.2/NEWS Tue Nov 20 19:00:20 2018 (r340691) +++ vendor-crypto/openssl/dist-1.0.2/NEWS Tue Nov 20 19:01:17 2018 (r340692) @@ -5,6 +5,11 @@ This file gives a brief overview of the major changes between each OpenSSL release. For more details please read the CHANGES file. + Major changes between OpenSSL 1.0.2p and OpenSSL 1.0.2q [20 Nov 2018] + + o Microarchitecture timing vulnerability in ECC scalar multiplication (CVE-2018-5407) + o Timing vulnerability in DSA signature generation (CVE-2018-0734) + Major changes between OpenSSL 1.0.2o and OpenSSL 1.0.2p [14 Aug 2018] o Client DoS due to large DH parameter (CVE-2018-0732) Modified: vendor-crypto/openssl/dist-1.0.2/README ============================================================================== --- vendor-crypto/openssl/dist-1.0.2/README Tue Nov 20 19:00:20 2018 (r340691) +++ vendor-crypto/openssl/dist-1.0.2/README Tue Nov 20 19:01:17 2018 (r340692) @@ -1,5 +1,5 @@ - OpenSSL 1.0.2p 14 Aug 2018 + OpenSSL 1.0.2q 20 Nov 2018 Copyright (c) 1998-2018 The OpenSSL Project Copyright (c) 1995-1998 Eric A. Young, Tim J. Hudson Modified: vendor-crypto/openssl/dist-1.0.2/apps/req.c ============================================================================== --- vendor-crypto/openssl/dist-1.0.2/apps/req.c Tue Nov 20 19:00:20 2018 (r340691) +++ vendor-crypto/openssl/dist-1.0.2/apps/req.c Tue Nov 20 19:01:17 2018 (r340692) @@ -659,8 +659,7 @@ int MAIN(int argc, char **argv) } } - BIO_printf(bio_err, "Generating a %ld bit %s private key\n", - newkey, keyalgstr); + BIO_printf(bio_err, "Generating a %s private key\n", keyalgstr); EVP_PKEY_CTX_set_cb(genctx, genpkey_cb); EVP_PKEY_CTX_set_app_data(genctx, bio_err); Modified: vendor-crypto/openssl/dist-1.0.2/config ============================================================================== --- vendor-crypto/openssl/dist-1.0.2/config Tue Nov 20 19:00:20 2018 (r340691) +++ vendor-crypto/openssl/dist-1.0.2/config Tue Nov 20 19:01:17 2018 (r340692) @@ -992,5 +992,6 @@ if [ $? = "0" ]; then fi else echo "This system ($OUT) is not supported. See file INSTALL for details." + exit 1 fi ) Modified: vendor-crypto/openssl/dist-1.0.2/crypto/Makefile ============================================================================== --- vendor-crypto/openssl/dist-1.0.2/crypto/Makefile Tue Nov 20 19:00:20 2018 (r340691) +++ vendor-crypto/openssl/dist-1.0.2/crypto/Makefile Tue Nov 20 19:01:17 2018 (r340692) @@ -36,9 +36,11 @@ TEST=constant_time_test.c LIB= $(TOP)/libcrypto.a SHARED_LIB= libcrypto$(SHLIB_EXT) LIBSRC= cryptlib.c mem.c mem_clr.c mem_dbg.c cversion.c ex_data.c cpt_err.c \ - ebcdic.c uid.c o_time.c o_str.c o_dir.c o_fips.c o_init.c fips_ers.c + ebcdic.c uid.c o_time.c o_str.c o_dir.c o_fips.c o_init.c fips_ers.c \ + getenv.c LIBOBJ= cryptlib.o mem.o mem_dbg.o cversion.o ex_data.o cpt_err.o ebcdic.o \ - uid.o o_time.o o_str.o o_dir.o o_fips.o o_init.o fips_ers.o $(CPUID_OBJ) + uid.o o_time.o o_str.o o_dir.o o_fips.o o_init.o fips_ers.o getenv.o \ + $(CPUID_OBJ) SRC= $(LIBSRC) @@ -178,6 +180,13 @@ ex_data.o: ../include/openssl/ossl_typ.h ../include/op ex_data.o: ../include/openssl/stack.h ../include/openssl/symhacks.h cryptlib.h ex_data.o: ex_data.c fips_ers.o: ../include/openssl/opensslconf.h fips_ers.c +getenv.o: ../e_os.h ../include/openssl/bio.h ../include/openssl/buffer.h +getenv.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h +getenv.o: ../include/openssl/err.h ../include/openssl/lhash.h +getenv.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h +getenv.o: ../include/openssl/ossl_typ.h ../include/openssl/safestack.h +getenv.o: ../include/openssl/stack.h ../include/openssl/symhacks.h cryptlib.h +getenv.o: getenv.c mem.o: ../e_os.h ../include/openssl/bio.h ../include/openssl/buffer.h mem.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h mem.o: ../include/openssl/err.h ../include/openssl/lhash.h Modified: vendor-crypto/openssl/dist-1.0.2/crypto/bio/b_sock.c ============================================================================== --- vendor-crypto/openssl/dist-1.0.2/crypto/bio/b_sock.c Tue Nov 20 19:00:20 2018 (r340691) +++ vendor-crypto/openssl/dist-1.0.2/crypto/bio/b_sock.c Tue Nov 20 19:01:17 2018 (r340692) @@ -56,6 +56,9 @@ * [including the GNU Public Licence.] */ +#define _DEFAULT_SOURCE +#define _BSD_SOURCE + #include #include #include @@ -83,6 +86,11 @@ NETDB_DEFINE_CONTEXT static int wsa_init_done = 0; # endif +# if defined(__GLIBC__) +# define HAVE_GETHOSTBYNAME_R +# define GETHOSTNAME_R_BUF (2 * 1024) +# endif + /* * WSAAPI specifier is required to make indirect calls to run-time * linked WinSock 2 functions used in this module, to be specific @@ -116,7 +124,12 @@ int BIO_get_host_ip(const char *str, unsigned char *ip int i; int err = 1; int locked = 0; - struct hostent *he; + struct hostent *he = NULL; +# ifdef HAVE_GETHOSTBYNAME_R + char buf[GETHOSTNAME_R_BUF]; + struct hostent hostent; + int h_errnop; +# endif i = get_ip(str, ip); if (i < 0) { @@ -138,10 +151,18 @@ int BIO_get_host_ip(const char *str, unsigned char *ip if (i > 0) return (1); + /* if gethostbyname_r is supported, use it. */ +# ifdef HAVE_GETHOSTBYNAME_R + memset(&hostent, 0x00, sizeof(hostent)); + /* gethostbyname_r() sets |he| to NULL on error, we check it further down */ + gethostbyname_r(str, &hostent, buf, sizeof(buf), &he, &h_errnop); +# else /* do a gethostbyname */ CRYPTO_w_lock(CRYPTO_LOCK_GETHOSTBYNAME); locked = 1; he = BIO_gethostbyname(str); +# endif + if (he == NULL) { BIOerr(BIO_F_BIO_GET_HOST_IP, BIO_R_BAD_HOSTNAME_LOOKUP); goto err; Modified: vendor-crypto/openssl/dist-1.0.2/crypto/bn/asm/x86_64-gcc.c ============================================================================== --- vendor-crypto/openssl/dist-1.0.2/crypto/bn/asm/x86_64-gcc.c Tue Nov 20 19:00:20 2018 (r340691) +++ vendor-crypto/openssl/dist-1.0.2/crypto/bn/asm/x86_64-gcc.c Tue Nov 20 19:01:17 2018 (r340692) @@ -55,12 +55,6 @@ * machine. */ -# if defined(_WIN64) || !defined(__LP64__) -# define BN_ULONG unsigned long long -# else -# define BN_ULONG unsigned long -# endif - # undef mul # undef mul_add Modified: vendor-crypto/openssl/dist-1.0.2/crypto/bn/bn_blind.c ============================================================================== --- vendor-crypto/openssl/dist-1.0.2/crypto/bn/bn_blind.c Tue Nov 20 19:00:20 2018 (r340691) +++ vendor-crypto/openssl/dist-1.0.2/crypto/bn/bn_blind.c Tue Nov 20 19:01:17 2018 (r340692) @@ -1,6 +1,6 @@ /* crypto/bn/bn_blind.c */ /* ==================================================================== - * Copyright (c) 1998-2006 The OpenSSL Project. All rights reserved. + * Copyright (c) 1998-2018 The OpenSSL Project. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -206,10 +206,15 @@ int BN_BLINDING_update(BN_BLINDING *b, BN_CTX *ctx) if (!BN_BLINDING_create_param(b, NULL, NULL, ctx, NULL, NULL)) goto err; } else if (!(b->flags & BN_BLINDING_NO_UPDATE)) { - if (!BN_mod_mul(b->A, b->A, b->A, b->mod, ctx)) - goto err; - if (!BN_mod_mul(b->Ai, b->Ai, b->Ai, b->mod, ctx)) - goto err; + if (b->m_ctx != NULL) { + if (!bn_mul_mont_fixed_top(b->Ai, b->Ai, b->Ai, b->m_ctx, ctx) + || !bn_mul_mont_fixed_top(b->A, b->A, b->A, b->m_ctx, ctx)) + goto err; + } else { + if (!BN_mod_mul(b->Ai, b->Ai, b->Ai, b->mod, ctx) + || !BN_mod_mul(b->A, b->A, b->A, b->mod, ctx)) + goto err; + } } ret = 1; @@ -241,13 +246,13 @@ int BN_BLINDING_convert_ex(BIGNUM *n, BIGNUM *r, BN_BL else if (!BN_BLINDING_update(b, ctx)) return (0); - if (r != NULL) { - if (!BN_copy(r, b->Ai)) - ret = 0; - } + if (r != NULL && (BN_copy(r, b->Ai) == NULL)) + return 0; - if (!BN_mod_mul(n, n, b->A, b->mod, ctx)) - ret = 0; + if (b->m_ctx != NULL) + ret = BN_mod_mul_montgomery(n, n, b->A, b->m_ctx, ctx); + else + ret = BN_mod_mul(n, n, b->A, b->mod, ctx); return ret; } @@ -264,14 +269,29 @@ int BN_BLINDING_invert_ex(BIGNUM *n, const BIGNUM *r, bn_check_top(n); - if (r != NULL) - ret = BN_mod_mul(n, n, r, b->mod, ctx); - else { - if (b->Ai == NULL) { - BNerr(BN_F_BN_BLINDING_INVERT_EX, BN_R_NOT_INITIALIZED); - return (0); + if (r == NULL && (r = b->Ai) == NULL) { + BNerr(BN_F_BN_BLINDING_INVERT_EX, BN_R_NOT_INITIALIZED); + return 0; + } + + if (b->m_ctx != NULL) { + /* ensure that BN_mod_mul_montgomery takes pre-defined path */ + if (n->dmax >= r->top) { + size_t i, rtop = r->top, ntop = n->top; + BN_ULONG mask; + + for (i = 0; i < rtop; i++) { + mask = (BN_ULONG)0 - ((i - ntop) >> (8 * sizeof(i) - 1)); + n->d[i] &= mask; + } + mask = (BN_ULONG)0 - ((rtop - ntop) >> (8 * sizeof(ntop) - 1)); + /* always true, if (rtop >= ntop) n->top = r->top; */ + n->top = (int)(rtop & ~mask) | (ntop & mask); + n->flags |= (BN_FLG_FIXED_TOP & ~mask); } - ret = BN_mod_mul(n, n, b->Ai, b->mod, ctx); + ret = BN_mod_mul_montgomery(n, n, r, b->m_ctx, ctx); + } else { + ret = BN_mod_mul(n, n, r, b->mod, ctx); } bn_check_top(n); @@ -366,11 +386,16 @@ BN_BLINDING *BN_BLINDING_create_param(BN_BLINDING *b, } while (1); if (ret->bn_mod_exp != NULL && ret->m_ctx != NULL) { - if (!ret->bn_mod_exp - (ret->A, ret->A, ret->e, ret->mod, ctx, ret->m_ctx)) + if (!ret->bn_mod_exp(ret->A, ret->A, ret->e, ret->mod, ctx, ret->m_ctx)) goto err; } else { if (!BN_mod_exp(ret->A, ret->A, ret->e, ret->mod, ctx)) + goto err; + } + + if (ret->m_ctx != NULL) { + if (!bn_to_mont_fixed_top(ret->Ai, ret->Ai, ret->m_ctx, ctx) + || !bn_to_mont_fixed_top(ret->A, ret->A, ret->m_ctx, ctx)) goto err; } Modified: vendor-crypto/openssl/dist-1.0.2/crypto/bn/bn_lib.c ============================================================================== --- vendor-crypto/openssl/dist-1.0.2/crypto/bn/bn_lib.c Tue Nov 20 19:00:20 2018 (r340691) +++ vendor-crypto/openssl/dist-1.0.2/crypto/bn/bn_lib.c Tue Nov 20 19:01:17 2018 (r340692) @@ -617,26 +617,40 @@ BIGNUM *BN_bin2bn(const unsigned char *s, int len, BIG static int bn2binpad(const BIGNUM *a, unsigned char *to, int tolen) { int n; - size_t i, inc, lasti, j; + size_t i, lasti, j, atop, mask; BN_ULONG l; + /* + * In case |a| is fixed-top, BN_num_bytes can return bogus length, + * but it's assumed that fixed-top inputs ought to be "nominated" + * even for padded output, so it works out... + */ n = BN_num_bytes(a); - if (tolen == -1) + if (tolen == -1) { tolen = n; - else if (tolen < n) - return -1; + } else if (tolen < n) { /* uncommon/unlike case */ + BIGNUM temp = *a; - if (n == 0) { + bn_correct_top(&temp); + n = BN_num_bytes(&temp); + if (tolen < n) + return -1; + } + + /* Swipe through whole available data and don't give away padded zero. */ + atop = a->dmax * BN_BYTES; + if (atop == 0) { OPENSSL_cleanse(to, tolen); return tolen; } - lasti = n - 1; - for (i = 0, inc = 1, j = tolen; j > 0;) { + lasti = atop - 1; + atop = a->top * BN_BYTES; + for (i = 0, j = 0, to += tolen; j < (size_t)tolen; j++) { l = a->d[i / BN_BYTES]; - to[--j] = (unsigned char)(l >> (8 * (i % BN_BYTES)) & (0 - inc)); - inc = (i - lasti) >> (8 * sizeof(i) - 1); - i += inc; /* stay on top limb */ + mask = 0 - ((j - atop) >> (8 * sizeof(i) - 1)); + *--to = (unsigned char)(l >> (8 * (i % BN_BYTES)) & mask); + i += (i - lasti) >> (8 * sizeof(i) - 1); /* stay on last limb */ } return tolen; @@ -888,6 +902,38 @@ void BN_consttime_swap(BN_ULONG condition, BIGNUM *a, t = (a->top ^ b->top) & condition; a->top ^= t; b->top ^= t; + + t = (a->neg ^ b->neg) & condition; + a->neg ^= t; + b->neg ^= t; + + /*- + * BN_FLG_STATIC_DATA: indicates that data may not be written to. Intention + * is actually to treat it as it's read-only data, and some (if not most) + * of it does reside in read-only segment. In other words observation of + * BN_FLG_STATIC_DATA in BN_consttime_swap should be treated as fatal + * condition. It would either cause SEGV or effectively cause data + * corruption. + * + * BN_FLG_MALLOCED: refers to BN structure itself, and hence must be + * preserved. + * + * BN_FLG_SECURE: must be preserved, because it determines how x->d was + * allocated and hence how to free it. + * + * BN_FLG_CONSTTIME: sufficient to mask and swap + * + * BN_FLG_FIXED_TOP: indicates that we haven't called bn_correct_top() on + * the data, so the d array may be padded with additional 0 values (i.e. + * top could be greater than the minimal value that it could be). We should + * be swapping it + */ + +#define BN_CONSTTIME_SWAP_FLAGS (BN_FLG_CONSTTIME | BN_FLG_FIXED_TOP) + + t = ((a->flags ^ b->flags) & BN_CONSTTIME_SWAP_FLAGS) & condition; + a->flags ^= t; + b->flags ^= t; #define BN_CONSTTIME_SWAP(ind) \ do { \ Modified: vendor-crypto/openssl/dist-1.0.2/crypto/bn/bn_mod.c ============================================================================== --- vendor-crypto/openssl/dist-1.0.2/crypto/bn/bn_mod.c Tue Nov 20 19:00:20 2018 (r340691) +++ vendor-crypto/openssl/dist-1.0.2/crypto/bn/bn_mod.c Tue Nov 20 19:01:17 2018 (r340692) @@ -172,7 +172,7 @@ int bn_mod_add_fixed_top(BIGNUM *r, const BIGNUM *a, c if (mtop > sizeof(storage) / sizeof(storage[0]) && (tp = OPENSSL_malloc(mtop * sizeof(BN_ULONG))) == NULL) - return 0; + return 0; ap = a->d != NULL ? a->d : tp; bp = b->d != NULL ? b->d : tp; @@ -197,6 +197,7 @@ int bn_mod_add_fixed_top(BIGNUM *r, const BIGNUM *a, c ((volatile BN_ULONG *)tp)[i] = 0; } r->top = mtop; + r->flags |= BN_FLG_FIXED_TOP; r->neg = 0; if (tp != storage) @@ -222,6 +223,70 @@ int BN_mod_sub(BIGNUM *r, const BIGNUM *a, const BIGNU if (!BN_sub(r, a, b)) return 0; return BN_nnmod(r, r, m, ctx); +} + +/* + * BN_mod_sub variant that may be used if both a and b are non-negative, + * a is less than m, while b is of same bit width as m. It's implemented + * as subtraction followed by two conditional additions. + * + * 0 <= a < m + * 0 <= b < 2^w < 2*m + * + * after subtraction + * + * -2*m < r = a - b < m + * + * Thus it takes up to two conditional additions to make |r| positive. + */ +int bn_mod_sub_fixed_top(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, + const BIGNUM *m) +{ + size_t i, ai, bi, mtop = m->top; + BN_ULONG borrow, carry, ta, tb, mask, *rp; + const BN_ULONG *ap, *bp; + + if (bn_wexpand(r, m->top) == NULL) + return 0; + + rp = r->d; + ap = a->d != NULL ? a->d : rp; + bp = b->d != NULL ? b->d : rp; + + for (i = 0, ai = 0, bi = 0, borrow = 0; i < mtop;) { + mask = (BN_ULONG)0 - ((i - a->top) >> (8 * sizeof(i) - 1)); + ta = ap[ai] & mask; + + mask = (BN_ULONG)0 - ((i - b->top) >> (8 * sizeof(i) - 1)); + tb = bp[bi] & mask; + rp[i] = ta - tb - borrow; + if (ta != tb) + borrow = (ta < tb); + + i++; + ai += (i - a->dmax) >> (8 * sizeof(i) - 1); + bi += (i - b->dmax) >> (8 * sizeof(i) - 1); + } + ap = m->d; + for (i = 0, mask = 0 - borrow, carry = 0; i < mtop; i++) { + ta = ((ap[i] & mask) + carry) & BN_MASK2; + carry = (ta < carry); + rp[i] = (rp[i] + ta) & BN_MASK2; + carry += (rp[i] < ta); + } + borrow -= carry; + for (i = 0, mask = 0 - borrow, carry = 0; i < mtop; i++) { + ta = ((ap[i] & mask) + carry) & BN_MASK2; + carry = (ta < carry); + rp[i] = (rp[i] + ta) & BN_MASK2; + carry += (rp[i] < ta); + } + + r->top = mtop; + r->flags |= BN_FLG_FIXED_TOP; + r->neg = 0; + + return 1; } /* Modified: vendor-crypto/openssl/dist-1.0.2/crypto/bn/bn_mont.c ============================================================================== --- vendor-crypto/openssl/dist-1.0.2/crypto/bn/bn_mont.c Tue Nov 20 19:00:20 2018 (r340691) +++ vendor-crypto/openssl/dist-1.0.2/crypto/bn/bn_mont.c Tue Nov 20 19:01:17 2018 (r340692) @@ -164,10 +164,10 @@ int bn_mul_mont_fixed_top(BIGNUM *r, const BIGNUM *a, bn_check_top(tmp); if (a == b) { - if (!BN_sqr(tmp, a, ctx)) + if (!bn_sqr_fixed_top(tmp, a, ctx)) goto err; } else { - if (!BN_mul(tmp, a, b, ctx)) + if (!bn_mul_fixed_top(tmp, a, b, ctx)) goto err; } /* reduce from aRR to aR */ @@ -190,6 +190,7 @@ static int bn_from_montgomery_word(BIGNUM *ret, BIGNUM BIGNUM *n; BN_ULONG *ap, *np, *rp, n0, v, carry; int nl, max, i; + unsigned int rtop; n = &(mont->N); nl = n->top; @@ -207,12 +208,10 @@ static int bn_from_montgomery_word(BIGNUM *ret, BIGNUM rp = r->d; /* clear the top words of T */ -# if 1 - for (i = r->top; i < max; i++) /* memset? XXX */ - rp[i] = 0; -# else - memset(&(rp[r->top]), 0, (max - r->top) * sizeof(BN_ULONG)); -# endif + for (rtop = r->top, i = 0; i < max; i++) { + v = (BN_ULONG)0 - ((i - rtop) >> (8 * sizeof(rtop) - 1)); + rp[i] &= v; + } r->top = max; r->flags |= BN_FLG_FIXED_TOP; @@ -263,6 +262,18 @@ static int bn_from_montgomery_word(BIGNUM *ret, BIGNUM int BN_from_montgomery(BIGNUM *ret, const BIGNUM *a, BN_MONT_CTX *mont, BN_CTX *ctx) { + int retn; + + retn = bn_from_mont_fixed_top(ret, a, mont, ctx); + bn_correct_top(ret); + bn_check_top(ret); + + return retn; +} + +int bn_from_mont_fixed_top(BIGNUM *ret, const BIGNUM *a, BN_MONT_CTX *mont, + BN_CTX *ctx) +{ int retn = 0; #ifdef MONT_WORD BIGNUM *t; @@ -270,8 +281,6 @@ int BN_from_montgomery(BIGNUM *ret, const BIGNUM *a, B BN_CTX_start(ctx); if ((t = BN_CTX_get(ctx)) && BN_copy(t, a)) { retn = bn_from_montgomery_word(ret, t, mont); - bn_correct_top(ret); - bn_check_top(ret); } BN_CTX_end(ctx); #else /* !MONT_WORD */ Modified: vendor-crypto/openssl/dist-1.0.2/crypto/bn/bn_mul.c ============================================================================== --- vendor-crypto/openssl/dist-1.0.2/crypto/bn/bn_mul.c Tue Nov 20 19:00:20 2018 (r340691) +++ vendor-crypto/openssl/dist-1.0.2/crypto/bn/bn_mul.c Tue Nov 20 19:01:17 2018 (r340692) @@ -936,6 +936,16 @@ void bn_mul_high(BN_ULONG *r, BN_ULONG *a, BN_ULONG *b int BN_mul(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx) { + int ret = bn_mul_fixed_top(r, a, b, ctx); + + bn_correct_top(r); + bn_check_top(r); + + return ret; +} + +int bn_mul_fixed_top(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx) +{ int ret = 0; int top, al, bl; BIGNUM *rr; @@ -1042,7 +1052,7 @@ int BN_mul(BIGNUM *r, const BIGNUM *a, const BIGNUM *b #if defined(BN_MUL_COMBA) || defined(BN_RECURSION) end: #endif - bn_correct_top(rr); + rr->flags |= BN_FLG_FIXED_TOP; if (r != rr && BN_copy(r, rr) == NULL) goto err; Modified: vendor-crypto/openssl/dist-1.0.2/crypto/bn/bn_sqr.c ============================================================================== --- vendor-crypto/openssl/dist-1.0.2/crypto/bn/bn_sqr.c Tue Nov 20 19:00:20 2018 (r340691) +++ vendor-crypto/openssl/dist-1.0.2/crypto/bn/bn_sqr.c Tue Nov 20 19:01:17 2018 (r340692) @@ -66,6 +66,16 @@ */ int BN_sqr(BIGNUM *r, const BIGNUM *a, BN_CTX *ctx) { + int ret = bn_sqr_fixed_top(r, a, ctx); + + bn_correct_top(r); + bn_check_top(r); + + return ret; +} + +int bn_sqr_fixed_top(BIGNUM *r, const BIGNUM *a, BN_CTX *ctx) +{ int max, al; int ret = 0; BIGNUM *tmp, *rr; @@ -136,7 +146,7 @@ int BN_sqr(BIGNUM *r, const BIGNUM *a, BN_CTX *ctx) rr->neg = 0; rr->top = max; - bn_correct_top(rr); + rr->flags |= BN_FLG_FIXED_TOP; if (r != rr && BN_copy(r, rr) == NULL) goto err; Modified: vendor-crypto/openssl/dist-1.0.2/crypto/bn/bn_x931p.c ============================================================================== --- vendor-crypto/openssl/dist-1.0.2/crypto/bn/bn_x931p.c Tue Nov 20 19:00:20 2018 (r340691) +++ vendor-crypto/openssl/dist-1.0.2/crypto/bn/bn_x931p.c Tue Nov 20 19:01:17 2018 (r340692) @@ -4,7 +4,7 @@ * 2005. */ /* ==================================================================== - * Copyright (c) 2005 The OpenSSL Project. All rights reserved. + * Copyright (c) 2005-2018 The OpenSSL Project. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -223,8 +223,10 @@ int BN_X931_generate_Xpq(BIGNUM *Xp, BIGNUM *Xq, int n for (i = 0; i < 1000; i++) { if (!BN_rand(Xq, nbits, 1, 0)) goto err; + /* Check that |Xp - Xq| > 2^(nbits - 100) */ - BN_sub(t, Xp, Xq); + if (!BN_sub(t, Xp, Xq)) + goto err; if (BN_num_bits(t) > (nbits - 100)) break; } Modified: vendor-crypto/openssl/dist-1.0.2/crypto/bn_int.h ============================================================================== --- vendor-crypto/openssl/dist-1.0.2/crypto/bn_int.h Tue Nov 20 19:00:20 2018 (r340691) +++ vendor-crypto/openssl/dist-1.0.2/crypto/bn_int.h Tue Nov 20 19:01:17 2018 (r340692) @@ -7,9 +7,15 @@ */ int bn_mul_mont_fixed_top(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, BN_MONT_CTX *mont, BN_CTX *ctx); +int bn_from_mont_fixed_top(BIGNUM *r, const BIGNUM *a, BN_MONT_CTX *mont, + BN_CTX *ctx); int bn_to_mont_fixed_top(BIGNUM *r, const BIGNUM *a, BN_MONT_CTX *mont, BN_CTX *ctx); int bn_mod_add_fixed_top(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, const BIGNUM *m); +int bn_mod_sub_fixed_top(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, + const BIGNUM *m); +int bn_mul_fixed_top(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx); +int bn_sqr_fixed_top(BIGNUM *r, const BIGNUM *a, BN_CTX *ctx); int bn_bn2binpad(const BIGNUM *a, unsigned char *to, int tolen); Modified: vendor-crypto/openssl/dist-1.0.2/crypto/conf/Makefile ============================================================================== --- vendor-crypto/openssl/dist-1.0.2/crypto/conf/Makefile Tue Nov 20 19:00:20 2018 (r340691) +++ vendor-crypto/openssl/dist-1.0.2/crypto/conf/Makefile Tue Nov 20 19:01:17 2018 (r340692) @@ -80,12 +80,13 @@ clean: # DO NOT DELETE THIS LINE -- make depend depends on it. conf_api.o: ../../e_os.h ../../include/openssl/bio.h -conf_api.o: ../../include/openssl/conf.h ../../include/openssl/conf_api.h -conf_api.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h +conf_api.o: ../../include/openssl/buffer.h ../../include/openssl/conf.h +conf_api.o: ../../include/openssl/conf_api.h ../../include/openssl/crypto.h +conf_api.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h conf_api.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h conf_api.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h conf_api.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h -conf_api.o: ../../include/openssl/symhacks.h conf_api.c +conf_api.o: ../../include/openssl/symhacks.h ../cryptlib.h conf_api.c conf_def.o: ../../e_os.h ../../include/openssl/bio.h conf_def.o: ../../include/openssl/buffer.h ../../include/openssl/conf.h conf_def.o: ../../include/openssl/conf_api.h ../../include/openssl/crypto.h Modified: vendor-crypto/openssl/dist-1.0.2/crypto/conf/conf_api.c ============================================================================== --- vendor-crypto/openssl/dist-1.0.2/crypto/conf/conf_api.c Tue Nov 20 19:00:20 2018 (r340691) +++ vendor-crypto/openssl/dist-1.0.2/crypto/conf/conf_api.c Tue Nov 20 19:01:17 2018 (r340692) @@ -66,6 +66,7 @@ #include #include #include +#include "cryptlib.h" #include #include #include "e_os.h" @@ -141,7 +142,7 @@ char *_CONF_get_string(const CONF *conf, const char *s if (v != NULL) return (v->value); if (strcmp(section, "ENV") == 0) { - p = getenv(name); + p = ossl_safe_getenv(name); if (p != NULL) return (p); } @@ -154,7 +155,7 @@ char *_CONF_get_string(const CONF *conf, const char *s else return (NULL); } else - return (getenv(name)); + return (ossl_safe_getenv(name)); } #if 0 /* There's no way to provide error checking Modified: vendor-crypto/openssl/dist-1.0.2/crypto/conf/conf_mod.c ============================================================================== --- vendor-crypto/openssl/dist-1.0.2/crypto/conf/conf_mod.c Tue Nov 20 19:00:20 2018 (r340691) +++ vendor-crypto/openssl/dist-1.0.2/crypto/conf/conf_mod.c Tue Nov 20 19:01:17 2018 (r340692) @@ -4,7 +4,7 @@ * 2001. */ /* ==================================================================== - * Copyright (c) 2001 The OpenSSL Project. All rights reserved. + * Copyright (c) 2001-2018 The OpenSSL Project. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -530,7 +530,7 @@ char *CONF_get1_default_config_file(void) char *file; int len; - file = getenv("OPENSSL_CONF"); + file = ossl_safe_getenv("OPENSSL_CONF"); if (file) return BUF_strdup(file); Modified: vendor-crypto/openssl/dist-1.0.2/crypto/cryptlib.h ============================================================================== --- vendor-crypto/openssl/dist-1.0.2/crypto/cryptlib.h Tue Nov 20 19:00:20 2018 (r340691) +++ vendor-crypto/openssl/dist-1.0.2/crypto/cryptlib.h Tue Nov 20 19:01:17 2018 (r340692) @@ -104,6 +104,8 @@ void OPENSSL_showfatal(const char *fmta, ...); void *OPENSSL_stderr(void); extern int OPENSSL_NONPIC_relocated; +char *ossl_safe_getenv(const char *); + #ifdef __cplusplus } #endif Modified: vendor-crypto/openssl/dist-1.0.2/crypto/dsa/dsa_gen.c ============================================================================== --- vendor-crypto/openssl/dist-1.0.2/crypto/dsa/dsa_gen.c Tue Nov 20 19:00:20 2018 (r340691) +++ vendor-crypto/openssl/dist-1.0.2/crypto/dsa/dsa_gen.c Tue Nov 20 19:01:17 2018 (r340692) @@ -435,6 +435,12 @@ int dsa_builtin_paramgen2(DSA *ret, size_t L, size_t N EVP_MD_CTX_init(&mctx); + /* make sure L > N, otherwise we'll get trapped in an infinite loop */ + if (L <= N) { + DSAerr(DSA_F_DSA_BUILTIN_PARAMGEN2, DSA_R_INVALID_PARAMETERS); + goto err; + } + if (evpmd == NULL) { if (N == 160) evpmd = EVP_sha1(); Modified: vendor-crypto/openssl/dist-1.0.2/crypto/dsa/dsa_ossl.c ============================================================================== --- vendor-crypto/openssl/dist-1.0.2/crypto/dsa/dsa_ossl.c Tue Nov 20 19:00:20 2018 (r340691) +++ vendor-crypto/openssl/dist-1.0.2/crypto/dsa/dsa_ossl.c Tue Nov 20 19:01:17 2018 (r340692) @@ -73,6 +73,8 @@ static int dsa_do_verify(const unsigned char *dgst, in DSA_SIG *sig, DSA *dsa); static int dsa_init(DSA *dsa); static int dsa_finish(DSA *dsa); +static BIGNUM *dsa_mod_inverse_fermat(const BIGNUM *k, const BIGNUM *q, + BN_CTX *ctx); static DSA_METHOD openssl_dsa_meth = { "OpenSSL DSA method", @@ -279,7 +281,7 @@ static int dsa_sign_setup(DSA *dsa, BN_CTX *ctx_in, BI goto err; /* Preallocate space */ - q_bits = BN_num_bits(dsa->q); + q_bits = BN_num_bits(dsa->q) + sizeof(dsa->q->d[0]) * 16; if (!BN_set_bit(&k, q_bits) || !BN_set_bit(&l, q_bits) || !BN_set_bit(&m, q_bits)) @@ -293,9 +295,9 @@ static int dsa_sign_setup(DSA *dsa, BN_CTX *ctx_in, BI if ((dsa->flags & DSA_FLAG_NO_EXP_CONSTTIME) == 0) { BN_set_flags(&k, BN_FLG_CONSTTIME); + BN_set_flags(&l, BN_FLG_CONSTTIME); } - if (dsa->flags & DSA_FLAG_CACHE_MONT_P) { if (!BN_MONT_CTX_set_locked(&dsa->method_mont_p, CRYPTO_LOCK_DSA, dsa->p, ctx)) @@ -333,8 +335,8 @@ static int dsa_sign_setup(DSA *dsa, BN_CTX *ctx_in, BI if (!BN_mod(r, r, dsa->q, ctx)) goto err; - /* Compute part of 's = inv(k) (m + xr) mod q' */ - if ((kinv = BN_mod_inverse(NULL, &k, dsa->q, ctx)) == NULL) + /* Compute part of 's = inv(k) (m + xr) mod q' */ + if ((kinv = dsa_mod_inverse_fermat(&k, dsa->q, ctx)) == NULL) goto err; if (*kinvp != NULL) @@ -467,4 +469,32 @@ static int dsa_finish(DSA *dsa) if (dsa->method_mont_p) BN_MONT_CTX_free(dsa->method_mont_p); return (1); +} + +/* + * Compute the inverse of k modulo q. + * Since q is prime, Fermat's Little Theorem applies, which reduces this to + * mod-exp operation. Both the exponent and modulus are public information + * so a mod-exp that doesn't leak the base is sufficient. A newly allocated + * BIGNUM is returned which the caller must free. + */ +static BIGNUM *dsa_mod_inverse_fermat(const BIGNUM *k, const BIGNUM *q, + BN_CTX *ctx) +{ + BIGNUM *res = NULL; + BIGNUM *r, e; + + if ((r = BN_new()) == NULL) + return NULL; + + BN_init(&e); + + if (BN_set_word(r, 2) + && BN_sub(&e, q, r) + && BN_mod_exp_mont(r, k, &e, q, ctx, NULL)) + res = r; + else + BN_free(r); + BN_free(&e); + return res; } Modified: vendor-crypto/openssl/dist-1.0.2/crypto/ec/ec_lcl.h ============================================================================== --- vendor-crypto/openssl/dist-1.0.2/crypto/ec/ec_lcl.h Tue Nov 20 19:00:20 2018 (r340691) +++ vendor-crypto/openssl/dist-1.0.2/crypto/ec/ec_lcl.h Tue Nov 20 19:01:17 2018 (r340692) @@ -3,7 +3,7 @@ * Originally written by Bodo Moeller for the OpenSSL project. */ /* ==================================================================== - * Copyright (c) 1998-2010 The OpenSSL Project. All rights reserved. + * Copyright (c) 1998-2018 The OpenSSL Project. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -214,7 +214,7 @@ struct ec_group_st { int asn1_flag; /* flag to control the asn1 encoding */ /* * Kludge: upper bit of ans1_flag is used to denote structure - * version. Is set, then last field is present. This is done + * version. If set, then last field is present. This is done * for interoperation with FIPS code. */ #define EC_GROUP_ASN1_FLAG_MASK 0x7fffffff @@ -549,7 +549,6 @@ void ec_GFp_nistp_points_make_affine_internal(size_t n void ec_GFp_nistp_recode_scalar_bits(unsigned char *sign, unsigned char *digit, unsigned char in); #endif -int ec_precompute_mont_data(EC_GROUP *); #ifdef ECP_NISTZ256_ASM /** Returns GFp methods using montgomery multiplication, with x86-64 optimized Modified: vendor-crypto/openssl/dist-1.0.2/crypto/ec/ec_lib.c ============================================================================== --- vendor-crypto/openssl/dist-1.0.2/crypto/ec/ec_lib.c Tue Nov 20 19:00:20 2018 (r340691) +++ vendor-crypto/openssl/dist-1.0.2/crypto/ec/ec_lib.c Tue Nov 20 19:01:17 2018 (r340692) @@ -70,6 +70,10 @@ const char EC_version[] = "EC" OPENSSL_VERSION_PTEXT; +/* local function prototypes */ + +static int ec_precompute_mont_data(EC_GROUP *group); + /* functions for EC_GROUP objects */ EC_GROUP *EC_GROUP_new(const EC_METHOD *meth) @@ -318,17 +322,25 @@ int EC_GROUP_set_generator(EC_GROUP *group, const EC_P } else BN_zero(&group->cofactor); - /* - * Some groups have an order with - * factors of two, which makes the Montgomery setup fail. - * |group->mont_data| will be NULL in this case. + /*- + * Access to the `mont_data` field of an EC_GROUP struct should always be + * guarded by an EC_GROUP_VERSION(group) check to avoid OOB accesses, as the + * group might come from the FIPS module, which does not define the + * `mont_data` field inside the EC_GROUP structure. */ - if (BN_is_odd(&group->order)) { - return ec_precompute_mont_data(group); + if (EC_GROUP_VERSION(group)) { + /*- + * Some groups have an order with + * factors of two, which makes the Montgomery setup fail. + * |group->mont_data| will be NULL in this case. + */ + if (BN_is_odd(&group->order)) + return ec_precompute_mont_data(group); + + BN_MONT_CTX_free(group->mont_data); + group->mont_data = NULL; } - BN_MONT_CTX_free(group->mont_data); - group->mont_data = NULL; return 1; } @@ -1098,17 +1110,22 @@ int EC_GROUP_have_precompute_mult(const EC_GROUP *grou * been performed */ } -/* +/*- * ec_precompute_mont_data sets |group->mont_data| from |group->order| and * returns one on success. On error it returns zero. + * *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Tue Nov 20 19:02:11 2018 Return-Path: Delivered-To: svn-src-all@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 74AF0113A2C1; Tue, 20 Nov 2018 19:02:11 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.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 1AE297CB64; Tue, 20 Nov 2018 19:02:11 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D239A15587; Tue, 20 Nov 2018 19:02:10 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAKJ2A38064720; Tue, 20 Nov 2018 19:02:10 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAKJ2ALq064719; Tue, 20 Nov 2018 19:02:10 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <201811201902.wAKJ2ALq064719@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Tue, 20 Nov 2018 19:02:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r340693 - vendor-crypto/openssl/1.0.2q X-SVN-Group: vendor-crypto X-SVN-Commit-Author: jkim X-SVN-Commit-Paths: vendor-crypto/openssl/1.0.2q X-SVN-Commit-Revision: 340693 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 1AE297CB64 X-Spamd-Result: default: False [0.41 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.31)[0.310,0]; NEURAL_HAM_LONG(-0.01)[-0.006,0]; NEURAL_SPAM_MEDIUM(0.11)[0.109,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Nov 2018 19:02:11 -0000 Author: jkim Date: Tue Nov 20 19:02:10 2018 New Revision: 340693 URL: https://svnweb.freebsd.org/changeset/base/340693 Log: Tag OpenSSL 1.0.2q. Added: vendor-crypto/openssl/1.0.2q/ - copied from r340692, vendor-crypto/openssl/dist-1.0.2/ From owner-svn-src-all@freebsd.org Tue Nov 20 19:31:04 2018 Return-Path: Delivered-To: svn-src-all@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 07B57113B32D; Tue, 20 Nov 2018 19:31:04 +0000 (UTC) (envelope-from zeising@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.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 9D89D7E501; Tue, 20 Nov 2018 19:31:03 +0000 (UTC) (envelope-from zeising@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7927D15A19; Tue, 20 Nov 2018 19:31:03 +0000 (UTC) (envelope-from zeising@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAKJV35A080796; Tue, 20 Nov 2018 19:31:03 GMT (envelope-from zeising@FreeBSD.org) Received: (from zeising@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAKJV3KT080795; Tue, 20 Nov 2018 19:31:03 GMT (envelope-from zeising@FreeBSD.org) Message-Id: <201811201931.wAKJV3KT080795@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: zeising set sender to zeising@FreeBSD.org using -f From: Niclas Zeising Date: Tue, 20 Nov 2018 19:31:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340694 - head/sys/powerpc/conf X-SVN-Group: head X-SVN-Commit-Author: zeising X-SVN-Commit-Paths: head/sys/powerpc/conf X-SVN-Commit-Revision: 340694 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 9D89D7E501 X-Spamd-Result: default: False [0.43 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_MEDIUM(0.13)[0.126,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.31)[0.310,0]; NEURAL_HAM_LONG(-0.00)[-0.003,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Nov 2018 19:31:04 -0000 Author: zeising (doc,ports committer) Date: Tue Nov 20 19:31:02 2018 New Revision: 340694 URL: https://svnweb.freebsd.org/changeset/base/340694 Log: Enable evdev on ppc32 Enable evdev on ppc32 as well, similar to what was done i386 and amd64 in r340387 and ppc64 in r340632. Evdev can be used by X and is used by wayland to handle input devices. Approved by: jhibbits MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D18049 Modified: head/sys/powerpc/conf/GENERIC Modified: head/sys/powerpc/conf/GENERIC ============================================================================== --- head/sys/powerpc/conf/GENERIC Tue Nov 20 19:02:10 2018 (r340693) +++ head/sys/powerpc/conf/GENERIC Tue Nov 20 19:31:02 2018 (r340694) @@ -228,3 +228,8 @@ device sound # Generic sound driver (required) device snd_ai2s # Apple I2S audio device snd_davbus # Apple DAVBUS audio device snd_uaudio # USB Audio + +# evdev interface +options EVDEV_SUPPORT # evdev support in legacy drivers +device evdev # input event device support +device uinput # install /dev/uinput cdev From owner-svn-src-all@freebsd.org Tue Nov 20 19:37:10 2018 Return-Path: Delivered-To: svn-src-all@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 C6020113B904; Tue, 20 Nov 2018 19:37:10 +0000 (UTC) (envelope-from zeising@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.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 6AFCC7F416; Tue, 20 Nov 2018 19:37:10 +0000 (UTC) (envelope-from zeising@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 33C5315B9A; Tue, 20 Nov 2018 19:37:10 +0000 (UTC) (envelope-from zeising@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAKJbAkf082799; Tue, 20 Nov 2018 19:37:10 GMT (envelope-from zeising@FreeBSD.org) Received: (from zeising@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAKJb9da082796; Tue, 20 Nov 2018 19:37:09 GMT (envelope-from zeising@FreeBSD.org) Message-Id: <201811201937.wAKJb9da082796@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: zeising set sender to zeising@FreeBSD.org using -f From: Niclas Zeising Date: Tue, 20 Nov 2018 19:37:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r340695 - in stable/12/sys: amd64/conf i386/conf X-SVN-Group: stable-12 X-SVN-Commit-Author: zeising X-SVN-Commit-Paths: in stable/12/sys: amd64/conf i386/conf X-SVN-Commit-Revision: 340695 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 6AFCC7F416 X-Spamd-Result: default: False [0.73 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.01)[0.010,0]; NEURAL_SPAM_MEDIUM(0.19)[0.189,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.53)[0.531,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Nov 2018 19:37:11 -0000 Author: zeising (doc,ports committer) Date: Tue Nov 20 19:37:09 2018 New Revision: 340695 URL: https://svnweb.freebsd.org/changeset/base/340695 Log: MFC r340387: Add evdev support to amd64 and i386 This merge is done sans sys/i386/conf/MINIMAL, since that doesn't exist in stable/12, only current. Include evdev support and drivers in the amd64 GENERIC and MINIMAL, and i386 GENERIC kernels. Evdev is used by X and wayland to handle input devices, and this change, together with upcomming changes in ports will make us handle input devices better in graphical UIs. Reviewed by: wulf, bapt, imp Approved by: imp Modified: stable/12/sys/amd64/conf/GENERIC stable/12/sys/amd64/conf/MINIMAL stable/12/sys/i386/conf/GENERIC Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/amd64/conf/GENERIC ============================================================================== --- stable/12/sys/amd64/conf/GENERIC Tue Nov 20 19:31:02 2018 (r340694) +++ stable/12/sys/amd64/conf/GENERIC Tue Nov 20 19:37:09 2018 (r340695) @@ -360,3 +360,8 @@ device vmx # VMware VMXNET3 Ethernet # Netmap provides direct access to TX/RX rings on supported NICs device netmap # netmap(4) support + +# evdev interface +options EVDEV_SUPPORT # evdev support in legacy drivers +device evdev # input event device support +device uinput # install /dev/uinput cdev Modified: stable/12/sys/amd64/conf/MINIMAL ============================================================================== --- stable/12/sys/amd64/conf/MINIMAL Tue Nov 20 19:31:02 2018 (r340694) +++ stable/12/sys/amd64/conf/MINIMAL Tue Nov 20 19:37:09 2018 (r340695) @@ -137,3 +137,8 @@ device bpf # Berkeley packet filter # NOTE: XENHVM depends on xenpci. They must be added or removed together. options XENHVM # Xen HVM kernel infrastructure device xenpci # Xen HVM Hypervisor services driver + +# evdev interface +options EVDEV_SUPPORT # evdev support in legacy drivers +device evdev # input event device support +device uinput # install /dev/uinput cdev Modified: stable/12/sys/i386/conf/GENERIC ============================================================================== --- stable/12/sys/i386/conf/GENERIC Tue Nov 20 19:31:02 2018 (r340694) +++ stable/12/sys/i386/conf/GENERIC Tue Nov 20 19:37:09 2018 (r340695) @@ -358,3 +358,8 @@ device xenpci # Xen HVM Hypervisor services driver # VMware support device vmx # VMware VMXNET3 Ethernet + +# evdev interface +options EVDEV_SUPPORT # evdev support in legacy drivers +device evdev # input event device support +device uinput # install /dev/uinput cdev From owner-svn-src-all@freebsd.org Tue Nov 20 20:07:39 2018 Return-Path: Delivered-To: svn-src-all@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 6A9DC113C305; Tue, 20 Nov 2018 20:07:39 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C0C3780709; Tue, 20 Nov 2018 20:07:38 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id wAKK7b7j068425; Tue, 20 Nov 2018 12:07:37 -0800 (PST) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id wAKK7bSP068424; Tue, 20 Nov 2018 12:07:37 -0800 (PST) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201811202007.wAKK7bSP068424@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r340695 - in stable/12/sys: amd64/conf i386/conf In-Reply-To: <201811201937.wAKJb9da082796@repo.freebsd.org> To: Niclas Zeising Date: Tue, 20 Nov 2018 12:07:37 -0800 (PST) CC: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Rspamd-Queue-Id: C0C3780709 X-Spamd-Result: default: False [1.63 / 15.00]; ARC_NA(0.00)[]; HAS_REPLYTO(0.00)[rgrimes@freebsd.org]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[dnsmgr.net]; REPLYTO_DOM_NEQ_FROM_DOM(0.00)[]; AUTH_NA(1.00)[]; RCPT_COUNT_FIVE(0.00)[5]; RCVD_COUNT_THREE(0.00)[3]; IP_SCORE(-0.02)[country: US(-0.09)]; MX_GOOD(-0.01)[cached: pdx.rh.CN85.dnsmgr.net]; NEURAL_SPAM_LONG(0.60)[0.601,0]; NEURAL_HAM_SHORT(-0.59)[-0.589,0]; NEURAL_SPAM_MEDIUM(0.75)[0.752,0]; R_SPF_NA(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:13868, ipnet:69.59.192.0/19, country:US]; MID_RHS_MATCH_FROM(0.00)[] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Nov 2018 20:07:39 -0000 [ Charset UTF-8 unsupported, converting... ] > Author: zeising (doc,ports committer) > Date: Tue Nov 20 19:37:09 2018 > New Revision: 340695 > URL: https://svnweb.freebsd.org/changeset/base/340695 > > Log: > MFC r340387: Add evdev support to amd64 and i386 > > This merge is done sans sys/i386/conf/MINIMAL, since that doesn't exist in > stable/12, only current. Could you do me a favor and track down why MINIMAL has not be mfc'ed? And if there is not a good reason for it to not be MFC'ed see that it does get done. Thanks, Rod Include evdev support and drivers in the amd64 GENERIC and MINIMAL, and i386 > GENERIC kernels. Evdev is used by X and wayland to handle input devices, and > this change, together with upcomming changes in ports will make us handle input > devices better in graphical UIs. > > Reviewed by: wulf, bapt, imp > Approved by: imp > > Modified: > stable/12/sys/amd64/conf/GENERIC > stable/12/sys/amd64/conf/MINIMAL > stable/12/sys/i386/conf/GENERIC > Directory Properties: > stable/12/ (props changed) > > Modified: stable/12/sys/amd64/conf/GENERIC > ============================================================================== > --- stable/12/sys/amd64/conf/GENERIC Tue Nov 20 19:31:02 2018 (r340694) > +++ stable/12/sys/amd64/conf/GENERIC Tue Nov 20 19:37:09 2018 (r340695) > @@ -360,3 +360,8 @@ device vmx # VMware VMXNET3 Ethernet > > # Netmap provides direct access to TX/RX rings on supported NICs > device netmap # netmap(4) support > + > +# evdev interface > +options EVDEV_SUPPORT # evdev support in legacy drivers > +device evdev # input event device support > +device uinput # install /dev/uinput cdev > > Modified: stable/12/sys/amd64/conf/MINIMAL > ============================================================================== > --- stable/12/sys/amd64/conf/MINIMAL Tue Nov 20 19:31:02 2018 (r340694) > +++ stable/12/sys/amd64/conf/MINIMAL Tue Nov 20 19:37:09 2018 (r340695) > @@ -137,3 +137,8 @@ device bpf # Berkeley packet filter > # NOTE: XENHVM depends on xenpci. They must be added or removed together. > options XENHVM # Xen HVM kernel infrastructure > device xenpci # Xen HVM Hypervisor services driver > + > +# evdev interface > +options EVDEV_SUPPORT # evdev support in legacy drivers > +device evdev # input event device support > +device uinput # install /dev/uinput cdev > > Modified: stable/12/sys/i386/conf/GENERIC > ============================================================================== > --- stable/12/sys/i386/conf/GENERIC Tue Nov 20 19:31:02 2018 (r340694) > +++ stable/12/sys/i386/conf/GENERIC Tue Nov 20 19:37:09 2018 (r340695) > @@ -358,3 +358,8 @@ device xenpci # Xen HVM Hypervisor services driver > > # VMware support > device vmx # VMware VMXNET3 Ethernet > + > +# evdev interface > +options EVDEV_SUPPORT # evdev support in legacy drivers > +device evdev # input event device support > +device uinput # install /dev/uinput cdev > > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Tue Nov 20 20:08:52 2018 Return-Path: Delivered-To: svn-src-all@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 17DD7113C388; Tue, 20 Nov 2018 20:08:52 +0000 (UTC) (envelope-from garga@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 AE4B780863; Tue, 20 Nov 2018 20:08:51 +0000 (UTC) (envelope-from garga@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8F54816077; Tue, 20 Nov 2018 20:08:51 +0000 (UTC) (envelope-from garga@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAKK8pxZ098698; Tue, 20 Nov 2018 20:08:51 GMT (envelope-from garga@FreeBSD.org) Received: (from garga@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAKK8pxn098697; Tue, 20 Nov 2018 20:08:51 GMT (envelope-from garga@FreeBSD.org) Message-Id: <201811202008.wAKK8pxn098697@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: garga set sender to garga@FreeBSD.org using -f From: Renato Botelho Date: Tue, 20 Nov 2018 20:08:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r340696 - stable/12/usr.sbin/ntp/ntpd X-SVN-Group: stable-12 X-SVN-Commit-Author: garga X-SVN-Commit-Paths: stable/12/usr.sbin/ntp/ntpd X-SVN-Commit-Revision: 340696 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: AE4B780863 X-Spamd-Result: default: False [0.71 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.53)[0.531,0]; NEURAL_SPAM_MEDIUM(0.17)[0.172,0]; NEURAL_SPAM_LONG(0.01)[0.007,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Nov 2018 20:08:52 -0000 Author: garga (ports committer) Date: Tue Nov 20 20:08:51 2018 New Revision: 340696 URL: https://svnweb.freebsd.org/changeset/base/340696 Log: MFC r340439,r340440 Fix /etc/ntp permissions. According to mtree it must be 0700 Approved by: imp Sponsored by: Rubicon Communications, LLC (Netgate) Modified: stable/12/usr.sbin/ntp/ntpd/Makefile Directory Properties: stable/12/ (props changed) Modified: stable/12/usr.sbin/ntp/ntpd/Makefile ============================================================================== --- stable/12/usr.sbin/ntp/ntpd/Makefile Tue Nov 20 19:37:09 2018 (r340695) +++ stable/12/usr.sbin/ntp/ntpd/Makefile Tue Nov 20 20:08:51 2018 (r340696) @@ -7,9 +7,12 @@ MAN= .PATH: ${SRCTOP}/contrib/ntp/ntpd \ ${.OBJDIR} +DIRS= ETC_NTP +ETC_NTP= /etc/ntp +ETC_NTP_MODE= 0700 CONFS= ntp.conf FILES= leap-seconds -FILESDIR= /etc/ntp +FILESDIR= ETC_NTP FILESMODE= 644 PROG= ntpd From owner-svn-src-all@freebsd.org Tue Nov 20 20:16:05 2018 Return-Path: Delivered-To: svn-src-all@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 C2180113C64D; Tue, 20 Nov 2018 20:16:05 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6651680DD1; Tue, 20 Nov 2018 20:16:05 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4451A1620F; Tue, 20 Nov 2018 20:16:05 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAKKG5jh003923; Tue, 20 Nov 2018 20:16:05 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAKKG30c003916; Tue, 20 Nov 2018 20:16:03 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201811202016.wAKKG30c003916@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Tue, 20 Nov 2018 20:16:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r340697 - in stable/12: . rescue/rescue share/mk tools/build/options X-SVN-Group: stable-12 X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: in stable/12: . rescue/rescue share/mk tools/build/options X-SVN-Commit-Revision: 340697 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 6651680DD1 X-Spamd-Result: default: False [0.73 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.01)[0.010,0]; NEURAL_SPAM_MEDIUM(0.19)[0.189,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.53)[0.531,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Nov 2018 20:16:06 -0000 Author: emaste Date: Tue Nov 20 20:16:03 2018 New Revision: 340697 URL: https://svnweb.freebsd.org/changeset/base/340697 Log: Introduce src.conf knob to build userland with retpoline MFC r339511: Introduce src.conf knob to build userland with retpoline WITH_RETPOLINE enables -mretpoline vulnerability mitigation in userland for CVE-2017-5715. MFC r340099: libcompat: disable retpoline when building build tools These are built with the host toolchain which may not support retpoline. While here, move the MK_ overrides to a separate line and sort them alphabetically to support future changes. MFC r340650: Avoid retpolineplt with static linking Statically linked binaries linked with -zretpolineplt crash at startup as lld produces a broken PLT. MFC r340652: rescue: set NO_SHARED in Makefile The rescue binary is built statically via the Makefile generated by crunchgen, but that does not trigger other shared/static logic in bsd.prog.mk - in particular PR: 233336 Reported by: Peter Malcom (r339511), Charlie Li (r340652) Approved by: re (gjb, early MFC) Sponsored by: The FreeBSD Foundation Added: stable/12/tools/build/options/WITH_RETPOLINE - copied unchanged from r339511, head/tools/build/options/WITH_RETPOLINE Modified: stable/12/Makefile.inc1 stable/12/Makefile.libcompat stable/12/rescue/rescue/Makefile stable/12/share/mk/bsd.lib.mk stable/12/share/mk/bsd.opts.mk stable/12/share/mk/bsd.prog.mk Directory Properties: stable/12/ (props changed) Modified: stable/12/Makefile.inc1 ============================================================================== --- stable/12/Makefile.inc1 Tue Nov 20 20:08:51 2018 (r340696) +++ stable/12/Makefile.inc1 Tue Nov 20 20:16:03 2018 (r340697) @@ -659,7 +659,7 @@ BSARGS= DESTDIR= \ -DNO_PIC MK_PROFILE=no -DNO_SHARED \ -DNO_CPU_CFLAGS MK_WARNS=no MK_CTF=no \ MK_CLANG_EXTRAS=no MK_CLANG_FULL=no \ - MK_LLDB=no MK_TESTS=no \ + MK_LLDB=no MK_RETPOLINE=no MK_TESTS=no \ MK_INCLUDES=yes BMAKE= \ @@ -680,7 +680,7 @@ TMAKE= \ -DNO_LINT \ -DNO_CPU_CFLAGS MK_WARNS=no MK_CTF=no \ MK_CLANG_EXTRAS=no MK_CLANG_FULL=no \ - MK_LLDB=no MK_TESTS=no + MK_LLDB=no MK_RETPOLINE=no MK_TESTS=no # cross-tools stage # TOOLS_PREFIX set in BMAKE @@ -703,7 +703,7 @@ KTMAKE= \ SSP_CFLAGS= \ MK_HTML=no -DNO_LINT MK_MAN=no \ -DNO_PIC MK_PROFILE=no -DNO_SHARED \ - -DNO_CPU_CFLAGS MK_WARNS=no MK_CTF=no + -DNO_CPU_CFLAGS MK_RETPOLINE=no MK_WARNS=no MK_CTF=no # world stage WMAKEENV= ${CROSSENV} \ @@ -2390,6 +2390,7 @@ NXBMAKEARGS+= \ MK_OFED=no \ MK_OPENSSH=no \ MK_PROFILE=no \ + MK_RETPOLINE=no \ MK_SENDMAIL=no \ MK_SVNLITE=no \ MK_TESTS=no \ Modified: stable/12/Makefile.libcompat ============================================================================== --- stable/12/Makefile.libcompat Tue Nov 20 20:08:51 2018 (r340696) +++ stable/12/Makefile.libcompat Tue Nov 20 20:16:03 2018 (r340697) @@ -200,7 +200,8 @@ build${libcompat}: .PHONY OBJTOP=${LIBCOMPAT_OBJTOP} \ OBJROOT='$${OBJTOP}/' \ MAKEOBJDIRPREFIX= \ - DIRPRFX=${_dir}/ -DNO_LINT -DNO_CPU_CFLAGS MK_WARNS=no MK_CTF=no \ + DIRPRFX=${_dir}/ -DNO_LINT -DNO_CPU_CFLAGS \ + MK_CTF=no MK_RETPOLINE=no MK_WARNS=no \ ${_t} .endfor .endfor Modified: stable/12/rescue/rescue/Makefile ============================================================================== --- stable/12/rescue/rescue/Makefile Tue Nov 20 20:08:51 2018 (r340696) +++ stable/12/rescue/rescue/Makefile Tue Nov 20 20:16:03 2018 (r340697) @@ -6,6 +6,7 @@ PACKAGE=rescue MAN= MK_SSP= no +NO_SHARED= yes PROG= rescue BINDIR?=/rescue Modified: stable/12/share/mk/bsd.lib.mk ============================================================================== --- stable/12/share/mk/bsd.lib.mk Tue Nov 20 20:08:51 2018 (r340696) +++ stable/12/share/mk/bsd.lib.mk Tue Nov 20 20:16:03 2018 (r340697) @@ -69,6 +69,12 @@ TAGS+= package=${PACKAGE:Uruntime} TAG_ARGS= -T ${TAGS:[*]:S/ /,/g} .endif +.if ${MK_RETPOLINE} != "no" +CFLAGS+= -mretpoline +CXXFLAGS+= -mretpoline +LDFLAGS+= -Wl,-zretpolineplt +.endif + .if ${MK_DEBUG_FILES} != "no" && empty(DEBUG_FLAGS:M-g) && \ empty(DEBUG_FLAGS:M-gdwarf*) CFLAGS+= ${DEBUG_FILES_CFLAGS} Modified: stable/12/share/mk/bsd.opts.mk ============================================================================== --- stable/12/share/mk/bsd.opts.mk Tue Nov 20 20:08:51 2018 (r340696) +++ stable/12/share/mk/bsd.opts.mk Tue Nov 20 20:16:03 2018 (r340697) @@ -72,6 +72,7 @@ __DEFAULT_NO_OPTIONS = \ CCACHE_BUILD \ CTF \ INSTALL_AS_USER \ + RETPOLINE \ STALE_STAGED __DEFAULT_DEPENDENT_OPTIONS = \ Modified: stable/12/share/mk/bsd.prog.mk ============================================================================== --- stable/12/share/mk/bsd.prog.mk Tue Nov 20 20:08:51 2018 (r340696) +++ stable/12/share/mk/bsd.prog.mk Tue Nov 20 20:16:03 2018 (r340697) @@ -34,6 +34,15 @@ PROG= ${PROG_CXX} MK_DEBUG_FILES= no .endif +.if ${MK_RETPOLINE} != "no" +CFLAGS+= -mretpoline +CXXFLAGS+= -mretpoline +# retpolineplt is broken with static linking (PR 233336) +.if !defined(NO_SHARED) || ${NO_SHARED} == "no" || ${NO_SHARED} == "NO" +LDFLAGS+= -Wl,-zretpolineplt +.endif +.endif + .if defined(CRUNCH_CFLAGS) CFLAGS+=${CRUNCH_CFLAGS} .else Copied: stable/12/tools/build/options/WITH_RETPOLINE (from r339511, head/tools/build/options/WITH_RETPOLINE) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/12/tools/build/options/WITH_RETPOLINE Tue Nov 20 20:16:03 2018 (r340697, copy of r339511, head/tools/build/options/WITH_RETPOLINE) @@ -0,0 +1,3 @@ +.\" $FreeBSD$ +Set to build the base system with the retpoline speculative execution +vulnerability mitigation for CVE-2017-5715. From owner-svn-src-all@freebsd.org Tue Nov 20 20:31:25 2018 Return-Path: Delivered-To: svn-src-all@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 9D18C113CEE9; Tue, 20 Nov 2018 20:31:25 +0000 (UTC) (envelope-from garga@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 4106D81954; Tue, 20 Nov 2018 20:31:25 +0000 (UTC) (envelope-from garga@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CB8DC16502; Tue, 20 Nov 2018 20:31:23 +0000 (UTC) (envelope-from garga@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAKKVN9d011130; Tue, 20 Nov 2018 20:31:23 GMT (envelope-from garga@FreeBSD.org) Received: (from garga@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAKKVNFx011129; Tue, 20 Nov 2018 20:31:23 GMT (envelope-from garga@FreeBSD.org) Message-Id: <201811202031.wAKKVNFx011129@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: garga set sender to garga@FreeBSD.org using -f From: Renato Botelho Date: Tue, 20 Nov 2018 20:31:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r340698 - releng/12.0/usr.sbin/ntp/ntpd X-SVN-Group: releng X-SVN-Commit-Author: garga X-SVN-Commit-Paths: releng/12.0/usr.sbin/ntp/ntpd X-SVN-Commit-Revision: 340698 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4106D81954 X-Spamd-Result: default: False [0.70 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_MEDIUM(0.13)[0.126,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.57)[0.574,0]; NEURAL_HAM_LONG(-0.00)[-0.003,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Nov 2018 20:31:25 -0000 Author: garga (ports committer) Date: Tue Nov 20 20:31:23 2018 New Revision: 340698 URL: https://svnweb.freebsd.org/changeset/base/340698 Log: MFC r340439,r340440 Fix /etc/ntp permissions. According to mtree it must be 0700 Approved by: re (gjb) Sponsored by: Rubicon Communications, LLC (Netgate) Modified: releng/12.0/usr.sbin/ntp/ntpd/Makefile Directory Properties: releng/12.0/ (props changed) Modified: releng/12.0/usr.sbin/ntp/ntpd/Makefile ============================================================================== --- releng/12.0/usr.sbin/ntp/ntpd/Makefile Tue Nov 20 20:16:03 2018 (r340697) +++ releng/12.0/usr.sbin/ntp/ntpd/Makefile Tue Nov 20 20:31:23 2018 (r340698) @@ -7,9 +7,12 @@ MAN= .PATH: ${SRCTOP}/contrib/ntp/ntpd \ ${.OBJDIR} +DIRS= ETC_NTP +ETC_NTP= /etc/ntp +ETC_NTP_MODE= 0700 CONFS= ntp.conf FILES= leap-seconds -FILESDIR= /etc/ntp +FILESDIR= ETC_NTP FILESMODE= 644 PROG= ntpd From owner-svn-src-all@freebsd.org Tue Nov 20 20:32:11 2018 Return-Path: Delivered-To: svn-src-all@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 6CFB4113D0A3; Tue, 20 Nov 2018 20:32:11 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.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 12E288247D; Tue, 20 Nov 2018 20:32:11 +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 E8ECF16544; Tue, 20 Nov 2018 20:32:10 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAKKWALX014480; Tue, 20 Nov 2018 20:32:10 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAKKWADR014479; Tue, 20 Nov 2018 20:32:10 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201811202032.wAKKWADR014479@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 20 Nov 2018 20:32:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340699 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 340699 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 12E288247D X-Spamd-Result: default: False [0.70 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_MEDIUM(0.13)[0.126,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.57)[0.574,0]; NEURAL_HAM_LONG(-0.00)[-0.003,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Nov 2018 20:32:11 -0000 Author: markj Date: Tue Nov 20 20:32:10 2018 New Revision: 340699 URL: https://svnweb.freebsd.org/changeset/base/340699 Log: Clear pad bytes in the struct exported by kern.ntp_pll.gettime. Reported by: Thomas Barabosch, Fraunhofer FKIE MFC after: 3 days Sponsored by: The FreeBSD Foundation Modified: head/sys/kern/kern_ntptime.c Modified: head/sys/kern/kern_ntptime.c ============================================================================== --- head/sys/kern/kern_ntptime.c Tue Nov 20 20:31:23 2018 (r340698) +++ head/sys/kern/kern_ntptime.c Tue Nov 20 20:32:10 2018 (r340699) @@ -300,6 +300,8 @@ ntp_sysctl(SYSCTL_HANDLER_ARGS) { struct ntptimeval ntv; /* temporary structure */ + memset(&ntv, 0, sizeof(ntv)); + NTP_LOCK(); ntp_gettime1(&ntv); NTP_UNLOCK(); From owner-svn-src-all@freebsd.org Tue Nov 20 20:40:11 2018 Return-Path: Delivered-To: svn-src-all@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 1AD83113D2B4; Tue, 20 Nov 2018 20:40:11 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BEE1B8285C; Tue, 20 Nov 2018 20:40:10 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 81A521658C; Tue, 20 Nov 2018 20:40:10 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAKKeAOg014998; Tue, 20 Nov 2018 20:40:10 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAKKeA2g014997; Tue, 20 Nov 2018 20:40:10 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201811202040.wAKKeA2g014997@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Tue, 20 Nov 2018 20:40:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r340700 - stable/12/share/man/man5 X-SVN-Group: stable-12 X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: stable/12/share/man/man5 X-SVN-Commit-Revision: 340700 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: BEE1B8285C X-Spamd-Result: default: False [0.75 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.53)[0.531,0]; NEURAL_SPAM_MEDIUM(0.21)[0.206,0]; NEURAL_SPAM_LONG(0.01)[0.014,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Nov 2018 20:40:11 -0000 Author: emaste Date: Tue Nov 20 20:40:10 2018 New Revision: 340700 URL: https://svnweb.freebsd.org/changeset/base/340700 Log: src.conf.5: regen after r340697 Modified: stable/12/share/man/man5/src.conf.5 Modified: stable/12/share/man/man5/src.conf.5 ============================================================================== --- stable/12/share/man/man5/src.conf.5 Tue Nov 20 20:32:10 2018 (r340699) +++ stable/12/share/man/man5/src.conf.5 Tue Nov 20 20:40:10 2018 (r340700) @@ -1,6 +1,6 @@ .\" DO NOT EDIT-- this file is @generated by tools/build/options/makeman. .\" $FreeBSD$ -.Dd September 18, 2018 +.Dd November 20, 2018 .Dt SRC.CONF 5 .Os .Sh NAME @@ -149,7 +149,7 @@ of the normal system build. The resulting system cannot build programs from source. .Pp This is a default setting on -arm64/aarch64, riscv/riscv64 and riscv/riscv64sf. +arm64/aarch64 and riscv/riscv64. When set, it enforces these options: .Pp .Bl -item -compact @@ -171,7 +171,7 @@ toolchain is provided. .Ef .Pp This is a default setting on -arm64/aarch64, riscv/riscv64 and riscv/riscv64sf. +arm64/aarch64 and riscv/riscv64. .It Va WITH_BINUTILS_BOOTSTRAP Set build binutils (as, ld, and objdump) as part of the bootstrap process. @@ -310,7 +310,7 @@ When set, it enforces these options: Set to not build the Clang C/C++ compiler during the regular phase of the build. .Pp This is a default setting on -riscv/riscv64, riscv/riscv64sf and sparc64/sparc64. +riscv/riscv64 and sparc64/sparc64. When set, it enforces these options: .Pp .Bl -item -compact @@ -366,7 +366,7 @@ To be able to build the system, either gcc or clang bo enabled unless an alternate compiler is provided via XCC. .Pp This is a default setting on -mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe, riscv/riscv64, riscv/riscv64sf and sparc64/sparc64. +mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe, riscv/riscv64 and sparc64/sparc64. .It Va WITH_CLANG_BOOTSTRAP Set to build the Clang C/C++ compiler during the bootstrap phase of the build. .Pp @@ -379,7 +379,7 @@ Set to avoid building the ARCMigrate, Rewriter and Sta the Clang C/C++ compiler. .Pp This is a default setting on -riscv/riscv64, riscv/riscv64sf and sparc64/sparc64. +riscv/riscv64 and sparc64/sparc64. .It Va WITH_CLANG_FULL Set to build the ARCMigrate, Rewriter and StaticAnalyzer components of the Clang C/C++ compiler. @@ -394,7 +394,7 @@ and .Pa /usr/bin/cpp . .Pp This is a default setting on -mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe, riscv/riscv64, riscv/riscv64sf and sparc64/sparc64. +mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe, riscv/riscv64 and sparc64/sparc64. .It Va WITH_CLANG_IS_CC Set to install the Clang C/C++ compiler as .Pa /usr/bin/cc , @@ -470,7 +470,7 @@ Set to not build .Xr cxgbetool 8 .Pp This is a default setting on -arm/arm, arm/armv6, arm/armv7, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpcspe, riscv/riscv64 and riscv/riscv64sf. +arm/arm, arm/armv6, arm/armv7, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpcspe and riscv/riscv64. .It Va WITH_CXGBETOOL Set to build .Xr cxgbetool 8 @@ -635,7 +635,7 @@ and .Xr efivar 8 . .Pp This is a default setting on -mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe, riscv/riscv64, riscv/riscv64sf and sparc64/sparc64. +mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe, riscv/riscv64 and sparc64/sparc64. .It Va WITH_EFI Set to build .Xr efivar 3 @@ -699,7 +699,7 @@ Set to not build games. Set to not build and install gcc and g++ as part of the normal build process. .Pp This is a default setting on -amd64/amd64, arm/arm, arm/armv6, arm/armv7, arm64/aarch64, i386/i386, riscv/riscv64 and riscv/riscv64sf. +amd64/amd64, arm/arm, arm/armv6, arm/armv7, arm64/aarch64, i386/i386 and riscv/riscv64. .It Va WITH_GCC Set to build and install gcc and g++. .Pp @@ -712,7 +712,7 @@ unless an alternative compiler is provided via XCC. .Pp This is a default setting on -amd64/amd64, arm/arm, arm/armv6, arm/armv7, arm64/aarch64, i386/i386, riscv/riscv64 and riscv/riscv64sf. +amd64/amd64, arm/arm, arm/armv6, arm/armv7, arm64/aarch64, i386/i386 and riscv/riscv64. .It Va WITH_GCC_BOOTSTRAP Set to build gcc and g++ as part of the bootstrap process. .Pp @@ -727,7 +727,7 @@ Set to not build .Xr gdb 1 . .Pp This is a default setting on -arm64/aarch64, riscv/riscv64 and riscv/riscv64sf. +arm64/aarch64 and riscv/riscv64. .It Va WITH_GDB Set to build .Xr gdb 1 . @@ -754,7 +754,7 @@ to be used as a fallback for if a newer version is not installed. .Pp This is a default setting on -amd64/amd64, arm/arm, arm/armv6, arm/armv7, arm64/aarch64, i386/i386, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe, riscv/riscv64 and riscv/riscv64sf. +amd64/amd64, arm/arm, arm/armv6, arm/armv7, arm64/aarch64, i386/i386, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe and riscv/riscv64. .It Va WITHOUT_GNUCXX Do not build the GNU C++ stack (g++, libstdc++). This is the default on platforms where clang is the system compiler. @@ -766,7 +766,7 @@ Build the GNU C++ stack (g++, libstdc++). This is the default on platforms where gcc is the system compiler. .Pp This is a default setting on -mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe, riscv/riscv64, riscv/riscv64sf and sparc64/sparc64. +mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe, riscv/riscv64 and sparc64/sparc64. .It Va WITHOUT_GNU_DIFF Set to not build GNU .Xr diff 1 @@ -794,7 +794,7 @@ Set to build the GPL'd version of the device tree comp instead of the BSD licensed one. .Pp This is a default setting on -mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe, riscv/riscv64, riscv/riscv64sf and sparc64/sparc64. +mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe, riscv/riscv64 and sparc64/sparc64. .It Va WITHOUT_GSSAPI Set to not build libgssapi. .It Va WITHOUT_HAST @@ -809,7 +809,7 @@ Set to not build HTML docs. Set to not build or install HyperV utilities. .Pp This is a default setting on -arm/arm, arm/armv6, arm/armv7, arm64/aarch64, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe, riscv/riscv64, riscv/riscv64sf and sparc64/sparc64. +arm/arm, arm/armv6, arm/armv7, arm64/aarch64, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe, riscv/riscv64 and sparc64/sparc64. .It Va WITH_HYPERV Set to build or install HyperV utilities. .Pp @@ -986,7 +986,7 @@ library. Set to not build LLVM's lld linker. .Pp This is a default setting on -riscv/riscv64, riscv/riscv64sf and sparc64/sparc64. +riscv/riscv64 and sparc64/sparc64. .It Va WITH_LLD Set to build LLVM's lld linker. .Pp @@ -996,7 +996,7 @@ amd64/amd64, arm/arm, arm/armv6, arm/armv7, arm64/aarc Set to not build the LLDB debugger. .Pp This is a default setting on -arm/arm, arm/armv6, arm/armv7, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe, riscv/riscv64, riscv/riscv64sf and sparc64/sparc64. +arm/arm, arm/armv6, arm/armv7, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe, riscv/riscv64 and sparc64/sparc64. .It Va WITH_LLDB Set to build the LLDB debugger. .Pp @@ -1009,7 +1009,7 @@ To be able to build the system, either Binutils or LLD enabled unless an alternate linker is provided via XLD. .Pp This is a default setting on -arm/arm, arm/armv6, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe, riscv/riscv64, riscv/riscv64sf and sparc64/sparc64. +arm/arm, arm/armv6, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe, riscv/riscv64 and sparc64/sparc64. .It Va WITH_LLD_BOOTSTRAP Set to build the LLD linker during the bootstrap phase of the build. .Pp @@ -1019,7 +1019,7 @@ amd64/amd64, arm/armv7, arm64/aarch64 and i386/i386. Set to use GNU binutils ld as the system linker, instead of LLVM's LLD. .Pp This is a default setting on -arm/arm, arm/armv6, i386/i386, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe, riscv/riscv64, riscv/riscv64sf and sparc64/sparc64. +arm/arm, arm/armv6, i386/i386, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe, riscv/riscv64 and sparc64/sparc64. .It Va WITH_LLD_IS_LD Set to use LLVM's LLD as the system linker, instead of GNU binutils ld. .Pp @@ -1031,7 +1031,7 @@ Set to not build the tool. .Pp This is a default setting on -riscv/riscv64, riscv/riscv64sf and sparc64/sparc64. +riscv/riscv64 and sparc64/sparc64. .It Va WITH_LLVM_COV Set to build the .Xr llvm-cov 1 @@ -1048,7 +1048,7 @@ arm/arm, arm/armv6, arm/armv7, powerpc/powerpc, powerp Set to use LLVM's libunwind stack unwinder (instead of GCC's unwinder). .Pp This is a default setting on -amd64/amd64, arm64/aarch64, i386/i386, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, riscv/riscv64 and riscv/riscv64sf. +amd64/amd64, arm64/aarch64, i386/i386, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf and riscv/riscv64. .It Va WITHOUT_LLVM_TARGET_AARCH64 Set to not build LLVM target support for AArch64. The @@ -1056,7 +1056,7 @@ The option should be used rather than this in most cases. .Pp This is a default setting on -riscv/riscv64, riscv/riscv64sf and sparc64/sparc64. +riscv/riscv64 and sparc64/sparc64. .It Va WITH_LLVM_TARGET_AARCH64 Set to build LLVM target support for AArch64. The @@ -1070,7 +1070,7 @@ Set to only build the required LLVM target support. This option is preferred to specific target support options. .Pp This is a default setting on -riscv/riscv64, riscv/riscv64sf and sparc64/sparc64. +riscv/riscv64 and sparc64/sparc64. When set, these options are also in effect: .Pp .Bl -inset -compact @@ -1109,7 +1109,7 @@ The option should be used rather than this in most cases. .Pp This is a default setting on -riscv/riscv64, riscv/riscv64sf and sparc64/sparc64. +riscv/riscv64 and sparc64/sparc64. .It Va WITH_LLVM_TARGET_ARM Set to build LLVM target support for ARM. The @@ -1130,7 +1130,7 @@ The option should be used rather than this in most cases. .Pp This is a default setting on -riscv/riscv64, riscv/riscv64sf and sparc64/sparc64. +riscv/riscv64 and sparc64/sparc64. .It Va WITH_LLVM_TARGET_MIPS Set to build LLVM target support for MIPS. The @@ -1146,7 +1146,7 @@ The option should be used rather than this in most cases. .Pp This is a default setting on -riscv/riscv64, riscv/riscv64sf and sparc64/sparc64. +riscv/riscv64 and sparc64/sparc64. .It Va WITH_LLVM_TARGET_POWERPC Set to build LLVM target support for PowerPC. The @@ -1162,7 +1162,7 @@ The option should be used rather than this in most cases. .Pp This is a default setting on -riscv/riscv64, riscv/riscv64sf and sparc64/sparc64. +riscv/riscv64 and sparc64/sparc64. .It Va WITH_LLVM_TARGET_SPARC Set to build LLVM target support for SPARC. The @@ -1178,7 +1178,7 @@ The option should be used rather than this in most cases. .Pp This is a default setting on -riscv/riscv64, riscv/riscv64sf and sparc64/sparc64. +riscv/riscv64 and sparc64/sparc64. .It Va WITH_LLVM_TARGET_X86 Set to build LLVM target support for X86. The @@ -1194,17 +1194,17 @@ on all other platforms. Disable inclusion of GELI crypto support in the boot chain binaries. .Pp This is a default setting on -sparc64/sparc64. +powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe and sparc64/sparc64. .It Va WITH_LOADER_LUA Set to build LUA bindings for the boot loader. .Pp This is a default setting on -amd64/amd64, arm/arm, arm/armv6, arm/armv7, arm64/aarch64, i386/i386, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe, riscv/riscv64 and riscv/riscv64sf. +amd64/amd64, arm/arm, arm/armv6, arm/armv7, arm64/aarch64, i386/i386, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf and riscv/riscv64. .It Va WITHOUT_LOADER_OFW Disable building of openfirmware bootloader components. .Pp This is a default setting on -amd64/amd64, arm/arm, arm/armv6, arm/armv7, arm64/aarch64, i386/i386, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, riscv/riscv64 and riscv/riscv64sf. +amd64/amd64, arm/arm, arm/armv6, arm/armv7, arm64/aarch64, i386/i386, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf and riscv/riscv64. .It Va WITH_LOADER_OFW Set to build openfirmware bootloader components. .Pp @@ -1214,7 +1214,7 @@ powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe Disable building of ubldr. .Pp This is a default setting on -amd64/amd64, arm64/aarch64, i386/i386, riscv/riscv64, riscv/riscv64sf and sparc64/sparc64. +amd64/amd64, arm64/aarch64, i386/i386, riscv/riscv64 and sparc64/sparc64. .It Va WITH_LOADER_UBOOT Set to build ubldr. .Pp @@ -1349,7 +1349,7 @@ Set to not build .Xr mlx5tool 8 .Pp This is a default setting on -arm/arm, arm/armv6, arm/armv7, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpcspe, riscv/riscv64 and riscv/riscv64sf. +arm/arm, arm/armv6, arm/armv7, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpcspe and riscv/riscv64. .It Va WITH_MLX5TOOL Set to build .Xr mlx5tool 8 @@ -1517,7 +1517,7 @@ Set to build profiled libraries for use with .Xr gprof 8 . .Pp This is a default setting on -amd64/amd64, arm/arm, arm/armv6, arm/armv7, arm64/aarch64, i386/i386, mips/mipsel, mips/mips, mips/mipsn32, mips/mipselhf, mips/mipshf, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe, riscv/riscv64, riscv/riscv64sf and sparc64/sparc64. +amd64/amd64, arm/arm, arm/armv6, arm/armv7, arm64/aarch64, i386/i386, mips/mipsel, mips/mips, mips/mipsn32, mips/mipselhf, mips/mipshf, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe, riscv/riscv64 and sparc64/sparc64. .It Va WITHOUT_QUOTAS Set to not build .Xr quota 1 @@ -1549,6 +1549,9 @@ Successive builds will not be bit-for-bit identical. .It Va WITHOUT_RESCUE Set to not build .Xr rescue 8 . +.It Va WITH_RETPOLINE +Set to build the base system with the retpoline speculative execution +vulnerability mitigation for CVE-2017-5715. .It Va WITHOUT_ROUTED Set to not build .Xr routed 8 @@ -1604,7 +1607,7 @@ mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mi Set to build world with propolice stack smashing protection. .Pp This is a default setting on -amd64/amd64, arm/arm, arm/armv6, arm/armv7, arm64/aarch64, i386/i386, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe, riscv/riscv64, riscv/riscv64sf and sparc64/sparc64. +amd64/amd64, arm/arm, arm/armv6, arm/armv7, arm64/aarch64, i386/i386, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe, riscv/riscv64 and sparc64/sparc64. .It Va WITH_STAGING Enable staging of files to a stage tree. This can be best thought of as auto-install to From owner-svn-src-all@freebsd.org Tue Nov 20 20:50:19 2018 Return-Path: Delivered-To: svn-src-all@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 9E3CB113D79F; Tue, 20 Nov 2018 20:50:19 +0000 (UTC) (envelope-from zeising@freebsd.org) Received: from mail.daemonic.se (mail.daemonic.se [176.58.89.161]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 29D0F82F8C; Tue, 20 Nov 2018 20:50:19 +0000 (UTC) (envelope-from zeising@freebsd.org) Received: from cid.daemonic.se (localhost [IPv6:::1]) by mail.daemonic.se (Postfix) with ESMTP id 42zyWl3Yr0zDj70; Tue, 20 Nov 2018 20:50:11 +0000 (UTC) X-Virus-Scanned: amavisd-new at daemonic.se Received: from mail.daemonic.se ([IPv6:::1]) (using TLS with cipher ECDHE-RSA-AES128-GCM-SHA256) by cid.daemonic.se (mailscanner.daemonic.se [IPv6:::1]) (amavisd-new, port 10587) with ESMTPS id CdQm2PoKhW61; Tue, 20 Nov 2018 20:50:11 +0000 (UTC) Received: from garnet.daemonic.se (unknown [IPv6:2001:470:dca9:201:25b3:f7a5:c407:630b]) by mail.daemonic.se (Postfix) with ESMTPSA id 42zyWk6RDHzDhFd; Tue, 20 Nov 2018 20:50:10 +0000 (UTC) Subject: Re: svn commit: r340695 - in stable/12/sys: amd64/conf i386/conf To: rgrimes@freebsd.org Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org References: <201811202007.wAKK7bSP068424@pdx.rh.CN85.dnsmgr.net> From: Niclas Zeising Message-ID: Date: Tue, 20 Nov 2018 21:50:10 +0100 User-Agent: Mutt/1.5.21 MIME-Version: 1.0 In-Reply-To: <201811202007.wAKK7bSP068424@pdx.rh.CN85.dnsmgr.net> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 29D0F82F8C X-Spamd-Result: default: False [-0.72 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_HAM_MEDIUM(-0.66)[-0.662,0]; NEURAL_SPAM_SHORT(0.60)[0.604,0]; NEURAL_HAM_LONG(-0.66)[-0.660,0]; ASN(0.00)[asn:36236, ipnet:176.58.89.0/24, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Nov 2018 20:50:19 -0000 On 11/20/18 9:07 PM, Rodney W. Grimes wrote: > [ Charset UTF-8 unsupported, converting... ] >> Author: zeising (doc,ports committer) >> Date: Tue Nov 20 19:37:09 2018 >> New Revision: 340695 >> URL: https://svnweb.freebsd.org/changeset/base/340695 >> >> Log: >> MFC r340387: Add evdev support to amd64 and i386 >> >> This merge is done sans sys/i386/conf/MINIMAL, since that doesn't exist in >> stable/12, only current. > > Could you do me a favor and track down why MINIMAL has > not be mfc'ed? And if there is not a good reason for > it to not be MFC'ed see that it does get done. > I asked about it cem (the original author of i386/conf/MINIMAL) about it here: https://lists.freebsd.org/pipermail/svn-src-all/2018-November/172337.html The reply is here: https://lists.freebsd.org/pipermail/svn-src-all/2018-November/172353.html Regards -- Niclas Zeising From owner-svn-src-all@freebsd.org Tue Nov 20 20:59:50 2018 Return-Path: Delivered-To: svn-src-all@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 993B3113DBD5; Tue, 20 Nov 2018 20:59:50 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3D95583578; Tue, 20 Nov 2018 20:59:50 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 17CFE168E4; Tue, 20 Nov 2018 20:59:50 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAKKxnuI025465; Tue, 20 Nov 2018 20:59:49 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAKKxnWT025464; Tue, 20 Nov 2018 20:59:49 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201811202059.wAKKxnWT025464@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Tue, 20 Nov 2018 20:59:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340701 - head/lib/csu/common X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/lib/csu/common X-SVN-Commit-Revision: 340701 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 3D95583578 X-Spamd-Result: default: False [0.76 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.63)[0.633,0]; NEURAL_HAM_LONG(-0.00)[-0.003,0]; NEURAL_SPAM_MEDIUM(0.13)[0.126,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Nov 2018 20:59:50 -0000 Author: emaste Date: Tue Nov 20 20:59:49 2018 New Revision: 340701 URL: https://svnweb.freebsd.org/changeset/base/340701 Log: Add NT_FREEBSD_FEATURE_CTL ELF note to csu This note will be used to allow binaries to opt out of, or in to, upcoming vulnerability mitigation and other features. It is not yet connected but being added now to facilitate testing and ensure compatibility with existing kernels and tools. Reviewed by: brooks, jhb, kib, markj Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D17438 Modified: head/lib/csu/common/crtbrand.c Modified: head/lib/csu/common/crtbrand.c ============================================================================== --- head/lib/csu/common/crtbrand.c Tue Nov 20 20:40:10 2018 (r340700) +++ head/lib/csu/common/crtbrand.c Tue Nov 20 20:59:49 2018 (r340701) @@ -67,3 +67,18 @@ static const struct { .name = NOTE_FREEBSD_VENDOR, .desc = __FreeBSD_version }; + +static const struct { + int32_t namesz; + int32_t descsz; + int32_t type; + char name[sizeof(NOTE_FREEBSD_VENDOR)]; + uint32_t desc[1]; +} crt_feature_ctl __attribute__ ((section (NOTE_SECTION), + aligned(4))) __used = { + .namesz = sizeof(NOTE_FREEBSD_VENDOR), + .descsz = sizeof(uint32_t), + .type = NT_FREEBSD_FEATURE_CTL, + .name = NOTE_FREEBSD_VENDOR, + .desc = { 0 } +}; From owner-svn-src-all@freebsd.org Tue Nov 20 21:04:21 2018 Return-Path: Delivered-To: svn-src-all@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 BED42113DEC5; Tue, 20 Nov 2018 21:04:21 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 648A683A21; Tue, 20 Nov 2018 21:04:21 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3FD2A16A84; Tue, 20 Nov 2018 21:04:21 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAKL4LfH030132; Tue, 20 Nov 2018 21:04:21 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAKL4KZl030127; Tue, 20 Nov 2018 21:04:20 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201811202104.wAKL4KZl030127@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Tue, 20 Nov 2018 21:04:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340702 - in head/lib/csu: amd64 common i386 X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: in head/lib/csu: amd64 common i386 X-SVN-Commit-Revision: 340702 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 648A683A21 X-Spamd-Result: default: False [0.78 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.63)[0.634,0]; NEURAL_SPAM_MEDIUM(0.14)[0.143,0]; NEURAL_SPAM_LONG(0.00)[0.001,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Nov 2018 21:04:22 -0000 Author: emaste Date: Tue Nov 20 21:04:20 2018 New Revision: 340702 URL: https://svnweb.freebsd.org/changeset/base/340702 Log: csu: use BSD-1-clause license on csu files Copyright on these files is held by kib@ and/or the Foundation, and both agree to this change. Approved by: kib Modified: head/lib/csu/amd64/reloc.c head/lib/csu/common/ignore_init.c head/lib/csu/common/notes.h head/lib/csu/i386/crt1_s.S head/lib/csu/i386/reloc.c Modified: head/lib/csu/amd64/reloc.c ============================================================================== --- head/lib/csu/amd64/reloc.c Tue Nov 20 20:59:49 2018 (r340701) +++ head/lib/csu/amd64/reloc.c Tue Nov 20 21:04:20 2018 (r340702) @@ -9,9 +9,6 @@ * 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 Modified: head/lib/csu/common/ignore_init.c ============================================================================== --- head/lib/csu/common/ignore_init.c Tue Nov 20 20:59:49 2018 (r340701) +++ head/lib/csu/common/ignore_init.c Tue Nov 20 21:04:20 2018 (r340702) @@ -1,5 +1,5 @@ /*- - * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * SPDX-License-Identifier: BSD-1-Clause * * Copyright 2012 Konstantin Belousov * Copyright (c) 2018 The FreeBSD Foundation @@ -12,9 +12,6 @@ * 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 Modified: head/lib/csu/common/notes.h ============================================================================== --- head/lib/csu/common/notes.h Tue Nov 20 20:59:49 2018 (r340701) +++ head/lib/csu/common/notes.h Tue Nov 20 21:04:20 2018 (r340702) @@ -1,5 +1,5 @@ /*- - * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * SPDX-License-Identifier: BSD-1-Clause * * Copyright 2012 Konstantin Belousov * All rights reserved. @@ -9,9 +9,6 @@ * 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 Modified: head/lib/csu/i386/crt1_s.S ============================================================================== --- head/lib/csu/i386/crt1_s.S Tue Nov 20 20:59:49 2018 (r340701) +++ head/lib/csu/i386/crt1_s.S Tue Nov 20 21:04:20 2018 (r340702) @@ -7,9 +7,6 @@ * 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 Modified: head/lib/csu/i386/reloc.c ============================================================================== --- head/lib/csu/i386/reloc.c Tue Nov 20 20:59:49 2018 (r340701) +++ head/lib/csu/i386/reloc.c Tue Nov 20 21:04:20 2018 (r340702) @@ -9,9 +9,6 @@ * 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 From owner-svn-src-all@freebsd.org Tue Nov 20 21:10:14 2018 Return-Path: Delivered-To: svn-src-all@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 EF358113E0B2; Tue, 20 Nov 2018 21:10:13 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.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 9D62F83F9E; Tue, 20 Nov 2018 21:10:13 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7DE6516AA6; Tue, 20 Nov 2018 21:10:13 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAKLADMb030780; Tue, 20 Nov 2018 21:10:13 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAKLA4i5030740; Tue, 20 Nov 2018 21:10:04 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <201811202110.wAKLA4i5030740@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Tue, 20 Nov 2018 21:10:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340703 - in head: crypto/openssl crypto/openssl/apps crypto/openssl/crypto crypto/openssl/crypto/async/arch crypto/openssl/crypto/bio crypto/openssl/crypto/bn crypto/openssl/crypto/bn/... X-SVN-Group: head X-SVN-Commit-Author: jkim X-SVN-Commit-Paths: in head: crypto/openssl crypto/openssl/apps crypto/openssl/crypto crypto/openssl/crypto/async/arch crypto/openssl/crypto/bio crypto/openssl/crypto/bn crypto/openssl/crypto/bn/asm crypto/openssl/crypto... X-SVN-Commit-Revision: 340703 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 9D62F83F9E X-Spamd-Result: default: False [0.84 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.01)[0.012,0]; NEURAL_SPAM_MEDIUM(0.19)[0.194,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.63)[0.634,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Nov 2018 21:10:14 -0000 Author: jkim Date: Tue Nov 20 21:10:04 2018 New Revision: 340703 URL: https://svnweb.freebsd.org/changeset/base/340703 Log: Merge OpenSSL 1.1.1a. Added: head/crypto/openssl/crypto/getenv.c - copied unchanged from r340690, vendor-crypto/openssl/dist/crypto/getenv.c head/crypto/openssl/doc/man3/SSL_get_peer_tmp_key.pod - copied unchanged from r340690, vendor-crypto/openssl/dist/doc/man3/SSL_get_peer_tmp_key.pod head/secure/lib/libcrypto/man/SSL_get_peer_tmp_key.3 (contents, props changed) Deleted: head/crypto/openssl/doc/man3/SSL_CTX_set_client_CA_list.pod head/crypto/openssl/doc/man3/SSL_get_client_CA_list.pod head/crypto/openssl/doc/man3/SSL_get_server_tmp_key.pod head/secure/lib/libcrypto/man/SSL_CTX_set_client_CA_list.3 head/secure/lib/libcrypto/man/SSL_get_client_CA_list.3 head/secure/lib/libcrypto/man/SSL_get_server_tmp_key.3 Modified: head/crypto/openssl/CHANGES head/crypto/openssl/Configure head/crypto/openssl/INSTALL head/crypto/openssl/NEWS head/crypto/openssl/README head/crypto/openssl/apps/app_rand.c head/crypto/openssl/apps/apps.c head/crypto/openssl/apps/apps.h head/crypto/openssl/apps/ca.c head/crypto/openssl/apps/ocsp.c head/crypto/openssl/apps/openssl.cnf head/crypto/openssl/apps/opt.c head/crypto/openssl/apps/rehash.c head/crypto/openssl/apps/rsa.c head/crypto/openssl/apps/s_cb.c head/crypto/openssl/apps/s_server.c head/crypto/openssl/apps/speed.c head/crypto/openssl/apps/x509.c head/crypto/openssl/crypto/LPdir_unix.c head/crypto/openssl/crypto/async/arch/async_posix.h head/crypto/openssl/crypto/bio/b_sock2.c head/crypto/openssl/crypto/bio/bio_lib.c head/crypto/openssl/crypto/bio/bss_log.c head/crypto/openssl/crypto/bn/asm/x86_64-gcc.c head/crypto/openssl/crypto/bn/bn_exp.c head/crypto/openssl/crypto/bn/bn_lib.c head/crypto/openssl/crypto/build.info head/crypto/openssl/crypto/conf/conf_api.c head/crypto/openssl/crypto/conf/conf_mod.c head/crypto/openssl/crypto/cryptlib.c head/crypto/openssl/crypto/ct/ct_log.c head/crypto/openssl/crypto/dsa/dsa_gen.c head/crypto/openssl/crypto/dsa/dsa_ossl.c head/crypto/openssl/crypto/ec/ec_ameth.c head/crypto/openssl/crypto/ec/ec_mult.c head/crypto/openssl/crypto/ec/ec_pmeth.c head/crypto/openssl/crypto/ec/ecdh_kdf.c head/crypto/openssl/crypto/engine/eng_devcrypto.c head/crypto/openssl/crypto/engine/eng_list.c head/crypto/openssl/crypto/err/openssl.txt head/crypto/openssl/crypto/evp/e_aes.c head/crypto/openssl/crypto/evp/e_rc2.c head/crypto/openssl/crypto/evp/pmeth_lib.c head/crypto/openssl/crypto/include/internal/ec_int.h head/crypto/openssl/crypto/include/internal/rand_int.h head/crypto/openssl/crypto/kdf/hkdf.c head/crypto/openssl/crypto/mem_sec.c head/crypto/openssl/crypto/o_fopen.c head/crypto/openssl/crypto/pkcs12/p12_mutl.c head/crypto/openssl/crypto/poly1305/poly1305_ieee754.c head/crypto/openssl/crypto/rand/drbg_ctr.c head/crypto/openssl/crypto/rand/drbg_lib.c head/crypto/openssl/crypto/rand/rand_err.c head/crypto/openssl/crypto/rand/rand_lcl.h head/crypto/openssl/crypto/rand/rand_lib.c head/crypto/openssl/crypto/rand/rand_unix.c head/crypto/openssl/crypto/rand/randfile.c head/crypto/openssl/crypto/rsa/rsa_lib.c head/crypto/openssl/crypto/rsa/rsa_meth.c head/crypto/openssl/crypto/rsa/rsa_ossl.c head/crypto/openssl/crypto/sha/asm/keccak1600-s390x.pl head/crypto/openssl/crypto/sha/asm/sha512p8-ppc.pl head/crypto/openssl/crypto/siphash/siphash.c head/crypto/openssl/crypto/sm2/sm2_crypt.c head/crypto/openssl/crypto/sm2/sm2_sign.c head/crypto/openssl/crypto/ui/ui_openssl.c head/crypto/openssl/crypto/x509/by_dir.c head/crypto/openssl/crypto/x509/by_file.c head/crypto/openssl/crypto/x509/x509_vfy.c head/crypto/openssl/doc/man1/ca.pod head/crypto/openssl/doc/man1/enc.pod head/crypto/openssl/doc/man1/openssl.pod head/crypto/openssl/doc/man1/req.pod head/crypto/openssl/doc/man1/rsa.pod head/crypto/openssl/doc/man1/s_server.pod head/crypto/openssl/doc/man1/storeutl.pod head/crypto/openssl/doc/man1/x509.pod head/crypto/openssl/doc/man3/DES_random_key.pod head/crypto/openssl/doc/man3/EVP_DigestInit.pod head/crypto/openssl/doc/man3/EVP_PKEY_CTX_ctrl.pod head/crypto/openssl/doc/man3/EVP_PKEY_CTX_set_hkdf_md.pod head/crypto/openssl/doc/man3/EVP_PKEY_CTX_set_rsa_pss_keygen_md.pod head/crypto/openssl/doc/man3/EVP_PKEY_set1_RSA.pod head/crypto/openssl/doc/man3/EVP_aes.pod head/crypto/openssl/doc/man3/EVP_aria.pod head/crypto/openssl/doc/man3/EVP_bf_cbc.pod head/crypto/openssl/doc/man3/EVP_camellia.pod head/crypto/openssl/doc/man3/EVP_cast5_cbc.pod head/crypto/openssl/doc/man3/EVP_des.pod head/crypto/openssl/doc/man3/EVP_idea_cbc.pod head/crypto/openssl/doc/man3/EVP_md5.pod head/crypto/openssl/doc/man3/EVP_rc2_cbc.pod head/crypto/openssl/doc/man3/EVP_rc5_32_12_16_cbc.pod head/crypto/openssl/doc/man3/EVP_seed_cbc.pod head/crypto/openssl/doc/man3/EVP_sm4_cbc.pod head/crypto/openssl/doc/man3/OPENSSL_VERSION_NUMBER.pod head/crypto/openssl/doc/man3/RSA_meth_new.pod head/crypto/openssl/doc/man3/SSL_CTX_set0_CA_list.pod head/crypto/openssl/doc/man3/SSL_CTX_set1_curves.pod head/crypto/openssl/doc/man3/SSL_CTX_set_quiet_shutdown.pod head/crypto/openssl/doc/man3/SSL_get_error.pod head/crypto/openssl/doc/man3/SSL_get_peer_signature_nid.pod head/crypto/openssl/doc/man3/SSL_set_bio.pod head/crypto/openssl/doc/man3/SSL_set_shutdown.pod head/crypto/openssl/doc/man3/SSL_shutdown.pod head/crypto/openssl/doc/man7/RAND_DRBG.pod head/crypto/openssl/e_os.h head/crypto/openssl/include/internal/cryptlib.h head/crypto/openssl/include/internal/tsan_assist.h head/crypto/openssl/include/openssl/cryptoerr.h head/crypto/openssl/include/openssl/ec.h head/crypto/openssl/include/openssl/ocsp.h head/crypto/openssl/include/openssl/opensslv.h head/crypto/openssl/include/openssl/rand_drbg.h head/crypto/openssl/include/openssl/randerr.h head/crypto/openssl/include/openssl/rsa.h head/crypto/openssl/include/openssl/ssl.h head/crypto/openssl/include/openssl/symhacks.h head/crypto/openssl/include/openssl/tls1.h head/crypto/openssl/ssl/d1_lib.c head/crypto/openssl/ssl/record/rec_layer_d1.c head/crypto/openssl/ssl/record/record.h head/crypto/openssl/ssl/record/record_locl.h head/crypto/openssl/ssl/record/ssl3_record.c head/crypto/openssl/ssl/s3_cbc.c head/crypto/openssl/ssl/s3_enc.c head/crypto/openssl/ssl/s3_lib.c head/crypto/openssl/ssl/ssl_cert.c head/crypto/openssl/ssl/ssl_ciph.c head/crypto/openssl/ssl/ssl_lib.c head/crypto/openssl/ssl/ssl_locl.h head/crypto/openssl/ssl/statem/extensions.c head/crypto/openssl/ssl/statem/extensions_clnt.c head/crypto/openssl/ssl/statem/statem.c head/crypto/openssl/ssl/statem/statem_clnt.c head/crypto/openssl/ssl/statem/statem_lib.c head/crypto/openssl/ssl/statem/statem_locl.h head/crypto/openssl/ssl/statem/statem_srvr.c head/crypto/openssl/ssl/t1_lib.c head/crypto/openssl/ssl/tls13_enc.c head/secure/lib/libcrypto/Makefile head/secure/lib/libcrypto/Makefile.inc head/secure/lib/libcrypto/Makefile.man head/secure/lib/libcrypto/man/ADMISSIONS.3 head/secure/lib/libcrypto/man/ASN1_INTEGER_get_int64.3 head/secure/lib/libcrypto/man/ASN1_ITEM_lookup.3 head/secure/lib/libcrypto/man/ASN1_OBJECT_new.3 head/secure/lib/libcrypto/man/ASN1_STRING_TABLE_add.3 head/secure/lib/libcrypto/man/ASN1_STRING_length.3 head/secure/lib/libcrypto/man/ASN1_STRING_new.3 head/secure/lib/libcrypto/man/ASN1_STRING_print_ex.3 head/secure/lib/libcrypto/man/ASN1_TIME_set.3 head/secure/lib/libcrypto/man/ASN1_TYPE_get.3 head/secure/lib/libcrypto/man/ASN1_generate_nconf.3 head/secure/lib/libcrypto/man/ASYNC_WAIT_CTX_new.3 head/secure/lib/libcrypto/man/ASYNC_start_job.3 head/secure/lib/libcrypto/man/BF_encrypt.3 head/secure/lib/libcrypto/man/BIO_ADDR.3 head/secure/lib/libcrypto/man/BIO_ADDRINFO.3 head/secure/lib/libcrypto/man/BIO_connect.3 head/secure/lib/libcrypto/man/BIO_ctrl.3 head/secure/lib/libcrypto/man/BIO_f_base64.3 head/secure/lib/libcrypto/man/BIO_f_buffer.3 head/secure/lib/libcrypto/man/BIO_f_cipher.3 head/secure/lib/libcrypto/man/BIO_f_md.3 head/secure/lib/libcrypto/man/BIO_f_null.3 head/secure/lib/libcrypto/man/BIO_f_ssl.3 head/secure/lib/libcrypto/man/BIO_find_type.3 head/secure/lib/libcrypto/man/BIO_get_data.3 head/secure/lib/libcrypto/man/BIO_get_ex_new_index.3 head/secure/lib/libcrypto/man/BIO_meth_new.3 head/secure/lib/libcrypto/man/BIO_new.3 head/secure/lib/libcrypto/man/BIO_new_CMS.3 head/secure/lib/libcrypto/man/BIO_parse_hostserv.3 head/secure/lib/libcrypto/man/BIO_printf.3 head/secure/lib/libcrypto/man/BIO_push.3 head/secure/lib/libcrypto/man/BIO_read.3 head/secure/lib/libcrypto/man/BIO_s_accept.3 head/secure/lib/libcrypto/man/BIO_s_bio.3 head/secure/lib/libcrypto/man/BIO_s_connect.3 head/secure/lib/libcrypto/man/BIO_s_fd.3 head/secure/lib/libcrypto/man/BIO_s_file.3 head/secure/lib/libcrypto/man/BIO_s_mem.3 head/secure/lib/libcrypto/man/BIO_s_null.3 head/secure/lib/libcrypto/man/BIO_s_socket.3 head/secure/lib/libcrypto/man/BIO_set_callback.3 head/secure/lib/libcrypto/man/BIO_should_retry.3 head/secure/lib/libcrypto/man/BN_BLINDING_new.3 head/secure/lib/libcrypto/man/BN_CTX_new.3 head/secure/lib/libcrypto/man/BN_CTX_start.3 head/secure/lib/libcrypto/man/BN_add.3 head/secure/lib/libcrypto/man/BN_add_word.3 head/secure/lib/libcrypto/man/BN_bn2bin.3 head/secure/lib/libcrypto/man/BN_cmp.3 head/secure/lib/libcrypto/man/BN_copy.3 head/secure/lib/libcrypto/man/BN_generate_prime.3 head/secure/lib/libcrypto/man/BN_mod_inverse.3 head/secure/lib/libcrypto/man/BN_mod_mul_montgomery.3 head/secure/lib/libcrypto/man/BN_mod_mul_reciprocal.3 head/secure/lib/libcrypto/man/BN_new.3 head/secure/lib/libcrypto/man/BN_num_bytes.3 head/secure/lib/libcrypto/man/BN_rand.3 head/secure/lib/libcrypto/man/BN_security_bits.3 head/secure/lib/libcrypto/man/BN_set_bit.3 head/secure/lib/libcrypto/man/BN_swap.3 head/secure/lib/libcrypto/man/BN_zero.3 head/secure/lib/libcrypto/man/BUF_MEM_new.3 head/secure/lib/libcrypto/man/CMS_add0_cert.3 head/secure/lib/libcrypto/man/CMS_add1_recipient_cert.3 head/secure/lib/libcrypto/man/CMS_add1_signer.3 head/secure/lib/libcrypto/man/CMS_compress.3 head/secure/lib/libcrypto/man/CMS_decrypt.3 head/secure/lib/libcrypto/man/CMS_encrypt.3 head/secure/lib/libcrypto/man/CMS_final.3 head/secure/lib/libcrypto/man/CMS_get0_RecipientInfos.3 head/secure/lib/libcrypto/man/CMS_get0_SignerInfos.3 head/secure/lib/libcrypto/man/CMS_get0_type.3 head/secure/lib/libcrypto/man/CMS_get1_ReceiptRequest.3 head/secure/lib/libcrypto/man/CMS_sign.3 head/secure/lib/libcrypto/man/CMS_sign_receipt.3 head/secure/lib/libcrypto/man/CMS_uncompress.3 head/secure/lib/libcrypto/man/CMS_verify.3 head/secure/lib/libcrypto/man/CMS_verify_receipt.3 head/secure/lib/libcrypto/man/CONF_modules_free.3 head/secure/lib/libcrypto/man/CONF_modules_load_file.3 head/secure/lib/libcrypto/man/CRYPTO_THREAD_run_once.3 head/secure/lib/libcrypto/man/CRYPTO_get_ex_new_index.3 head/secure/lib/libcrypto/man/CTLOG_STORE_get0_log_by_id.3 head/secure/lib/libcrypto/man/CTLOG_STORE_new.3 head/secure/lib/libcrypto/man/CTLOG_new.3 head/secure/lib/libcrypto/man/CT_POLICY_EVAL_CTX_new.3 head/secure/lib/libcrypto/man/DEFINE_STACK_OF.3 head/secure/lib/libcrypto/man/DES_random_key.3 head/secure/lib/libcrypto/man/DH_generate_key.3 head/secure/lib/libcrypto/man/DH_generate_parameters.3 head/secure/lib/libcrypto/man/DH_get0_pqg.3 head/secure/lib/libcrypto/man/DH_get_1024_160.3 head/secure/lib/libcrypto/man/DH_meth_new.3 head/secure/lib/libcrypto/man/DH_new.3 head/secure/lib/libcrypto/man/DH_new_by_nid.3 head/secure/lib/libcrypto/man/DH_set_method.3 head/secure/lib/libcrypto/man/DH_size.3 head/secure/lib/libcrypto/man/DSA_SIG_new.3 head/secure/lib/libcrypto/man/DSA_do_sign.3 head/secure/lib/libcrypto/man/DSA_dup_DH.3 head/secure/lib/libcrypto/man/DSA_generate_key.3 head/secure/lib/libcrypto/man/DSA_generate_parameters.3 head/secure/lib/libcrypto/man/DSA_get0_pqg.3 head/secure/lib/libcrypto/man/DSA_meth_new.3 head/secure/lib/libcrypto/man/DSA_new.3 head/secure/lib/libcrypto/man/DSA_set_method.3 head/secure/lib/libcrypto/man/DSA_sign.3 head/secure/lib/libcrypto/man/DSA_size.3 head/secure/lib/libcrypto/man/DTLS_get_data_mtu.3 head/secure/lib/libcrypto/man/DTLS_set_timer_cb.3 head/secure/lib/libcrypto/man/DTLSv1_listen.3 head/secure/lib/libcrypto/man/ECDSA_SIG_new.3 head/secure/lib/libcrypto/man/ECPKParameters_print.3 head/secure/lib/libcrypto/man/EC_GFp_simple_method.3 head/secure/lib/libcrypto/man/EC_GROUP_copy.3 head/secure/lib/libcrypto/man/EC_GROUP_new.3 head/secure/lib/libcrypto/man/EC_KEY_get_enc_flags.3 head/secure/lib/libcrypto/man/EC_KEY_new.3 head/secure/lib/libcrypto/man/EC_POINT_add.3 head/secure/lib/libcrypto/man/EC_POINT_new.3 head/secure/lib/libcrypto/man/ENGINE_add.3 head/secure/lib/libcrypto/man/ERR_GET_LIB.3 head/secure/lib/libcrypto/man/ERR_clear_error.3 head/secure/lib/libcrypto/man/ERR_error_string.3 head/secure/lib/libcrypto/man/ERR_get_error.3 head/secure/lib/libcrypto/man/ERR_load_crypto_strings.3 head/secure/lib/libcrypto/man/ERR_load_strings.3 head/secure/lib/libcrypto/man/ERR_print_errors.3 head/secure/lib/libcrypto/man/ERR_put_error.3 head/secure/lib/libcrypto/man/ERR_remove_state.3 head/secure/lib/libcrypto/man/ERR_set_mark.3 head/secure/lib/libcrypto/man/EVP_BytesToKey.3 head/secure/lib/libcrypto/man/EVP_CIPHER_CTX_get_cipher_data.3 head/secure/lib/libcrypto/man/EVP_CIPHER_meth_new.3 head/secure/lib/libcrypto/man/EVP_DigestInit.3 head/secure/lib/libcrypto/man/EVP_DigestSignInit.3 head/secure/lib/libcrypto/man/EVP_DigestVerifyInit.3 head/secure/lib/libcrypto/man/EVP_EncodeInit.3 head/secure/lib/libcrypto/man/EVP_EncryptInit.3 head/secure/lib/libcrypto/man/EVP_MD_meth_new.3 head/secure/lib/libcrypto/man/EVP_OpenInit.3 head/secure/lib/libcrypto/man/EVP_PKEY_ASN1_METHOD.3 head/secure/lib/libcrypto/man/EVP_PKEY_CTX_ctrl.3 head/secure/lib/libcrypto/man/EVP_PKEY_CTX_new.3 head/secure/lib/libcrypto/man/EVP_PKEY_CTX_set1_pbe_pass.3 head/secure/lib/libcrypto/man/EVP_PKEY_CTX_set_hkdf_md.3 head/secure/lib/libcrypto/man/EVP_PKEY_CTX_set_rsa_pss_keygen_md.3 head/secure/lib/libcrypto/man/EVP_PKEY_CTX_set_scrypt_N.3 head/secure/lib/libcrypto/man/EVP_PKEY_CTX_set_tls1_prf_md.3 head/secure/lib/libcrypto/man/EVP_PKEY_asn1_get_count.3 head/secure/lib/libcrypto/man/EVP_PKEY_cmp.3 head/secure/lib/libcrypto/man/EVP_PKEY_decrypt.3 head/secure/lib/libcrypto/man/EVP_PKEY_derive.3 head/secure/lib/libcrypto/man/EVP_PKEY_encrypt.3 head/secure/lib/libcrypto/man/EVP_PKEY_get_default_digest_nid.3 head/secure/lib/libcrypto/man/EVP_PKEY_keygen.3 head/secure/lib/libcrypto/man/EVP_PKEY_meth_get_count.3 head/secure/lib/libcrypto/man/EVP_PKEY_meth_new.3 head/secure/lib/libcrypto/man/EVP_PKEY_new.3 head/secure/lib/libcrypto/man/EVP_PKEY_print_private.3 head/secure/lib/libcrypto/man/EVP_PKEY_set1_RSA.3 head/secure/lib/libcrypto/man/EVP_PKEY_sign.3 head/secure/lib/libcrypto/man/EVP_PKEY_verify.3 head/secure/lib/libcrypto/man/EVP_PKEY_verify_recover.3 head/secure/lib/libcrypto/man/EVP_SealInit.3 head/secure/lib/libcrypto/man/EVP_SignInit.3 head/secure/lib/libcrypto/man/EVP_VerifyInit.3 head/secure/lib/libcrypto/man/EVP_aes.3 head/secure/lib/libcrypto/man/EVP_aria.3 head/secure/lib/libcrypto/man/EVP_bf_cbc.3 head/secure/lib/libcrypto/man/EVP_blake2b512.3 head/secure/lib/libcrypto/man/EVP_camellia.3 head/secure/lib/libcrypto/man/EVP_cast5_cbc.3 head/secure/lib/libcrypto/man/EVP_chacha20.3 head/secure/lib/libcrypto/man/EVP_des.3 head/secure/lib/libcrypto/man/EVP_desx_cbc.3 head/secure/lib/libcrypto/man/EVP_idea_cbc.3 head/secure/lib/libcrypto/man/EVP_md2.3 head/secure/lib/libcrypto/man/EVP_md4.3 head/secure/lib/libcrypto/man/EVP_md5.3 head/secure/lib/libcrypto/man/EVP_mdc2.3 head/secure/lib/libcrypto/man/EVP_rc2_cbc.3 head/secure/lib/libcrypto/man/EVP_rc4.3 head/secure/lib/libcrypto/man/EVP_rc5_32_12_16_cbc.3 head/secure/lib/libcrypto/man/EVP_ripemd160.3 head/secure/lib/libcrypto/man/EVP_seed_cbc.3 head/secure/lib/libcrypto/man/EVP_sha1.3 head/secure/lib/libcrypto/man/EVP_sha224.3 head/secure/lib/libcrypto/man/EVP_sha3_224.3 head/secure/lib/libcrypto/man/EVP_sm3.3 head/secure/lib/libcrypto/man/EVP_sm4_cbc.3 head/secure/lib/libcrypto/man/EVP_whirlpool.3 head/secure/lib/libcrypto/man/HMAC.3 head/secure/lib/libcrypto/man/MD5.3 head/secure/lib/libcrypto/man/MDC2_Init.3 head/secure/lib/libcrypto/man/OBJ_nid2obj.3 head/secure/lib/libcrypto/man/OCSP_REQUEST_new.3 head/secure/lib/libcrypto/man/OCSP_cert_to_id.3 head/secure/lib/libcrypto/man/OCSP_request_add1_nonce.3 head/secure/lib/libcrypto/man/OCSP_resp_find_status.3 head/secure/lib/libcrypto/man/OCSP_response_status.3 head/secure/lib/libcrypto/man/OCSP_sendreq_new.3 head/secure/lib/libcrypto/man/OPENSSL_Applink.3 head/secure/lib/libcrypto/man/OPENSSL_LH_COMPFUNC.3 head/secure/lib/libcrypto/man/OPENSSL_LH_stats.3 head/secure/lib/libcrypto/man/OPENSSL_VERSION_NUMBER.3 head/secure/lib/libcrypto/man/OPENSSL_config.3 head/secure/lib/libcrypto/man/OPENSSL_fork_prepare.3 head/secure/lib/libcrypto/man/OPENSSL_ia32cap.3 head/secure/lib/libcrypto/man/OPENSSL_init_crypto.3 head/secure/lib/libcrypto/man/OPENSSL_init_ssl.3 head/secure/lib/libcrypto/man/OPENSSL_instrument_bus.3 head/secure/lib/libcrypto/man/OPENSSL_load_builtin_modules.3 head/secure/lib/libcrypto/man/OPENSSL_malloc.3 head/secure/lib/libcrypto/man/OPENSSL_secure_malloc.3 head/secure/lib/libcrypto/man/OSSL_STORE_INFO.3 head/secure/lib/libcrypto/man/OSSL_STORE_LOADER.3 head/secure/lib/libcrypto/man/OSSL_STORE_SEARCH.3 head/secure/lib/libcrypto/man/OSSL_STORE_expect.3 head/secure/lib/libcrypto/man/OSSL_STORE_open.3 head/secure/lib/libcrypto/man/OpenSSL_add_all_algorithms.3 head/secure/lib/libcrypto/man/PEM_bytes_read_bio.3 head/secure/lib/libcrypto/man/PEM_read.3 head/secure/lib/libcrypto/man/PEM_read_CMS.3 head/secure/lib/libcrypto/man/PEM_read_bio_PrivateKey.3 head/secure/lib/libcrypto/man/PEM_read_bio_ex.3 head/secure/lib/libcrypto/man/PEM_write_bio_CMS_stream.3 head/secure/lib/libcrypto/man/PEM_write_bio_PKCS7_stream.3 head/secure/lib/libcrypto/man/PKCS12_create.3 head/secure/lib/libcrypto/man/PKCS12_newpass.3 head/secure/lib/libcrypto/man/PKCS12_parse.3 head/secure/lib/libcrypto/man/PKCS5_PBKDF2_HMAC.3 head/secure/lib/libcrypto/man/PKCS7_decrypt.3 head/secure/lib/libcrypto/man/PKCS7_encrypt.3 head/secure/lib/libcrypto/man/PKCS7_sign.3 head/secure/lib/libcrypto/man/PKCS7_sign_add_signer.3 head/secure/lib/libcrypto/man/PKCS7_verify.3 head/secure/lib/libcrypto/man/RAND_DRBG_generate.3 head/secure/lib/libcrypto/man/RAND_DRBG_get0_master.3 head/secure/lib/libcrypto/man/RAND_DRBG_new.3 head/secure/lib/libcrypto/man/RAND_DRBG_reseed.3 head/secure/lib/libcrypto/man/RAND_DRBG_set_callbacks.3 head/secure/lib/libcrypto/man/RAND_DRBG_set_ex_data.3 head/secure/lib/libcrypto/man/RAND_add.3 head/secure/lib/libcrypto/man/RAND_bytes.3 head/secure/lib/libcrypto/man/RAND_cleanup.3 head/secure/lib/libcrypto/man/RAND_egd.3 head/secure/lib/libcrypto/man/RAND_load_file.3 head/secure/lib/libcrypto/man/RAND_set_rand_method.3 head/secure/lib/libcrypto/man/RC4_set_key.3 head/secure/lib/libcrypto/man/RIPEMD160_Init.3 head/secure/lib/libcrypto/man/RSA_blinding_on.3 head/secure/lib/libcrypto/man/RSA_check_key.3 head/secure/lib/libcrypto/man/RSA_generate_key.3 head/secure/lib/libcrypto/man/RSA_get0_key.3 head/secure/lib/libcrypto/man/RSA_meth_new.3 head/secure/lib/libcrypto/man/RSA_new.3 head/secure/lib/libcrypto/man/RSA_padding_add_PKCS1_type_1.3 head/secure/lib/libcrypto/man/RSA_print.3 head/secure/lib/libcrypto/man/RSA_private_encrypt.3 head/secure/lib/libcrypto/man/RSA_public_encrypt.3 head/secure/lib/libcrypto/man/RSA_set_method.3 head/secure/lib/libcrypto/man/RSA_sign.3 head/secure/lib/libcrypto/man/RSA_sign_ASN1_OCTET_STRING.3 head/secure/lib/libcrypto/man/RSA_size.3 head/secure/lib/libcrypto/man/SCT_new.3 head/secure/lib/libcrypto/man/SCT_print.3 head/secure/lib/libcrypto/man/SCT_validate.3 head/secure/lib/libcrypto/man/SHA256_Init.3 head/secure/lib/libcrypto/man/SMIME_read_CMS.3 head/secure/lib/libcrypto/man/SMIME_read_PKCS7.3 head/secure/lib/libcrypto/man/SMIME_write_CMS.3 head/secure/lib/libcrypto/man/SMIME_write_PKCS7.3 head/secure/lib/libcrypto/man/SSL_CIPHER_get_name.3 head/secure/lib/libcrypto/man/SSL_COMP_add_compression_method.3 head/secure/lib/libcrypto/man/SSL_CONF_CTX_new.3 head/secure/lib/libcrypto/man/SSL_CONF_CTX_set1_prefix.3 head/secure/lib/libcrypto/man/SSL_CONF_CTX_set_flags.3 head/secure/lib/libcrypto/man/SSL_CONF_CTX_set_ssl_ctx.3 head/secure/lib/libcrypto/man/SSL_CONF_cmd.3 head/secure/lib/libcrypto/man/SSL_CONF_cmd_argv.3 head/secure/lib/libcrypto/man/SSL_CTX_add1_chain_cert.3 head/secure/lib/libcrypto/man/SSL_CTX_add_extra_chain_cert.3 head/secure/lib/libcrypto/man/SSL_CTX_add_session.3 head/secure/lib/libcrypto/man/SSL_CTX_config.3 head/secure/lib/libcrypto/man/SSL_CTX_ctrl.3 head/secure/lib/libcrypto/man/SSL_CTX_dane_enable.3 head/secure/lib/libcrypto/man/SSL_CTX_flush_sessions.3 head/secure/lib/libcrypto/man/SSL_CTX_free.3 head/secure/lib/libcrypto/man/SSL_CTX_get0_param.3 head/secure/lib/libcrypto/man/SSL_CTX_get_verify_mode.3 head/secure/lib/libcrypto/man/SSL_CTX_has_client_custom_ext.3 head/secure/lib/libcrypto/man/SSL_CTX_load_verify_locations.3 head/secure/lib/libcrypto/man/SSL_CTX_new.3 head/secure/lib/libcrypto/man/SSL_CTX_sess_number.3 head/secure/lib/libcrypto/man/SSL_CTX_sess_set_cache_size.3 head/secure/lib/libcrypto/man/SSL_CTX_sess_set_get_cb.3 head/secure/lib/libcrypto/man/SSL_CTX_sessions.3 head/secure/lib/libcrypto/man/SSL_CTX_set0_CA_list.3 head/secure/lib/libcrypto/man/SSL_CTX_set1_curves.3 head/secure/lib/libcrypto/man/SSL_CTX_set1_sigalgs.3 head/secure/lib/libcrypto/man/SSL_CTX_set1_verify_cert_store.3 head/secure/lib/libcrypto/man/SSL_CTX_set_alpn_select_cb.3 head/secure/lib/libcrypto/man/SSL_CTX_set_cert_cb.3 head/secure/lib/libcrypto/man/SSL_CTX_set_cert_store.3 head/secure/lib/libcrypto/man/SSL_CTX_set_cert_verify_callback.3 head/secure/lib/libcrypto/man/SSL_CTX_set_cipher_list.3 head/secure/lib/libcrypto/man/SSL_CTX_set_client_cert_cb.3 head/secure/lib/libcrypto/man/SSL_CTX_set_client_hello_cb.3 head/secure/lib/libcrypto/man/SSL_CTX_set_ct_validation_callback.3 head/secure/lib/libcrypto/man/SSL_CTX_set_ctlog_list_file.3 head/secure/lib/libcrypto/man/SSL_CTX_set_default_passwd_cb.3 head/secure/lib/libcrypto/man/SSL_CTX_set_ex_data.3 head/secure/lib/libcrypto/man/SSL_CTX_set_generate_session_id.3 head/secure/lib/libcrypto/man/SSL_CTX_set_info_callback.3 head/secure/lib/libcrypto/man/SSL_CTX_set_keylog_callback.3 head/secure/lib/libcrypto/man/SSL_CTX_set_max_cert_list.3 head/secure/lib/libcrypto/man/SSL_CTX_set_min_proto_version.3 head/secure/lib/libcrypto/man/SSL_CTX_set_mode.3 head/secure/lib/libcrypto/man/SSL_CTX_set_msg_callback.3 head/secure/lib/libcrypto/man/SSL_CTX_set_num_tickets.3 head/secure/lib/libcrypto/man/SSL_CTX_set_options.3 head/secure/lib/libcrypto/man/SSL_CTX_set_psk_client_callback.3 head/secure/lib/libcrypto/man/SSL_CTX_set_quiet_shutdown.3 head/secure/lib/libcrypto/man/SSL_CTX_set_read_ahead.3 head/secure/lib/libcrypto/man/SSL_CTX_set_record_padding_callback.3 head/secure/lib/libcrypto/man/SSL_CTX_set_security_level.3 head/secure/lib/libcrypto/man/SSL_CTX_set_session_cache_mode.3 head/secure/lib/libcrypto/man/SSL_CTX_set_session_id_context.3 head/secure/lib/libcrypto/man/SSL_CTX_set_session_ticket_cb.3 head/secure/lib/libcrypto/man/SSL_CTX_set_split_send_fragment.3 head/secure/lib/libcrypto/man/SSL_CTX_set_ssl_version.3 head/secure/lib/libcrypto/man/SSL_CTX_set_stateless_cookie_generate_cb.3 head/secure/lib/libcrypto/man/SSL_CTX_set_timeout.3 head/secure/lib/libcrypto/man/SSL_CTX_set_tlsext_servername_callback.3 head/secure/lib/libcrypto/man/SSL_CTX_set_tlsext_status_cb.3 head/secure/lib/libcrypto/man/SSL_CTX_set_tlsext_ticket_key_cb.3 head/secure/lib/libcrypto/man/SSL_CTX_set_tlsext_use_srtp.3 head/secure/lib/libcrypto/man/SSL_CTX_set_tmp_dh_callback.3 head/secure/lib/libcrypto/man/SSL_CTX_set_verify.3 head/secure/lib/libcrypto/man/SSL_CTX_use_certificate.3 head/secure/lib/libcrypto/man/SSL_CTX_use_psk_identity_hint.3 head/secure/lib/libcrypto/man/SSL_CTX_use_serverinfo.3 head/secure/lib/libcrypto/man/SSL_SESSION_free.3 head/secure/lib/libcrypto/man/SSL_SESSION_get0_cipher.3 head/secure/lib/libcrypto/man/SSL_SESSION_get0_hostname.3 head/secure/lib/libcrypto/man/SSL_SESSION_get0_id_context.3 head/secure/lib/libcrypto/man/SSL_SESSION_get0_peer.3 head/secure/lib/libcrypto/man/SSL_SESSION_get_compress_id.3 head/secure/lib/libcrypto/man/SSL_SESSION_get_ex_data.3 head/secure/lib/libcrypto/man/SSL_SESSION_get_protocol_version.3 head/secure/lib/libcrypto/man/SSL_SESSION_get_time.3 head/secure/lib/libcrypto/man/SSL_SESSION_has_ticket.3 head/secure/lib/libcrypto/man/SSL_SESSION_is_resumable.3 head/secure/lib/libcrypto/man/SSL_SESSION_print.3 head/secure/lib/libcrypto/man/SSL_SESSION_set1_id.3 head/secure/lib/libcrypto/man/SSL_accept.3 head/secure/lib/libcrypto/man/SSL_alert_type_string.3 head/secure/lib/libcrypto/man/SSL_alloc_buffers.3 head/secure/lib/libcrypto/man/SSL_check_chain.3 head/secure/lib/libcrypto/man/SSL_clear.3 head/secure/lib/libcrypto/man/SSL_connect.3 head/secure/lib/libcrypto/man/SSL_do_handshake.3 head/secure/lib/libcrypto/man/SSL_export_keying_material.3 head/secure/lib/libcrypto/man/SSL_extension_supported.3 head/secure/lib/libcrypto/man/SSL_free.3 head/secure/lib/libcrypto/man/SSL_get0_peer_scts.3 head/secure/lib/libcrypto/man/SSL_get_SSL_CTX.3 head/secure/lib/libcrypto/man/SSL_get_all_async_fds.3 head/secure/lib/libcrypto/man/SSL_get_ciphers.3 head/secure/lib/libcrypto/man/SSL_get_client_random.3 head/secure/lib/libcrypto/man/SSL_get_current_cipher.3 head/secure/lib/libcrypto/man/SSL_get_default_timeout.3 head/secure/lib/libcrypto/man/SSL_get_error.3 head/secure/lib/libcrypto/man/SSL_get_extms_support.3 head/secure/lib/libcrypto/man/SSL_get_fd.3 head/secure/lib/libcrypto/man/SSL_get_peer_cert_chain.3 head/secure/lib/libcrypto/man/SSL_get_peer_certificate.3 head/secure/lib/libcrypto/man/SSL_get_peer_signature_nid.3 head/secure/lib/libcrypto/man/SSL_get_psk_identity.3 head/secure/lib/libcrypto/man/SSL_get_rbio.3 head/secure/lib/libcrypto/man/SSL_get_session.3 head/secure/lib/libcrypto/man/SSL_get_shared_sigalgs.3 head/secure/lib/libcrypto/man/SSL_get_verify_result.3 head/secure/lib/libcrypto/man/SSL_get_version.3 head/secure/lib/libcrypto/man/SSL_in_init.3 head/secure/lib/libcrypto/man/SSL_key_update.3 head/secure/lib/libcrypto/man/SSL_library_init.3 head/secure/lib/libcrypto/man/SSL_load_client_CA_file.3 head/secure/lib/libcrypto/man/SSL_new.3 head/secure/lib/libcrypto/man/SSL_pending.3 head/secure/lib/libcrypto/man/SSL_read.3 head/secure/lib/libcrypto/man/SSL_read_early_data.3 head/secure/lib/libcrypto/man/SSL_rstate_string.3 head/secure/lib/libcrypto/man/SSL_session_reused.3 head/secure/lib/libcrypto/man/SSL_set1_host.3 head/secure/lib/libcrypto/man/SSL_set_bio.3 head/secure/lib/libcrypto/man/SSL_set_connect_state.3 head/secure/lib/libcrypto/man/SSL_set_fd.3 head/secure/lib/libcrypto/man/SSL_set_session.3 head/secure/lib/libcrypto/man/SSL_set_shutdown.3 head/secure/lib/libcrypto/man/SSL_set_verify_result.3 head/secure/lib/libcrypto/man/SSL_shutdown.3 head/secure/lib/libcrypto/man/SSL_state_string.3 head/secure/lib/libcrypto/man/SSL_want.3 head/secure/lib/libcrypto/man/SSL_write.3 head/secure/lib/libcrypto/man/UI_STRING.3 head/secure/lib/libcrypto/man/UI_UTIL_read_pw.3 head/secure/lib/libcrypto/man/UI_create_method.3 head/secure/lib/libcrypto/man/UI_new.3 head/secure/lib/libcrypto/man/X509V3_get_d2i.3 head/secure/lib/libcrypto/man/X509_ALGOR_dup.3 head/secure/lib/libcrypto/man/X509_CRL_get0_by_serial.3 head/secure/lib/libcrypto/man/X509_EXTENSION_set_object.3 head/secure/lib/libcrypto/man/X509_LOOKUP_hash_dir.3 head/secure/lib/libcrypto/man/X509_LOOKUP_meth_new.3 head/secure/lib/libcrypto/man/X509_NAME_ENTRY_get_object.3 head/secure/lib/libcrypto/man/X509_NAME_add_entry_by_txt.3 head/secure/lib/libcrypto/man/X509_NAME_get0_der.3 head/secure/lib/libcrypto/man/X509_NAME_get_index_by_NID.3 head/secure/lib/libcrypto/man/X509_NAME_print_ex.3 head/secure/lib/libcrypto/man/X509_PUBKEY_new.3 head/secure/lib/libcrypto/man/X509_SIG_get0.3 head/secure/lib/libcrypto/man/X509_STORE_CTX_get_error.3 head/secure/lib/libcrypto/man/X509_STORE_CTX_new.3 head/secure/lib/libcrypto/man/X509_STORE_CTX_set_verify_cb.3 head/secure/lib/libcrypto/man/X509_STORE_add_cert.3 head/secure/lib/libcrypto/man/X509_STORE_get0_param.3 head/secure/lib/libcrypto/man/X509_STORE_new.3 head/secure/lib/libcrypto/man/X509_STORE_set_verify_cb_func.3 head/secure/lib/libcrypto/man/X509_VERIFY_PARAM_set_flags.3 head/secure/lib/libcrypto/man/X509_check_ca.3 head/secure/lib/libcrypto/man/X509_check_host.3 head/secure/lib/libcrypto/man/X509_check_issued.3 head/secure/lib/libcrypto/man/X509_check_private_key.3 head/secure/lib/libcrypto/man/X509_cmp_time.3 head/secure/lib/libcrypto/man/X509_digest.3 head/secure/lib/libcrypto/man/X509_dup.3 head/secure/lib/libcrypto/man/X509_get0_notBefore.3 head/secure/lib/libcrypto/man/X509_get0_signature.3 head/secure/lib/libcrypto/man/X509_get0_uids.3 head/secure/lib/libcrypto/man/X509_get_extension_flags.3 head/secure/lib/libcrypto/man/X509_get_pubkey.3 head/secure/lib/libcrypto/man/X509_get_serialNumber.3 head/secure/lib/libcrypto/man/X509_get_subject_name.3 head/secure/lib/libcrypto/man/X509_get_version.3 head/secure/lib/libcrypto/man/X509_new.3 head/secure/lib/libcrypto/man/X509_sign.3 head/secure/lib/libcrypto/man/X509_verify_cert.3 head/secure/lib/libcrypto/man/X509v3_get_ext_by_NID.3 head/secure/lib/libcrypto/man/d2i_DHparams.3 head/secure/lib/libcrypto/man/d2i_PKCS8PrivateKey_bio.3 head/secure/lib/libcrypto/man/d2i_PrivateKey.3 head/secure/lib/libcrypto/man/d2i_SSL_SESSION.3 head/secure/lib/libcrypto/man/d2i_X509.3 head/secure/lib/libcrypto/man/i2d_CMS_bio_stream.3 head/secure/lib/libcrypto/man/i2d_PKCS7_bio_stream.3 head/secure/lib/libcrypto/man/i2d_re_X509_tbs.3 head/secure/lib/libcrypto/man/o2i_SCT_LIST.3 head/secure/lib/libssl/Version.map (contents, props changed) head/secure/usr.bin/openssl/man/CA.pl.1 head/secure/usr.bin/openssl/man/asn1parse.1 head/secure/usr.bin/openssl/man/ca.1 head/secure/usr.bin/openssl/man/ciphers.1 head/secure/usr.bin/openssl/man/cms.1 head/secure/usr.bin/openssl/man/crl.1 head/secure/usr.bin/openssl/man/crl2pkcs7.1 head/secure/usr.bin/openssl/man/dgst.1 head/secure/usr.bin/openssl/man/dhparam.1 head/secure/usr.bin/openssl/man/dsa.1 head/secure/usr.bin/openssl/man/dsaparam.1 head/secure/usr.bin/openssl/man/ec.1 head/secure/usr.bin/openssl/man/ecparam.1 head/secure/usr.bin/openssl/man/enc.1 head/secure/usr.bin/openssl/man/engine.1 head/secure/usr.bin/openssl/man/errstr.1 head/secure/usr.bin/openssl/man/gendsa.1 head/secure/usr.bin/openssl/man/genpkey.1 head/secure/usr.bin/openssl/man/genrsa.1 head/secure/usr.bin/openssl/man/list.1 head/secure/usr.bin/openssl/man/nseq.1 head/secure/usr.bin/openssl/man/ocsp.1 head/secure/usr.bin/openssl/man/openssl.1 head/secure/usr.bin/openssl/man/passwd.1 head/secure/usr.bin/openssl/man/pkcs12.1 head/secure/usr.bin/openssl/man/pkcs7.1 head/secure/usr.bin/openssl/man/pkcs8.1 head/secure/usr.bin/openssl/man/pkey.1 head/secure/usr.bin/openssl/man/pkeyparam.1 head/secure/usr.bin/openssl/man/pkeyutl.1 head/secure/usr.bin/openssl/man/prime.1 head/secure/usr.bin/openssl/man/rand.1 head/secure/usr.bin/openssl/man/req.1 head/secure/usr.bin/openssl/man/rsa.1 head/secure/usr.bin/openssl/man/rsautl.1 head/secure/usr.bin/openssl/man/s_client.1 head/secure/usr.bin/openssl/man/s_server.1 head/secure/usr.bin/openssl/man/s_time.1 head/secure/usr.bin/openssl/man/sess_id.1 head/secure/usr.bin/openssl/man/smime.1 head/secure/usr.bin/openssl/man/speed.1 head/secure/usr.bin/openssl/man/spkac.1 head/secure/usr.bin/openssl/man/srp.1 head/secure/usr.bin/openssl/man/storeutl.1 head/secure/usr.bin/openssl/man/ts.1 head/secure/usr.bin/openssl/man/tsget.1 head/secure/usr.bin/openssl/man/verify.1 head/secure/usr.bin/openssl/man/version.1 head/secure/usr.bin/openssl/man/x509.1 Directory Properties: head/crypto/openssl/ (props changed) head/secure/lib/libcrypto/Version.map (props changed) Modified: head/crypto/openssl/CHANGES ============================================================================== --- head/crypto/openssl/CHANGES Tue Nov 20 21:04:20 2018 (r340702) +++ head/crypto/openssl/CHANGES Tue Nov 20 21:10:04 2018 (r340703) @@ -7,6 +7,42 @@ https://github.com/openssl/openssl/commits/ and pick the appropriate release branch. + Changes between 1.1.1 and 1.1.1a [20 Nov 2018] + + *) Timing vulnerability in DSA signature generation + + The OpenSSL DSA signature algorithm has been shown to be vulnerable to a + timing side channel attack. An attacker could use variations in the signing + algorithm to recover the private key. + + This issue was reported to OpenSSL on 16th October 2018 by Samuel Weiser. + (CVE-2018-0734) + [Paul Dale] + + *) Timing vulnerability in ECDSA signature generation + + The OpenSSL ECDSA signature algorithm has been shown to be vulnerable to a + timing side channel attack. An attacker could use variations in the signing + algorithm to recover the private key. + + This issue was reported to OpenSSL on 25th October 2018 by Samuel Weiser. + (CVE-2018-0735) + [Paul Dale] + + *) Added EVP_PKEY_ECDH_KDF_X9_63 and ecdh_KDF_X9_63() as replacements for + the EVP_PKEY_ECDH_KDF_X9_62 KDF type and ECDH_KDF_X9_62(). The old names + are retained for backwards compatibility. + [Antoine Salon] + + *) Fixed the issue that RAND_add()/RAND_seed() silently discards random input + if its length exceeds 4096 bytes. The limit has been raised to a buffer size + of two gigabytes and the error handling improved. + + This issue was reported to OpenSSL by Dr. Falko Strenzke. It has been + categorized as a normal bug, not a security issue, because the DRBG reseeds + automatically and is fully functional even without additional randomness + provided by the application. + Changes between 1.1.0i and 1.1.1 [11 Sep 2018] *) Add a new ClientHello callback. Provides a callback interface that gives @@ -13103,4 +13139,3 @@ des-cbc 3624.96k 5258.21k 5530.91k *) A minor bug in ssl/s3_clnt.c where there would always be 4 0 bytes sent in the client random. [Edward Bishop ] - Modified: head/crypto/openssl/Configure ============================================================================== --- head/crypto/openssl/Configure Tue Nov 20 21:04:20 2018 (r340702) +++ head/crypto/openssl/Configure Tue Nov 20 21:10:04 2018 (r340703) @@ -1013,13 +1013,18 @@ if (scalar(@seed_sources) == 0) { if (scalar(grep { $_ eq 'none' } @seed_sources) > 0) { die "Cannot seed with none and anything else" if scalar(@seed_sources) > 1; warn <<_____ if scalar(@seed_sources) == 1; -You have selected the --with-rand-seed=none option, which effectively disables -automatic reseeding of the OpenSSL random generator. All operations depending -on the random generator such as creating keys will not work unless the random -generator is seeded manually by the application. -Please read the 'Note on random number generation' section in the INSTALL -instructions and the RAND_DRBG(7) manual page for more details. +============================== WARNING =============================== +You have selected the --with-rand-seed=none option, which effectively +disables automatic reseeding of the OpenSSL random generator. +All operations depending on the random generator such as creating keys +will not work unless the random generator is seeded manually by the +application. + +Please read the 'Note on random number generation' section in the +INSTALL instructions and the RAND_DRBG(7) manual page for more details. +============================== WARNING =============================== + _____ } push @{$config{openssl_other_defines}}, @@ -2174,6 +2179,16 @@ EOF # Massage the result + # If the user configured no-shared, we allow no shared sources + if ($disabled{shared}) { + foreach (keys %{$unified_info{shared_sources}}) { + foreach (keys %{$unified_info{shared_sources}->{$_}}) { + delete $unified_info{sources}->{$_}; + } + } + $unified_info{shared_sources} = {}; + } + # If we depend on a header file or a perl module, add an inclusion of # its directory to allow smoothe inclusion foreach my $dest (keys %{$unified_info{depends}}) { @@ -2198,8 +2213,8 @@ EOF next unless defined($unified_info{includes}->{$dest}->{$k}); my @incs = reverse @{$unified_info{includes}->{$dest}->{$k}}; foreach my $obj (grep /\.o$/, - (keys %{$unified_info{sources}->{$dest}}, - keys %{$unified_info{shared_sources}->{$dest}})) { + (keys %{$unified_info{sources}->{$dest} // {}}, + keys %{$unified_info{shared_sources}->{$dest} // {}})) { foreach my $inc (@incs) { unshift @{$unified_info{includes}->{$obj}->{$k}}, $inc unless grep { $_ eq $inc } @{$unified_info{includes}->{$obj}->{$k}}; @@ -2238,6 +2253,42 @@ EOF [ @{$unified_info{includes}->{$dest}->{source}} ]; } } + + # For convenience collect information regarding directories where + # files are generated, those generated files and the end product + # they end up in where applicable. Then, add build rules for those + # directories + my %loopinfo = ( "lib" => [ @{$unified_info{libraries}} ], + "dso" => [ @{$unified_info{engines}} ], + "bin" => [ @{$unified_info{programs}} ], + "script" => [ @{$unified_info{scripts}} ] ); + foreach my $type (keys %loopinfo) { + foreach my $product (@{$loopinfo{$type}}) { + my %dirs = (); + my $pd = dirname($product); + + foreach (@{$unified_info{sources}->{$product} // []}, + @{$unified_info{shared_sources}->{$product} // []}) { + my $d = dirname($_); + + # We don't want to create targets for source directories + # when building out of source + next if ($config{sourcedir} ne $config{builddir} + && $d =~ m|^\Q$config{sourcedir}\E|); + # We already have a "test" target, and the current directory + # is just silly to make a target for + next if $d eq "test" || $d eq "."; + + $dirs{$d} = 1; + push @{$unified_info{dirinfo}->{$d}->{deps}}, $_ + if $d ne $pd; + } + foreach (keys %dirs) { + push @{$unified_info{dirinfo}->{$_}->{products}->{$type}}, + $product; + } + } + } } # For the schemes that need it, we provide the old *_obj configs @@ -2712,10 +2763,16 @@ print <<"EOF"; ********************************************************************** *** *** -*** If you want to report a building issue, please include the *** -*** output from this command: *** +*** OpenSSL has been successfully configured *** *** *** -*** perl configdata.pm --dump *** +*** If you encounter a problem while building, please open an *** +*** issue on GitHub *** +*** and include the output from the following command: *** +*** *** +*** perl configdata.pm --dump *** +*** *** +*** (If you are new to OpenSSL, you might want to consult the *** +*** 'Troubleshooting' section in the INSTALL file first) *** *** *** ********************************************************************** EOF Modified: head/crypto/openssl/INSTALL ============================================================================== --- head/crypto/openssl/INSTALL Tue Nov 20 21:04:20 2018 (r340702) +++ head/crypto/openssl/INSTALL Tue Nov 20 21:10:04 2018 (r340703) @@ -614,8 +614,8 @@ Windows, and as a comma separated list of libraries on VMS. RANLIB The library archive indexer. - RC The Windows resources manipulator. - RCFLAGS Flags for the Windows reources manipulator. + RC The Windows resource compiler. + RCFLAGS Flags for the Windows resource compiler. RM The command to remove files and directories. These cannot be mixed with compiling / linking flags given @@ -969,7 +969,7 @@ BUILDFILE Use a different build file name than the platform default - ("Makefile" on Unixly platforms, "makefile" on native Windows, + ("Makefile" on Unix-like platforms, "makefile" on native Windows, "descrip.mms" on OpenVMS). This requires that there is a corresponding build file template. See Configurations/README for further information. @@ -1171,7 +1171,7 @@ part of the file name, i.e. for OpenSSL 1.1.x, 1.1 is somehow part of the name. - On most POSIXly platforms, shared libraries are named libcrypto.so.1.1 + On most POSIX platforms, shared libraries are named libcrypto.so.1.1 and libssl.so.1.1. on Cygwin, shared libraries are named cygcrypto-1.1.dll and cygssl-1.1.dll @@ -1202,7 +1202,7 @@ The seeding method can be configured using the --with-rand-seed option, which can be used to specify a comma separated list of seed methods. However in most cases OpenSSL will choose a suitable default method, - so it is not necessary to explicitely provide this option. Note also + so it is not necessary to explicitly provide this option. Note also that not all methods are available on all platforms. I) On operating systems which provide a suitable randomness source (in Modified: head/crypto/openssl/NEWS ============================================================================== --- head/crypto/openssl/NEWS Tue Nov 20 21:04:20 2018 (r340702) +++ head/crypto/openssl/NEWS Tue Nov 20 21:10:04 2018 (r340703) @@ -5,6 +5,11 @@ This file gives a brief overview of the major changes between each OpenSSL release. For more details please read the CHANGES file. + Major changes between OpenSSL 1.1.1 and OpenSSL 1.1.1a [20 Nov 2018] + + o Timing vulnerability in DSA signature generation (CVE-2018-0734) + o Timing vulnerability in ECDSA signature generation (CVE-2018-0735) + Major changes between OpenSSL 1.1.0i and OpenSSL 1.1.1 [11 Sep 2018] o Support for TLSv1.3 added (see https://wiki.openssl.org/index.php/TLS1.3 Modified: head/crypto/openssl/README ============================================================================== --- head/crypto/openssl/README Tue Nov 20 21:04:20 2018 (r340702) +++ head/crypto/openssl/README Tue Nov 20 21:10:04 2018 (r340703) @@ -1,5 +1,5 @@ - OpenSSL 1.1.1 11 Sep 2018 + OpenSSL 1.1.1a 20 Nov 2018 Copyright (c) 1998-2018 The OpenSSL Project Copyright (c) 1995-1998 Eric A. Young, Tim J. Hudson Modified: head/crypto/openssl/apps/app_rand.c ============================================================================== --- head/crypto/openssl/apps/app_rand.c Tue Nov 20 21:04:20 2018 (r340702) +++ head/crypto/openssl/apps/app_rand.c Tue Nov 20 21:10:04 2018 (r340703) @@ -1,5 +1,5 @@ /* - * Copyright 1995-2017 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -26,7 +26,6 @@ void app_RAND_load_conf(CONF *c, const char *section) if (RAND_load_file(randfile, -1) < 0) { BIO_printf(bio_err, "Can't load %s into RNG\n", randfile); ERR_print_errors(bio_err); - return; } if (save_rand_file == NULL) save_rand_file = OPENSSL_strdup(randfile); Modified: head/crypto/openssl/apps/apps.c ============================================================================== --- head/crypto/openssl/apps/apps.c Tue Nov 20 21:04:20 2018 (r340702) +++ head/crypto/openssl/apps/apps.c Tue Nov 20 21:10:04 2018 (r340703) @@ -1831,6 +1831,12 @@ X509_NAME *parse_name(const char *cp, long chtype, int opt_getprog(), typestr); continue; } + if (*valstr == '\0') { + BIO_printf(bio_err, + "%s: No value provided for Subject Attribute %s, skipped\n", + opt_getprog(), typestr); + continue; + } if (!X509_NAME_add_entry_by_NID(n, nid, chtype, valstr, strlen((char *)valstr), -1, ismulti ? -1 : 0)) Modified: head/crypto/openssl/apps/apps.h ============================================================================== --- head/crypto/openssl/apps/apps.h Tue Nov 20 21:04:20 2018 (r340702) +++ head/crypto/openssl/apps/apps.h Tue Nov 20 21:10:04 2018 (r340703) @@ -369,7 +369,7 @@ typedef struct string_int_pair_st { # define OPT_FMT_SMIME (1L << 3) # define OPT_FMT_ENGINE (1L << 4) # define OPT_FMT_MSBLOB (1L << 5) -# define OPT_FMT_NETSCAPE (1L << 6) +/* (1L << 6) was OPT_FMT_NETSCAPE, but wasn't used */ # define OPT_FMT_NSS (1L << 7) # define OPT_FMT_TEXT (1L << 8) # define OPT_FMT_HTTP (1L << 9) @@ -378,8 +378,8 @@ typedef struct string_int_pair_st { # define OPT_FMT_PDS (OPT_FMT_PEMDER | OPT_FMT_SMIME) # define OPT_FMT_ANY ( \ OPT_FMT_PEMDER | OPT_FMT_PKCS12 | OPT_FMT_SMIME | \ - OPT_FMT_ENGINE | OPT_FMT_MSBLOB | OPT_FMT_NETSCAPE | \ - OPT_FMT_NSS | OPT_FMT_TEXT | OPT_FMT_HTTP | OPT_FMT_PVK) + OPT_FMT_ENGINE | OPT_FMT_MSBLOB | OPT_FMT_NSS | \ + OPT_FMT_TEXT | OPT_FMT_HTTP | OPT_FMT_PVK) char *opt_progname(const char *argv0); char *opt_getprog(void); Modified: head/crypto/openssl/apps/ca.c ============================================================================== --- head/crypto/openssl/apps/ca.c Tue Nov 20 21:04:20 2018 (r340702) +++ head/crypto/openssl/apps/ca.c Tue Nov 20 21:10:04 2018 (r340703) @@ -605,7 +605,7 @@ end_of_options: /* * outdir is a directory spec, but access() for VMS demands a * filename. We could use the DEC C routine to convert the - * directory syntax to Unixly, and give that to app_isdir, + * directory syntax to Unix, and give that to app_isdir, * but for now the fopen will catch the error if it's not a * directory */ @@ -976,7 +976,7 @@ end_of_options: BIO_printf(bio_err, "Write out database with %d new entries\n", sk_X509_num(cert_sk)); - if (!rand_ser + if (serialfile != NULL && !save_serial(serialfile, "new", serial, NULL)) goto end; @@ -1044,7 +1044,8 @@ end_of_options: if (sk_X509_num(cert_sk)) { /* Rename the database and the serial file */ - if (!rotate_serial(serialfile, "new", "old")) + if (serialfile != NULL + && !rotate_serial(serialfile, "new", "old")) goto end; if (!rotate_index(dbfile, "new", "old")) @@ -1177,10 +1178,9 @@ end_of_options: } /* we have a CRL number that need updating */ - if (crlnumberfile != NULL) - if (!rand_ser - && !save_serial(crlnumberfile, "new", crlnumber, NULL)) - goto end; + if (crlnumberfile != NULL + && !save_serial(crlnumberfile, "new", crlnumber, NULL)) + goto end; BN_free(crlnumber); crlnumber = NULL; @@ -1195,9 +1195,10 @@ end_of_options: PEM_write_bio_X509_CRL(Sout, crl); - if (crlnumberfile != NULL) /* Rename the crlnumber file */ - if (!rotate_serial(crlnumberfile, "new", "old")) - goto end; + /* Rename the crlnumber file */ + if (crlnumberfile != NULL + && !rotate_serial(crlnumberfile, "new", "old")) + goto end; } /*****************************************************************/ Modified: head/crypto/openssl/apps/ocsp.c ============================================================================== --- head/crypto/openssl/apps/ocsp.c Tue Nov 20 21:04:20 2018 (r340702) +++ head/crypto/openssl/apps/ocsp.c Tue Nov 20 21:10:04 2018 (r340703) @@ -950,6 +950,7 @@ static void spawn_loop(void) sleep(30); break; case 0: /* child */ + OPENSSL_free(kidpids); signal(SIGINT, SIG_DFL); signal(SIGTERM, SIG_DFL); if (termsig) @@ -976,6 +977,7 @@ static void spawn_loop(void) } /* The loop above can only break on termsig */ + OPENSSL_free(kidpids); syslog(LOG_INFO, "terminating on signal: %d", termsig); killall(0, kidpids); } Modified: head/crypto/openssl/apps/openssl.cnf ============================================================================== --- head/crypto/openssl/apps/openssl.cnf Tue Nov 20 21:04:20 2018 (r340702) +++ head/crypto/openssl/apps/openssl.cnf Tue Nov 20 21:10:04 2018 (r340703) @@ -11,7 +11,6 @@ # This definition stops the following lines choking if HOME isn't # defined. HOME = . -RANDFILE = $ENV::HOME/.rnd # Extra OBJECT IDENTIFIER info: #oid_file = $ENV::HOME/.oid @@ -58,7 +57,6 @@ crlnumber = $dir/crlnumber # the current crl number # must be commented out to leave a V1 CRL crl = $dir/crl.pem # The current CRL private_key = $dir/private/cakey.pem# The private key -RANDFILE = $dir/private/.rand # private random number file x509_extensions = usr_cert # The extensions to add to the cert Modified: head/crypto/openssl/apps/opt.c ============================================================================== --- head/crypto/openssl/apps/opt.c Tue Nov 20 21:04:20 2018 (r340702) +++ head/crypto/openssl/apps/opt.c Tue Nov 20 21:10:04 2018 (r340703) @@ -168,7 +168,6 @@ static OPT_PAIR formats[] = { {"smime", OPT_FMT_SMIME}, {"engine", OPT_FMT_ENGINE}, {"msblob", OPT_FMT_MSBLOB}, - {"netscape", OPT_FMT_NETSCAPE}, {"nss", OPT_FMT_NSS}, {"text", OPT_FMT_TEXT}, {"http", OPT_FMT_HTTP}, Modified: head/crypto/openssl/apps/rehash.c ============================================================================== --- head/crypto/openssl/apps/rehash.c Tue Nov 20 21:04:20 2018 (r340702) +++ head/crypto/openssl/apps/rehash.c Tue Nov 20 21:10:04 2018 (r340703) @@ -1,6 +1,6 @@ /* * Copyright 2015-2018 The OpenSSL Project Authors. All Rights Reserved. - * Copyright (c) 2013-2014 Timo Teräs + * Copyright (c) 2013-2014 Timo Teräs * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy Modified: head/crypto/openssl/apps/rsa.c ============================================================================== --- head/crypto/openssl/apps/rsa.c Tue Nov 20 21:04:20 2018 (r340702) +++ head/crypto/openssl/apps/rsa.c Tue Nov 20 21:10:04 2018 (r340703) @@ -38,8 +38,8 @@ typedef enum OPTION_choice { const OPTIONS rsa_options[] = { {"help", OPT_HELP, '-', "Display this summary"}, - {"inform", OPT_INFORM, 'f', "Input format, one of DER NET PEM"}, - {"outform", OPT_OUTFORM, 'f', "Output format, one of DER NET PEM PVK"}, + {"inform", OPT_INFORM, 'f', "Input format, one of DER PEM"}, + {"outform", OPT_OUTFORM, 'f', "Output format, one of DER PEM PVK"}, {"in", OPT_IN, 's', "Input file"}, {"out", OPT_OUT, '>', "Output file"}, {"pubin", OPT_PUBIN, '-', "Expect a public key in input file"}, @@ -269,6 +269,9 @@ int rsa_main(int argc, char **argv) } else if (outformat == FORMAT_MSBLOB || outformat == FORMAT_PVK) { EVP_PKEY *pk; pk = EVP_PKEY_new(); + if (pk == NULL) + goto end; + EVP_PKEY_set1_RSA(pk, rsa); if (outformat == FORMAT_PVK) { if (pubin) { Modified: head/crypto/openssl/apps/s_cb.c ============================================================================== --- head/crypto/openssl/apps/s_cb.c Tue Nov 20 21:04:20 2018 (r340702) +++ head/crypto/openssl/apps/s_cb.c Tue Nov 20 21:10:04 2018 (r340703) @@ -394,7 +394,8 @@ int ssl_print_groups(BIO *out, SSL *s, int noshared) int ssl_print_tmp_key(BIO *out, SSL *s) { EVP_PKEY *key; - if (!SSL_get_server_tmp_key(s, &key)) + + if (!SSL_get_peer_tmp_key(s, &key)) return 1; BIO_puts(out, "Server Temp Key: "); switch (EVP_PKEY_id(key)) { Modified: head/crypto/openssl/apps/s_server.c ============================================================================== --- head/crypto/openssl/apps/s_server.c Tue Nov 20 21:04:20 2018 (r340702) +++ head/crypto/openssl/apps/s_server.c Tue Nov 20 21:10:04 2018 (r340703) @@ -193,9 +193,8 @@ static int psk_find_session_cb(SSL *ssl, const unsigne if (strlen(psk_identity) != identity_len || memcmp(psk_identity, identity, identity_len) != 0) { - BIO_printf(bio_s_out, - "PSK warning: client identity not what we expected" - " (got '%s' expected '%s')\n", identity, psk_identity); + *sess = NULL; + return 1; } if (psksess != NULL) { @@ -1622,6 +1621,11 @@ int s_server_main(int argc, char *argv[]) goto end; } #endif + if (early_data && (www > 0 || rev)) { + BIO_printf(bio_err, + "Can't use -early_data in combination with -www, -WWW, -HTTP, or -rev\n"); + goto end; + } #ifndef OPENSSL_NO_SCTP if (protocol == IPPROTO_SCTP) { Modified: head/crypto/openssl/apps/speed.c ============================================================================== --- head/crypto/openssl/apps/speed.c Tue Nov 20 21:04:20 2018 (r340702) +++ head/crypto/openssl/apps/speed.c Tue Nov 20 21:10:04 2018 (r340703) @@ -2896,7 +2896,7 @@ int speed_main(int argc, char **argv) if (rsa_count <= 1) { /* if longer than 10s, don't do any more */ - for (testnum++; testnum < EC_NUM; testnum++) + for (testnum++; testnum < ECDSA_NUM; testnum++) ecdsa_doit[testnum] = 0; } } Modified: head/crypto/openssl/apps/x509.c ============================================================================== --- head/crypto/openssl/apps/x509.c Tue Nov 20 21:04:20 2018 (r340702) +++ head/crypto/openssl/apps/x509.c Tue Nov 20 21:10:04 2018 (r340703) @@ -67,10 +67,10 @@ typedef enum OPTION_choice { const OPTIONS x509_options[] = { {"help", OPT_HELP, '-', "Display this summary"}, {"inform", OPT_INFORM, 'f', - "Input format - default PEM (one of DER, NET or PEM)"}, + "Input format - default PEM (one of DER or PEM)"}, {"in", OPT_IN, '<', "Input file - default stdin"}, {"outform", OPT_OUTFORM, 'f', - "Output format - default PEM (one of DER, NET or PEM)"}, + "Output format - default PEM (one of DER or PEM)"}, {"out", OPT_OUT, '>', "Output file - default stdout"}, {"keyform", OPT_KEYFORM, 'F', "Private key format - default PEM"}, {"passin", OPT_PASSIN, 's', "Private key password/pass-phrase source"}, Modified: head/crypto/openssl/crypto/LPdir_unix.c ============================================================================== --- head/crypto/openssl/crypto/LPdir_unix.c Tue Nov 20 21:04:20 2018 (r340702) +++ head/crypto/openssl/crypto/LPdir_unix.c Tue Nov 20 21:10:04 2018 (r340703) @@ -51,7 +51,7 @@ #endif /* - * The POSIXly macro for the maximum number of characters in a file path is + * The POSIX macro for the maximum number of characters in a file path is * NAME_MAX. However, some operating systems use PATH_MAX instead. * Therefore, it seems natural to first check for PATH_MAX and use that, and * if it doesn't exist, use NAME_MAX. Modified: head/crypto/openssl/crypto/async/arch/async_posix.h ============================================================================== --- head/crypto/openssl/crypto/async/arch/async_posix.h Tue Nov 20 21:04:20 2018 (r340702) +++ head/crypto/openssl/crypto/async/arch/async_posix.h Tue Nov 20 21:10:04 2018 (r340703) @@ -17,7 +17,8 @@ # include -# if _POSIX_VERSION >= 200112L +# if _POSIX_VERSION >= 200112L \ + && (_POSIX_VERSION < 200809L || defined(__GLIBC__)) # include Modified: head/crypto/openssl/crypto/bio/b_sock2.c ============================================================================== --- head/crypto/openssl/crypto/bio/b_sock2.c Tue Nov 20 21:04:20 2018 (r340702) +++ head/crypto/openssl/crypto/bio/b_sock2.c Tue Nov 20 21:10:04 2018 (r340703) @@ -133,7 +133,9 @@ int BIO_connect(int sock, const BIO_ADDR *addr, int op */ int BIO_bind(int sock, const BIO_ADDR *addr, int options) { +# ifndef OPENSSL_SYS_WINDOWS int on = 1; +# endif if (sock == -1) { BIOerr(BIO_F_BIO_BIND, BIO_R_INVALID_SOCKET); Modified: head/crypto/openssl/crypto/bio/bio_lib.c ============================================================================== --- head/crypto/openssl/crypto/bio/bio_lib.c Tue Nov 20 21:04:20 2018 (r340702) +++ head/crypto/openssl/crypto/bio/bio_lib.c Tue Nov 20 21:10:04 2018 (r340703) @@ -52,7 +52,7 @@ static long bio_call_callback(BIO *b, int oper, const argi = (int)len; } - if (inret && (oper & BIO_CB_RETURN) && bareoper != BIO_CB_CTRL) { + if (inret > 0 && (oper & BIO_CB_RETURN) && bareoper != BIO_CB_CTRL) { if (*processed > INT_MAX) return -1; inret = *processed; @@ -60,7 +60,7 @@ static long bio_call_callback(BIO *b, int oper, const ret = b->callback(b, oper, argp, argi, argl, inret); - if (ret >= 0 && (oper & BIO_CB_RETURN) && bareoper != BIO_CB_CTRL) { + if (ret > 0 && (oper & BIO_CB_RETURN) && bareoper != BIO_CB_CTRL) { *processed = (size_t)ret; ret = 1; } Modified: head/crypto/openssl/crypto/bio/bss_log.c ============================================================================== --- head/crypto/openssl/crypto/bio/bss_log.c Tue Nov 20 21:04:20 2018 (r340702) +++ head/crypto/openssl/crypto/bio/bss_log.c Tue Nov 20 21:10:04 2018 (r340703) @@ -408,4 +408,9 @@ static void xcloselog(BIO *bp) # endif /* Unix */ +#else /* NO_SYSLOG */ +const BIO_METHOD *BIO_s_log(void) +{ + return NULL; +} #endif /* NO_SYSLOG */ Modified: head/crypto/openssl/crypto/bn/asm/x86_64-gcc.c ============================================================================== --- head/crypto/openssl/crypto/bn/asm/x86_64-gcc.c Tue Nov 20 21:04:20 2018 (r340702) +++ head/crypto/openssl/crypto/bn/asm/x86_64-gcc.c Tue Nov 20 21:10:04 2018 (r340703) @@ -1,5 +1,5 @@ /* - * Copyright 2002-2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2002-2018 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -63,12 +63,6 @@ * very much like 64-bit code compiled with no-asm on the same * machine. */ - -# if defined(_WIN64) || !defined(__LP64__) -# define BN_ULONG unsigned long long -# else -# define BN_ULONG unsigned long -# endif # undef mul # undef mul_add Modified: head/crypto/openssl/crypto/bn/bn_exp.c ============================================================================== --- head/crypto/openssl/crypto/bn/bn_exp.c Tue Nov 20 21:04:20 2018 (r340702) +++ head/crypto/openssl/crypto/bn/bn_exp.c Tue Nov 20 21:10:04 2018 (r340703) @@ -1077,7 +1077,7 @@ int BN_mod_exp_mont_consttime(BIGNUM *rr, const BIGNUM * is not only slower but also makes each bit vulnerable to * EM (and likely other) side-channel attacks like One&Done * (for details see "One&Done: A Single-Decryption EM-Based - * Attack on OpenSSL’s Constant-Time Blinded RSA" by M. Alam, + * Attack on OpenSSL's Constant-Time Blinded RSA" by M. Alam, * H. Khan, M. Dey, N. Sinha, R. Callan, A. Zajic, and * M. Prvulovic, in USENIX Security'18) */ Modified: head/crypto/openssl/crypto/bn/bn_lib.c ============================================================================== --- head/crypto/openssl/crypto/bn/bn_lib.c Tue Nov 20 21:04:20 2018 (r340702) +++ head/crypto/openssl/crypto/bn/bn_lib.c Tue Nov 20 21:10:04 2018 (r340703) @@ -767,26 +767,30 @@ void BN_consttime_swap(BN_ULONG condition, BIGNUM *a, b->neg ^= t; /*- - * Idea behind BN_FLG_STATIC_DATA is actually to - * indicate that data may not be written to. - * Intention is actually to treat it as it's - * read-only data, and some (if not most) of it does - * reside in read-only segment. In other words - * observation of BN_FLG_STATIC_DATA in - * BN_consttime_swap should be treated as fatal - * condition. It would either cause SEGV or - * effectively cause data corruption. - * BN_FLG_MALLOCED refers to BN structure itself, - * and hence must be preserved. Remaining flags are - * BN_FLG_CONSTIME and BN_FLG_SECURE. Latter must be - * preserved, because it determines how x->d was - * allocated and hence how to free it. This leaves - * BN_FLG_CONSTTIME that one can do something about. - * To summarize it's sufficient to mask and swap - * BN_FLG_CONSTTIME alone. BN_FLG_STATIC_DATA should - * be treated as fatal. + * BN_FLG_STATIC_DATA: indicates that data may not be written to. Intention + * is actually to treat it as it's read-only data, and some (if not most) + * of it does reside in read-only segment. In other words observation of + * BN_FLG_STATIC_DATA in BN_consttime_swap should be treated as fatal + * condition. It would either cause SEGV or effectively cause data + * corruption. + * + * BN_FLG_MALLOCED: refers to BN structure itself, and hence must be + * preserved. + * + * BN_FLG_SECURE: must be preserved, because it determines how x->d was + * allocated and hence how to free it. + * + * BN_FLG_CONSTTIME: sufficient to mask and swap + * + * BN_FLG_FIXED_TOP: indicates that we haven't called bn_correct_top() on + * the data, so the d array may be padded with additional 0 values (i.e. + * top could be greater than the minimal value that it could be). We should + * be swapping it */ - t = ((a->flags ^ b->flags) & BN_FLG_CONSTTIME) & condition; + +#define BN_CONSTTIME_SWAP_FLAGS (BN_FLG_CONSTTIME | BN_FLG_FIXED_TOP) + + t = ((a->flags ^ b->flags) & BN_CONSTTIME_SWAP_FLAGS) & condition; a->flags ^= t; b->flags ^= t; Modified: head/crypto/openssl/crypto/build.info ============================================================================== --- head/crypto/openssl/crypto/build.info Tue Nov 20 21:04:20 2018 (r340702) +++ head/crypto/openssl/crypto/build.info Tue Nov 20 21:10:04 2018 (r340703) @@ -2,7 +2,7 @@ LIBS=../libcrypto SOURCE[../libcrypto]=\ cryptlib.c mem.c mem_dbg.c cversion.c ex_data.c cpt_err.c \ ebcdic.c uid.c o_time.c o_str.c o_dir.c o_fopen.c ctype.c \ - threads_pthread.c threads_win.c threads_none.c \ + threads_pthread.c threads_win.c threads_none.c getenv.c \ o_init.c o_fips.c mem_sec.c init.c {- $target{cpuid_asm_src} -} \ {- $target{uplink_aux_src} -} EXTRA= ../ms/uplink-x86.pl ../ms/uplink.c ../ms/applink.c \ Modified: head/crypto/openssl/crypto/conf/conf_api.c ============================================================================== --- head/crypto/openssl/crypto/conf/conf_api.c Tue Nov 20 21:04:20 2018 (r340702) +++ head/crypto/openssl/crypto/conf/conf_api.c Tue Nov 20 21:10:04 2018 (r340703) @@ -10,6 +10,7 @@ /* Part of the code in here was originally in conf.c, which is now removed */ #include "e_os.h" +#include "internal/cryptlib.h" #include #include #include @@ -82,7 +83,7 @@ char *_CONF_get_string(const CONF *conf, const char *s if (v != NULL) return v->value; if (strcmp(section, "ENV") == 0) { - p = getenv(name); + p = ossl_safe_getenv(name); if (p != NULL) return p; } @@ -95,7 +96,7 @@ char *_CONF_get_string(const CONF *conf, const char *s else return NULL; } else - return getenv(name); + return ossl_safe_getenv(name); } static unsigned long conf_value_hash(const CONF_VALUE *v) Modified: head/crypto/openssl/crypto/conf/conf_mod.c ============================================================================== --- head/crypto/openssl/crypto/conf/conf_mod.c Tue Nov 20 21:04:20 2018 (r340702) +++ head/crypto/openssl/crypto/conf/conf_mod.c Tue Nov 20 21:10:04 2018 (r340703) @@ -480,11 +480,8 @@ char *CONF_get1_default_config_file(void) char *file, *sep = ""; int len; - if (!OPENSSL_issetugid()) { - file = getenv("OPENSSL_CONF"); - if (file) - return OPENSSL_strdup(file); - } + if ((file = ossl_safe_getenv("OPENSSL_CONF")) != NULL) + return OPENSSL_strdup(file); len = strlen(X509_get_default_cert_area()); #ifndef OPENSSL_SYS_VMS Modified: head/crypto/openssl/crypto/cryptlib.c ============================================================================== --- head/crypto/openssl/crypto/cryptlib.c Tue Nov 20 21:04:20 2018 (r340702) +++ head/crypto/openssl/crypto/cryptlib.c Tue Nov 20 21:10:04 2018 (r340703) @@ -204,7 +204,7 @@ int OPENSSL_isservice(void) if (_OPENSSL_isservice.p == NULL) { HANDLE mod = GetModuleHandle(NULL); - FARPROC f; + FARPROC f = NULL; if (mod != NULL) f = GetProcAddress(mod, "_OPENSSL_isservice"); Modified: head/crypto/openssl/crypto/ct/ct_log.c ============================================================================== --- head/crypto/openssl/crypto/ct/ct_log.c Tue Nov 20 21:04:20 2018 (r340702) +++ head/crypto/openssl/crypto/ct/ct_log.c Tue Nov 20 21:10:04 2018 (r340703) @@ -137,7 +137,7 @@ static int ctlog_new_from_conf(CTLOG **ct_log, const C int CTLOG_STORE_load_default_file(CTLOG_STORE *store) { - const char *fpath = getenv(CTLOG_FILE_EVP); + const char *fpath = ossl_safe_getenv(CTLOG_FILE_EVP); if (fpath == NULL) fpath = CTLOG_FILE; Modified: head/crypto/openssl/crypto/dsa/dsa_gen.c ============================================================================== --- head/crypto/openssl/crypto/dsa/dsa_gen.c Tue Nov 20 21:04:20 2018 (r340702) +++ head/crypto/openssl/crypto/dsa/dsa_gen.c Tue Nov 20 21:10:04 2018 (r340703) @@ -327,6 +327,12 @@ int dsa_builtin_paramgen2(DSA *ret, size_t L, size_t N if (mctx == NULL) goto err; + /* make sure L > N, otherwise we'll get trapped in an infinite loop */ + if (L <= N) { + DSAerr(DSA_F_DSA_BUILTIN_PARAMGEN2, DSA_R_INVALID_PARAMETERS); + goto err; + } + if (evpmd == NULL) { if (N == 160) evpmd = EVP_sha1(); Modified: head/crypto/openssl/crypto/dsa/dsa_ossl.c ============================================================================== --- head/crypto/openssl/crypto/dsa/dsa_ossl.c Tue Nov 20 21:04:20 2018 (r340702) +++ head/crypto/openssl/crypto/dsa/dsa_ossl.c Tue Nov 20 21:10:04 2018 (r340703) @@ -9,6 +9,7 @@ #include #include "internal/cryptlib.h" +#include "internal/bn_int.h" #include #include #include "dsa_locl.h" @@ -23,6 +24,8 @@ static int dsa_do_verify(const unsigned char *dgst, in DSA_SIG *sig, DSA *dsa); static int dsa_init(DSA *dsa); static int dsa_finish(DSA *dsa); +static BIGNUM *dsa_mod_inverse_fermat(const BIGNUM *k, const BIGNUM *q, + BN_CTX *ctx); static DSA_METHOD openssl_dsa_meth = { "OpenSSL DSA method", @@ -178,9 +181,9 @@ static int dsa_sign_setup(DSA *dsa, BN_CTX *ctx_in, { BN_CTX *ctx = NULL; BIGNUM *k, *kinv = NULL, *r = *rp; - BIGNUM *l, *m; + BIGNUM *l; int ret = 0; - int q_bits; + int q_bits, q_words; if (!dsa->p || !dsa->q || !dsa->g) { DSAerr(DSA_F_DSA_SIGN_SETUP, DSA_R_MISSING_PARAMETERS); @@ -189,8 +192,7 @@ static int dsa_sign_setup(DSA *dsa, BN_CTX *ctx_in, k = BN_new(); l = BN_new(); - m = BN_new(); - if (k == NULL || l == NULL || m == NULL) + if (k == NULL || l == NULL) goto err; if (ctx_in == NULL) { @@ -201,9 +203,9 @@ static int dsa_sign_setup(DSA *dsa, BN_CTX *ctx_in, /* Preallocate space */ q_bits = BN_num_bits(dsa->q); - if (!BN_set_bit(k, q_bits) - || !BN_set_bit(l, q_bits) - || !BN_set_bit(m, q_bits)) + q_words = bn_get_top(dsa->q); + if (!bn_wexpand(k, q_words + 2) + || !bn_wexpand(l, q_words + 2)) goto err; /* Get random k */ @@ -221,6 +223,7 @@ static int dsa_sign_setup(DSA *dsa, BN_CTX *ctx_in, } while (BN_is_zero(k)); BN_set_flags(k, BN_FLG_CONSTTIME); + BN_set_flags(l, BN_FLG_CONSTTIME); if (dsa->flags & DSA_FLAG_CACHE_MONT_P) { if (!BN_MONT_CTX_set_locked(&dsa->method_mont_p, @@ -238,14 +241,17 @@ static int dsa_sign_setup(DSA *dsa, BN_CTX *ctx_in, * small timing information leakage. We then choose the sum that is * one bit longer than the modulus. * - * TODO: revisit the BN_copy aiming for a memory access agnostic - * conditional copy. + * There are some concerns about the efficacy of doing this. More + * specificly refer to the discussion starting with: + * https://github.com/openssl/openssl/pull/7486#discussion_r228323705 + * The fix is to rework BN so these gymnastics aren't required. */ if (!BN_add(l, k, dsa->q) - || !BN_add(m, l, dsa->q) - || !BN_copy(k, BN_num_bits(l) > q_bits ? l : m)) + || !BN_add(k, l, dsa->q)) goto err; + BN_consttime_swap(BN_is_bit_set(l, q_bits), k, l, q_words + 2); + if ((dsa)->meth->bn_mod_exp != NULL) { if (!dsa->meth->bn_mod_exp(dsa, r, dsa->g, k, dsa->p, ctx, dsa->method_mont_p)) @@ -258,8 +264,8 @@ static int dsa_sign_setup(DSA *dsa, BN_CTX *ctx_in, if (!BN_mod(r, r, dsa->q, ctx)) goto err; - /* Compute part of 's = inv(k) (m + xr) mod q' */ - if ((kinv = BN_mod_inverse(NULL, k, dsa->q, ctx)) == NULL) + /* Compute part of 's = inv(k) (m + xr) mod q' */ + if ((kinv = dsa_mod_inverse_fermat(k, dsa->q, ctx)) == NULL) goto err; BN_clear_free(*kinvp); @@ -273,7 +279,6 @@ static int dsa_sign_setup(DSA *dsa, BN_CTX *ctx_in, BN_CTX_free(ctx); BN_clear_free(k); BN_clear_free(l); - BN_clear_free(m); return ret; } @@ -392,4 +397,32 @@ static int dsa_finish(DSA *dsa) { BN_MONT_CTX_free(dsa->method_mont_p); return 1; +} + +/* + * Compute the inverse of k modulo q. + * Since q is prime, Fermat's Little Theorem applies, which reduces this to + * mod-exp operation. Both the exponent and modulus are public information + * so a mod-exp that doesn't leak the base is sufficient. A newly allocated + * BIGNUM is returned which the caller must free. + */ +static BIGNUM *dsa_mod_inverse_fermat(const BIGNUM *k, const BIGNUM *q, + BN_CTX *ctx) +{ + BIGNUM *res = NULL; + BIGNUM *r, *e; + + if ((r = BN_new()) == NULL) + return NULL; + + BN_CTX_start(ctx); + if ((e = BN_CTX_get(ctx)) != NULL + && BN_set_word(r, 2) + && BN_sub(e, q, r) + && BN_mod_exp_mont(r, k, e, q, ctx, NULL)) + res = r; + else + BN_free(r); + BN_CTX_end(ctx); + return res; } Modified: head/crypto/openssl/crypto/ec/ec_ameth.c ============================================================================== --- head/crypto/openssl/crypto/ec/ec_ameth.c Tue Nov 20 21:04:20 2018 (r340702) +++ head/crypto/openssl/crypto/ec/ec_ameth.c Tue Nov 20 21:10:04 2018 (r340703) @@ -699,7 +699,7 @@ static int ecdh_cms_set_kdf_param(EVP_PKEY_CTX *pctx, if (EVP_PKEY_CTX_set_ecdh_cofactor_mode(pctx, cofactor) <= 0) return 0; - if (EVP_PKEY_CTX_set_ecdh_kdf_type(pctx, EVP_PKEY_ECDH_KDF_X9_62) <= 0) + if (EVP_PKEY_CTX_set_ecdh_kdf_type(pctx, EVP_PKEY_ECDH_KDF_X9_63) <= 0) return 0; kdf_md = EVP_get_digestbynid(kdfmd_nid); @@ -864,7 +864,7 @@ static int ecdh_cms_encrypt(CMS_RecipientInfo *ri) ecdh_nid = NID_dh_cofactor_kdf; if (kdf_type == EVP_PKEY_ECDH_KDF_NONE) { - kdf_type = EVP_PKEY_ECDH_KDF_X9_62; + kdf_type = EVP_PKEY_ECDH_KDF_X9_63; if (EVP_PKEY_CTX_set_ecdh_kdf_type(pctx, kdf_type) <= 0) goto err; } else Modified: head/crypto/openssl/crypto/ec/ec_mult.c ============================================================================== --- head/crypto/openssl/crypto/ec/ec_mult.c Tue Nov 20 21:04:20 2018 (r340702) +++ head/crypto/openssl/crypto/ec/ec_mult.c Tue Nov 20 21:10:04 2018 (r340703) @@ -206,8 +206,8 @@ int ec_scalar_mul_ladder(const EC_GROUP *group, EC_POI */ cardinality_bits = BN_num_bits(cardinality); group_top = bn_get_top(cardinality); - if ((bn_wexpand(k, group_top + 1) == NULL) - || (bn_wexpand(lambda, group_top + 1) == NULL)) { + if ((bn_wexpand(k, group_top + 2) == NULL) + || (bn_wexpand(lambda, group_top + 2) == NULL)) { ECerr(EC_F_EC_SCALAR_MUL_LADDER, ERR_R_BN_LIB); goto err; } @@ -244,7 +244,7 @@ int ec_scalar_mul_ladder(const EC_GROUP *group, EC_POI * k := scalar + 2*cardinality */ kbit = BN_is_bit_set(lambda, cardinality_bits); - BN_consttime_swap(kbit, k, lambda, group_top + 1); + BN_consttime_swap(kbit, k, lambda, group_top + 2); group_top = bn_get_top(group->field); if ((bn_wexpand(s->X, group_top) == NULL) Modified: head/crypto/openssl/crypto/ec/ec_pmeth.c ============================================================================== --- head/crypto/openssl/crypto/ec/ec_pmeth.c Tue Nov 20 21:04:20 2018 (r340702) +++ head/crypto/openssl/crypto/ec/ec_pmeth.c Tue Nov 20 21:10:04 2018 (r340703) @@ -209,7 +209,7 @@ static int pkey_ec_kdf_derive(EVP_PKEY_CTX *ctx, if (!pkey_ec_derive(ctx, ktmp, &ktmplen)) goto err; /* Do KDF stuff */ - if (!ECDH_KDF_X9_62(key, *keylen, ktmp, ktmplen, + if (!ecdh_KDF_X9_63(key, *keylen, ktmp, ktmplen, dctx->kdf_ukm, dctx->kdf_ukmlen, dctx->kdf_md)) goto err; rv = 1; @@ -281,7 +281,7 @@ static int pkey_ec_ctrl(EVP_PKEY_CTX *ctx, int type, i case EVP_PKEY_CTRL_EC_KDF_TYPE: if (p1 == -2) return dctx->kdf_type; - if (p1 != EVP_PKEY_ECDH_KDF_NONE && p1 != EVP_PKEY_ECDH_KDF_X9_62) + if (p1 != EVP_PKEY_ECDH_KDF_NONE && p1 != EVP_PKEY_ECDH_KDF_X9_63) return -2; dctx->kdf_type = p1; return 1; Modified: head/crypto/openssl/crypto/ec/ecdh_kdf.c ============================================================================== --- head/crypto/openssl/crypto/ec/ecdh_kdf.c Tue Nov 20 21:04:20 2018 (r340702) +++ head/crypto/openssl/crypto/ec/ecdh_kdf.c Tue Nov 20 21:10:04 2018 (r340703) @@ -1,5 +1,5 @@ /* - * Copyright 2015-2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2015-2018 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -10,12 +10,13 @@ #include #include #include +#include "ec_lcl.h" -/* Key derivation function from X9.62/SECG */ +/* Key derivation function from X9.63/SECG */ /* Way more than we will ever need */ #define ECDH_KDF_MAX (1 << 30) -int ECDH_KDF_X9_62(unsigned char *out, size_t outlen, +int ecdh_KDF_X9_63(unsigned char *out, size_t outlen, const unsigned char *Z, size_t Zlen, const unsigned char *sinfo, size_t sinfolen, const EVP_MD *md) @@ -65,4 +66,16 @@ int ECDH_KDF_X9_62(unsigned char *out, size_t outlen, err: EVP_MD_CTX_free(mctx); return rv; +} + +/*- + * The old name for ecdh_KDF_X9_63 + * Retained for ABI compatibility + */ +int ECDH_KDF_X9_62(unsigned char *out, size_t outlen, + const unsigned char *Z, size_t Zlen, + const unsigned char *sinfo, size_t sinfolen, + const EVP_MD *md) +{ + return ecdh_KDF_X9_63(out, outlen, Z, Zlen, sinfo, sinfolen, md); } Modified: head/crypto/openssl/crypto/engine/eng_devcrypto.c ============================================================================== --- head/crypto/openssl/crypto/engine/eng_devcrypto.c Tue Nov 20 21:04:20 2018 (r340702) +++ head/crypto/openssl/crypto/engine/eng_devcrypto.c Tue Nov 20 21:10:04 2018 (r340703) @@ -28,6 +28,13 @@ # define CHECK_BSD_STYLE_MACROS #endif +/* + * ONE global file descriptor for all sessions. This allows operations + * such as digest session data copying (see digest_copy()), but is also + * saner... why re-open /dev/crypto for every session? + */ +static int cfd; + /****************************************************************************** * * Ciphers @@ -39,7 +46,6 @@ *****/ struct cipher_ctx { - int cfd; struct session_op sess; /* to pass from init to do_cipher */ @@ -69,7 +75,7 @@ static const struct cipher_data_st { { NID_aes_192_cbc, 16, 192 / 8, 16, EVP_CIPH_CBC_MODE, CRYPTO_AES_CBC }, { NID_aes_256_cbc, 16, 256 / 8, 16, EVP_CIPH_CBC_MODE, CRYPTO_AES_CBC }, #ifndef OPENSSL_NO_RC4 - { NID_rc4, 1, 16, 0, CRYPTO_ARC4 }, + { NID_rc4, 1, 16, 0, EVP_CIPH_STREAM_CIPHER, CRYPTO_ARC4 }, *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Tue Nov 20 21:26:32 2018 Return-Path: Delivered-To: svn-src-all@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 B0BA9113E770; Tue, 20 Nov 2018 21:26:31 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.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 6089C84919; Tue, 20 Nov 2018 21:26:31 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 42B3F16E00; Tue, 20 Nov 2018 21:26:31 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAKLQVvR040835; Tue, 20 Nov 2018 21:26:31 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAKLQQSC040809; Tue, 20 Nov 2018 21:26:26 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <201811202126.wAKLQQSC040809@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Tue, 20 Nov 2018 21:26:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r340704 - in stable/11: crypto/openssl crypto/openssl/apps crypto/openssl/crypto crypto/openssl/crypto/bio crypto/openssl/crypto/bn crypto/openssl/crypto/bn/asm crypto/openssl/crypto/co... X-SVN-Group: stable-11 X-SVN-Commit-Author: jkim X-SVN-Commit-Paths: in stable/11: crypto/openssl crypto/openssl/apps crypto/openssl/crypto crypto/openssl/crypto/bio crypto/openssl/crypto/bn crypto/openssl/crypto/bn/asm crypto/openssl/crypto/conf crypto/openssl/crypto/... X-SVN-Commit-Revision: 340704 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 6089C84919 X-Spamd-Result: default: False [0.86 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.60)[0.595,0]; NEURAL_SPAM_MEDIUM(0.24)[0.240,0]; NEURAL_SPAM_LONG(0.02)[0.022,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Nov 2018 21:26:32 -0000 Author: jkim Date: Tue Nov 20 21:26:25 2018 New Revision: 340704 URL: https://svnweb.freebsd.org/changeset/base/340704 Log: Merge OpenSSL 1.0.2q. Added: stable/11/crypto/openssl/crypto/getenv.c - copied unchanged from r340692, vendor-crypto/openssl/dist-1.0.2/crypto/getenv.c Modified: stable/11/crypto/openssl/CHANGES stable/11/crypto/openssl/Makefile stable/11/crypto/openssl/NEWS stable/11/crypto/openssl/README stable/11/crypto/openssl/apps/req.c stable/11/crypto/openssl/config stable/11/crypto/openssl/crypto/Makefile stable/11/crypto/openssl/crypto/bio/b_sock.c stable/11/crypto/openssl/crypto/bn/asm/x86_64-gcc.c stable/11/crypto/openssl/crypto/bn/bn_blind.c stable/11/crypto/openssl/crypto/bn/bn_lib.c stable/11/crypto/openssl/crypto/bn/bn_mod.c stable/11/crypto/openssl/crypto/bn/bn_mont.c stable/11/crypto/openssl/crypto/bn/bn_mul.c stable/11/crypto/openssl/crypto/bn/bn_sqr.c stable/11/crypto/openssl/crypto/bn/bn_x931p.c stable/11/crypto/openssl/crypto/bn_int.h stable/11/crypto/openssl/crypto/conf/Makefile stable/11/crypto/openssl/crypto/conf/conf_api.c stable/11/crypto/openssl/crypto/conf/conf_mod.c stable/11/crypto/openssl/crypto/cryptlib.h stable/11/crypto/openssl/crypto/dsa/dsa_gen.c stable/11/crypto/openssl/crypto/dsa/dsa_ossl.c stable/11/crypto/openssl/crypto/ec/ec_lcl.h stable/11/crypto/openssl/crypto/ec/ec_lib.c stable/11/crypto/openssl/crypto/ec/ec_mult.c stable/11/crypto/openssl/crypto/engine/eng_list.c stable/11/crypto/openssl/crypto/opensslconf.h stable/11/crypto/openssl/crypto/opensslv.h stable/11/crypto/openssl/crypto/pkcs12/p12_init.c stable/11/crypto/openssl/crypto/pkcs7/pk7_lib.c stable/11/crypto/openssl/crypto/rand/Makefile stable/11/crypto/openssl/crypto/rand/md_rand.c stable/11/crypto/openssl/crypto/rand/rand_lcl.h stable/11/crypto/openssl/crypto/rand/rand_lib.c stable/11/crypto/openssl/crypto/rand/randfile.c stable/11/crypto/openssl/crypto/rsa/rsa_eay.c stable/11/crypto/openssl/crypto/ui/ui_openssl.c stable/11/crypto/openssl/crypto/x509/by_dir.c stable/11/crypto/openssl/crypto/x509/by_file.c stable/11/crypto/openssl/crypto/x509/x509_vfy.c stable/11/crypto/openssl/crypto/x509v3/v3_purp.c stable/11/crypto/openssl/doc/apps/crl.pod stable/11/crypto/openssl/doc/apps/req.pod stable/11/crypto/openssl/doc/apps/s_server.pod stable/11/crypto/openssl/doc/crypto/EVP_DigestSignInit.pod stable/11/crypto/openssl/doc/crypto/EVP_DigestVerifyInit.pod stable/11/crypto/openssl/doc/crypto/OPENSSL_VERSION_NUMBER.pod stable/11/crypto/openssl/engines/e_capi.c stable/11/crypto/openssl/ssl/d1_pkt.c stable/11/crypto/openssl/ssl/ssl_ciph.c stable/11/crypto/openssl/ssl/ssl_lib.c stable/11/crypto/openssl/ssl/t1_lib.c stable/11/crypto/openssl/util/domd stable/11/crypto/openssl/util/libeay.num stable/11/secure/lib/libcrypto/Makefile stable/11/secure/lib/libcrypto/Makefile.inc stable/11/secure/lib/libcrypto/Makefile.man stable/11/secure/lib/libcrypto/man/ASN1_OBJECT_new.3 stable/11/secure/lib/libcrypto/man/ASN1_STRING_length.3 stable/11/secure/lib/libcrypto/man/ASN1_STRING_new.3 stable/11/secure/lib/libcrypto/man/ASN1_STRING_print_ex.3 stable/11/secure/lib/libcrypto/man/ASN1_TIME_set.3 stable/11/secure/lib/libcrypto/man/ASN1_generate_nconf.3 stable/11/secure/lib/libcrypto/man/BIO_ctrl.3 stable/11/secure/lib/libcrypto/man/BIO_f_base64.3 stable/11/secure/lib/libcrypto/man/BIO_f_buffer.3 stable/11/secure/lib/libcrypto/man/BIO_f_cipher.3 stable/11/secure/lib/libcrypto/man/BIO_f_md.3 stable/11/secure/lib/libcrypto/man/BIO_f_null.3 stable/11/secure/lib/libcrypto/man/BIO_f_ssl.3 stable/11/secure/lib/libcrypto/man/BIO_find_type.3 stable/11/secure/lib/libcrypto/man/BIO_new.3 stable/11/secure/lib/libcrypto/man/BIO_new_CMS.3 stable/11/secure/lib/libcrypto/man/BIO_push.3 stable/11/secure/lib/libcrypto/man/BIO_read.3 stable/11/secure/lib/libcrypto/man/BIO_s_accept.3 stable/11/secure/lib/libcrypto/man/BIO_s_bio.3 stable/11/secure/lib/libcrypto/man/BIO_s_connect.3 stable/11/secure/lib/libcrypto/man/BIO_s_fd.3 stable/11/secure/lib/libcrypto/man/BIO_s_file.3 stable/11/secure/lib/libcrypto/man/BIO_s_mem.3 stable/11/secure/lib/libcrypto/man/BIO_s_null.3 stable/11/secure/lib/libcrypto/man/BIO_s_socket.3 stable/11/secure/lib/libcrypto/man/BIO_set_callback.3 stable/11/secure/lib/libcrypto/man/BIO_should_retry.3 stable/11/secure/lib/libcrypto/man/BN_BLINDING_new.3 stable/11/secure/lib/libcrypto/man/BN_CTX_new.3 stable/11/secure/lib/libcrypto/man/BN_CTX_start.3 stable/11/secure/lib/libcrypto/man/BN_add.3 stable/11/secure/lib/libcrypto/man/BN_add_word.3 stable/11/secure/lib/libcrypto/man/BN_bn2bin.3 stable/11/secure/lib/libcrypto/man/BN_cmp.3 stable/11/secure/lib/libcrypto/man/BN_copy.3 stable/11/secure/lib/libcrypto/man/BN_generate_prime.3 stable/11/secure/lib/libcrypto/man/BN_mod_inverse.3 stable/11/secure/lib/libcrypto/man/BN_mod_mul_montgomery.3 stable/11/secure/lib/libcrypto/man/BN_mod_mul_reciprocal.3 stable/11/secure/lib/libcrypto/man/BN_new.3 stable/11/secure/lib/libcrypto/man/BN_num_bytes.3 stable/11/secure/lib/libcrypto/man/BN_rand.3 stable/11/secure/lib/libcrypto/man/BN_set_bit.3 stable/11/secure/lib/libcrypto/man/BN_swap.3 stable/11/secure/lib/libcrypto/man/BN_zero.3 stable/11/secure/lib/libcrypto/man/CMS_add0_cert.3 stable/11/secure/lib/libcrypto/man/CMS_add1_recipient_cert.3 stable/11/secure/lib/libcrypto/man/CMS_add1_signer.3 stable/11/secure/lib/libcrypto/man/CMS_compress.3 stable/11/secure/lib/libcrypto/man/CMS_decrypt.3 stable/11/secure/lib/libcrypto/man/CMS_encrypt.3 stable/11/secure/lib/libcrypto/man/CMS_final.3 stable/11/secure/lib/libcrypto/man/CMS_get0_RecipientInfos.3 stable/11/secure/lib/libcrypto/man/CMS_get0_SignerInfos.3 stable/11/secure/lib/libcrypto/man/CMS_get0_type.3 stable/11/secure/lib/libcrypto/man/CMS_get1_ReceiptRequest.3 stable/11/secure/lib/libcrypto/man/CMS_sign.3 stable/11/secure/lib/libcrypto/man/CMS_sign_receipt.3 stable/11/secure/lib/libcrypto/man/CMS_uncompress.3 stable/11/secure/lib/libcrypto/man/CMS_verify.3 stable/11/secure/lib/libcrypto/man/CMS_verify_receipt.3 stable/11/secure/lib/libcrypto/man/CONF_modules_free.3 stable/11/secure/lib/libcrypto/man/CONF_modules_load_file.3 stable/11/secure/lib/libcrypto/man/CRYPTO_set_ex_data.3 stable/11/secure/lib/libcrypto/man/DH_generate_key.3 stable/11/secure/lib/libcrypto/man/DH_generate_parameters.3 stable/11/secure/lib/libcrypto/man/DH_get_ex_new_index.3 stable/11/secure/lib/libcrypto/man/DH_new.3 stable/11/secure/lib/libcrypto/man/DH_set_method.3 stable/11/secure/lib/libcrypto/man/DH_size.3 stable/11/secure/lib/libcrypto/man/DSA_SIG_new.3 stable/11/secure/lib/libcrypto/man/DSA_do_sign.3 stable/11/secure/lib/libcrypto/man/DSA_dup_DH.3 stable/11/secure/lib/libcrypto/man/DSA_generate_key.3 stable/11/secure/lib/libcrypto/man/DSA_generate_parameters.3 stable/11/secure/lib/libcrypto/man/DSA_get_ex_new_index.3 stable/11/secure/lib/libcrypto/man/DSA_new.3 stable/11/secure/lib/libcrypto/man/DSA_set_method.3 stable/11/secure/lib/libcrypto/man/DSA_sign.3 stable/11/secure/lib/libcrypto/man/DSA_size.3 stable/11/secure/lib/libcrypto/man/EC_GFp_simple_method.3 stable/11/secure/lib/libcrypto/man/EC_GROUP_copy.3 stable/11/secure/lib/libcrypto/man/EC_GROUP_new.3 stable/11/secure/lib/libcrypto/man/EC_KEY_new.3 stable/11/secure/lib/libcrypto/man/EC_POINT_add.3 stable/11/secure/lib/libcrypto/man/EC_POINT_new.3 stable/11/secure/lib/libcrypto/man/ERR_GET_LIB.3 stable/11/secure/lib/libcrypto/man/ERR_clear_error.3 stable/11/secure/lib/libcrypto/man/ERR_error_string.3 stable/11/secure/lib/libcrypto/man/ERR_get_error.3 stable/11/secure/lib/libcrypto/man/ERR_load_crypto_strings.3 stable/11/secure/lib/libcrypto/man/ERR_load_strings.3 stable/11/secure/lib/libcrypto/man/ERR_print_errors.3 stable/11/secure/lib/libcrypto/man/ERR_put_error.3 stable/11/secure/lib/libcrypto/man/ERR_remove_state.3 stable/11/secure/lib/libcrypto/man/ERR_set_mark.3 stable/11/secure/lib/libcrypto/man/EVP_BytesToKey.3 stable/11/secure/lib/libcrypto/man/EVP_DigestInit.3 stable/11/secure/lib/libcrypto/man/EVP_DigestSignInit.3 stable/11/secure/lib/libcrypto/man/EVP_DigestVerifyInit.3 stable/11/secure/lib/libcrypto/man/EVP_EncodeInit.3 stable/11/secure/lib/libcrypto/man/EVP_EncryptInit.3 stable/11/secure/lib/libcrypto/man/EVP_OpenInit.3 stable/11/secure/lib/libcrypto/man/EVP_PKEY_CTX_ctrl.3 stable/11/secure/lib/libcrypto/man/EVP_PKEY_CTX_new.3 stable/11/secure/lib/libcrypto/man/EVP_PKEY_cmp.3 stable/11/secure/lib/libcrypto/man/EVP_PKEY_decrypt.3 stable/11/secure/lib/libcrypto/man/EVP_PKEY_derive.3 stable/11/secure/lib/libcrypto/man/EVP_PKEY_encrypt.3 stable/11/secure/lib/libcrypto/man/EVP_PKEY_get_default_digest.3 stable/11/secure/lib/libcrypto/man/EVP_PKEY_keygen.3 stable/11/secure/lib/libcrypto/man/EVP_PKEY_meth_new.3 stable/11/secure/lib/libcrypto/man/EVP_PKEY_new.3 stable/11/secure/lib/libcrypto/man/EVP_PKEY_print_private.3 stable/11/secure/lib/libcrypto/man/EVP_PKEY_set1_RSA.3 stable/11/secure/lib/libcrypto/man/EVP_PKEY_sign.3 stable/11/secure/lib/libcrypto/man/EVP_PKEY_verify.3 stable/11/secure/lib/libcrypto/man/EVP_PKEY_verify_recover.3 stable/11/secure/lib/libcrypto/man/EVP_SealInit.3 stable/11/secure/lib/libcrypto/man/EVP_SignInit.3 stable/11/secure/lib/libcrypto/man/EVP_VerifyInit.3 stable/11/secure/lib/libcrypto/man/OBJ_nid2obj.3 stable/11/secure/lib/libcrypto/man/OPENSSL_Applink.3 stable/11/secure/lib/libcrypto/man/OPENSSL_VERSION_NUMBER.3 stable/11/secure/lib/libcrypto/man/OPENSSL_config.3 stable/11/secure/lib/libcrypto/man/OPENSSL_ia32cap.3 stable/11/secure/lib/libcrypto/man/OPENSSL_instrument_bus.3 stable/11/secure/lib/libcrypto/man/OPENSSL_load_builtin_modules.3 stable/11/secure/lib/libcrypto/man/OpenSSL_add_all_algorithms.3 stable/11/secure/lib/libcrypto/man/PEM_write_bio_CMS_stream.3 stable/11/secure/lib/libcrypto/man/PEM_write_bio_PKCS7_stream.3 stable/11/secure/lib/libcrypto/man/PKCS12_create.3 stable/11/secure/lib/libcrypto/man/PKCS12_parse.3 stable/11/secure/lib/libcrypto/man/PKCS7_decrypt.3 stable/11/secure/lib/libcrypto/man/PKCS7_encrypt.3 stable/11/secure/lib/libcrypto/man/PKCS7_sign.3 stable/11/secure/lib/libcrypto/man/PKCS7_sign_add_signer.3 stable/11/secure/lib/libcrypto/man/PKCS7_verify.3 stable/11/secure/lib/libcrypto/man/RAND_add.3 stable/11/secure/lib/libcrypto/man/RAND_bytes.3 stable/11/secure/lib/libcrypto/man/RAND_cleanup.3 stable/11/secure/lib/libcrypto/man/RAND_egd.3 stable/11/secure/lib/libcrypto/man/RAND_load_file.3 stable/11/secure/lib/libcrypto/man/RAND_set_rand_method.3 stable/11/secure/lib/libcrypto/man/RSA_blinding_on.3 stable/11/secure/lib/libcrypto/man/RSA_check_key.3 stable/11/secure/lib/libcrypto/man/RSA_generate_key.3 stable/11/secure/lib/libcrypto/man/RSA_get_ex_new_index.3 stable/11/secure/lib/libcrypto/man/RSA_new.3 stable/11/secure/lib/libcrypto/man/RSA_padding_add_PKCS1_type_1.3 stable/11/secure/lib/libcrypto/man/RSA_print.3 stable/11/secure/lib/libcrypto/man/RSA_private_encrypt.3 stable/11/secure/lib/libcrypto/man/RSA_public_encrypt.3 stable/11/secure/lib/libcrypto/man/RSA_set_method.3 stable/11/secure/lib/libcrypto/man/RSA_sign.3 stable/11/secure/lib/libcrypto/man/RSA_sign_ASN1_OCTET_STRING.3 stable/11/secure/lib/libcrypto/man/RSA_size.3 stable/11/secure/lib/libcrypto/man/SMIME_read_CMS.3 stable/11/secure/lib/libcrypto/man/SMIME_read_PKCS7.3 stable/11/secure/lib/libcrypto/man/SMIME_write_CMS.3 stable/11/secure/lib/libcrypto/man/SMIME_write_PKCS7.3 stable/11/secure/lib/libcrypto/man/X509_NAME_ENTRY_get_object.3 stable/11/secure/lib/libcrypto/man/X509_NAME_add_entry_by_txt.3 stable/11/secure/lib/libcrypto/man/X509_NAME_get_index_by_NID.3 stable/11/secure/lib/libcrypto/man/X509_NAME_print_ex.3 stable/11/secure/lib/libcrypto/man/X509_STORE_CTX_get_error.3 stable/11/secure/lib/libcrypto/man/X509_STORE_CTX_get_ex_new_index.3 stable/11/secure/lib/libcrypto/man/X509_STORE_CTX_new.3 stable/11/secure/lib/libcrypto/man/X509_STORE_CTX_set_verify_cb.3 stable/11/secure/lib/libcrypto/man/X509_STORE_set_verify_cb_func.3 stable/11/secure/lib/libcrypto/man/X509_VERIFY_PARAM_set_flags.3 stable/11/secure/lib/libcrypto/man/X509_check_host.3 stable/11/secure/lib/libcrypto/man/X509_check_private_key.3 stable/11/secure/lib/libcrypto/man/X509_cmp_time.3 stable/11/secure/lib/libcrypto/man/X509_new.3 stable/11/secure/lib/libcrypto/man/X509_verify_cert.3 stable/11/secure/lib/libcrypto/man/bio.3 stable/11/secure/lib/libcrypto/man/blowfish.3 stable/11/secure/lib/libcrypto/man/bn.3 stable/11/secure/lib/libcrypto/man/bn_internal.3 stable/11/secure/lib/libcrypto/man/buffer.3 stable/11/secure/lib/libcrypto/man/crypto.3 stable/11/secure/lib/libcrypto/man/d2i_ASN1_OBJECT.3 stable/11/secure/lib/libcrypto/man/d2i_CMS_ContentInfo.3 stable/11/secure/lib/libcrypto/man/d2i_DHparams.3 stable/11/secure/lib/libcrypto/man/d2i_DSAPublicKey.3 stable/11/secure/lib/libcrypto/man/d2i_ECPKParameters.3 stable/11/secure/lib/libcrypto/man/d2i_ECPrivateKey.3 stable/11/secure/lib/libcrypto/man/d2i_PKCS8PrivateKey.3 stable/11/secure/lib/libcrypto/man/d2i_PrivateKey.3 stable/11/secure/lib/libcrypto/man/d2i_RSAPublicKey.3 stable/11/secure/lib/libcrypto/man/d2i_X509.3 stable/11/secure/lib/libcrypto/man/d2i_X509_ALGOR.3 stable/11/secure/lib/libcrypto/man/d2i_X509_CRL.3 stable/11/secure/lib/libcrypto/man/d2i_X509_NAME.3 stable/11/secure/lib/libcrypto/man/d2i_X509_REQ.3 stable/11/secure/lib/libcrypto/man/d2i_X509_SIG.3 stable/11/secure/lib/libcrypto/man/des.3 stable/11/secure/lib/libcrypto/man/dh.3 stable/11/secure/lib/libcrypto/man/dsa.3 stable/11/secure/lib/libcrypto/man/ec.3 stable/11/secure/lib/libcrypto/man/ecdsa.3 stable/11/secure/lib/libcrypto/man/engine.3 stable/11/secure/lib/libcrypto/man/err.3 stable/11/secure/lib/libcrypto/man/evp.3 stable/11/secure/lib/libcrypto/man/hmac.3 stable/11/secure/lib/libcrypto/man/i2d_CMS_bio_stream.3 stable/11/secure/lib/libcrypto/man/i2d_PKCS7_bio_stream.3 stable/11/secure/lib/libcrypto/man/lh_stats.3 stable/11/secure/lib/libcrypto/man/lhash.3 stable/11/secure/lib/libcrypto/man/md5.3 stable/11/secure/lib/libcrypto/man/mdc2.3 stable/11/secure/lib/libcrypto/man/pem.3 stable/11/secure/lib/libcrypto/man/rand.3 stable/11/secure/lib/libcrypto/man/rc4.3 stable/11/secure/lib/libcrypto/man/ripemd.3 stable/11/secure/lib/libcrypto/man/rsa.3 stable/11/secure/lib/libcrypto/man/sha.3 stable/11/secure/lib/libcrypto/man/threads.3 stable/11/secure/lib/libcrypto/man/ui.3 stable/11/secure/lib/libcrypto/man/ui_compat.3 stable/11/secure/lib/libcrypto/man/x509.3 stable/11/secure/lib/libssl/man/SSL_CIPHER_get_name.3 stable/11/secure/lib/libssl/man/SSL_COMP_add_compression_method.3 stable/11/secure/lib/libssl/man/SSL_CONF_CTX_new.3 stable/11/secure/lib/libssl/man/SSL_CONF_CTX_set1_prefix.3 stable/11/secure/lib/libssl/man/SSL_CONF_CTX_set_flags.3 stable/11/secure/lib/libssl/man/SSL_CONF_CTX_set_ssl_ctx.3 stable/11/secure/lib/libssl/man/SSL_CONF_cmd.3 stable/11/secure/lib/libssl/man/SSL_CONF_cmd_argv.3 stable/11/secure/lib/libssl/man/SSL_CTX_add1_chain_cert.3 stable/11/secure/lib/libssl/man/SSL_CTX_add_extra_chain_cert.3 stable/11/secure/lib/libssl/man/SSL_CTX_add_session.3 stable/11/secure/lib/libssl/man/SSL_CTX_ctrl.3 stable/11/secure/lib/libssl/man/SSL_CTX_flush_sessions.3 stable/11/secure/lib/libssl/man/SSL_CTX_free.3 stable/11/secure/lib/libssl/man/SSL_CTX_get0_param.3 stable/11/secure/lib/libssl/man/SSL_CTX_get_ex_new_index.3 stable/11/secure/lib/libssl/man/SSL_CTX_get_verify_mode.3 stable/11/secure/lib/libssl/man/SSL_CTX_load_verify_locations.3 stable/11/secure/lib/libssl/man/SSL_CTX_new.3 stable/11/secure/lib/libssl/man/SSL_CTX_sess_number.3 stable/11/secure/lib/libssl/man/SSL_CTX_sess_set_cache_size.3 stable/11/secure/lib/libssl/man/SSL_CTX_sess_set_get_cb.3 stable/11/secure/lib/libssl/man/SSL_CTX_sessions.3 stable/11/secure/lib/libssl/man/SSL_CTX_set1_curves.3 stable/11/secure/lib/libssl/man/SSL_CTX_set1_verify_cert_store.3 stable/11/secure/lib/libssl/man/SSL_CTX_set_alpn_select_cb.3 stable/11/secure/lib/libssl/man/SSL_CTX_set_cert_cb.3 stable/11/secure/lib/libssl/man/SSL_CTX_set_cert_store.3 stable/11/secure/lib/libssl/man/SSL_CTX_set_cert_verify_callback.3 stable/11/secure/lib/libssl/man/SSL_CTX_set_cipher_list.3 stable/11/secure/lib/libssl/man/SSL_CTX_set_client_CA_list.3 stable/11/secure/lib/libssl/man/SSL_CTX_set_client_cert_cb.3 stable/11/secure/lib/libssl/man/SSL_CTX_set_custom_cli_ext.3 stable/11/secure/lib/libssl/man/SSL_CTX_set_default_passwd_cb.3 stable/11/secure/lib/libssl/man/SSL_CTX_set_generate_session_id.3 stable/11/secure/lib/libssl/man/SSL_CTX_set_info_callback.3 stable/11/secure/lib/libssl/man/SSL_CTX_set_max_cert_list.3 stable/11/secure/lib/libssl/man/SSL_CTX_set_mode.3 stable/11/secure/lib/libssl/man/SSL_CTX_set_msg_callback.3 stable/11/secure/lib/libssl/man/SSL_CTX_set_options.3 stable/11/secure/lib/libssl/man/SSL_CTX_set_psk_client_callback.3 stable/11/secure/lib/libssl/man/SSL_CTX_set_quiet_shutdown.3 stable/11/secure/lib/libssl/man/SSL_CTX_set_read_ahead.3 stable/11/secure/lib/libssl/man/SSL_CTX_set_session_cache_mode.3 stable/11/secure/lib/libssl/man/SSL_CTX_set_session_id_context.3 stable/11/secure/lib/libssl/man/SSL_CTX_set_ssl_version.3 stable/11/secure/lib/libssl/man/SSL_CTX_set_timeout.3 stable/11/secure/lib/libssl/man/SSL_CTX_set_tlsext_servername_callback.3 stable/11/secure/lib/libssl/man/SSL_CTX_set_tlsext_status_cb.3 stable/11/secure/lib/libssl/man/SSL_CTX_set_tlsext_ticket_key_cb.3 stable/11/secure/lib/libssl/man/SSL_CTX_set_tmp_dh_callback.3 stable/11/secure/lib/libssl/man/SSL_CTX_set_tmp_rsa_callback.3 stable/11/secure/lib/libssl/man/SSL_CTX_set_verify.3 stable/11/secure/lib/libssl/man/SSL_CTX_use_certificate.3 stable/11/secure/lib/libssl/man/SSL_CTX_use_psk_identity_hint.3 stable/11/secure/lib/libssl/man/SSL_CTX_use_serverinfo.3 stable/11/secure/lib/libssl/man/SSL_SESSION_free.3 stable/11/secure/lib/libssl/man/SSL_SESSION_get_ex_new_index.3 stable/11/secure/lib/libssl/man/SSL_SESSION_get_time.3 stable/11/secure/lib/libssl/man/SSL_accept.3 stable/11/secure/lib/libssl/man/SSL_alert_type_string.3 stable/11/secure/lib/libssl/man/SSL_check_chain.3 stable/11/secure/lib/libssl/man/SSL_clear.3 stable/11/secure/lib/libssl/man/SSL_connect.3 stable/11/secure/lib/libssl/man/SSL_do_handshake.3 stable/11/secure/lib/libssl/man/SSL_export_keying_material.3 stable/11/secure/lib/libssl/man/SSL_free.3 stable/11/secure/lib/libssl/man/SSL_get_SSL_CTX.3 stable/11/secure/lib/libssl/man/SSL_get_ciphers.3 stable/11/secure/lib/libssl/man/SSL_get_client_CA_list.3 stable/11/secure/lib/libssl/man/SSL_get_current_cipher.3 stable/11/secure/lib/libssl/man/SSL_get_default_timeout.3 stable/11/secure/lib/libssl/man/SSL_get_error.3 stable/11/secure/lib/libssl/man/SSL_get_ex_data_X509_STORE_CTX_idx.3 stable/11/secure/lib/libssl/man/SSL_get_ex_new_index.3 stable/11/secure/lib/libssl/man/SSL_get_fd.3 stable/11/secure/lib/libssl/man/SSL_get_peer_cert_chain.3 stable/11/secure/lib/libssl/man/SSL_get_peer_certificate.3 stable/11/secure/lib/libssl/man/SSL_get_psk_identity.3 stable/11/secure/lib/libssl/man/SSL_get_rbio.3 stable/11/secure/lib/libssl/man/SSL_get_session.3 stable/11/secure/lib/libssl/man/SSL_get_verify_result.3 stable/11/secure/lib/libssl/man/SSL_get_version.3 stable/11/secure/lib/libssl/man/SSL_library_init.3 stable/11/secure/lib/libssl/man/SSL_load_client_CA_file.3 stable/11/secure/lib/libssl/man/SSL_new.3 stable/11/secure/lib/libssl/man/SSL_pending.3 stable/11/secure/lib/libssl/man/SSL_read.3 stable/11/secure/lib/libssl/man/SSL_rstate_string.3 stable/11/secure/lib/libssl/man/SSL_session_reused.3 stable/11/secure/lib/libssl/man/SSL_set_bio.3 stable/11/secure/lib/libssl/man/SSL_set_connect_state.3 stable/11/secure/lib/libssl/man/SSL_set_fd.3 stable/11/secure/lib/libssl/man/SSL_set_session.3 stable/11/secure/lib/libssl/man/SSL_set_shutdown.3 stable/11/secure/lib/libssl/man/SSL_set_verify_result.3 stable/11/secure/lib/libssl/man/SSL_shutdown.3 stable/11/secure/lib/libssl/man/SSL_state_string.3 stable/11/secure/lib/libssl/man/SSL_want.3 stable/11/secure/lib/libssl/man/SSL_write.3 stable/11/secure/lib/libssl/man/d2i_SSL_SESSION.3 stable/11/secure/lib/libssl/man/ssl.3 stable/11/secure/usr.bin/openssl/man/CA.pl.1 stable/11/secure/usr.bin/openssl/man/asn1parse.1 stable/11/secure/usr.bin/openssl/man/ca.1 stable/11/secure/usr.bin/openssl/man/ciphers.1 stable/11/secure/usr.bin/openssl/man/cms.1 stable/11/secure/usr.bin/openssl/man/crl.1 stable/11/secure/usr.bin/openssl/man/crl2pkcs7.1 stable/11/secure/usr.bin/openssl/man/dgst.1 stable/11/secure/usr.bin/openssl/man/dhparam.1 stable/11/secure/usr.bin/openssl/man/dsa.1 stable/11/secure/usr.bin/openssl/man/dsaparam.1 stable/11/secure/usr.bin/openssl/man/ec.1 stable/11/secure/usr.bin/openssl/man/ecparam.1 stable/11/secure/usr.bin/openssl/man/enc.1 stable/11/secure/usr.bin/openssl/man/errstr.1 stable/11/secure/usr.bin/openssl/man/gendsa.1 stable/11/secure/usr.bin/openssl/man/genpkey.1 stable/11/secure/usr.bin/openssl/man/genrsa.1 stable/11/secure/usr.bin/openssl/man/nseq.1 stable/11/secure/usr.bin/openssl/man/ocsp.1 stable/11/secure/usr.bin/openssl/man/openssl.1 stable/11/secure/usr.bin/openssl/man/passwd.1 stable/11/secure/usr.bin/openssl/man/pkcs12.1 stable/11/secure/usr.bin/openssl/man/pkcs7.1 stable/11/secure/usr.bin/openssl/man/pkcs8.1 stable/11/secure/usr.bin/openssl/man/pkey.1 stable/11/secure/usr.bin/openssl/man/pkeyparam.1 stable/11/secure/usr.bin/openssl/man/pkeyutl.1 stable/11/secure/usr.bin/openssl/man/rand.1 stable/11/secure/usr.bin/openssl/man/req.1 stable/11/secure/usr.bin/openssl/man/rsa.1 stable/11/secure/usr.bin/openssl/man/rsautl.1 stable/11/secure/usr.bin/openssl/man/s_client.1 stable/11/secure/usr.bin/openssl/man/s_server.1 stable/11/secure/usr.bin/openssl/man/s_time.1 stable/11/secure/usr.bin/openssl/man/sess_id.1 stable/11/secure/usr.bin/openssl/man/smime.1 stable/11/secure/usr.bin/openssl/man/speed.1 stable/11/secure/usr.bin/openssl/man/spkac.1 stable/11/secure/usr.bin/openssl/man/ts.1 stable/11/secure/usr.bin/openssl/man/tsget.1 stable/11/secure/usr.bin/openssl/man/verify.1 stable/11/secure/usr.bin/openssl/man/version.1 stable/11/secure/usr.bin/openssl/man/x509.1 stable/11/secure/usr.bin/openssl/man/x509v3_config.1 Modified: stable/11/crypto/openssl/CHANGES ============================================================================== --- stable/11/crypto/openssl/CHANGES Tue Nov 20 21:10:04 2018 (r340703) +++ stable/11/crypto/openssl/CHANGES Tue Nov 20 21:26:25 2018 (r340704) @@ -7,6 +7,36 @@ https://github.com/openssl/openssl/commits/ and pick the appropriate release branch. + Changes between 1.0.2p and 1.0.2q [20 Nov 2018] + + *) Microarchitecture timing vulnerability in ECC scalar multiplication + + OpenSSL ECC scalar multiplication, used in e.g. ECDSA and ECDH, has been + shown to be vulnerable to a microarchitecture timing side channel attack. + An attacker with sufficient access to mount local timing attacks during + ECDSA signature generation could recover the private key. + + This issue was reported to OpenSSL on 26th October 2018 by Alejandro + Cabrera Aldaya, Billy Brumley, Sohaib ul Hassan, Cesar Pereida Garcia and + Nicola Tuveri. + (CVE-2018-5407) + [Billy Brumley] + + *) Timing vulnerability in DSA signature generation + + The OpenSSL DSA signature algorithm has been shown to be vulnerable to a + timing side channel attack. An attacker could use variations in the signing + algorithm to recover the private key. + + This issue was reported to OpenSSL on 16th October 2018 by Samuel Weiser. + (CVE-2018-0734) + [Paul Dale] + + *) Resolve a compatibility issue in EC_GROUP handling with the FIPS Object + Module, accidentally introduced while backporting security fixes from the + development branch and hindering the use of ECC in FIPS mode. + [Nicola Tuveri] + Changes between 1.0.2o and 1.0.2p [14 Aug 2018] *) Client DoS due to large DH parameter Modified: stable/11/crypto/openssl/Makefile ============================================================================== --- stable/11/crypto/openssl/Makefile Tue Nov 20 21:10:04 2018 (r340703) +++ stable/11/crypto/openssl/Makefile Tue Nov 20 21:26:25 2018 (r340704) @@ -4,18 +4,18 @@ ## Makefile for OpenSSL ## -VERSION=1.0.2p +VERSION=1.0.2q MAJOR=1 MINOR=0.2 SHLIB_VERSION_NUMBER=1.0.0 SHLIB_VERSION_HISTORY= SHLIB_MAJOR=1 SHLIB_MINOR=0.0 -SHLIB_EXT= -PLATFORM=dist -OPTIONS= no-ec_nistp_64_gcc_128 no-gmp no-jpake no-krb5 no-libunbound no-md2 no-rc5 no-rfc3779 no-sctp no-shared no-ssl-trace no-ssl2 no-store no-unit-test no-weak-ssl-ciphers no-zlib no-zlib-dynamic static-engine -CONFIGURE_ARGS=dist -SHLIB_TARGET= +SHLIB_EXT=.so.$(SHLIB_MAJOR).$(SHLIB_MINOR) +PLATFORM=linux-x86_64 +OPTIONS=-Wa,--noexecstack no-ec_nistp_64_gcc_128 no-gmp no-jpake no-krb5 no-libunbound no-md2 no-rc5 no-rfc3779 no-sctp no-shared no-ssl-trace no-ssl2 no-store no-unit-test no-weak-ssl-ciphers no-zlib no-zlib-dynamic static-engine +CONFIGURE_ARGS=linux-x86_64 -Wa,--noexecstack +SHLIB_TARGET=linux-shared # HERE indicates where this Makefile lives. This can be used to indicate # where sub-Makefiles are expected to be. Currently has very limited usage, @@ -59,11 +59,11 @@ OPENSSLDIR=/usr/local/ssl # equal 4. # PKCS1_CHECK - pkcs1 tests. -CC= cc -CFLAG= -O +CC= gcc +CFLAG= -DOPENSSL_THREADS -D_REENTRANT -DDSO_DLFCN -DHAVE_DLFCN_H -Wa,--noexecstack -m64 -DL_ENDIAN -O3 -Wall -DOPENSSL_IA32_SSE2 -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_BN_ASM_GF2m -DRC4_ASM -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DMD5_ASM -DAES_ASM -DVPAES_ASM -DBSAES_ASM -DWHIRLPOOL_ASM -DGHASH_ASM -DECP_NISTZ256_ASM DEPFLAG= -DOPENSSL_NO_EC_NISTP_64_GCC_128 -DOPENSSL_NO_GMP -DOPENSSL_NO_JPAKE -DOPENSSL_NO_LIBUNBOUND -DOPENSSL_NO_MD2 -DOPENSSL_NO_RC5 -DOPENSSL_NO_RFC3779 -DOPENSSL_NO_SCTP -DOPENSSL_NO_SSL_TRACE -DOPENSSL_NO_SSL2 -DOPENSSL_NO_STORE -DOPENSSL_NO_UNIT_TEST -DOPENSSL_NO_WEAK_SSL_CIPHERS PEX_LIBS= -EX_LIBS= +EX_LIBS= -ldl EXE_EXT= ARFLAGS= AR= ar $(ARFLAGS) r @@ -73,7 +73,7 @@ NM= nm PERL= /usr/bin/perl TAR= tar TARFLAGS= --no-recursion -MAKEDEPPROG= cc +MAKEDEPPROG= gcc LIBDIR=lib # We let the C compiler driver to take care of .s files. This is done in @@ -89,23 +89,23 @@ ASFLAG=$(CFLAG) PROCESSOR= # CPUID module collects small commonly used assembler snippets -CPUID_OBJ= mem_clr.o -BN_ASM= bn_asm.o -EC_ASM= +CPUID_OBJ= x86_64cpuid.o +BN_ASM= x86_64-gcc.o x86_64-mont.o x86_64-mont5.o x86_64-gf2m.o rsaz_exp.o rsaz-x86_64.o rsaz-avx2.o +EC_ASM= ecp_nistz256.o ecp_nistz256-x86_64.o DES_ENC= des_enc.o fcrypt_b.o -AES_ENC= aes_core.o aes_cbc.o +AES_ENC= aes-x86_64.o vpaes-x86_64.o bsaes-x86_64.o aesni-x86_64.o aesni-sha1-x86_64.o aesni-sha256-x86_64.o aesni-mb-x86_64.o BF_ENC= bf_enc.o CAST_ENC= c_enc.o -RC4_ENC= rc4_enc.o rc4_skey.o +RC4_ENC= rc4-x86_64.o rc4-md5-x86_64.o RC5_ENC= rc5_enc.o -MD5_ASM_OBJ= -SHA1_ASM_OBJ= +MD5_ASM_OBJ= md5-x86_64.o +SHA1_ASM_OBJ= sha1-x86_64.o sha256-x86_64.o sha512-x86_64.o sha1-mb-x86_64.o sha256-mb-x86_64.o RMD160_ASM_OBJ= -WP_ASM_OBJ= wp_block.o -CMLL_ENC= camellia.o cmll_misc.o cmll_cbc.o -MODES_ASM_OBJ= +WP_ASM_OBJ= wp-x86_64.o +CMLL_ENC= cmll-x86_64.o cmll_misc.o +MODES_ASM_OBJ= ghash-x86_64.o aesni-gcm-x86_64.o ENGINES_ASM_OBJ= -PERLASM_SCHEME= +PERLASM_SCHEME= elf # KRB5 stuff KRB5_INCLUDES= @@ -177,8 +177,8 @@ LIBS= libcrypto.a libssl.a SHARED_CRYPTO=libcrypto$(SHLIB_EXT) SHARED_SSL=libssl$(SHLIB_EXT) SHARED_LIBS= -SHARED_LIBS_LINK_EXTS= -SHARED_LDFLAGS= +SHARED_LIBS_LINK_EXTS=.so.$(SHLIB_MAJOR) .so +SHARED_LDFLAGS=-m64 GENERAL= Makefile BASENAME= openssl Modified: stable/11/crypto/openssl/NEWS ============================================================================== --- stable/11/crypto/openssl/NEWS Tue Nov 20 21:10:04 2018 (r340703) +++ stable/11/crypto/openssl/NEWS Tue Nov 20 21:26:25 2018 (r340704) @@ -5,6 +5,11 @@ This file gives a brief overview of the major changes between each OpenSSL release. For more details please read the CHANGES file. + Major changes between OpenSSL 1.0.2p and OpenSSL 1.0.2q [20 Nov 2018] + + o Microarchitecture timing vulnerability in ECC scalar multiplication (CVE-2018-5407) + o Timing vulnerability in DSA signature generation (CVE-2018-0734) + Major changes between OpenSSL 1.0.2o and OpenSSL 1.0.2p [14 Aug 2018] o Client DoS due to large DH parameter (CVE-2018-0732) Modified: stable/11/crypto/openssl/README ============================================================================== --- stable/11/crypto/openssl/README Tue Nov 20 21:10:04 2018 (r340703) +++ stable/11/crypto/openssl/README Tue Nov 20 21:26:25 2018 (r340704) @@ -1,5 +1,5 @@ - OpenSSL 1.0.2p 14 Aug 2018 + OpenSSL 1.0.2q 20 Nov 2018 Copyright (c) 1998-2018 The OpenSSL Project Copyright (c) 1995-1998 Eric A. Young, Tim J. Hudson Modified: stable/11/crypto/openssl/apps/req.c ============================================================================== --- stable/11/crypto/openssl/apps/req.c Tue Nov 20 21:10:04 2018 (r340703) +++ stable/11/crypto/openssl/apps/req.c Tue Nov 20 21:26:25 2018 (r340704) @@ -659,8 +659,7 @@ int MAIN(int argc, char **argv) } } - BIO_printf(bio_err, "Generating a %ld bit %s private key\n", - newkey, keyalgstr); + BIO_printf(bio_err, "Generating a %s private key\n", keyalgstr); EVP_PKEY_CTX_set_cb(genctx, genpkey_cb); EVP_PKEY_CTX_set_app_data(genctx, bio_err); Modified: stable/11/crypto/openssl/config ============================================================================== --- stable/11/crypto/openssl/config Tue Nov 20 21:10:04 2018 (r340703) +++ stable/11/crypto/openssl/config Tue Nov 20 21:26:25 2018 (r340704) @@ -992,5 +992,6 @@ if [ $? = "0" ]; then fi else echo "This system ($OUT) is not supported. See file INSTALL for details." + exit 1 fi ) Modified: stable/11/crypto/openssl/crypto/Makefile ============================================================================== --- stable/11/crypto/openssl/crypto/Makefile Tue Nov 20 21:10:04 2018 (r340703) +++ stable/11/crypto/openssl/crypto/Makefile Tue Nov 20 21:26:25 2018 (r340704) @@ -37,9 +37,11 @@ TEST=constant_time_test.c LIB= $(TOP)/libcrypto.a SHARED_LIB= libcrypto$(SHLIB_EXT) LIBSRC= cryptlib.c mem.c mem_clr.c mem_dbg.c cversion.c ex_data.c cpt_err.c \ - ebcdic.c uid.c o_time.c o_str.c o_dir.c o_fips.c o_init.c fips_ers.c + ebcdic.c uid.c o_time.c o_str.c o_dir.c o_fips.c o_init.c fips_ers.c \ + getenv.c LIBOBJ= cryptlib.o mem.o mem_dbg.o cversion.o ex_data.o cpt_err.o ebcdic.o \ - uid.o o_time.o o_str.o o_dir.o o_fips.o o_init.o fips_ers.o $(CPUID_OBJ) + uid.o o_time.o o_str.o o_dir.o o_fips.o o_init.o fips_ers.o getenv.o \ + $(CPUID_OBJ) SRC= $(LIBSRC) @@ -179,6 +181,13 @@ ex_data.o: ../include/openssl/ossl_typ.h ../include/op ex_data.o: ../include/openssl/stack.h ../include/openssl/symhacks.h cryptlib.h ex_data.o: ex_data.c fips_ers.o: ../include/openssl/opensslconf.h fips_ers.c +getenv.o: ../e_os.h ../include/openssl/bio.h ../include/openssl/buffer.h +getenv.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h +getenv.o: ../include/openssl/err.h ../include/openssl/lhash.h +getenv.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h +getenv.o: ../include/openssl/ossl_typ.h ../include/openssl/safestack.h +getenv.o: ../include/openssl/stack.h ../include/openssl/symhacks.h cryptlib.h +getenv.o: getenv.c mem.o: ../e_os.h ../include/openssl/bio.h ../include/openssl/buffer.h mem.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h mem.o: ../include/openssl/err.h ../include/openssl/lhash.h Modified: stable/11/crypto/openssl/crypto/bio/b_sock.c ============================================================================== --- stable/11/crypto/openssl/crypto/bio/b_sock.c Tue Nov 20 21:10:04 2018 (r340703) +++ stable/11/crypto/openssl/crypto/bio/b_sock.c Tue Nov 20 21:26:25 2018 (r340704) @@ -56,6 +56,9 @@ * [including the GNU Public Licence.] */ +#define _DEFAULT_SOURCE +#define _BSD_SOURCE + #include #include #include @@ -83,6 +86,11 @@ NETDB_DEFINE_CONTEXT static int wsa_init_done = 0; # endif +# if defined(__GLIBC__) +# define HAVE_GETHOSTBYNAME_R +# define GETHOSTNAME_R_BUF (2 * 1024) +# endif + /* * WSAAPI specifier is required to make indirect calls to run-time * linked WinSock 2 functions used in this module, to be specific @@ -116,7 +124,12 @@ int BIO_get_host_ip(const char *str, unsigned char *ip int i; int err = 1; int locked = 0; - struct hostent *he; + struct hostent *he = NULL; +# ifdef HAVE_GETHOSTBYNAME_R + char buf[GETHOSTNAME_R_BUF]; + struct hostent hostent; + int h_errnop; +# endif i = get_ip(str, ip); if (i < 0) { @@ -138,10 +151,18 @@ int BIO_get_host_ip(const char *str, unsigned char *ip if (i > 0) return (1); + /* if gethostbyname_r is supported, use it. */ +# ifdef HAVE_GETHOSTBYNAME_R + memset(&hostent, 0x00, sizeof(hostent)); + /* gethostbyname_r() sets |he| to NULL on error, we check it further down */ + gethostbyname_r(str, &hostent, buf, sizeof(buf), &he, &h_errnop); +# else /* do a gethostbyname */ CRYPTO_w_lock(CRYPTO_LOCK_GETHOSTBYNAME); locked = 1; he = BIO_gethostbyname(str); +# endif + if (he == NULL) { BIOerr(BIO_F_BIO_GET_HOST_IP, BIO_R_BAD_HOSTNAME_LOOKUP); goto err; Modified: stable/11/crypto/openssl/crypto/bn/asm/x86_64-gcc.c ============================================================================== --- stable/11/crypto/openssl/crypto/bn/asm/x86_64-gcc.c Tue Nov 20 21:10:04 2018 (r340703) +++ stable/11/crypto/openssl/crypto/bn/asm/x86_64-gcc.c Tue Nov 20 21:26:25 2018 (r340704) @@ -55,12 +55,6 @@ * machine. */ -# if defined(_WIN64) || !defined(__LP64__) -# define BN_ULONG unsigned long long -# else -# define BN_ULONG unsigned long -# endif - # undef mul # undef mul_add Modified: stable/11/crypto/openssl/crypto/bn/bn_blind.c ============================================================================== --- stable/11/crypto/openssl/crypto/bn/bn_blind.c Tue Nov 20 21:10:04 2018 (r340703) +++ stable/11/crypto/openssl/crypto/bn/bn_blind.c Tue Nov 20 21:26:25 2018 (r340704) @@ -1,6 +1,6 @@ /* crypto/bn/bn_blind.c */ /* ==================================================================== - * Copyright (c) 1998-2006 The OpenSSL Project. All rights reserved. + * Copyright (c) 1998-2018 The OpenSSL Project. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -206,10 +206,15 @@ int BN_BLINDING_update(BN_BLINDING *b, BN_CTX *ctx) if (!BN_BLINDING_create_param(b, NULL, NULL, ctx, NULL, NULL)) goto err; } else if (!(b->flags & BN_BLINDING_NO_UPDATE)) { - if (!BN_mod_mul(b->A, b->A, b->A, b->mod, ctx)) - goto err; - if (!BN_mod_mul(b->Ai, b->Ai, b->Ai, b->mod, ctx)) - goto err; + if (b->m_ctx != NULL) { + if (!bn_mul_mont_fixed_top(b->Ai, b->Ai, b->Ai, b->m_ctx, ctx) + || !bn_mul_mont_fixed_top(b->A, b->A, b->A, b->m_ctx, ctx)) + goto err; + } else { + if (!BN_mod_mul(b->Ai, b->Ai, b->Ai, b->mod, ctx) + || !BN_mod_mul(b->A, b->A, b->A, b->mod, ctx)) + goto err; + } } ret = 1; @@ -241,13 +246,13 @@ int BN_BLINDING_convert_ex(BIGNUM *n, BIGNUM *r, BN_BL else if (!BN_BLINDING_update(b, ctx)) return (0); - if (r != NULL) { - if (!BN_copy(r, b->Ai)) - ret = 0; - } + if (r != NULL && (BN_copy(r, b->Ai) == NULL)) + return 0; - if (!BN_mod_mul(n, n, b->A, b->mod, ctx)) - ret = 0; + if (b->m_ctx != NULL) + ret = BN_mod_mul_montgomery(n, n, b->A, b->m_ctx, ctx); + else + ret = BN_mod_mul(n, n, b->A, b->mod, ctx); return ret; } @@ -264,14 +269,29 @@ int BN_BLINDING_invert_ex(BIGNUM *n, const BIGNUM *r, bn_check_top(n); - if (r != NULL) - ret = BN_mod_mul(n, n, r, b->mod, ctx); - else { - if (b->Ai == NULL) { - BNerr(BN_F_BN_BLINDING_INVERT_EX, BN_R_NOT_INITIALIZED); - return (0); + if (r == NULL && (r = b->Ai) == NULL) { + BNerr(BN_F_BN_BLINDING_INVERT_EX, BN_R_NOT_INITIALIZED); + return 0; + } + + if (b->m_ctx != NULL) { + /* ensure that BN_mod_mul_montgomery takes pre-defined path */ + if (n->dmax >= r->top) { + size_t i, rtop = r->top, ntop = n->top; + BN_ULONG mask; + + for (i = 0; i < rtop; i++) { + mask = (BN_ULONG)0 - ((i - ntop) >> (8 * sizeof(i) - 1)); + n->d[i] &= mask; + } + mask = (BN_ULONG)0 - ((rtop - ntop) >> (8 * sizeof(ntop) - 1)); + /* always true, if (rtop >= ntop) n->top = r->top; */ + n->top = (int)(rtop & ~mask) | (ntop & mask); + n->flags |= (BN_FLG_FIXED_TOP & ~mask); } - ret = BN_mod_mul(n, n, b->Ai, b->mod, ctx); + ret = BN_mod_mul_montgomery(n, n, r, b->m_ctx, ctx); + } else { + ret = BN_mod_mul(n, n, r, b->mod, ctx); } bn_check_top(n); @@ -366,11 +386,16 @@ BN_BLINDING *BN_BLINDING_create_param(BN_BLINDING *b, } while (1); if (ret->bn_mod_exp != NULL && ret->m_ctx != NULL) { - if (!ret->bn_mod_exp - (ret->A, ret->A, ret->e, ret->mod, ctx, ret->m_ctx)) + if (!ret->bn_mod_exp(ret->A, ret->A, ret->e, ret->mod, ctx, ret->m_ctx)) goto err; } else { if (!BN_mod_exp(ret->A, ret->A, ret->e, ret->mod, ctx)) + goto err; + } + + if (ret->m_ctx != NULL) { + if (!bn_to_mont_fixed_top(ret->Ai, ret->Ai, ret->m_ctx, ctx) + || !bn_to_mont_fixed_top(ret->A, ret->A, ret->m_ctx, ctx)) goto err; } Modified: stable/11/crypto/openssl/crypto/bn/bn_lib.c ============================================================================== --- stable/11/crypto/openssl/crypto/bn/bn_lib.c Tue Nov 20 21:10:04 2018 (r340703) +++ stable/11/crypto/openssl/crypto/bn/bn_lib.c Tue Nov 20 21:26:25 2018 (r340704) @@ -617,26 +617,40 @@ BIGNUM *BN_bin2bn(const unsigned char *s, int len, BIG static int bn2binpad(const BIGNUM *a, unsigned char *to, int tolen) { int n; - size_t i, inc, lasti, j; + size_t i, lasti, j, atop, mask; BN_ULONG l; + /* + * In case |a| is fixed-top, BN_num_bytes can return bogus length, + * but it's assumed that fixed-top inputs ought to be "nominated" + * even for padded output, so it works out... + */ n = BN_num_bytes(a); - if (tolen == -1) + if (tolen == -1) { tolen = n; - else if (tolen < n) - return -1; + } else if (tolen < n) { /* uncommon/unlike case */ + BIGNUM temp = *a; - if (n == 0) { + bn_correct_top(&temp); + n = BN_num_bytes(&temp); + if (tolen < n) + return -1; + } + + /* Swipe through whole available data and don't give away padded zero. */ + atop = a->dmax * BN_BYTES; + if (atop == 0) { OPENSSL_cleanse(to, tolen); return tolen; } - lasti = n - 1; - for (i = 0, inc = 1, j = tolen; j > 0;) { + lasti = atop - 1; + atop = a->top * BN_BYTES; + for (i = 0, j = 0, to += tolen; j < (size_t)tolen; j++) { l = a->d[i / BN_BYTES]; - to[--j] = (unsigned char)(l >> (8 * (i % BN_BYTES)) & (0 - inc)); - inc = (i - lasti) >> (8 * sizeof(i) - 1); - i += inc; /* stay on top limb */ + mask = 0 - ((j - atop) >> (8 * sizeof(i) - 1)); + *--to = (unsigned char)(l >> (8 * (i % BN_BYTES)) & mask); + i += (i - lasti) >> (8 * sizeof(i) - 1); /* stay on last limb */ } return tolen; @@ -888,6 +902,38 @@ void BN_consttime_swap(BN_ULONG condition, BIGNUM *a, t = (a->top ^ b->top) & condition; a->top ^= t; b->top ^= t; + + t = (a->neg ^ b->neg) & condition; + a->neg ^= t; + b->neg ^= t; + + /*- + * BN_FLG_STATIC_DATA: indicates that data may not be written to. Intention + * is actually to treat it as it's read-only data, and some (if not most) + * of it does reside in read-only segment. In other words observation of + * BN_FLG_STATIC_DATA in BN_consttime_swap should be treated as fatal + * condition. It would either cause SEGV or effectively cause data + * corruption. + * + * BN_FLG_MALLOCED: refers to BN structure itself, and hence must be + * preserved. + * + * BN_FLG_SECURE: must be preserved, because it determines how x->d was + * allocated and hence how to free it. + * + * BN_FLG_CONSTTIME: sufficient to mask and swap + * + * BN_FLG_FIXED_TOP: indicates that we haven't called bn_correct_top() on + * the data, so the d array may be padded with additional 0 values (i.e. + * top could be greater than the minimal value that it could be). We should + * be swapping it + */ + +#define BN_CONSTTIME_SWAP_FLAGS (BN_FLG_CONSTTIME | BN_FLG_FIXED_TOP) + + t = ((a->flags ^ b->flags) & BN_CONSTTIME_SWAP_FLAGS) & condition; + a->flags ^= t; + b->flags ^= t; #define BN_CONSTTIME_SWAP(ind) \ do { \ Modified: stable/11/crypto/openssl/crypto/bn/bn_mod.c ============================================================================== --- stable/11/crypto/openssl/crypto/bn/bn_mod.c Tue Nov 20 21:10:04 2018 (r340703) +++ stable/11/crypto/openssl/crypto/bn/bn_mod.c Tue Nov 20 21:26:25 2018 (r340704) @@ -172,7 +172,7 @@ int bn_mod_add_fixed_top(BIGNUM *r, const BIGNUM *a, c if (mtop > sizeof(storage) / sizeof(storage[0]) && (tp = OPENSSL_malloc(mtop * sizeof(BN_ULONG))) == NULL) - return 0; + return 0; ap = a->d != NULL ? a->d : tp; bp = b->d != NULL ? b->d : tp; @@ -197,6 +197,7 @@ int bn_mod_add_fixed_top(BIGNUM *r, const BIGNUM *a, c ((volatile BN_ULONG *)tp)[i] = 0; } r->top = mtop; + r->flags |= BN_FLG_FIXED_TOP; r->neg = 0; if (tp != storage) @@ -222,6 +223,70 @@ int BN_mod_sub(BIGNUM *r, const BIGNUM *a, const BIGNU if (!BN_sub(r, a, b)) return 0; return BN_nnmod(r, r, m, ctx); +} + +/* + * BN_mod_sub variant that may be used if both a and b are non-negative, + * a is less than m, while b is of same bit width as m. It's implemented + * as subtraction followed by two conditional additions. + * + * 0 <= a < m + * 0 <= b < 2^w < 2*m + * + * after subtraction + * + * -2*m < r = a - b < m + * + * Thus it takes up to two conditional additions to make |r| positive. + */ +int bn_mod_sub_fixed_top(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, + const BIGNUM *m) +{ + size_t i, ai, bi, mtop = m->top; + BN_ULONG borrow, carry, ta, tb, mask, *rp; + const BN_ULONG *ap, *bp; + + if (bn_wexpand(r, m->top) == NULL) + return 0; + + rp = r->d; + ap = a->d != NULL ? a->d : rp; + bp = b->d != NULL ? b->d : rp; + + for (i = 0, ai = 0, bi = 0, borrow = 0; i < mtop;) { + mask = (BN_ULONG)0 - ((i - a->top) >> (8 * sizeof(i) - 1)); + ta = ap[ai] & mask; + + mask = (BN_ULONG)0 - ((i - b->top) >> (8 * sizeof(i) - 1)); + tb = bp[bi] & mask; + rp[i] = ta - tb - borrow; + if (ta != tb) + borrow = (ta < tb); + + i++; + ai += (i - a->dmax) >> (8 * sizeof(i) - 1); + bi += (i - b->dmax) >> (8 * sizeof(i) - 1); + } + ap = m->d; + for (i = 0, mask = 0 - borrow, carry = 0; i < mtop; i++) { + ta = ((ap[i] & mask) + carry) & BN_MASK2; + carry = (ta < carry); + rp[i] = (rp[i] + ta) & BN_MASK2; + carry += (rp[i] < ta); + } + borrow -= carry; + for (i = 0, mask = 0 - borrow, carry = 0; i < mtop; i++) { + ta = ((ap[i] & mask) + carry) & BN_MASK2; + carry = (ta < carry); + rp[i] = (rp[i] + ta) & BN_MASK2; + carry += (rp[i] < ta); + } + + r->top = mtop; + r->flags |= BN_FLG_FIXED_TOP; + r->neg = 0; + + return 1; } /* Modified: stable/11/crypto/openssl/crypto/bn/bn_mont.c ============================================================================== --- stable/11/crypto/openssl/crypto/bn/bn_mont.c Tue Nov 20 21:10:04 2018 (r340703) +++ stable/11/crypto/openssl/crypto/bn/bn_mont.c Tue Nov 20 21:26:25 2018 (r340704) @@ -164,10 +164,10 @@ int bn_mul_mont_fixed_top(BIGNUM *r, const BIGNUM *a, bn_check_top(tmp); if (a == b) { - if (!BN_sqr(tmp, a, ctx)) + if (!bn_sqr_fixed_top(tmp, a, ctx)) goto err; } else { - if (!BN_mul(tmp, a, b, ctx)) + if (!bn_mul_fixed_top(tmp, a, b, ctx)) goto err; } /* reduce from aRR to aR */ @@ -190,6 +190,7 @@ static int bn_from_montgomery_word(BIGNUM *ret, BIGNUM BIGNUM *n; BN_ULONG *ap, *np, *rp, n0, v, carry; int nl, max, i; + unsigned int rtop; n = &(mont->N); nl = n->top; @@ -207,12 +208,10 @@ static int bn_from_montgomery_word(BIGNUM *ret, BIGNUM rp = r->d; /* clear the top words of T */ -# if 1 - for (i = r->top; i < max; i++) /* memset? XXX */ - rp[i] = 0; -# else - memset(&(rp[r->top]), 0, (max - r->top) * sizeof(BN_ULONG)); -# endif + for (rtop = r->top, i = 0; i < max; i++) { + v = (BN_ULONG)0 - ((i - rtop) >> (8 * sizeof(rtop) - 1)); + rp[i] &= v; + } r->top = max; r->flags |= BN_FLG_FIXED_TOP; @@ -263,6 +262,18 @@ static int bn_from_montgomery_word(BIGNUM *ret, BIGNUM int BN_from_montgomery(BIGNUM *ret, const BIGNUM *a, BN_MONT_CTX *mont, BN_CTX *ctx) { + int retn; + + retn = bn_from_mont_fixed_top(ret, a, mont, ctx); + bn_correct_top(ret); + bn_check_top(ret); + + return retn; +} + +int bn_from_mont_fixed_top(BIGNUM *ret, const BIGNUM *a, BN_MONT_CTX *mont, + BN_CTX *ctx) +{ int retn = 0; #ifdef MONT_WORD BIGNUM *t; @@ -270,8 +281,6 @@ int BN_from_montgomery(BIGNUM *ret, const BIGNUM *a, B BN_CTX_start(ctx); if ((t = BN_CTX_get(ctx)) && BN_copy(t, a)) { retn = bn_from_montgomery_word(ret, t, mont); - bn_correct_top(ret); - bn_check_top(ret); } BN_CTX_end(ctx); #else /* !MONT_WORD */ Modified: stable/11/crypto/openssl/crypto/bn/bn_mul.c ============================================================================== --- stable/11/crypto/openssl/crypto/bn/bn_mul.c Tue Nov 20 21:10:04 2018 (r340703) +++ stable/11/crypto/openssl/crypto/bn/bn_mul.c Tue Nov 20 21:26:25 2018 (r340704) @@ -936,6 +936,16 @@ void bn_mul_high(BN_ULONG *r, BN_ULONG *a, BN_ULONG *b int BN_mul(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx) { + int ret = bn_mul_fixed_top(r, a, b, ctx); + + bn_correct_top(r); + bn_check_top(r); + + return ret; +} + +int bn_mul_fixed_top(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx) +{ int ret = 0; int top, al, bl; BIGNUM *rr; @@ -1042,7 +1052,7 @@ int BN_mul(BIGNUM *r, const BIGNUM *a, const BIGNUM *b #if defined(BN_MUL_COMBA) || defined(BN_RECURSION) end: #endif - bn_correct_top(rr); + rr->flags |= BN_FLG_FIXED_TOP; if (r != rr && BN_copy(r, rr) == NULL) goto err; Modified: stable/11/crypto/openssl/crypto/bn/bn_sqr.c ============================================================================== --- stable/11/crypto/openssl/crypto/bn/bn_sqr.c Tue Nov 20 21:10:04 2018 (r340703) +++ stable/11/crypto/openssl/crypto/bn/bn_sqr.c Tue Nov 20 21:26:25 2018 (r340704) @@ -66,6 +66,16 @@ */ int BN_sqr(BIGNUM *r, const BIGNUM *a, BN_CTX *ctx) { + int ret = bn_sqr_fixed_top(r, a, ctx); + + bn_correct_top(r); + bn_check_top(r); + + return ret; +} + +int bn_sqr_fixed_top(BIGNUM *r, const BIGNUM *a, BN_CTX *ctx) +{ int max, al; int ret = 0; BIGNUM *tmp, *rr; @@ -136,7 +146,7 @@ int BN_sqr(BIGNUM *r, const BIGNUM *a, BN_CTX *ctx) rr->neg = 0; rr->top = max; - bn_correct_top(rr); + rr->flags |= BN_FLG_FIXED_TOP; if (r != rr && BN_copy(r, rr) == NULL) goto err; Modified: stable/11/crypto/openssl/crypto/bn/bn_x931p.c ============================================================================== --- stable/11/crypto/openssl/crypto/bn/bn_x931p.c Tue Nov 20 21:10:04 2018 (r340703) +++ stable/11/crypto/openssl/crypto/bn/bn_x931p.c Tue Nov 20 21:26:25 2018 (r340704) @@ -4,7 +4,7 @@ * 2005. */ /* ==================================================================== - * Copyright (c) 2005 The OpenSSL Project. All rights reserved. + * Copyright (c) 2005-2018 The OpenSSL Project. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -223,8 +223,10 @@ int BN_X931_generate_Xpq(BIGNUM *Xp, BIGNUM *Xq, int n for (i = 0; i < 1000; i++) { if (!BN_rand(Xq, nbits, 1, 0)) goto err; + /* Check that |Xp - Xq| > 2^(nbits - 100) */ - BN_sub(t, Xp, Xq); + if (!BN_sub(t, Xp, Xq)) + goto err; if (BN_num_bits(t) > (nbits - 100)) break; } Modified: stable/11/crypto/openssl/crypto/bn_int.h ============================================================================== --- stable/11/crypto/openssl/crypto/bn_int.h Tue Nov 20 21:10:04 2018 (r340703) +++ stable/11/crypto/openssl/crypto/bn_int.h Tue Nov 20 21:26:25 2018 (r340704) @@ -7,9 +7,15 @@ */ int bn_mul_mont_fixed_top(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, BN_MONT_CTX *mont, BN_CTX *ctx); +int bn_from_mont_fixed_top(BIGNUM *r, const BIGNUM *a, BN_MONT_CTX *mont, + BN_CTX *ctx); int bn_to_mont_fixed_top(BIGNUM *r, const BIGNUM *a, BN_MONT_CTX *mont, BN_CTX *ctx); int bn_mod_add_fixed_top(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, const BIGNUM *m); +int bn_mod_sub_fixed_top(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, + const BIGNUM *m); +int bn_mul_fixed_top(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx); +int bn_sqr_fixed_top(BIGNUM *r, const BIGNUM *a, BN_CTX *ctx); int bn_bn2binpad(const BIGNUM *a, unsigned char *to, int tolen); Modified: stable/11/crypto/openssl/crypto/conf/Makefile ============================================================================== --- stable/11/crypto/openssl/crypto/conf/Makefile Tue Nov 20 21:10:04 2018 (r340703) +++ stable/11/crypto/openssl/crypto/conf/Makefile Tue Nov 20 21:26:25 2018 (r340704) @@ -80,12 +80,13 @@ clean: # DO NOT DELETE THIS LINE -- make depend depends on it. conf_api.o: ../../e_os.h ../../include/openssl/bio.h -conf_api.o: ../../include/openssl/conf.h ../../include/openssl/conf_api.h -conf_api.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h +conf_api.o: ../../include/openssl/buffer.h ../../include/openssl/conf.h +conf_api.o: ../../include/openssl/conf_api.h ../../include/openssl/crypto.h +conf_api.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h conf_api.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h conf_api.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h conf_api.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h -conf_api.o: ../../include/openssl/symhacks.h conf_api.c +conf_api.o: ../../include/openssl/symhacks.h ../cryptlib.h conf_api.c conf_def.o: ../../e_os.h ../../include/openssl/bio.h conf_def.o: ../../include/openssl/buffer.h ../../include/openssl/conf.h conf_def.o: ../../include/openssl/conf_api.h ../../include/openssl/crypto.h Modified: stable/11/crypto/openssl/crypto/conf/conf_api.c ============================================================================== --- stable/11/crypto/openssl/crypto/conf/conf_api.c Tue Nov 20 21:10:04 2018 (r340703) +++ stable/11/crypto/openssl/crypto/conf/conf_api.c Tue Nov 20 21:26:25 2018 (r340704) @@ -66,6 +66,7 @@ #include #include #include +#include "cryptlib.h" #include #include #include "e_os.h" @@ -141,7 +142,7 @@ char *_CONF_get_string(const CONF *conf, const char *s if (v != NULL) return (v->value); if (strcmp(section, "ENV") == 0) { - p = getenv(name); + p = ossl_safe_getenv(name); if (p != NULL) return (p); } @@ -154,7 +155,7 @@ char *_CONF_get_string(const CONF *conf, const char *s else return (NULL); } else - return (getenv(name)); + return (ossl_safe_getenv(name)); } #if 0 /* There's no way to provide error checking Modified: stable/11/crypto/openssl/crypto/conf/conf_mod.c ============================================================================== --- stable/11/crypto/openssl/crypto/conf/conf_mod.c Tue Nov 20 21:10:04 2018 (r340703) +++ stable/11/crypto/openssl/crypto/conf/conf_mod.c Tue Nov 20 21:26:25 2018 (r340704) @@ -4,7 +4,7 @@ * 2001. */ /* ==================================================================== - * Copyright (c) 2001 The OpenSSL Project. All rights reserved. + * Copyright (c) 2001-2018 The OpenSSL Project. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -530,7 +530,7 @@ char *CONF_get1_default_config_file(void) char *file; int len; - file = getenv("OPENSSL_CONF"); + file = ossl_safe_getenv("OPENSSL_CONF"); if (file) return BUF_strdup(file); Modified: stable/11/crypto/openssl/crypto/cryptlib.h ============================================================================== --- stable/11/crypto/openssl/crypto/cryptlib.h Tue Nov 20 21:10:04 2018 (r340703) +++ stable/11/crypto/openssl/crypto/cryptlib.h Tue Nov 20 21:26:25 2018 (r340704) @@ -104,6 +104,8 @@ void OPENSSL_showfatal(const char *fmta, ...); void *OPENSSL_stderr(void); extern int OPENSSL_NONPIC_relocated; +char *ossl_safe_getenv(const char *); + #ifdef __cplusplus } #endif Modified: stable/11/crypto/openssl/crypto/dsa/dsa_gen.c ============================================================================== --- stable/11/crypto/openssl/crypto/dsa/dsa_gen.c Tue Nov 20 21:10:04 2018 (r340703) +++ stable/11/crypto/openssl/crypto/dsa/dsa_gen.c Tue Nov 20 21:26:25 2018 (r340704) @@ -435,6 +435,12 @@ int dsa_builtin_paramgen2(DSA *ret, size_t L, size_t N EVP_MD_CTX_init(&mctx); + /* make sure L > N, otherwise we'll get trapped in an infinite loop */ + if (L <= N) { + DSAerr(DSA_F_DSA_BUILTIN_PARAMGEN2, DSA_R_INVALID_PARAMETERS); + goto err; + } + if (evpmd == NULL) { if (N == 160) evpmd = EVP_sha1(); Modified: stable/11/crypto/openssl/crypto/dsa/dsa_ossl.c ============================================================================== --- stable/11/crypto/openssl/crypto/dsa/dsa_ossl.c Tue Nov 20 21:10:04 2018 (r340703) +++ stable/11/crypto/openssl/crypto/dsa/dsa_ossl.c Tue Nov 20 21:26:25 2018 (r340704) @@ -73,6 +73,8 @@ static int dsa_do_verify(const unsigned char *dgst, in DSA_SIG *sig, DSA *dsa); static int dsa_init(DSA *dsa); static int dsa_finish(DSA *dsa); +static BIGNUM *dsa_mod_inverse_fermat(const BIGNUM *k, const BIGNUM *q, + BN_CTX *ctx); static DSA_METHOD openssl_dsa_meth = { "OpenSSL DSA method", @@ -279,7 +281,7 @@ static int dsa_sign_setup(DSA *dsa, BN_CTX *ctx_in, BI goto err; /* Preallocate space */ - q_bits = BN_num_bits(dsa->q); + q_bits = BN_num_bits(dsa->q) + sizeof(dsa->q->d[0]) * 16; if (!BN_set_bit(&k, q_bits) || !BN_set_bit(&l, q_bits) || !BN_set_bit(&m, q_bits)) @@ -293,9 +295,9 @@ static int dsa_sign_setup(DSA *dsa, BN_CTX *ctx_in, BI if ((dsa->flags & DSA_FLAG_NO_EXP_CONSTTIME) == 0) { BN_set_flags(&k, BN_FLG_CONSTTIME); + BN_set_flags(&l, BN_FLG_CONSTTIME); } - if (dsa->flags & DSA_FLAG_CACHE_MONT_P) { if (!BN_MONT_CTX_set_locked(&dsa->method_mont_p, CRYPTO_LOCK_DSA, dsa->p, ctx)) @@ -333,8 +335,8 @@ static int dsa_sign_setup(DSA *dsa, BN_CTX *ctx_in, BI if (!BN_mod(r, r, dsa->q, ctx)) goto err; - /* Compute part of 's = inv(k) (m + xr) mod q' */ - if ((kinv = BN_mod_inverse(NULL, &k, dsa->q, ctx)) == NULL) + /* Compute part of 's = inv(k) (m + xr) mod q' */ + if ((kinv = dsa_mod_inverse_fermat(&k, dsa->q, ctx)) == NULL) goto err; if (*kinvp != NULL) @@ -467,4 +469,32 @@ static int dsa_finish(DSA *dsa) if (dsa->method_mont_p) BN_MONT_CTX_free(dsa->method_mont_p); return (1); +} + +/* + * Compute the inverse of k modulo q. + * Since q is prime, Fermat's Little Theorem applies, which reduces this to + * mod-exp operation. Both the exponent and modulus are public information + * so a mod-exp that doesn't leak the base is sufficient. A newly allocated + * BIGNUM is returned which the caller must free. + */ +static BIGNUM *dsa_mod_inverse_fermat(const BIGNUM *k, const BIGNUM *q, + BN_CTX *ctx) +{ + BIGNUM *res = NULL; + BIGNUM *r, e; + + if ((r = BN_new()) == NULL) + return NULL; + + BN_init(&e); + + if (BN_set_word(r, 2) + && BN_sub(&e, q, r) + && BN_mod_exp_mont(r, k, &e, q, ctx, NULL)) + res = r; + else + BN_free(r); + BN_free(&e); + return res; } Modified: stable/11/crypto/openssl/crypto/ec/ec_lcl.h ============================================================================== --- stable/11/crypto/openssl/crypto/ec/ec_lcl.h Tue Nov 20 21:10:04 2018 (r340703) +++ stable/11/crypto/openssl/crypto/ec/ec_lcl.h Tue Nov 20 21:26:25 2018 (r340704) @@ -3,7 +3,7 @@ * Originally written by Bodo Moeller for the OpenSSL project. */ /* ==================================================================== - * Copyright (c) 1998-2010 The OpenSSL Project. All rights reserved. + * Copyright (c) 1998-2018 The OpenSSL Project. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -214,7 +214,7 @@ struct ec_group_st { int asn1_flag; /* flag to control the asn1 encoding */ /* * Kludge: upper bit of ans1_flag is used to denote structure - * version. Is set, then last field is present. This is done + * version. If set, then last field is present. This is done * for interoperation with FIPS code. */ #define EC_GROUP_ASN1_FLAG_MASK 0x7fffffff @@ -549,7 +549,6 @@ void ec_GFp_nistp_points_make_affine_internal(size_t n void ec_GFp_nistp_recode_scalar_bits(unsigned char *sign, unsigned char *digit, unsigned char in); #endif -int ec_precompute_mont_data(EC_GROUP *); #ifdef ECP_NISTZ256_ASM /** Returns GFp methods using montgomery multiplication, with x86-64 optimized Modified: stable/11/crypto/openssl/crypto/ec/ec_lib.c ============================================================================== --- stable/11/crypto/openssl/crypto/ec/ec_lib.c Tue Nov 20 21:10:04 2018 (r340703) +++ stable/11/crypto/openssl/crypto/ec/ec_lib.c Tue Nov 20 21:26:25 2018 (r340704) @@ -70,6 +70,10 @@ const char EC_version[] = "EC" OPENSSL_VERSION_PTEXT; +/* local function prototypes */ + +static int ec_precompute_mont_data(EC_GROUP *group); + /* functions for EC_GROUP objects */ EC_GROUP *EC_GROUP_new(const EC_METHOD *meth) @@ -318,17 +322,25 @@ int EC_GROUP_set_generator(EC_GROUP *group, const EC_P } else BN_zero(&group->cofactor); - /* - * Some groups have an order with - * factors of two, which makes the Montgomery setup fail. - * |group->mont_data| will be NULL in this case. + /*- + * Access to the `mont_data` field of an EC_GROUP struct should always be + * guarded by an EC_GROUP_VERSION(group) check to avoid OOB accesses, as the + * group might come from the FIPS module, which does not define the + * `mont_data` field inside the EC_GROUP structure. */ - if (BN_is_odd(&group->order)) { - return ec_precompute_mont_data(group); + if (EC_GROUP_VERSION(group)) { + /*- + * Some groups have an order with + * factors of two, which makes the Montgomery setup fail. + * |group->mont_data| will be NULL in this case. + */ + if (BN_is_odd(&group->order)) + return ec_precompute_mont_data(group); + + BN_MONT_CTX_free(group->mont_data); + group->mont_data = NULL; } - BN_MONT_CTX_free(group->mont_data); - group->mont_data = NULL; return 1; } @@ -1098,17 +1110,22 @@ int EC_GROUP_have_precompute_mult(const EC_GROUP *grou * been performed */ } -/* +/*- * ec_precompute_mont_data sets |group->mont_data| from |group->order| and * returns one on success. On error it returns zero. + * + * Note: this function must be called only after verifying that + * EC_GROUP_VERSION(group) returns true. + * The reason for this is that access to the `mont_data` field of an EC_GROUP + * struct should always be guarded by an EC_GROUP_VERSION(group) check to avoid + * OOB accesses, as the group might come from the FIPS module, which does not + * define the `mont_data` field inside the EC_GROUP structure. */ +static int ec_precompute_mont_data(EC_GROUP *group) { BN_CTX *ctx = BN_CTX_new(); int ret = 0; - *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Tue Nov 20 21:35:30 2018 Return-Path: Delivered-To: svn-src-all@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 06744113EC39; Tue, 20 Nov 2018 21:35:30 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.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 A52C684F7F; Tue, 20 Nov 2018 21:35:29 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6BB8E16FB1; Tue, 20 Nov 2018 21:35:29 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAKLZT2a046073; Tue, 20 Nov 2018 21:35:29 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAKLZLwh046031; Tue, 20 Nov 2018 21:35:21 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <201811202135.wAKLZLwh046031@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Tue, 20 Nov 2018 21:35:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r340705 - in stable/12: crypto/openssl crypto/openssl/apps crypto/openssl/crypto crypto/openssl/crypto/async/arch crypto/openssl/crypto/bio crypto/openssl/crypto/bn crypto/openssl/crypt... X-SVN-Group: stable-12 X-SVN-Commit-Author: jkim X-SVN-Commit-Paths: in stable/12: crypto/openssl crypto/openssl/apps crypto/openssl/crypto crypto/openssl/crypto/async/arch crypto/openssl/crypto/bio crypto/openssl/crypto/bn crypto/openssl/crypto/bn/asm crypto/openssl/c... X-SVN-Commit-Revision: 340705 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A52C684F7F X-Spamd-Result: default: False [0.86 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.02)[0.022,0]; NEURAL_SPAM_MEDIUM(0.24)[0.240,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.60)[0.595,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Nov 2018 21:35:30 -0000 Author: jkim Date: Tue Nov 20 21:35:20 2018 New Revision: 340705 URL: https://svnweb.freebsd.org/changeset/base/340705 Log: MFC: r340703 Merge OpenSSL 1.1.1a. Added: stable/12/crypto/openssl/crypto/getenv.c - copied unchanged from r340703, head/crypto/openssl/crypto/getenv.c stable/12/crypto/openssl/doc/man3/SSL_get_peer_tmp_key.pod - copied unchanged from r340703, head/crypto/openssl/doc/man3/SSL_get_peer_tmp_key.pod stable/12/secure/lib/libcrypto/man/SSL_get_peer_tmp_key.3 - copied unchanged from r340703, head/secure/lib/libcrypto/man/SSL_get_peer_tmp_key.3 Deleted: stable/12/crypto/openssl/doc/man3/SSL_CTX_set_client_CA_list.pod stable/12/crypto/openssl/doc/man3/SSL_get_client_CA_list.pod stable/12/crypto/openssl/doc/man3/SSL_get_server_tmp_key.pod stable/12/secure/lib/libcrypto/man/SSL_CTX_set_client_CA_list.3 stable/12/secure/lib/libcrypto/man/SSL_get_client_CA_list.3 stable/12/secure/lib/libcrypto/man/SSL_get_server_tmp_key.3 Modified: stable/12/crypto/openssl/CHANGES stable/12/crypto/openssl/Configure stable/12/crypto/openssl/INSTALL stable/12/crypto/openssl/NEWS stable/12/crypto/openssl/README stable/12/crypto/openssl/apps/app_rand.c stable/12/crypto/openssl/apps/apps.c stable/12/crypto/openssl/apps/apps.h stable/12/crypto/openssl/apps/ca.c stable/12/crypto/openssl/apps/ocsp.c stable/12/crypto/openssl/apps/openssl.cnf stable/12/crypto/openssl/apps/opt.c stable/12/crypto/openssl/apps/rehash.c stable/12/crypto/openssl/apps/rsa.c stable/12/crypto/openssl/apps/s_cb.c stable/12/crypto/openssl/apps/s_server.c stable/12/crypto/openssl/apps/speed.c stable/12/crypto/openssl/apps/x509.c stable/12/crypto/openssl/crypto/LPdir_unix.c stable/12/crypto/openssl/crypto/async/arch/async_posix.h stable/12/crypto/openssl/crypto/bio/b_sock2.c stable/12/crypto/openssl/crypto/bio/bio_lib.c stable/12/crypto/openssl/crypto/bio/bss_log.c stable/12/crypto/openssl/crypto/bn/asm/x86_64-gcc.c stable/12/crypto/openssl/crypto/bn/bn_exp.c stable/12/crypto/openssl/crypto/bn/bn_lib.c stable/12/crypto/openssl/crypto/build.info stable/12/crypto/openssl/crypto/conf/conf_api.c stable/12/crypto/openssl/crypto/conf/conf_mod.c stable/12/crypto/openssl/crypto/cryptlib.c stable/12/crypto/openssl/crypto/ct/ct_log.c stable/12/crypto/openssl/crypto/dsa/dsa_gen.c stable/12/crypto/openssl/crypto/dsa/dsa_ossl.c stable/12/crypto/openssl/crypto/ec/ec_ameth.c stable/12/crypto/openssl/crypto/ec/ec_mult.c stable/12/crypto/openssl/crypto/ec/ec_pmeth.c stable/12/crypto/openssl/crypto/ec/ecdh_kdf.c stable/12/crypto/openssl/crypto/engine/eng_devcrypto.c stable/12/crypto/openssl/crypto/engine/eng_list.c stable/12/crypto/openssl/crypto/err/openssl.txt stable/12/crypto/openssl/crypto/evp/e_aes.c stable/12/crypto/openssl/crypto/evp/e_rc2.c stable/12/crypto/openssl/crypto/evp/pmeth_lib.c stable/12/crypto/openssl/crypto/include/internal/ec_int.h stable/12/crypto/openssl/crypto/include/internal/rand_int.h stable/12/crypto/openssl/crypto/kdf/hkdf.c stable/12/crypto/openssl/crypto/mem_sec.c stable/12/crypto/openssl/crypto/o_fopen.c stable/12/crypto/openssl/crypto/pkcs12/p12_mutl.c stable/12/crypto/openssl/crypto/poly1305/poly1305_ieee754.c stable/12/crypto/openssl/crypto/rand/drbg_ctr.c stable/12/crypto/openssl/crypto/rand/drbg_lib.c stable/12/crypto/openssl/crypto/rand/rand_err.c stable/12/crypto/openssl/crypto/rand/rand_lcl.h stable/12/crypto/openssl/crypto/rand/rand_lib.c stable/12/crypto/openssl/crypto/rand/rand_unix.c stable/12/crypto/openssl/crypto/rand/randfile.c stable/12/crypto/openssl/crypto/rsa/rsa_lib.c stable/12/crypto/openssl/crypto/rsa/rsa_meth.c stable/12/crypto/openssl/crypto/rsa/rsa_ossl.c stable/12/crypto/openssl/crypto/sha/asm/keccak1600-s390x.pl stable/12/crypto/openssl/crypto/sha/asm/sha512p8-ppc.pl stable/12/crypto/openssl/crypto/siphash/siphash.c stable/12/crypto/openssl/crypto/sm2/sm2_crypt.c stable/12/crypto/openssl/crypto/sm2/sm2_sign.c stable/12/crypto/openssl/crypto/ui/ui_openssl.c stable/12/crypto/openssl/crypto/x509/by_dir.c stable/12/crypto/openssl/crypto/x509/by_file.c stable/12/crypto/openssl/crypto/x509/x509_vfy.c stable/12/crypto/openssl/doc/man1/ca.pod stable/12/crypto/openssl/doc/man1/enc.pod stable/12/crypto/openssl/doc/man1/openssl.pod stable/12/crypto/openssl/doc/man1/req.pod stable/12/crypto/openssl/doc/man1/rsa.pod stable/12/crypto/openssl/doc/man1/s_server.pod stable/12/crypto/openssl/doc/man1/storeutl.pod stable/12/crypto/openssl/doc/man1/x509.pod stable/12/crypto/openssl/doc/man3/DES_random_key.pod stable/12/crypto/openssl/doc/man3/EVP_DigestInit.pod stable/12/crypto/openssl/doc/man3/EVP_PKEY_CTX_ctrl.pod stable/12/crypto/openssl/doc/man3/EVP_PKEY_CTX_set_hkdf_md.pod stable/12/crypto/openssl/doc/man3/EVP_PKEY_CTX_set_rsa_pss_keygen_md.pod stable/12/crypto/openssl/doc/man3/EVP_PKEY_set1_RSA.pod stable/12/crypto/openssl/doc/man3/EVP_aes.pod stable/12/crypto/openssl/doc/man3/EVP_aria.pod stable/12/crypto/openssl/doc/man3/EVP_bf_cbc.pod stable/12/crypto/openssl/doc/man3/EVP_camellia.pod stable/12/crypto/openssl/doc/man3/EVP_cast5_cbc.pod stable/12/crypto/openssl/doc/man3/EVP_des.pod stable/12/crypto/openssl/doc/man3/EVP_idea_cbc.pod stable/12/crypto/openssl/doc/man3/EVP_md5.pod stable/12/crypto/openssl/doc/man3/EVP_rc2_cbc.pod stable/12/crypto/openssl/doc/man3/EVP_rc5_32_12_16_cbc.pod stable/12/crypto/openssl/doc/man3/EVP_seed_cbc.pod stable/12/crypto/openssl/doc/man3/EVP_sm4_cbc.pod stable/12/crypto/openssl/doc/man3/OPENSSL_VERSION_NUMBER.pod stable/12/crypto/openssl/doc/man3/RSA_meth_new.pod stable/12/crypto/openssl/doc/man3/SSL_CTX_set0_CA_list.pod stable/12/crypto/openssl/doc/man3/SSL_CTX_set1_curves.pod stable/12/crypto/openssl/doc/man3/SSL_CTX_set_quiet_shutdown.pod stable/12/crypto/openssl/doc/man3/SSL_get_error.pod stable/12/crypto/openssl/doc/man3/SSL_get_peer_signature_nid.pod stable/12/crypto/openssl/doc/man3/SSL_set_bio.pod stable/12/crypto/openssl/doc/man3/SSL_set_shutdown.pod stable/12/crypto/openssl/doc/man3/SSL_shutdown.pod stable/12/crypto/openssl/doc/man7/RAND_DRBG.pod stable/12/crypto/openssl/e_os.h stable/12/crypto/openssl/include/internal/cryptlib.h stable/12/crypto/openssl/include/internal/tsan_assist.h stable/12/crypto/openssl/include/openssl/cryptoerr.h stable/12/crypto/openssl/include/openssl/ec.h stable/12/crypto/openssl/include/openssl/ocsp.h stable/12/crypto/openssl/include/openssl/opensslv.h stable/12/crypto/openssl/include/openssl/rand_drbg.h stable/12/crypto/openssl/include/openssl/randerr.h stable/12/crypto/openssl/include/openssl/rsa.h stable/12/crypto/openssl/include/openssl/ssl.h stable/12/crypto/openssl/include/openssl/symhacks.h stable/12/crypto/openssl/include/openssl/tls1.h stable/12/crypto/openssl/ssl/d1_lib.c stable/12/crypto/openssl/ssl/record/rec_layer_d1.c stable/12/crypto/openssl/ssl/record/record.h stable/12/crypto/openssl/ssl/record/record_locl.h stable/12/crypto/openssl/ssl/record/ssl3_record.c stable/12/crypto/openssl/ssl/s3_cbc.c stable/12/crypto/openssl/ssl/s3_enc.c stable/12/crypto/openssl/ssl/s3_lib.c stable/12/crypto/openssl/ssl/ssl_cert.c stable/12/crypto/openssl/ssl/ssl_ciph.c stable/12/crypto/openssl/ssl/ssl_lib.c stable/12/crypto/openssl/ssl/ssl_locl.h stable/12/crypto/openssl/ssl/statem/extensions.c stable/12/crypto/openssl/ssl/statem/extensions_clnt.c stable/12/crypto/openssl/ssl/statem/statem.c stable/12/crypto/openssl/ssl/statem/statem_clnt.c stable/12/crypto/openssl/ssl/statem/statem_lib.c stable/12/crypto/openssl/ssl/statem/statem_locl.h stable/12/crypto/openssl/ssl/statem/statem_srvr.c stable/12/crypto/openssl/ssl/t1_lib.c stable/12/crypto/openssl/ssl/tls13_enc.c stable/12/secure/lib/libcrypto/Makefile stable/12/secure/lib/libcrypto/Makefile.inc stable/12/secure/lib/libcrypto/Makefile.man stable/12/secure/lib/libcrypto/man/ADMISSIONS.3 stable/12/secure/lib/libcrypto/man/ASN1_INTEGER_get_int64.3 stable/12/secure/lib/libcrypto/man/ASN1_ITEM_lookup.3 stable/12/secure/lib/libcrypto/man/ASN1_OBJECT_new.3 stable/12/secure/lib/libcrypto/man/ASN1_STRING_TABLE_add.3 stable/12/secure/lib/libcrypto/man/ASN1_STRING_length.3 stable/12/secure/lib/libcrypto/man/ASN1_STRING_new.3 stable/12/secure/lib/libcrypto/man/ASN1_STRING_print_ex.3 stable/12/secure/lib/libcrypto/man/ASN1_TIME_set.3 stable/12/secure/lib/libcrypto/man/ASN1_TYPE_get.3 stable/12/secure/lib/libcrypto/man/ASN1_generate_nconf.3 stable/12/secure/lib/libcrypto/man/ASYNC_WAIT_CTX_new.3 stable/12/secure/lib/libcrypto/man/ASYNC_start_job.3 stable/12/secure/lib/libcrypto/man/BF_encrypt.3 stable/12/secure/lib/libcrypto/man/BIO_ADDR.3 stable/12/secure/lib/libcrypto/man/BIO_ADDRINFO.3 stable/12/secure/lib/libcrypto/man/BIO_connect.3 stable/12/secure/lib/libcrypto/man/BIO_ctrl.3 stable/12/secure/lib/libcrypto/man/BIO_f_base64.3 stable/12/secure/lib/libcrypto/man/BIO_f_buffer.3 stable/12/secure/lib/libcrypto/man/BIO_f_cipher.3 stable/12/secure/lib/libcrypto/man/BIO_f_md.3 stable/12/secure/lib/libcrypto/man/BIO_f_null.3 stable/12/secure/lib/libcrypto/man/BIO_f_ssl.3 stable/12/secure/lib/libcrypto/man/BIO_find_type.3 stable/12/secure/lib/libcrypto/man/BIO_get_data.3 stable/12/secure/lib/libcrypto/man/BIO_get_ex_new_index.3 stable/12/secure/lib/libcrypto/man/BIO_meth_new.3 stable/12/secure/lib/libcrypto/man/BIO_new.3 stable/12/secure/lib/libcrypto/man/BIO_new_CMS.3 stable/12/secure/lib/libcrypto/man/BIO_parse_hostserv.3 stable/12/secure/lib/libcrypto/man/BIO_printf.3 stable/12/secure/lib/libcrypto/man/BIO_push.3 stable/12/secure/lib/libcrypto/man/BIO_read.3 stable/12/secure/lib/libcrypto/man/BIO_s_accept.3 stable/12/secure/lib/libcrypto/man/BIO_s_bio.3 stable/12/secure/lib/libcrypto/man/BIO_s_connect.3 stable/12/secure/lib/libcrypto/man/BIO_s_fd.3 stable/12/secure/lib/libcrypto/man/BIO_s_file.3 stable/12/secure/lib/libcrypto/man/BIO_s_mem.3 stable/12/secure/lib/libcrypto/man/BIO_s_null.3 stable/12/secure/lib/libcrypto/man/BIO_s_socket.3 stable/12/secure/lib/libcrypto/man/BIO_set_callback.3 stable/12/secure/lib/libcrypto/man/BIO_should_retry.3 stable/12/secure/lib/libcrypto/man/BN_BLINDING_new.3 stable/12/secure/lib/libcrypto/man/BN_CTX_new.3 stable/12/secure/lib/libcrypto/man/BN_CTX_start.3 stable/12/secure/lib/libcrypto/man/BN_add.3 stable/12/secure/lib/libcrypto/man/BN_add_word.3 stable/12/secure/lib/libcrypto/man/BN_bn2bin.3 stable/12/secure/lib/libcrypto/man/BN_cmp.3 stable/12/secure/lib/libcrypto/man/BN_copy.3 stable/12/secure/lib/libcrypto/man/BN_generate_prime.3 stable/12/secure/lib/libcrypto/man/BN_mod_inverse.3 stable/12/secure/lib/libcrypto/man/BN_mod_mul_montgomery.3 stable/12/secure/lib/libcrypto/man/BN_mod_mul_reciprocal.3 stable/12/secure/lib/libcrypto/man/BN_new.3 stable/12/secure/lib/libcrypto/man/BN_num_bytes.3 stable/12/secure/lib/libcrypto/man/BN_rand.3 stable/12/secure/lib/libcrypto/man/BN_security_bits.3 stable/12/secure/lib/libcrypto/man/BN_set_bit.3 stable/12/secure/lib/libcrypto/man/BN_swap.3 stable/12/secure/lib/libcrypto/man/BN_zero.3 stable/12/secure/lib/libcrypto/man/BUF_MEM_new.3 stable/12/secure/lib/libcrypto/man/CMS_add0_cert.3 stable/12/secure/lib/libcrypto/man/CMS_add1_recipient_cert.3 stable/12/secure/lib/libcrypto/man/CMS_add1_signer.3 stable/12/secure/lib/libcrypto/man/CMS_compress.3 stable/12/secure/lib/libcrypto/man/CMS_decrypt.3 stable/12/secure/lib/libcrypto/man/CMS_encrypt.3 stable/12/secure/lib/libcrypto/man/CMS_final.3 stable/12/secure/lib/libcrypto/man/CMS_get0_RecipientInfos.3 stable/12/secure/lib/libcrypto/man/CMS_get0_SignerInfos.3 stable/12/secure/lib/libcrypto/man/CMS_get0_type.3 stable/12/secure/lib/libcrypto/man/CMS_get1_ReceiptRequest.3 stable/12/secure/lib/libcrypto/man/CMS_sign.3 stable/12/secure/lib/libcrypto/man/CMS_sign_receipt.3 stable/12/secure/lib/libcrypto/man/CMS_uncompress.3 stable/12/secure/lib/libcrypto/man/CMS_verify.3 stable/12/secure/lib/libcrypto/man/CMS_verify_receipt.3 stable/12/secure/lib/libcrypto/man/CONF_modules_free.3 stable/12/secure/lib/libcrypto/man/CONF_modules_load_file.3 stable/12/secure/lib/libcrypto/man/CRYPTO_THREAD_run_once.3 stable/12/secure/lib/libcrypto/man/CRYPTO_get_ex_new_index.3 stable/12/secure/lib/libcrypto/man/CTLOG_STORE_get0_log_by_id.3 stable/12/secure/lib/libcrypto/man/CTLOG_STORE_new.3 stable/12/secure/lib/libcrypto/man/CTLOG_new.3 stable/12/secure/lib/libcrypto/man/CT_POLICY_EVAL_CTX_new.3 stable/12/secure/lib/libcrypto/man/DEFINE_STACK_OF.3 stable/12/secure/lib/libcrypto/man/DES_random_key.3 stable/12/secure/lib/libcrypto/man/DH_generate_key.3 stable/12/secure/lib/libcrypto/man/DH_generate_parameters.3 stable/12/secure/lib/libcrypto/man/DH_get0_pqg.3 stable/12/secure/lib/libcrypto/man/DH_get_1024_160.3 stable/12/secure/lib/libcrypto/man/DH_meth_new.3 stable/12/secure/lib/libcrypto/man/DH_new.3 stable/12/secure/lib/libcrypto/man/DH_new_by_nid.3 stable/12/secure/lib/libcrypto/man/DH_set_method.3 stable/12/secure/lib/libcrypto/man/DH_size.3 stable/12/secure/lib/libcrypto/man/DSA_SIG_new.3 stable/12/secure/lib/libcrypto/man/DSA_do_sign.3 stable/12/secure/lib/libcrypto/man/DSA_dup_DH.3 stable/12/secure/lib/libcrypto/man/DSA_generate_key.3 stable/12/secure/lib/libcrypto/man/DSA_generate_parameters.3 stable/12/secure/lib/libcrypto/man/DSA_get0_pqg.3 stable/12/secure/lib/libcrypto/man/DSA_meth_new.3 stable/12/secure/lib/libcrypto/man/DSA_new.3 stable/12/secure/lib/libcrypto/man/DSA_set_method.3 stable/12/secure/lib/libcrypto/man/DSA_sign.3 stable/12/secure/lib/libcrypto/man/DSA_size.3 stable/12/secure/lib/libcrypto/man/DTLS_get_data_mtu.3 stable/12/secure/lib/libcrypto/man/DTLS_set_timer_cb.3 stable/12/secure/lib/libcrypto/man/DTLSv1_listen.3 stable/12/secure/lib/libcrypto/man/ECDSA_SIG_new.3 stable/12/secure/lib/libcrypto/man/ECPKParameters_print.3 stable/12/secure/lib/libcrypto/man/EC_GFp_simple_method.3 stable/12/secure/lib/libcrypto/man/EC_GROUP_copy.3 stable/12/secure/lib/libcrypto/man/EC_GROUP_new.3 stable/12/secure/lib/libcrypto/man/EC_KEY_get_enc_flags.3 stable/12/secure/lib/libcrypto/man/EC_KEY_new.3 stable/12/secure/lib/libcrypto/man/EC_POINT_add.3 stable/12/secure/lib/libcrypto/man/EC_POINT_new.3 stable/12/secure/lib/libcrypto/man/ENGINE_add.3 stable/12/secure/lib/libcrypto/man/ERR_GET_LIB.3 stable/12/secure/lib/libcrypto/man/ERR_clear_error.3 stable/12/secure/lib/libcrypto/man/ERR_error_string.3 stable/12/secure/lib/libcrypto/man/ERR_get_error.3 stable/12/secure/lib/libcrypto/man/ERR_load_crypto_strings.3 stable/12/secure/lib/libcrypto/man/ERR_load_strings.3 stable/12/secure/lib/libcrypto/man/ERR_print_errors.3 stable/12/secure/lib/libcrypto/man/ERR_put_error.3 stable/12/secure/lib/libcrypto/man/ERR_remove_state.3 stable/12/secure/lib/libcrypto/man/ERR_set_mark.3 stable/12/secure/lib/libcrypto/man/EVP_BytesToKey.3 stable/12/secure/lib/libcrypto/man/EVP_CIPHER_CTX_get_cipher_data.3 stable/12/secure/lib/libcrypto/man/EVP_CIPHER_meth_new.3 stable/12/secure/lib/libcrypto/man/EVP_DigestInit.3 stable/12/secure/lib/libcrypto/man/EVP_DigestSignInit.3 stable/12/secure/lib/libcrypto/man/EVP_DigestVerifyInit.3 stable/12/secure/lib/libcrypto/man/EVP_EncodeInit.3 stable/12/secure/lib/libcrypto/man/EVP_EncryptInit.3 stable/12/secure/lib/libcrypto/man/EVP_MD_meth_new.3 stable/12/secure/lib/libcrypto/man/EVP_OpenInit.3 stable/12/secure/lib/libcrypto/man/EVP_PKEY_ASN1_METHOD.3 stable/12/secure/lib/libcrypto/man/EVP_PKEY_CTX_ctrl.3 stable/12/secure/lib/libcrypto/man/EVP_PKEY_CTX_new.3 stable/12/secure/lib/libcrypto/man/EVP_PKEY_CTX_set1_pbe_pass.3 stable/12/secure/lib/libcrypto/man/EVP_PKEY_CTX_set_hkdf_md.3 stable/12/secure/lib/libcrypto/man/EVP_PKEY_CTX_set_rsa_pss_keygen_md.3 stable/12/secure/lib/libcrypto/man/EVP_PKEY_CTX_set_scrypt_N.3 stable/12/secure/lib/libcrypto/man/EVP_PKEY_CTX_set_tls1_prf_md.3 stable/12/secure/lib/libcrypto/man/EVP_PKEY_asn1_get_count.3 stable/12/secure/lib/libcrypto/man/EVP_PKEY_cmp.3 stable/12/secure/lib/libcrypto/man/EVP_PKEY_decrypt.3 stable/12/secure/lib/libcrypto/man/EVP_PKEY_derive.3 stable/12/secure/lib/libcrypto/man/EVP_PKEY_encrypt.3 stable/12/secure/lib/libcrypto/man/EVP_PKEY_get_default_digest_nid.3 stable/12/secure/lib/libcrypto/man/EVP_PKEY_keygen.3 stable/12/secure/lib/libcrypto/man/EVP_PKEY_meth_get_count.3 stable/12/secure/lib/libcrypto/man/EVP_PKEY_meth_new.3 stable/12/secure/lib/libcrypto/man/EVP_PKEY_new.3 stable/12/secure/lib/libcrypto/man/EVP_PKEY_print_private.3 stable/12/secure/lib/libcrypto/man/EVP_PKEY_set1_RSA.3 stable/12/secure/lib/libcrypto/man/EVP_PKEY_sign.3 stable/12/secure/lib/libcrypto/man/EVP_PKEY_verify.3 stable/12/secure/lib/libcrypto/man/EVP_PKEY_verify_recover.3 stable/12/secure/lib/libcrypto/man/EVP_SealInit.3 stable/12/secure/lib/libcrypto/man/EVP_SignInit.3 stable/12/secure/lib/libcrypto/man/EVP_VerifyInit.3 stable/12/secure/lib/libcrypto/man/EVP_aes.3 stable/12/secure/lib/libcrypto/man/EVP_aria.3 stable/12/secure/lib/libcrypto/man/EVP_bf_cbc.3 stable/12/secure/lib/libcrypto/man/EVP_blake2b512.3 stable/12/secure/lib/libcrypto/man/EVP_camellia.3 stable/12/secure/lib/libcrypto/man/EVP_cast5_cbc.3 stable/12/secure/lib/libcrypto/man/EVP_chacha20.3 stable/12/secure/lib/libcrypto/man/EVP_des.3 stable/12/secure/lib/libcrypto/man/EVP_desx_cbc.3 stable/12/secure/lib/libcrypto/man/EVP_idea_cbc.3 stable/12/secure/lib/libcrypto/man/EVP_md2.3 stable/12/secure/lib/libcrypto/man/EVP_md4.3 stable/12/secure/lib/libcrypto/man/EVP_md5.3 stable/12/secure/lib/libcrypto/man/EVP_mdc2.3 stable/12/secure/lib/libcrypto/man/EVP_rc2_cbc.3 stable/12/secure/lib/libcrypto/man/EVP_rc4.3 stable/12/secure/lib/libcrypto/man/EVP_rc5_32_12_16_cbc.3 stable/12/secure/lib/libcrypto/man/EVP_ripemd160.3 stable/12/secure/lib/libcrypto/man/EVP_seed_cbc.3 stable/12/secure/lib/libcrypto/man/EVP_sha1.3 stable/12/secure/lib/libcrypto/man/EVP_sha224.3 stable/12/secure/lib/libcrypto/man/EVP_sha3_224.3 stable/12/secure/lib/libcrypto/man/EVP_sm3.3 stable/12/secure/lib/libcrypto/man/EVP_sm4_cbc.3 stable/12/secure/lib/libcrypto/man/EVP_whirlpool.3 stable/12/secure/lib/libcrypto/man/HMAC.3 stable/12/secure/lib/libcrypto/man/MD5.3 stable/12/secure/lib/libcrypto/man/MDC2_Init.3 stable/12/secure/lib/libcrypto/man/OBJ_nid2obj.3 stable/12/secure/lib/libcrypto/man/OCSP_REQUEST_new.3 stable/12/secure/lib/libcrypto/man/OCSP_cert_to_id.3 stable/12/secure/lib/libcrypto/man/OCSP_request_add1_nonce.3 stable/12/secure/lib/libcrypto/man/OCSP_resp_find_status.3 stable/12/secure/lib/libcrypto/man/OCSP_response_status.3 stable/12/secure/lib/libcrypto/man/OCSP_sendreq_new.3 stable/12/secure/lib/libcrypto/man/OPENSSL_Applink.3 stable/12/secure/lib/libcrypto/man/OPENSSL_LH_COMPFUNC.3 stable/12/secure/lib/libcrypto/man/OPENSSL_LH_stats.3 stable/12/secure/lib/libcrypto/man/OPENSSL_VERSION_NUMBER.3 stable/12/secure/lib/libcrypto/man/OPENSSL_config.3 stable/12/secure/lib/libcrypto/man/OPENSSL_fork_prepare.3 stable/12/secure/lib/libcrypto/man/OPENSSL_ia32cap.3 stable/12/secure/lib/libcrypto/man/OPENSSL_init_crypto.3 stable/12/secure/lib/libcrypto/man/OPENSSL_init_ssl.3 stable/12/secure/lib/libcrypto/man/OPENSSL_instrument_bus.3 stable/12/secure/lib/libcrypto/man/OPENSSL_load_builtin_modules.3 stable/12/secure/lib/libcrypto/man/OPENSSL_malloc.3 stable/12/secure/lib/libcrypto/man/OPENSSL_secure_malloc.3 stable/12/secure/lib/libcrypto/man/OSSL_STORE_INFO.3 stable/12/secure/lib/libcrypto/man/OSSL_STORE_LOADER.3 stable/12/secure/lib/libcrypto/man/OSSL_STORE_SEARCH.3 stable/12/secure/lib/libcrypto/man/OSSL_STORE_expect.3 stable/12/secure/lib/libcrypto/man/OSSL_STORE_open.3 stable/12/secure/lib/libcrypto/man/OpenSSL_add_all_algorithms.3 stable/12/secure/lib/libcrypto/man/PEM_bytes_read_bio.3 stable/12/secure/lib/libcrypto/man/PEM_read.3 stable/12/secure/lib/libcrypto/man/PEM_read_CMS.3 stable/12/secure/lib/libcrypto/man/PEM_read_bio_PrivateKey.3 stable/12/secure/lib/libcrypto/man/PEM_read_bio_ex.3 stable/12/secure/lib/libcrypto/man/PEM_write_bio_CMS_stream.3 stable/12/secure/lib/libcrypto/man/PEM_write_bio_PKCS7_stream.3 stable/12/secure/lib/libcrypto/man/PKCS12_create.3 stable/12/secure/lib/libcrypto/man/PKCS12_newpass.3 stable/12/secure/lib/libcrypto/man/PKCS12_parse.3 stable/12/secure/lib/libcrypto/man/PKCS5_PBKDF2_HMAC.3 stable/12/secure/lib/libcrypto/man/PKCS7_decrypt.3 stable/12/secure/lib/libcrypto/man/PKCS7_encrypt.3 stable/12/secure/lib/libcrypto/man/PKCS7_sign.3 stable/12/secure/lib/libcrypto/man/PKCS7_sign_add_signer.3 stable/12/secure/lib/libcrypto/man/PKCS7_verify.3 stable/12/secure/lib/libcrypto/man/RAND_DRBG_generate.3 stable/12/secure/lib/libcrypto/man/RAND_DRBG_get0_master.3 stable/12/secure/lib/libcrypto/man/RAND_DRBG_new.3 stable/12/secure/lib/libcrypto/man/RAND_DRBG_reseed.3 stable/12/secure/lib/libcrypto/man/RAND_DRBG_set_callbacks.3 stable/12/secure/lib/libcrypto/man/RAND_DRBG_set_ex_data.3 stable/12/secure/lib/libcrypto/man/RAND_add.3 stable/12/secure/lib/libcrypto/man/RAND_bytes.3 stable/12/secure/lib/libcrypto/man/RAND_cleanup.3 stable/12/secure/lib/libcrypto/man/RAND_egd.3 stable/12/secure/lib/libcrypto/man/RAND_load_file.3 stable/12/secure/lib/libcrypto/man/RAND_set_rand_method.3 stable/12/secure/lib/libcrypto/man/RC4_set_key.3 stable/12/secure/lib/libcrypto/man/RIPEMD160_Init.3 stable/12/secure/lib/libcrypto/man/RSA_blinding_on.3 stable/12/secure/lib/libcrypto/man/RSA_check_key.3 stable/12/secure/lib/libcrypto/man/RSA_generate_key.3 stable/12/secure/lib/libcrypto/man/RSA_get0_key.3 stable/12/secure/lib/libcrypto/man/RSA_meth_new.3 stable/12/secure/lib/libcrypto/man/RSA_new.3 stable/12/secure/lib/libcrypto/man/RSA_padding_add_PKCS1_type_1.3 stable/12/secure/lib/libcrypto/man/RSA_print.3 stable/12/secure/lib/libcrypto/man/RSA_private_encrypt.3 stable/12/secure/lib/libcrypto/man/RSA_public_encrypt.3 stable/12/secure/lib/libcrypto/man/RSA_set_method.3 stable/12/secure/lib/libcrypto/man/RSA_sign.3 stable/12/secure/lib/libcrypto/man/RSA_sign_ASN1_OCTET_STRING.3 stable/12/secure/lib/libcrypto/man/RSA_size.3 stable/12/secure/lib/libcrypto/man/SCT_new.3 stable/12/secure/lib/libcrypto/man/SCT_print.3 stable/12/secure/lib/libcrypto/man/SCT_validate.3 stable/12/secure/lib/libcrypto/man/SHA256_Init.3 stable/12/secure/lib/libcrypto/man/SMIME_read_CMS.3 stable/12/secure/lib/libcrypto/man/SMIME_read_PKCS7.3 stable/12/secure/lib/libcrypto/man/SMIME_write_CMS.3 stable/12/secure/lib/libcrypto/man/SMIME_write_PKCS7.3 stable/12/secure/lib/libcrypto/man/SSL_CIPHER_get_name.3 stable/12/secure/lib/libcrypto/man/SSL_COMP_add_compression_method.3 stable/12/secure/lib/libcrypto/man/SSL_CONF_CTX_new.3 stable/12/secure/lib/libcrypto/man/SSL_CONF_CTX_set1_prefix.3 stable/12/secure/lib/libcrypto/man/SSL_CONF_CTX_set_flags.3 stable/12/secure/lib/libcrypto/man/SSL_CONF_CTX_set_ssl_ctx.3 stable/12/secure/lib/libcrypto/man/SSL_CONF_cmd.3 stable/12/secure/lib/libcrypto/man/SSL_CONF_cmd_argv.3 stable/12/secure/lib/libcrypto/man/SSL_CTX_add1_chain_cert.3 stable/12/secure/lib/libcrypto/man/SSL_CTX_add_extra_chain_cert.3 stable/12/secure/lib/libcrypto/man/SSL_CTX_add_session.3 stable/12/secure/lib/libcrypto/man/SSL_CTX_config.3 stable/12/secure/lib/libcrypto/man/SSL_CTX_ctrl.3 stable/12/secure/lib/libcrypto/man/SSL_CTX_dane_enable.3 stable/12/secure/lib/libcrypto/man/SSL_CTX_flush_sessions.3 stable/12/secure/lib/libcrypto/man/SSL_CTX_free.3 stable/12/secure/lib/libcrypto/man/SSL_CTX_get0_param.3 stable/12/secure/lib/libcrypto/man/SSL_CTX_get_verify_mode.3 stable/12/secure/lib/libcrypto/man/SSL_CTX_has_client_custom_ext.3 stable/12/secure/lib/libcrypto/man/SSL_CTX_load_verify_locations.3 stable/12/secure/lib/libcrypto/man/SSL_CTX_new.3 stable/12/secure/lib/libcrypto/man/SSL_CTX_sess_number.3 stable/12/secure/lib/libcrypto/man/SSL_CTX_sess_set_cache_size.3 stable/12/secure/lib/libcrypto/man/SSL_CTX_sess_set_get_cb.3 stable/12/secure/lib/libcrypto/man/SSL_CTX_sessions.3 stable/12/secure/lib/libcrypto/man/SSL_CTX_set0_CA_list.3 stable/12/secure/lib/libcrypto/man/SSL_CTX_set1_curves.3 stable/12/secure/lib/libcrypto/man/SSL_CTX_set1_sigalgs.3 stable/12/secure/lib/libcrypto/man/SSL_CTX_set1_verify_cert_store.3 stable/12/secure/lib/libcrypto/man/SSL_CTX_set_alpn_select_cb.3 stable/12/secure/lib/libcrypto/man/SSL_CTX_set_cert_cb.3 stable/12/secure/lib/libcrypto/man/SSL_CTX_set_cert_store.3 stable/12/secure/lib/libcrypto/man/SSL_CTX_set_cert_verify_callback.3 stable/12/secure/lib/libcrypto/man/SSL_CTX_set_cipher_list.3 stable/12/secure/lib/libcrypto/man/SSL_CTX_set_client_cert_cb.3 stable/12/secure/lib/libcrypto/man/SSL_CTX_set_client_hello_cb.3 stable/12/secure/lib/libcrypto/man/SSL_CTX_set_ct_validation_callback.3 stable/12/secure/lib/libcrypto/man/SSL_CTX_set_ctlog_list_file.3 stable/12/secure/lib/libcrypto/man/SSL_CTX_set_default_passwd_cb.3 stable/12/secure/lib/libcrypto/man/SSL_CTX_set_ex_data.3 stable/12/secure/lib/libcrypto/man/SSL_CTX_set_generate_session_id.3 stable/12/secure/lib/libcrypto/man/SSL_CTX_set_info_callback.3 stable/12/secure/lib/libcrypto/man/SSL_CTX_set_keylog_callback.3 stable/12/secure/lib/libcrypto/man/SSL_CTX_set_max_cert_list.3 stable/12/secure/lib/libcrypto/man/SSL_CTX_set_min_proto_version.3 stable/12/secure/lib/libcrypto/man/SSL_CTX_set_mode.3 stable/12/secure/lib/libcrypto/man/SSL_CTX_set_msg_callback.3 stable/12/secure/lib/libcrypto/man/SSL_CTX_set_num_tickets.3 stable/12/secure/lib/libcrypto/man/SSL_CTX_set_options.3 stable/12/secure/lib/libcrypto/man/SSL_CTX_set_psk_client_callback.3 stable/12/secure/lib/libcrypto/man/SSL_CTX_set_quiet_shutdown.3 stable/12/secure/lib/libcrypto/man/SSL_CTX_set_read_ahead.3 stable/12/secure/lib/libcrypto/man/SSL_CTX_set_record_padding_callback.3 stable/12/secure/lib/libcrypto/man/SSL_CTX_set_security_level.3 stable/12/secure/lib/libcrypto/man/SSL_CTX_set_session_cache_mode.3 stable/12/secure/lib/libcrypto/man/SSL_CTX_set_session_id_context.3 stable/12/secure/lib/libcrypto/man/SSL_CTX_set_session_ticket_cb.3 stable/12/secure/lib/libcrypto/man/SSL_CTX_set_split_send_fragment.3 stable/12/secure/lib/libcrypto/man/SSL_CTX_set_ssl_version.3 stable/12/secure/lib/libcrypto/man/SSL_CTX_set_stateless_cookie_generate_cb.3 stable/12/secure/lib/libcrypto/man/SSL_CTX_set_timeout.3 stable/12/secure/lib/libcrypto/man/SSL_CTX_set_tlsext_servername_callback.3 stable/12/secure/lib/libcrypto/man/SSL_CTX_set_tlsext_status_cb.3 stable/12/secure/lib/libcrypto/man/SSL_CTX_set_tlsext_ticket_key_cb.3 stable/12/secure/lib/libcrypto/man/SSL_CTX_set_tlsext_use_srtp.3 stable/12/secure/lib/libcrypto/man/SSL_CTX_set_tmp_dh_callback.3 stable/12/secure/lib/libcrypto/man/SSL_CTX_set_verify.3 stable/12/secure/lib/libcrypto/man/SSL_CTX_use_certificate.3 stable/12/secure/lib/libcrypto/man/SSL_CTX_use_psk_identity_hint.3 stable/12/secure/lib/libcrypto/man/SSL_CTX_use_serverinfo.3 stable/12/secure/lib/libcrypto/man/SSL_SESSION_free.3 stable/12/secure/lib/libcrypto/man/SSL_SESSION_get0_cipher.3 stable/12/secure/lib/libcrypto/man/SSL_SESSION_get0_hostname.3 stable/12/secure/lib/libcrypto/man/SSL_SESSION_get0_id_context.3 stable/12/secure/lib/libcrypto/man/SSL_SESSION_get0_peer.3 stable/12/secure/lib/libcrypto/man/SSL_SESSION_get_compress_id.3 stable/12/secure/lib/libcrypto/man/SSL_SESSION_get_ex_data.3 stable/12/secure/lib/libcrypto/man/SSL_SESSION_get_protocol_version.3 stable/12/secure/lib/libcrypto/man/SSL_SESSION_get_time.3 stable/12/secure/lib/libcrypto/man/SSL_SESSION_has_ticket.3 stable/12/secure/lib/libcrypto/man/SSL_SESSION_is_resumable.3 stable/12/secure/lib/libcrypto/man/SSL_SESSION_print.3 stable/12/secure/lib/libcrypto/man/SSL_SESSION_set1_id.3 stable/12/secure/lib/libcrypto/man/SSL_accept.3 stable/12/secure/lib/libcrypto/man/SSL_alert_type_string.3 stable/12/secure/lib/libcrypto/man/SSL_alloc_buffers.3 stable/12/secure/lib/libcrypto/man/SSL_check_chain.3 stable/12/secure/lib/libcrypto/man/SSL_clear.3 stable/12/secure/lib/libcrypto/man/SSL_connect.3 stable/12/secure/lib/libcrypto/man/SSL_do_handshake.3 stable/12/secure/lib/libcrypto/man/SSL_export_keying_material.3 stable/12/secure/lib/libcrypto/man/SSL_extension_supported.3 stable/12/secure/lib/libcrypto/man/SSL_free.3 stable/12/secure/lib/libcrypto/man/SSL_get0_peer_scts.3 stable/12/secure/lib/libcrypto/man/SSL_get_SSL_CTX.3 stable/12/secure/lib/libcrypto/man/SSL_get_all_async_fds.3 stable/12/secure/lib/libcrypto/man/SSL_get_ciphers.3 stable/12/secure/lib/libcrypto/man/SSL_get_client_random.3 stable/12/secure/lib/libcrypto/man/SSL_get_current_cipher.3 stable/12/secure/lib/libcrypto/man/SSL_get_default_timeout.3 stable/12/secure/lib/libcrypto/man/SSL_get_error.3 stable/12/secure/lib/libcrypto/man/SSL_get_extms_support.3 stable/12/secure/lib/libcrypto/man/SSL_get_fd.3 stable/12/secure/lib/libcrypto/man/SSL_get_peer_cert_chain.3 stable/12/secure/lib/libcrypto/man/SSL_get_peer_certificate.3 stable/12/secure/lib/libcrypto/man/SSL_get_peer_signature_nid.3 stable/12/secure/lib/libcrypto/man/SSL_get_psk_identity.3 stable/12/secure/lib/libcrypto/man/SSL_get_rbio.3 stable/12/secure/lib/libcrypto/man/SSL_get_session.3 stable/12/secure/lib/libcrypto/man/SSL_get_shared_sigalgs.3 stable/12/secure/lib/libcrypto/man/SSL_get_verify_result.3 stable/12/secure/lib/libcrypto/man/SSL_get_version.3 stable/12/secure/lib/libcrypto/man/SSL_in_init.3 stable/12/secure/lib/libcrypto/man/SSL_key_update.3 stable/12/secure/lib/libcrypto/man/SSL_library_init.3 stable/12/secure/lib/libcrypto/man/SSL_load_client_CA_file.3 stable/12/secure/lib/libcrypto/man/SSL_new.3 stable/12/secure/lib/libcrypto/man/SSL_pending.3 stable/12/secure/lib/libcrypto/man/SSL_read.3 stable/12/secure/lib/libcrypto/man/SSL_read_early_data.3 stable/12/secure/lib/libcrypto/man/SSL_rstate_string.3 stable/12/secure/lib/libcrypto/man/SSL_session_reused.3 stable/12/secure/lib/libcrypto/man/SSL_set1_host.3 stable/12/secure/lib/libcrypto/man/SSL_set_bio.3 stable/12/secure/lib/libcrypto/man/SSL_set_connect_state.3 stable/12/secure/lib/libcrypto/man/SSL_set_fd.3 stable/12/secure/lib/libcrypto/man/SSL_set_session.3 stable/12/secure/lib/libcrypto/man/SSL_set_shutdown.3 stable/12/secure/lib/libcrypto/man/SSL_set_verify_result.3 stable/12/secure/lib/libcrypto/man/SSL_shutdown.3 stable/12/secure/lib/libcrypto/man/SSL_state_string.3 stable/12/secure/lib/libcrypto/man/SSL_want.3 stable/12/secure/lib/libcrypto/man/SSL_write.3 stable/12/secure/lib/libcrypto/man/UI_STRING.3 stable/12/secure/lib/libcrypto/man/UI_UTIL_read_pw.3 stable/12/secure/lib/libcrypto/man/UI_create_method.3 stable/12/secure/lib/libcrypto/man/UI_new.3 stable/12/secure/lib/libcrypto/man/X509V3_get_d2i.3 stable/12/secure/lib/libcrypto/man/X509_ALGOR_dup.3 stable/12/secure/lib/libcrypto/man/X509_CRL_get0_by_serial.3 stable/12/secure/lib/libcrypto/man/X509_EXTENSION_set_object.3 stable/12/secure/lib/libcrypto/man/X509_LOOKUP_hash_dir.3 stable/12/secure/lib/libcrypto/man/X509_LOOKUP_meth_new.3 stable/12/secure/lib/libcrypto/man/X509_NAME_ENTRY_get_object.3 stable/12/secure/lib/libcrypto/man/X509_NAME_add_entry_by_txt.3 stable/12/secure/lib/libcrypto/man/X509_NAME_get0_der.3 stable/12/secure/lib/libcrypto/man/X509_NAME_get_index_by_NID.3 stable/12/secure/lib/libcrypto/man/X509_NAME_print_ex.3 stable/12/secure/lib/libcrypto/man/X509_PUBKEY_new.3 stable/12/secure/lib/libcrypto/man/X509_SIG_get0.3 stable/12/secure/lib/libcrypto/man/X509_STORE_CTX_get_error.3 stable/12/secure/lib/libcrypto/man/X509_STORE_CTX_new.3 stable/12/secure/lib/libcrypto/man/X509_STORE_CTX_set_verify_cb.3 stable/12/secure/lib/libcrypto/man/X509_STORE_add_cert.3 stable/12/secure/lib/libcrypto/man/X509_STORE_get0_param.3 stable/12/secure/lib/libcrypto/man/X509_STORE_new.3 stable/12/secure/lib/libcrypto/man/X509_STORE_set_verify_cb_func.3 stable/12/secure/lib/libcrypto/man/X509_VERIFY_PARAM_set_flags.3 stable/12/secure/lib/libcrypto/man/X509_check_ca.3 stable/12/secure/lib/libcrypto/man/X509_check_host.3 stable/12/secure/lib/libcrypto/man/X509_check_issued.3 stable/12/secure/lib/libcrypto/man/X509_check_private_key.3 stable/12/secure/lib/libcrypto/man/X509_cmp_time.3 stable/12/secure/lib/libcrypto/man/X509_digest.3 stable/12/secure/lib/libcrypto/man/X509_dup.3 stable/12/secure/lib/libcrypto/man/X509_get0_notBefore.3 stable/12/secure/lib/libcrypto/man/X509_get0_signature.3 stable/12/secure/lib/libcrypto/man/X509_get0_uids.3 stable/12/secure/lib/libcrypto/man/X509_get_extension_flags.3 stable/12/secure/lib/libcrypto/man/X509_get_pubkey.3 stable/12/secure/lib/libcrypto/man/X509_get_serialNumber.3 stable/12/secure/lib/libcrypto/man/X509_get_subject_name.3 stable/12/secure/lib/libcrypto/man/X509_get_version.3 stable/12/secure/lib/libcrypto/man/X509_new.3 stable/12/secure/lib/libcrypto/man/X509_sign.3 stable/12/secure/lib/libcrypto/man/X509_verify_cert.3 stable/12/secure/lib/libcrypto/man/X509v3_get_ext_by_NID.3 stable/12/secure/lib/libcrypto/man/d2i_DHparams.3 stable/12/secure/lib/libcrypto/man/d2i_PKCS8PrivateKey_bio.3 stable/12/secure/lib/libcrypto/man/d2i_PrivateKey.3 stable/12/secure/lib/libcrypto/man/d2i_SSL_SESSION.3 stable/12/secure/lib/libcrypto/man/d2i_X509.3 stable/12/secure/lib/libcrypto/man/i2d_CMS_bio_stream.3 stable/12/secure/lib/libcrypto/man/i2d_PKCS7_bio_stream.3 stable/12/secure/lib/libcrypto/man/i2d_re_X509_tbs.3 stable/12/secure/lib/libcrypto/man/o2i_SCT_LIST.3 stable/12/secure/lib/libssl/Version.map (contents, props changed) stable/12/secure/usr.bin/openssl/man/CA.pl.1 stable/12/secure/usr.bin/openssl/man/asn1parse.1 stable/12/secure/usr.bin/openssl/man/ca.1 stable/12/secure/usr.bin/openssl/man/ciphers.1 stable/12/secure/usr.bin/openssl/man/cms.1 stable/12/secure/usr.bin/openssl/man/crl.1 stable/12/secure/usr.bin/openssl/man/crl2pkcs7.1 stable/12/secure/usr.bin/openssl/man/dgst.1 stable/12/secure/usr.bin/openssl/man/dhparam.1 stable/12/secure/usr.bin/openssl/man/dsa.1 stable/12/secure/usr.bin/openssl/man/dsaparam.1 stable/12/secure/usr.bin/openssl/man/ec.1 stable/12/secure/usr.bin/openssl/man/ecparam.1 stable/12/secure/usr.bin/openssl/man/enc.1 stable/12/secure/usr.bin/openssl/man/engine.1 stable/12/secure/usr.bin/openssl/man/errstr.1 stable/12/secure/usr.bin/openssl/man/gendsa.1 stable/12/secure/usr.bin/openssl/man/genpkey.1 stable/12/secure/usr.bin/openssl/man/genrsa.1 stable/12/secure/usr.bin/openssl/man/list.1 stable/12/secure/usr.bin/openssl/man/nseq.1 stable/12/secure/usr.bin/openssl/man/ocsp.1 stable/12/secure/usr.bin/openssl/man/openssl.1 stable/12/secure/usr.bin/openssl/man/passwd.1 stable/12/secure/usr.bin/openssl/man/pkcs12.1 stable/12/secure/usr.bin/openssl/man/pkcs7.1 stable/12/secure/usr.bin/openssl/man/pkcs8.1 stable/12/secure/usr.bin/openssl/man/pkey.1 stable/12/secure/usr.bin/openssl/man/pkeyparam.1 stable/12/secure/usr.bin/openssl/man/pkeyutl.1 stable/12/secure/usr.bin/openssl/man/prime.1 stable/12/secure/usr.bin/openssl/man/rand.1 stable/12/secure/usr.bin/openssl/man/req.1 stable/12/secure/usr.bin/openssl/man/rsa.1 stable/12/secure/usr.bin/openssl/man/rsautl.1 stable/12/secure/usr.bin/openssl/man/s_client.1 stable/12/secure/usr.bin/openssl/man/s_server.1 stable/12/secure/usr.bin/openssl/man/s_time.1 stable/12/secure/usr.bin/openssl/man/sess_id.1 stable/12/secure/usr.bin/openssl/man/smime.1 stable/12/secure/usr.bin/openssl/man/speed.1 stable/12/secure/usr.bin/openssl/man/spkac.1 stable/12/secure/usr.bin/openssl/man/srp.1 stable/12/secure/usr.bin/openssl/man/storeutl.1 stable/12/secure/usr.bin/openssl/man/ts.1 stable/12/secure/usr.bin/openssl/man/tsget.1 stable/12/secure/usr.bin/openssl/man/verify.1 stable/12/secure/usr.bin/openssl/man/version.1 stable/12/secure/usr.bin/openssl/man/x509.1 Directory Properties: stable/12/ (props changed) stable/12/secure/lib/libcrypto/Version.map (props changed) Modified: stable/12/crypto/openssl/CHANGES ============================================================================== --- stable/12/crypto/openssl/CHANGES Tue Nov 20 21:26:25 2018 (r340704) +++ stable/12/crypto/openssl/CHANGES Tue Nov 20 21:35:20 2018 (r340705) @@ -7,6 +7,42 @@ https://github.com/openssl/openssl/commits/ and pick the appropriate release branch. + Changes between 1.1.1 and 1.1.1a [20 Nov 2018] + + *) Timing vulnerability in DSA signature generation + + The OpenSSL DSA signature algorithm has been shown to be vulnerable to a + timing side channel attack. An attacker could use variations in the signing + algorithm to recover the private key. + + This issue was reported to OpenSSL on 16th October 2018 by Samuel Weiser. + (CVE-2018-0734) + [Paul Dale] + + *) Timing vulnerability in ECDSA signature generation + + The OpenSSL ECDSA signature algorithm has been shown to be vulnerable to a + timing side channel attack. An attacker could use variations in the signing + algorithm to recover the private key. + + This issue was reported to OpenSSL on 25th October 2018 by Samuel Weiser. + (CVE-2018-0735) + [Paul Dale] + + *) Added EVP_PKEY_ECDH_KDF_X9_63 and ecdh_KDF_X9_63() as replacements for + the EVP_PKEY_ECDH_KDF_X9_62 KDF type and ECDH_KDF_X9_62(). The old names + are retained for backwards compatibility. + [Antoine Salon] + + *) Fixed the issue that RAND_add()/RAND_seed() silently discards random input + if its length exceeds 4096 bytes. The limit has been raised to a buffer size + of two gigabytes and the error handling improved. + + This issue was reported to OpenSSL by Dr. Falko Strenzke. It has been + categorized as a normal bug, not a security issue, because the DRBG reseeds + automatically and is fully functional even without additional randomness + provided by the application. + Changes between 1.1.0i and 1.1.1 [11 Sep 2018] *) Add a new ClientHello callback. Provides a callback interface that gives @@ -13103,4 +13139,3 @@ des-cbc 3624.96k 5258.21k 5530.91k *) A minor bug in ssl/s3_clnt.c where there would always be 4 0 bytes sent in the client random. [Edward Bishop ] - Modified: stable/12/crypto/openssl/Configure ============================================================================== --- stable/12/crypto/openssl/Configure Tue Nov 20 21:26:25 2018 (r340704) +++ stable/12/crypto/openssl/Configure Tue Nov 20 21:35:20 2018 (r340705) @@ -1013,13 +1013,18 @@ if (scalar(@seed_sources) == 0) { if (scalar(grep { $_ eq 'none' } @seed_sources) > 0) { die "Cannot seed with none and anything else" if scalar(@seed_sources) > 1; warn <<_____ if scalar(@seed_sources) == 1; -You have selected the --with-rand-seed=none option, which effectively disables -automatic reseeding of the OpenSSL random generator. All operations depending -on the random generator such as creating keys will not work unless the random -generator is seeded manually by the application. -Please read the 'Note on random number generation' section in the INSTALL -instructions and the RAND_DRBG(7) manual page for more details. +============================== WARNING =============================== +You have selected the --with-rand-seed=none option, which effectively +disables automatic reseeding of the OpenSSL random generator. +All operations depending on the random generator such as creating keys +will not work unless the random generator is seeded manually by the +application. + +Please read the 'Note on random number generation' section in the +INSTALL instructions and the RAND_DRBG(7) manual page for more details. +============================== WARNING =============================== + _____ } push @{$config{openssl_other_defines}}, @@ -2174,6 +2179,16 @@ EOF # Massage the result + # If the user configured no-shared, we allow no shared sources + if ($disabled{shared}) { + foreach (keys %{$unified_info{shared_sources}}) { + foreach (keys %{$unified_info{shared_sources}->{$_}}) { + delete $unified_info{sources}->{$_}; + } + } + $unified_info{shared_sources} = {}; + } + # If we depend on a header file or a perl module, add an inclusion of # its directory to allow smoothe inclusion foreach my $dest (keys %{$unified_info{depends}}) { @@ -2198,8 +2213,8 @@ EOF next unless defined($unified_info{includes}->{$dest}->{$k}); my @incs = reverse @{$unified_info{includes}->{$dest}->{$k}}; foreach my $obj (grep /\.o$/, - (keys %{$unified_info{sources}->{$dest}}, - keys %{$unified_info{shared_sources}->{$dest}})) { + (keys %{$unified_info{sources}->{$dest} // {}}, + keys %{$unified_info{shared_sources}->{$dest} // {}})) { foreach my $inc (@incs) { unshift @{$unified_info{includes}->{$obj}->{$k}}, $inc unless grep { $_ eq $inc } @{$unified_info{includes}->{$obj}->{$k}}; @@ -2238,6 +2253,42 @@ EOF [ @{$unified_info{includes}->{$dest}->{source}} ]; } } + + # For convenience collect information regarding directories where + # files are generated, those generated files and the end product + # they end up in where applicable. Then, add build rules for those + # directories + my %loopinfo = ( "lib" => [ @{$unified_info{libraries}} ], + "dso" => [ @{$unified_info{engines}} ], + "bin" => [ @{$unified_info{programs}} ], + "script" => [ @{$unified_info{scripts}} ] ); + foreach my $type (keys %loopinfo) { + foreach my $product (@{$loopinfo{$type}}) { + my %dirs = (); + my $pd = dirname($product); + + foreach (@{$unified_info{sources}->{$product} // []}, + @{$unified_info{shared_sources}->{$product} // []}) { + my $d = dirname($_); + + # We don't want to create targets for source directories + # when building out of source + next if ($config{sourcedir} ne $config{builddir} + && $d =~ m|^\Q$config{sourcedir}\E|); + # We already have a "test" target, and the current directory + # is just silly to make a target for + next if $d eq "test" || $d eq "."; + + $dirs{$d} = 1; + push @{$unified_info{dirinfo}->{$d}->{deps}}, $_ + if $d ne $pd; + } + foreach (keys %dirs) { + push @{$unified_info{dirinfo}->{$_}->{products}->{$type}}, + $product; + } + } + } } # For the schemes that need it, we provide the old *_obj configs @@ -2712,10 +2763,16 @@ print <<"EOF"; ********************************************************************** *** *** -*** If you want to report a building issue, please include the *** -*** output from this command: *** +*** OpenSSL has been successfully configured *** *** *** -*** perl configdata.pm --dump *** +*** If you encounter a problem while building, please open an *** +*** issue on GitHub *** +*** and include the output from the following command: *** +*** *** +*** perl configdata.pm --dump *** +*** *** +*** (If you are new to OpenSSL, you might want to consult the *** +*** 'Troubleshooting' section in the INSTALL file first) *** *** *** ********************************************************************** EOF Modified: stable/12/crypto/openssl/INSTALL ============================================================================== --- stable/12/crypto/openssl/INSTALL Tue Nov 20 21:26:25 2018 (r340704) +++ stable/12/crypto/openssl/INSTALL Tue Nov 20 21:35:20 2018 (r340705) @@ -614,8 +614,8 @@ Windows, and as a comma separated list of libraries on VMS. RANLIB The library archive indexer. - RC The Windows resources manipulator. - RCFLAGS Flags for the Windows reources manipulator. + RC The Windows resource compiler. + RCFLAGS Flags for the Windows resource compiler. RM The command to remove files and directories. These cannot be mixed with compiling / linking flags given @@ -969,7 +969,7 @@ BUILDFILE Use a different build file name than the platform default - ("Makefile" on Unixly platforms, "makefile" on native Windows, + ("Makefile" on Unix-like platforms, "makefile" on native Windows, "descrip.mms" on OpenVMS). This requires that there is a corresponding build file template. See Configurations/README for further information. @@ -1171,7 +1171,7 @@ part of the file name, i.e. for OpenSSL 1.1.x, 1.1 is somehow part of the name. - On most POSIXly platforms, shared libraries are named libcrypto.so.1.1 + On most POSIX platforms, shared libraries are named libcrypto.so.1.1 and libssl.so.1.1. on Cygwin, shared libraries are named cygcrypto-1.1.dll and cygssl-1.1.dll @@ -1202,7 +1202,7 @@ The seeding method can be configured using the --with-rand-seed option, which can be used to specify a comma separated list of seed methods. However in most cases OpenSSL will choose a suitable default method, - so it is not necessary to explicitely provide this option. Note also + so it is not necessary to explicitly provide this option. Note also that not all methods are available on all platforms. I) On operating systems which provide a suitable randomness source (in Modified: stable/12/crypto/openssl/NEWS ============================================================================== --- stable/12/crypto/openssl/NEWS Tue Nov 20 21:26:25 2018 (r340704) +++ stable/12/crypto/openssl/NEWS Tue Nov 20 21:35:20 2018 (r340705) @@ -5,6 +5,11 @@ This file gives a brief overview of the major changes between each OpenSSL release. For more details please read the CHANGES file. + Major changes between OpenSSL 1.1.1 and OpenSSL 1.1.1a [20 Nov 2018] + + o Timing vulnerability in DSA signature generation (CVE-2018-0734) + o Timing vulnerability in ECDSA signature generation (CVE-2018-0735) + Major changes between OpenSSL 1.1.0i and OpenSSL 1.1.1 [11 Sep 2018] o Support for TLSv1.3 added (see https://wiki.openssl.org/index.php/TLS1.3 Modified: stable/12/crypto/openssl/README ============================================================================== --- stable/12/crypto/openssl/README Tue Nov 20 21:26:25 2018 (r340704) +++ stable/12/crypto/openssl/README Tue Nov 20 21:35:20 2018 (r340705) @@ -1,5 +1,5 @@ - OpenSSL 1.1.1 11 Sep 2018 + OpenSSL 1.1.1a 20 Nov 2018 Copyright (c) 1998-2018 The OpenSSL Project Copyright (c) 1995-1998 Eric A. Young, Tim J. Hudson Modified: stable/12/crypto/openssl/apps/app_rand.c ============================================================================== --- stable/12/crypto/openssl/apps/app_rand.c Tue Nov 20 21:26:25 2018 (r340704) +++ stable/12/crypto/openssl/apps/app_rand.c Tue Nov 20 21:35:20 2018 (r340705) @@ -1,5 +1,5 @@ /* - * Copyright 1995-2017 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -26,7 +26,6 @@ void app_RAND_load_conf(CONF *c, const char *section) if (RAND_load_file(randfile, -1) < 0) { BIO_printf(bio_err, "Can't load %s into RNG\n", randfile); ERR_print_errors(bio_err); - return; } if (save_rand_file == NULL) save_rand_file = OPENSSL_strdup(randfile); Modified: stable/12/crypto/openssl/apps/apps.c ============================================================================== --- stable/12/crypto/openssl/apps/apps.c Tue Nov 20 21:26:25 2018 (r340704) +++ stable/12/crypto/openssl/apps/apps.c Tue Nov 20 21:35:20 2018 (r340705) @@ -1831,6 +1831,12 @@ X509_NAME *parse_name(const char *cp, long chtype, int opt_getprog(), typestr); continue; } + if (*valstr == '\0') { + BIO_printf(bio_err, + "%s: No value provided for Subject Attribute %s, skipped\n", + opt_getprog(), typestr); + continue; + } if (!X509_NAME_add_entry_by_NID(n, nid, chtype, valstr, strlen((char *)valstr), -1, ismulti ? -1 : 0)) Modified: stable/12/crypto/openssl/apps/apps.h ============================================================================== --- stable/12/crypto/openssl/apps/apps.h Tue Nov 20 21:26:25 2018 (r340704) +++ stable/12/crypto/openssl/apps/apps.h Tue Nov 20 21:35:20 2018 (r340705) @@ -369,7 +369,7 @@ typedef struct string_int_pair_st { # define OPT_FMT_SMIME (1L << 3) # define OPT_FMT_ENGINE (1L << 4) # define OPT_FMT_MSBLOB (1L << 5) -# define OPT_FMT_NETSCAPE (1L << 6) +/* (1L << 6) was OPT_FMT_NETSCAPE, but wasn't used */ # define OPT_FMT_NSS (1L << 7) # define OPT_FMT_TEXT (1L << 8) # define OPT_FMT_HTTP (1L << 9) @@ -378,8 +378,8 @@ typedef struct string_int_pair_st { # define OPT_FMT_PDS (OPT_FMT_PEMDER | OPT_FMT_SMIME) # define OPT_FMT_ANY ( \ OPT_FMT_PEMDER | OPT_FMT_PKCS12 | OPT_FMT_SMIME | \ - OPT_FMT_ENGINE | OPT_FMT_MSBLOB | OPT_FMT_NETSCAPE | \ - OPT_FMT_NSS | OPT_FMT_TEXT | OPT_FMT_HTTP | OPT_FMT_PVK) + OPT_FMT_ENGINE | OPT_FMT_MSBLOB | OPT_FMT_NSS | \ + OPT_FMT_TEXT | OPT_FMT_HTTP | OPT_FMT_PVK) char *opt_progname(const char *argv0); char *opt_getprog(void); Modified: stable/12/crypto/openssl/apps/ca.c ============================================================================== --- stable/12/crypto/openssl/apps/ca.c Tue Nov 20 21:26:25 2018 (r340704) +++ stable/12/crypto/openssl/apps/ca.c Tue Nov 20 21:35:20 2018 (r340705) @@ -605,7 +605,7 @@ end_of_options: /* * outdir is a directory spec, but access() for VMS demands a * filename. We could use the DEC C routine to convert the - * directory syntax to Unixly, and give that to app_isdir, + * directory syntax to Unix, and give that to app_isdir, * but for now the fopen will catch the error if it's not a * directory */ @@ -976,7 +976,7 @@ end_of_options: BIO_printf(bio_err, "Write out database with %d new entries\n", sk_X509_num(cert_sk)); - if (!rand_ser + if (serialfile != NULL && !save_serial(serialfile, "new", serial, NULL)) goto end; @@ -1044,7 +1044,8 @@ end_of_options: if (sk_X509_num(cert_sk)) { /* Rename the database and the serial file */ - if (!rotate_serial(serialfile, "new", "old")) + if (serialfile != NULL + && !rotate_serial(serialfile, "new", "old")) goto end; if (!rotate_index(dbfile, "new", "old")) @@ -1177,10 +1178,9 @@ end_of_options: } /* we have a CRL number that need updating */ - if (crlnumberfile != NULL) - if (!rand_ser - && !save_serial(crlnumberfile, "new", crlnumber, NULL)) - goto end; + if (crlnumberfile != NULL + && !save_serial(crlnumberfile, "new", crlnumber, NULL)) + goto end; BN_free(crlnumber); crlnumber = NULL; @@ -1195,9 +1195,10 @@ end_of_options: PEM_write_bio_X509_CRL(Sout, crl); - if (crlnumberfile != NULL) /* Rename the crlnumber file */ - if (!rotate_serial(crlnumberfile, "new", "old")) - goto end; + /* Rename the crlnumber file */ + if (crlnumberfile != NULL + && !rotate_serial(crlnumberfile, "new", "old")) + goto end; } /*****************************************************************/ Modified: stable/12/crypto/openssl/apps/ocsp.c ============================================================================== --- stable/12/crypto/openssl/apps/ocsp.c Tue Nov 20 21:26:25 2018 (r340704) +++ stable/12/crypto/openssl/apps/ocsp.c Tue Nov 20 21:35:20 2018 (r340705) @@ -950,6 +950,7 @@ static void spawn_loop(void) sleep(30); break; case 0: /* child */ + OPENSSL_free(kidpids); signal(SIGINT, SIG_DFL); signal(SIGTERM, SIG_DFL); if (termsig) @@ -976,6 +977,7 @@ static void spawn_loop(void) } /* The loop above can only break on termsig */ + OPENSSL_free(kidpids); syslog(LOG_INFO, "terminating on signal: %d", termsig); killall(0, kidpids); } Modified: stable/12/crypto/openssl/apps/openssl.cnf ============================================================================== --- stable/12/crypto/openssl/apps/openssl.cnf Tue Nov 20 21:26:25 2018 (r340704) +++ stable/12/crypto/openssl/apps/openssl.cnf Tue Nov 20 21:35:20 2018 (r340705) @@ -11,7 +11,6 @@ # This definition stops the following lines choking if HOME isn't # defined. HOME = . -RANDFILE = $ENV::HOME/.rnd # Extra OBJECT IDENTIFIER info: #oid_file = $ENV::HOME/.oid @@ -58,7 +57,6 @@ crlnumber = $dir/crlnumber # the current crl number # must be commented out to leave a V1 CRL crl = $dir/crl.pem # The current CRL private_key = $dir/private/cakey.pem# The private key -RANDFILE = $dir/private/.rand # private random number file x509_extensions = usr_cert # The extensions to add to the cert Modified: stable/12/crypto/openssl/apps/opt.c ============================================================================== --- stable/12/crypto/openssl/apps/opt.c Tue Nov 20 21:26:25 2018 (r340704) +++ stable/12/crypto/openssl/apps/opt.c Tue Nov 20 21:35:20 2018 (r340705) @@ -168,7 +168,6 @@ static OPT_PAIR formats[] = { {"smime", OPT_FMT_SMIME}, {"engine", OPT_FMT_ENGINE}, {"msblob", OPT_FMT_MSBLOB}, - {"netscape", OPT_FMT_NETSCAPE}, {"nss", OPT_FMT_NSS}, {"text", OPT_FMT_TEXT}, {"http", OPT_FMT_HTTP}, Modified: stable/12/crypto/openssl/apps/rehash.c ============================================================================== --- stable/12/crypto/openssl/apps/rehash.c Tue Nov 20 21:26:25 2018 (r340704) +++ stable/12/crypto/openssl/apps/rehash.c Tue Nov 20 21:35:20 2018 (r340705) @@ -1,6 +1,6 @@ /* * Copyright 2015-2018 The OpenSSL Project Authors. All Rights Reserved. - * Copyright (c) 2013-2014 Timo Teräs + * Copyright (c) 2013-2014 Timo Teräs * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy Modified: stable/12/crypto/openssl/apps/rsa.c ============================================================================== --- stable/12/crypto/openssl/apps/rsa.c Tue Nov 20 21:26:25 2018 (r340704) +++ stable/12/crypto/openssl/apps/rsa.c Tue Nov 20 21:35:20 2018 (r340705) @@ -38,8 +38,8 @@ typedef enum OPTION_choice { const OPTIONS rsa_options[] = { {"help", OPT_HELP, '-', "Display this summary"}, - {"inform", OPT_INFORM, 'f', "Input format, one of DER NET PEM"}, - {"outform", OPT_OUTFORM, 'f', "Output format, one of DER NET PEM PVK"}, + {"inform", OPT_INFORM, 'f', "Input format, one of DER PEM"}, + {"outform", OPT_OUTFORM, 'f', "Output format, one of DER PEM PVK"}, {"in", OPT_IN, 's', "Input file"}, {"out", OPT_OUT, '>', "Output file"}, {"pubin", OPT_PUBIN, '-', "Expect a public key in input file"}, @@ -269,6 +269,9 @@ int rsa_main(int argc, char **argv) } else if (outformat == FORMAT_MSBLOB || outformat == FORMAT_PVK) { EVP_PKEY *pk; pk = EVP_PKEY_new(); + if (pk == NULL) + goto end; + EVP_PKEY_set1_RSA(pk, rsa); if (outformat == FORMAT_PVK) { if (pubin) { Modified: stable/12/crypto/openssl/apps/s_cb.c ============================================================================== --- stable/12/crypto/openssl/apps/s_cb.c Tue Nov 20 21:26:25 2018 (r340704) +++ stable/12/crypto/openssl/apps/s_cb.c Tue Nov 20 21:35:20 2018 (r340705) @@ -394,7 +394,8 @@ int ssl_print_groups(BIO *out, SSL *s, int noshared) int ssl_print_tmp_key(BIO *out, SSL *s) { EVP_PKEY *key; - if (!SSL_get_server_tmp_key(s, &key)) + + if (!SSL_get_peer_tmp_key(s, &key)) return 1; BIO_puts(out, "Server Temp Key: "); switch (EVP_PKEY_id(key)) { Modified: stable/12/crypto/openssl/apps/s_server.c ============================================================================== --- stable/12/crypto/openssl/apps/s_server.c Tue Nov 20 21:26:25 2018 (r340704) +++ stable/12/crypto/openssl/apps/s_server.c Tue Nov 20 21:35:20 2018 (r340705) @@ -193,9 +193,8 @@ static int psk_find_session_cb(SSL *ssl, const unsigne if (strlen(psk_identity) != identity_len || memcmp(psk_identity, identity, identity_len) != 0) { - BIO_printf(bio_s_out, - "PSK warning: client identity not what we expected" - " (got '%s' expected '%s')\n", identity, psk_identity); + *sess = NULL; + return 1; } if (psksess != NULL) { @@ -1622,6 +1621,11 @@ int s_server_main(int argc, char *argv[]) goto end; } #endif + if (early_data && (www > 0 || rev)) { + BIO_printf(bio_err, + "Can't use -early_data in combination with -www, -WWW, -HTTP, or -rev\n"); + goto end; + } #ifndef OPENSSL_NO_SCTP if (protocol == IPPROTO_SCTP) { Modified: stable/12/crypto/openssl/apps/speed.c ============================================================================== --- stable/12/crypto/openssl/apps/speed.c Tue Nov 20 21:26:25 2018 (r340704) +++ stable/12/crypto/openssl/apps/speed.c Tue Nov 20 21:35:20 2018 (r340705) @@ -2896,7 +2896,7 @@ int speed_main(int argc, char **argv) if (rsa_count <= 1) { /* if longer than 10s, don't do any more */ - for (testnum++; testnum < EC_NUM; testnum++) + for (testnum++; testnum < ECDSA_NUM; testnum++) ecdsa_doit[testnum] = 0; } } Modified: stable/12/crypto/openssl/apps/x509.c ============================================================================== --- stable/12/crypto/openssl/apps/x509.c Tue Nov 20 21:26:25 2018 (r340704) +++ stable/12/crypto/openssl/apps/x509.c Tue Nov 20 21:35:20 2018 (r340705) @@ -67,10 +67,10 @@ typedef enum OPTION_choice { const OPTIONS x509_options[] = { {"help", OPT_HELP, '-', "Display this summary"}, {"inform", OPT_INFORM, 'f', - "Input format - default PEM (one of DER, NET or PEM)"}, + "Input format - default PEM (one of DER or PEM)"}, {"in", OPT_IN, '<', "Input file - default stdin"}, {"outform", OPT_OUTFORM, 'f', - "Output format - default PEM (one of DER, NET or PEM)"}, + "Output format - default PEM (one of DER or PEM)"}, {"out", OPT_OUT, '>', "Output file - default stdout"}, {"keyform", OPT_KEYFORM, 'F', "Private key format - default PEM"}, {"passin", OPT_PASSIN, 's', "Private key password/pass-phrase source"}, Modified: stable/12/crypto/openssl/crypto/LPdir_unix.c ============================================================================== --- stable/12/crypto/openssl/crypto/LPdir_unix.c Tue Nov 20 21:26:25 2018 (r340704) +++ stable/12/crypto/openssl/crypto/LPdir_unix.c Tue Nov 20 21:35:20 2018 (r340705) @@ -51,7 +51,7 @@ #endif /* - * The POSIXly macro for the maximum number of characters in a file path is + * The POSIX macro for the maximum number of characters in a file path is * NAME_MAX. However, some operating systems use PATH_MAX instead. * Therefore, it seems natural to first check for PATH_MAX and use that, and * if it doesn't exist, use NAME_MAX. Modified: stable/12/crypto/openssl/crypto/async/arch/async_posix.h ============================================================================== --- stable/12/crypto/openssl/crypto/async/arch/async_posix.h Tue Nov 20 21:26:25 2018 (r340704) +++ stable/12/crypto/openssl/crypto/async/arch/async_posix.h Tue Nov 20 21:35:20 2018 (r340705) @@ -17,7 +17,8 @@ # include -# if _POSIX_VERSION >= 200112L +# if _POSIX_VERSION >= 200112L \ + && (_POSIX_VERSION < 200809L || defined(__GLIBC__)) # include Modified: stable/12/crypto/openssl/crypto/bio/b_sock2.c ============================================================================== --- stable/12/crypto/openssl/crypto/bio/b_sock2.c Tue Nov 20 21:26:25 2018 (r340704) +++ stable/12/crypto/openssl/crypto/bio/b_sock2.c Tue Nov 20 21:35:20 2018 (r340705) @@ -133,7 +133,9 @@ int BIO_connect(int sock, const BIO_ADDR *addr, int op */ int BIO_bind(int sock, const BIO_ADDR *addr, int options) { +# ifndef OPENSSL_SYS_WINDOWS int on = 1; +# endif if (sock == -1) { BIOerr(BIO_F_BIO_BIND, BIO_R_INVALID_SOCKET); Modified: stable/12/crypto/openssl/crypto/bio/bio_lib.c ============================================================================== --- stable/12/crypto/openssl/crypto/bio/bio_lib.c Tue Nov 20 21:26:25 2018 (r340704) +++ stable/12/crypto/openssl/crypto/bio/bio_lib.c Tue Nov 20 21:35:20 2018 (r340705) @@ -52,7 +52,7 @@ static long bio_call_callback(BIO *b, int oper, const argi = (int)len; } - if (inret && (oper & BIO_CB_RETURN) && bareoper != BIO_CB_CTRL) { + if (inret > 0 && (oper & BIO_CB_RETURN) && bareoper != BIO_CB_CTRL) { if (*processed > INT_MAX) return -1; inret = *processed; @@ -60,7 +60,7 @@ static long bio_call_callback(BIO *b, int oper, const ret = b->callback(b, oper, argp, argi, argl, inret); - if (ret >= 0 && (oper & BIO_CB_RETURN) && bareoper != BIO_CB_CTRL) { + if (ret > 0 && (oper & BIO_CB_RETURN) && bareoper != BIO_CB_CTRL) { *processed = (size_t)ret; ret = 1; } Modified: stable/12/crypto/openssl/crypto/bio/bss_log.c ============================================================================== --- stable/12/crypto/openssl/crypto/bio/bss_log.c Tue Nov 20 21:26:25 2018 (r340704) +++ stable/12/crypto/openssl/crypto/bio/bss_log.c Tue Nov 20 21:35:20 2018 (r340705) @@ -408,4 +408,9 @@ static void xcloselog(BIO *bp) # endif /* Unix */ +#else /* NO_SYSLOG */ +const BIO_METHOD *BIO_s_log(void) +{ + return NULL; +} #endif /* NO_SYSLOG */ Modified: stable/12/crypto/openssl/crypto/bn/asm/x86_64-gcc.c ============================================================================== --- stable/12/crypto/openssl/crypto/bn/asm/x86_64-gcc.c Tue Nov 20 21:26:25 2018 (r340704) +++ stable/12/crypto/openssl/crypto/bn/asm/x86_64-gcc.c Tue Nov 20 21:35:20 2018 (r340705) @@ -1,5 +1,5 @@ /* - * Copyright 2002-2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2002-2018 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -63,12 +63,6 @@ * very much like 64-bit code compiled with no-asm on the same * machine. */ - -# if defined(_WIN64) || !defined(__LP64__) -# define BN_ULONG unsigned long long -# else -# define BN_ULONG unsigned long -# endif # undef mul # undef mul_add Modified: stable/12/crypto/openssl/crypto/bn/bn_exp.c ============================================================================== --- stable/12/crypto/openssl/crypto/bn/bn_exp.c Tue Nov 20 21:26:25 2018 (r340704) +++ stable/12/crypto/openssl/crypto/bn/bn_exp.c Tue Nov 20 21:35:20 2018 (r340705) @@ -1077,7 +1077,7 @@ int BN_mod_exp_mont_consttime(BIGNUM *rr, const BIGNUM * is not only slower but also makes each bit vulnerable to * EM (and likely other) side-channel attacks like One&Done * (for details see "One&Done: A Single-Decryption EM-Based - * Attack on OpenSSL’s Constant-Time Blinded RSA" by M. Alam, + * Attack on OpenSSL's Constant-Time Blinded RSA" by M. Alam, * H. Khan, M. Dey, N. Sinha, R. Callan, A. Zajic, and * M. Prvulovic, in USENIX Security'18) */ Modified: stable/12/crypto/openssl/crypto/bn/bn_lib.c ============================================================================== --- stable/12/crypto/openssl/crypto/bn/bn_lib.c Tue Nov 20 21:26:25 2018 (r340704) +++ stable/12/crypto/openssl/crypto/bn/bn_lib.c Tue Nov 20 21:35:20 2018 (r340705) @@ -767,26 +767,30 @@ void BN_consttime_swap(BN_ULONG condition, BIGNUM *a, b->neg ^= t; /*- - * Idea behind BN_FLG_STATIC_DATA is actually to - * indicate that data may not be written to. - * Intention is actually to treat it as it's - * read-only data, and some (if not most) of it does - * reside in read-only segment. In other words - * observation of BN_FLG_STATIC_DATA in - * BN_consttime_swap should be treated as fatal - * condition. It would either cause SEGV or - * effectively cause data corruption. - * BN_FLG_MALLOCED refers to BN structure itself, - * and hence must be preserved. Remaining flags are - * BN_FLG_CONSTIME and BN_FLG_SECURE. Latter must be - * preserved, because it determines how x->d was - * allocated and hence how to free it. This leaves - * BN_FLG_CONSTTIME that one can do something about. - * To summarize it's sufficient to mask and swap - * BN_FLG_CONSTTIME alone. BN_FLG_STATIC_DATA should - * be treated as fatal. + * BN_FLG_STATIC_DATA: indicates that data may not be written to. Intention + * is actually to treat it as it's read-only data, and some (if not most) + * of it does reside in read-only segment. In other words observation of + * BN_FLG_STATIC_DATA in BN_consttime_swap should be treated as fatal + * condition. It would either cause SEGV or effectively cause data + * corruption. + * + * BN_FLG_MALLOCED: refers to BN structure itself, and hence must be + * preserved. + * + * BN_FLG_SECURE: must be preserved, because it determines how x->d was + * allocated and hence how to free it. + * + * BN_FLG_CONSTTIME: sufficient to mask and swap + * + * BN_FLG_FIXED_TOP: indicates that we haven't called bn_correct_top() on + * the data, so the d array may be padded with additional 0 values (i.e. + * top could be greater than the minimal value that it could be). We should + * be swapping it */ - t = ((a->flags ^ b->flags) & BN_FLG_CONSTTIME) & condition; + +#define BN_CONSTTIME_SWAP_FLAGS (BN_FLG_CONSTTIME | BN_FLG_FIXED_TOP) + + t = ((a->flags ^ b->flags) & BN_CONSTTIME_SWAP_FLAGS) & condition; a->flags ^= t; b->flags ^= t; Modified: stable/12/crypto/openssl/crypto/build.info ============================================================================== --- stable/12/crypto/openssl/crypto/build.info Tue Nov 20 21:26:25 2018 (r340704) +++ stable/12/crypto/openssl/crypto/build.info Tue Nov 20 21:35:20 2018 (r340705) @@ -2,7 +2,7 @@ LIBS=../libcrypto SOURCE[../libcrypto]=\ cryptlib.c mem.c mem_dbg.c cversion.c ex_data.c cpt_err.c \ ebcdic.c uid.c o_time.c o_str.c o_dir.c o_fopen.c ctype.c \ - threads_pthread.c threads_win.c threads_none.c \ + threads_pthread.c threads_win.c threads_none.c getenv.c \ o_init.c o_fips.c mem_sec.c init.c {- $target{cpuid_asm_src} -} \ {- $target{uplink_aux_src} -} EXTRA= ../ms/uplink-x86.pl ../ms/uplink.c ../ms/applink.c \ Modified: stable/12/crypto/openssl/crypto/conf/conf_api.c ============================================================================== --- stable/12/crypto/openssl/crypto/conf/conf_api.c Tue Nov 20 21:26:25 2018 (r340704) +++ stable/12/crypto/openssl/crypto/conf/conf_api.c Tue Nov 20 21:35:20 2018 (r340705) @@ -10,6 +10,7 @@ /* Part of the code in here was originally in conf.c, which is now removed */ #include "e_os.h" +#include "internal/cryptlib.h" #include #include #include @@ -82,7 +83,7 @@ char *_CONF_get_string(const CONF *conf, const char *s if (v != NULL) return v->value; if (strcmp(section, "ENV") == 0) { - p = getenv(name); + p = ossl_safe_getenv(name); if (p != NULL) return p; } @@ -95,7 +96,7 @@ char *_CONF_get_string(const CONF *conf, const char *s else return NULL; } else - return getenv(name); + return ossl_safe_getenv(name); } static unsigned long conf_value_hash(const CONF_VALUE *v) Modified: stable/12/crypto/openssl/crypto/conf/conf_mod.c ============================================================================== --- stable/12/crypto/openssl/crypto/conf/conf_mod.c Tue Nov 20 21:26:25 2018 (r340704) +++ stable/12/crypto/openssl/crypto/conf/conf_mod.c Tue Nov 20 21:35:20 2018 (r340705) @@ -480,11 +480,8 @@ char *CONF_get1_default_config_file(void) char *file, *sep = ""; int len; - if (!OPENSSL_issetugid()) { - file = getenv("OPENSSL_CONF"); - if (file) - return OPENSSL_strdup(file); - } + if ((file = ossl_safe_getenv("OPENSSL_CONF")) != NULL) + return OPENSSL_strdup(file); len = strlen(X509_get_default_cert_area()); #ifndef OPENSSL_SYS_VMS Modified: stable/12/crypto/openssl/crypto/cryptlib.c ============================================================================== --- stable/12/crypto/openssl/crypto/cryptlib.c Tue Nov 20 21:26:25 2018 (r340704) +++ stable/12/crypto/openssl/crypto/cryptlib.c Tue Nov 20 21:35:20 2018 (r340705) @@ -204,7 +204,7 @@ int OPENSSL_isservice(void) if (_OPENSSL_isservice.p == NULL) { HANDLE mod = GetModuleHandle(NULL); - FARPROC f; + FARPROC f = NULL; if (mod != NULL) f = GetProcAddress(mod, "_OPENSSL_isservice"); Modified: stable/12/crypto/openssl/crypto/ct/ct_log.c ============================================================================== --- stable/12/crypto/openssl/crypto/ct/ct_log.c Tue Nov 20 21:26:25 2018 (r340704) +++ stable/12/crypto/openssl/crypto/ct/ct_log.c Tue Nov 20 21:35:20 2018 (r340705) @@ -137,7 +137,7 @@ static int ctlog_new_from_conf(CTLOG **ct_log, const C int CTLOG_STORE_load_default_file(CTLOG_STORE *store) { - const char *fpath = getenv(CTLOG_FILE_EVP); + const char *fpath = ossl_safe_getenv(CTLOG_FILE_EVP); if (fpath == NULL) fpath = CTLOG_FILE; Modified: stable/12/crypto/openssl/crypto/dsa/dsa_gen.c ============================================================================== --- stable/12/crypto/openssl/crypto/dsa/dsa_gen.c Tue Nov 20 21:26:25 2018 (r340704) +++ stable/12/crypto/openssl/crypto/dsa/dsa_gen.c Tue Nov 20 21:35:20 2018 (r340705) @@ -327,6 +327,12 @@ int dsa_builtin_paramgen2(DSA *ret, size_t L, size_t N if (mctx == NULL) goto err; + /* make sure L > N, otherwise we'll get trapped in an infinite loop */ + if (L <= N) { + DSAerr(DSA_F_DSA_BUILTIN_PARAMGEN2, DSA_R_INVALID_PARAMETERS); + goto err; + } + if (evpmd == NULL) { if (N == 160) evpmd = EVP_sha1(); Modified: stable/12/crypto/openssl/crypto/dsa/dsa_ossl.c ============================================================================== --- stable/12/crypto/openssl/crypto/dsa/dsa_ossl.c Tue Nov 20 21:26:25 2018 (r340704) +++ stable/12/crypto/openssl/crypto/dsa/dsa_ossl.c Tue Nov 20 21:35:20 2018 (r340705) @@ -9,6 +9,7 @@ #include #include "internal/cryptlib.h" +#include "internal/bn_int.h" #include #include #include "dsa_locl.h" @@ -23,6 +24,8 @@ static int dsa_do_verify(const unsigned char *dgst, in DSA_SIG *sig, DSA *dsa); static int dsa_init(DSA *dsa); static int dsa_finish(DSA *dsa); +static BIGNUM *dsa_mod_inverse_fermat(const BIGNUM *k, const BIGNUM *q, + BN_CTX *ctx); static DSA_METHOD openssl_dsa_meth = { "OpenSSL DSA method", @@ -178,9 +181,9 @@ static int dsa_sign_setup(DSA *dsa, BN_CTX *ctx_in, { BN_CTX *ctx = NULL; BIGNUM *k, *kinv = NULL, *r = *rp; - BIGNUM *l, *m; + BIGNUM *l; int ret = 0; - int q_bits; + int q_bits, q_words; if (!dsa->p || !dsa->q || !dsa->g) { DSAerr(DSA_F_DSA_SIGN_SETUP, DSA_R_MISSING_PARAMETERS); @@ -189,8 +192,7 @@ static int dsa_sign_setup(DSA *dsa, BN_CTX *ctx_in, k = BN_new(); l = BN_new(); - m = BN_new(); - if (k == NULL || l == NULL || m == NULL) + if (k == NULL || l == NULL) goto err; if (ctx_in == NULL) { @@ -201,9 +203,9 @@ static int dsa_sign_setup(DSA *dsa, BN_CTX *ctx_in, /* Preallocate space */ q_bits = BN_num_bits(dsa->q); - if (!BN_set_bit(k, q_bits) - || !BN_set_bit(l, q_bits) - || !BN_set_bit(m, q_bits)) + q_words = bn_get_top(dsa->q); + if (!bn_wexpand(k, q_words + 2) + || !bn_wexpand(l, q_words + 2)) goto err; /* Get random k */ @@ -221,6 +223,7 @@ static int dsa_sign_setup(DSA *dsa, BN_CTX *ctx_in, } while (BN_is_zero(k)); BN_set_flags(k, BN_FLG_CONSTTIME); + BN_set_flags(l, BN_FLG_CONSTTIME); if (dsa->flags & DSA_FLAG_CACHE_MONT_P) { if (!BN_MONT_CTX_set_locked(&dsa->method_mont_p, @@ -238,14 +241,17 @@ static int dsa_sign_setup(DSA *dsa, BN_CTX *ctx_in, * small timing information leakage. We then choose the sum that is * one bit longer than the modulus. * - * TODO: revisit the BN_copy aiming for a memory access agnostic - * conditional copy. + * There are some concerns about the efficacy of doing this. More + * specificly refer to the discussion starting with: + * https://github.com/openssl/openssl/pull/7486#discussion_r228323705 + * The fix is to rework BN so these gymnastics aren't required. */ if (!BN_add(l, k, dsa->q) - || !BN_add(m, l, dsa->q) - || !BN_copy(k, BN_num_bits(l) > q_bits ? l : m)) + || !BN_add(k, l, dsa->q)) goto err; + BN_consttime_swap(BN_is_bit_set(l, q_bits), k, l, q_words + 2); + if ((dsa)->meth->bn_mod_exp != NULL) { if (!dsa->meth->bn_mod_exp(dsa, r, dsa->g, k, dsa->p, ctx, dsa->method_mont_p)) @@ -258,8 +264,8 @@ static int dsa_sign_setup(DSA *dsa, BN_CTX *ctx_in, if (!BN_mod(r, r, dsa->q, ctx)) goto err; - /* Compute part of 's = inv(k) (m + xr) mod q' */ - if ((kinv = BN_mod_inverse(NULL, k, dsa->q, ctx)) == NULL) + /* Compute part of 's = inv(k) (m + xr) mod q' */ + if ((kinv = dsa_mod_inverse_fermat(k, dsa->q, ctx)) == NULL) goto err; BN_clear_free(*kinvp); @@ -273,7 +279,6 @@ static int dsa_sign_setup(DSA *dsa, BN_CTX *ctx_in, BN_CTX_free(ctx); BN_clear_free(k); BN_clear_free(l); - BN_clear_free(m); return ret; } @@ -392,4 +397,32 @@ static int dsa_finish(DSA *dsa) { BN_MONT_CTX_free(dsa->method_mont_p); return 1; +} + +/* + * Compute the inverse of k modulo q. + * Since q is prime, Fermat's Little Theorem applies, which reduces this to + * mod-exp operation. Both the exponent and modulus are public information + * so a mod-exp that doesn't leak the base is sufficient. A newly allocated + * BIGNUM is returned which the caller must free. + */ +static BIGNUM *dsa_mod_inverse_fermat(const BIGNUM *k, const BIGNUM *q, + BN_CTX *ctx) +{ + BIGNUM *res = NULL; + BIGNUM *r, *e; + + if ((r = BN_new()) == NULL) + return NULL; + + BN_CTX_start(ctx); + if ((e = BN_CTX_get(ctx)) != NULL + && BN_set_word(r, 2) + && BN_sub(e, q, r) + && BN_mod_exp_mont(r, k, e, q, ctx, NULL)) + res = r; + else + BN_free(r); + BN_CTX_end(ctx); + return res; } Modified: stable/12/crypto/openssl/crypto/ec/ec_ameth.c ============================================================================== --- stable/12/crypto/openssl/crypto/ec/ec_ameth.c Tue Nov 20 21:26:25 2018 (r340704) +++ stable/12/crypto/openssl/crypto/ec/ec_ameth.c Tue Nov 20 21:35:20 2018 (r340705) @@ -699,7 +699,7 @@ static int ecdh_cms_set_kdf_param(EVP_PKEY_CTX *pctx, if (EVP_PKEY_CTX_set_ecdh_cofactor_mode(pctx, cofactor) <= 0) return 0; - if (EVP_PKEY_CTX_set_ecdh_kdf_type(pctx, EVP_PKEY_ECDH_KDF_X9_62) <= 0) + if (EVP_PKEY_CTX_set_ecdh_kdf_type(pctx, EVP_PKEY_ECDH_KDF_X9_63) <= 0) return 0; kdf_md = EVP_get_digestbynid(kdfmd_nid); @@ -864,7 +864,7 @@ static int ecdh_cms_encrypt(CMS_RecipientInfo *ri) ecdh_nid = NID_dh_cofactor_kdf; if (kdf_type == EVP_PKEY_ECDH_KDF_NONE) { - kdf_type = EVP_PKEY_ECDH_KDF_X9_62; + kdf_type = EVP_PKEY_ECDH_KDF_X9_63; if (EVP_PKEY_CTX_set_ecdh_kdf_type(pctx, kdf_type) <= 0) goto err; } else Modified: stable/12/crypto/openssl/crypto/ec/ec_mult.c ============================================================================== --- stable/12/crypto/openssl/crypto/ec/ec_mult.c Tue Nov 20 21:26:25 2018 (r340704) +++ stable/12/crypto/openssl/crypto/ec/ec_mult.c Tue Nov 20 21:35:20 2018 (r340705) @@ -206,8 +206,8 @@ int ec_scalar_mul_ladder(const EC_GROUP *group, EC_POI */ cardinality_bits = BN_num_bits(cardinality); group_top = bn_get_top(cardinality); - if ((bn_wexpand(k, group_top + 1) == NULL) - || (bn_wexpand(lambda, group_top + 1) == NULL)) { + if ((bn_wexpand(k, group_top + 2) == NULL) + || (bn_wexpand(lambda, group_top + 2) == NULL)) { ECerr(EC_F_EC_SCALAR_MUL_LADDER, ERR_R_BN_LIB); goto err; } @@ -244,7 +244,7 @@ int ec_scalar_mul_ladder(const EC_GROUP *group, EC_POI * k := scalar + 2*cardinality */ kbit = BN_is_bit_set(lambda, cardinality_bits); - BN_consttime_swap(kbit, k, lambda, group_top + 1); + BN_consttime_swap(kbit, k, lambda, group_top + 2); group_top = bn_get_top(group->field); if ((bn_wexpand(s->X, group_top) == NULL) Modified: stable/12/crypto/openssl/crypto/ec/ec_pmeth.c ============================================================================== --- stable/12/crypto/openssl/crypto/ec/ec_pmeth.c Tue Nov 20 21:26:25 2018 (r340704) +++ stable/12/crypto/openssl/crypto/ec/ec_pmeth.c Tue Nov 20 21:35:20 2018 (r340705) @@ -209,7 +209,7 @@ static int pkey_ec_kdf_derive(EVP_PKEY_CTX *ctx, if (!pkey_ec_derive(ctx, ktmp, &ktmplen)) goto err; /* Do KDF stuff */ - if (!ECDH_KDF_X9_62(key, *keylen, ktmp, ktmplen, + if (!ecdh_KDF_X9_63(key, *keylen, ktmp, ktmplen, dctx->kdf_ukm, dctx->kdf_ukmlen, dctx->kdf_md)) goto err; rv = 1; @@ -281,7 +281,7 @@ static int pkey_ec_ctrl(EVP_PKEY_CTX *ctx, int type, i case EVP_PKEY_CTRL_EC_KDF_TYPE: if (p1 == -2) return dctx->kdf_type; - if (p1 != EVP_PKEY_ECDH_KDF_NONE && p1 != EVP_PKEY_ECDH_KDF_X9_62) + if (p1 != EVP_PKEY_ECDH_KDF_NONE && p1 != EVP_PKEY_ECDH_KDF_X9_63) return -2; dctx->kdf_type = p1; return 1; Modified: stable/12/crypto/openssl/crypto/ec/ecdh_kdf.c ============================================================================== --- stable/12/crypto/openssl/crypto/ec/ecdh_kdf.c Tue Nov 20 21:26:25 2018 (r340704) +++ stable/12/crypto/openssl/crypto/ec/ecdh_kdf.c Tue Nov 20 21:35:20 2018 (r340705) @@ -1,5 +1,5 @@ /* - * Copyright 2015-2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2015-2018 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -10,12 +10,13 @@ #include #include #include +#include "ec_lcl.h" -/* Key derivation function from X9.62/SECG */ +/* Key derivation function from X9.63/SECG */ /* Way more than we will ever need */ #define ECDH_KDF_MAX (1 << 30) -int ECDH_KDF_X9_62(unsigned char *out, size_t outlen, +int ecdh_KDF_X9_63(unsigned char *out, size_t outlen, const unsigned char *Z, size_t Zlen, const unsigned char *sinfo, size_t sinfolen, const EVP_MD *md) @@ -65,4 +66,16 @@ int ECDH_KDF_X9_62(unsigned char *out, size_t outlen, err: EVP_MD_CTX_free(mctx); return rv; +} + +/*- + * The old name for ecdh_KDF_X9_63 + * Retained for ABI compatibility + */ +int ECDH_KDF_X9_62(unsigned char *out, size_t outlen, + const unsigned char *Z, size_t Zlen, + const unsigned char *sinfo, size_t sinfolen, + const EVP_MD *md) +{ + return ecdh_KDF_X9_63(out, outlen, Z, Zlen, sinfo, sinfolen, md); } Modified: stable/12/crypto/openssl/crypto/engine/eng_devcrypto.c ============================================================================== --- stable/12/crypto/openssl/crypto/engine/eng_devcrypto.c Tue Nov 20 21:26:25 2018 (r340704) +++ stable/12/crypto/openssl/crypto/engine/eng_devcrypto.c Tue Nov 20 21:35:20 2018 (r340705) @@ -28,6 +28,13 @@ # define CHECK_BSD_STYLE_MACROS #endif +/* + * ONE global file descriptor for all sessions. This allows operations + * such as digest session data copying (see digest_copy()), but is also + * saner... why re-open /dev/crypto for every session? + */ +static int cfd; + /****************************************************************************** * * Ciphers @@ -39,7 +46,6 @@ *****/ struct cipher_ctx { - int cfd; struct session_op sess; /* to pass from init to do_cipher */ @@ -69,7 +75,7 @@ static const struct cipher_data_st { { NID_aes_192_cbc, 16, 192 / 8, 16, EVP_CIPH_CBC_MODE, CRYPTO_AES_CBC }, { NID_aes_256_cbc, 16, 256 / 8, 16, EVP_CIPH_CBC_MODE, CRYPTO_AES_CBC }, #ifndef OPENSSL_NO_RC4 - { NID_rc4, 1, 16, 0, CRYPTO_ARC4 }, + { NID_rc4, 1, 16, 0, EVP_CIPH_STREAM_CIPHER, CRYPTO_ARC4 }, *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Tue Nov 20 22:12:11 2018 Return-Path: Delivered-To: svn-src-all@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 D61CB113FFE8; Tue, 20 Nov 2018 22:12:11 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.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 7C8428685F; Tue, 20 Nov 2018 22:12:11 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5F20C17654; Tue, 20 Nov 2018 22:12:11 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAKMCBnk064133; Tue, 20 Nov 2018 22:12:11 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAKMCBCW064132; Tue, 20 Nov 2018 22:12:11 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <201811202212.wAKMCBCW064132@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Tue, 20 Nov 2018 22:12:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340706 - head X-SVN-Group: head X-SVN-Commit-Author: jkim X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 340706 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 7C8428685F X-Spamd-Result: default: False [0.51 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_MEDIUM(0.13)[0.126,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.39)[0.386,0]; NEURAL_HAM_LONG(-0.00)[-0.003,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Nov 2018 22:12:12 -0000 Author: jkim Date: Tue Nov 20 22:12:10 2018 New Revision: 340706 URL: https://svnweb.freebsd.org/changeset/base/340706 Log: Remove stale manual pages after OpenSSL 1.1.1a merge. Modified: head/ObsoleteFiles.inc Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Tue Nov 20 21:35:20 2018 (r340705) +++ head/ObsoleteFiles.inc Tue Nov 20 22:12:10 2018 (r340706) @@ -38,6 +38,14 @@ # xargs -n1 | sort | uniq -d; # done +# 20181120: OpenSSL 1.1.1a +OLD_FILES+=usr/share/openssl/man/man3/SSL_CTX_add_client_CA.3.gz +OLD_FILES+=usr/share/openssl/man/man3/SSL_CTX_get_client_CA_list.3.gz +OLD_FILES+=usr/share/openssl/man/man3/SSL_CTX_set_client_CA_list.3.gz +OLD_FILES+=usr/share/openssl/man/man3/SSL_add_client_CA.3.gz +OLD_FILES+=usr/share/openssl/man/man3/SSL_get_client_CA_list.3.gz +OLD_FILES+=usr/share/openssl/man/man3/SSL_get_server_tmp_key.3.gz +OLD_FILES+=usr/share/openssl/man/man3/SSL_set_client_CA_list.3.gz # 20181116: Rename test file. OLD_FILES+=usr/tests/sys/netinet/reuseport_lb # 20181112: Cleanup old libcap_dns. From owner-svn-src-all@freebsd.org Tue Nov 20 22:21:20 2018 Return-Path: Delivered-To: svn-src-all@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 4D2DE1140519; Tue, 20 Nov 2018 22:21:20 +0000 (UTC) (envelope-from araujo@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 DF76586EAB; Tue, 20 Nov 2018 22:21:19 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C0A4B176B7; Tue, 20 Nov 2018 22:21:19 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAKMLJDM068168; Tue, 20 Nov 2018 22:21:19 GMT (envelope-from araujo@FreeBSD.org) Received: (from araujo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAKMLJ3W068166; Tue, 20 Nov 2018 22:21:19 GMT (envelope-from araujo@FreeBSD.org) Message-Id: <201811202221.wAKMLJ3W068166@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: araujo set sender to araujo@FreeBSD.org using -f From: Marcelo Araujo Date: Tue, 20 Nov 2018 22:21:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340707 - head/usr.sbin/bhyve X-SVN-Group: head X-SVN-Commit-Author: araujo X-SVN-Commit-Paths: head/usr.sbin/bhyve X-SVN-Commit-Revision: 340707 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: DF76586EAB X-Spamd-Result: default: False [0.53 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.00)[0.001,0]; NEURAL_SPAM_MEDIUM(0.14)[0.143,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.39)[0.391,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Nov 2018 22:21:20 -0000 Author: araujo Date: Tue Nov 20 22:21:19 2018 New Revision: 340707 URL: https://svnweb.freebsd.org/changeset/base/340707 Log: Define AHCI_PORT_IDENT and increase by 1 the VTBLK_BLK_ID_BYTES to avoid buffer accessed out of bounds, also switch to snprintf(3). PR: 200859 Submitted by: Caglar Obtained from: https://github.com/mist64/xhyve/pull/24 MFC after: 4 weeks Sponsored by: iXsystems Inc. Modified: head/usr.sbin/bhyve/pci_ahci.c head/usr.sbin/bhyve/pci_virtio_block.c Modified: head/usr.sbin/bhyve/pci_ahci.c ============================================================================== --- head/usr.sbin/bhyve/pci_ahci.c Tue Nov 20 22:12:10 2018 (r340706) +++ head/usr.sbin/bhyve/pci_ahci.c Tue Nov 20 22:21:19 2018 (r340707) @@ -105,7 +105,7 @@ enum sata_fis_type { * ATA commands */ #define ATA_SF_ENAB_SATA_SF 0x10 -#define ATA_SATA_SF_AN 0x05 +#define ATA_SATA_SF_AN 0x05 #define ATA_SF_DIS_SATA_SF 0x90 /* @@ -119,6 +119,8 @@ static FILE *dbg; #endif #define WPRINTF(format, arg...) printf(format, ##arg) +#define AHCI_PORT_IDENT 20 + 1 + struct ahci_ioreq { struct blockif_req io_req; struct ahci_port *io_pr; @@ -136,7 +138,7 @@ struct ahci_port { struct pci_ahci_softc *pr_sc; uint8_t *cmd_lst; uint8_t *rfis; - char ident[20 + 1]; + char ident[AHCI_PORT_IDENT]; int port; int atapi; int reset; @@ -2374,7 +2376,8 @@ pci_ahci_init(struct vmctx *ctx, struct pci_devinst *p MD5Init(&mdctx); MD5Update(&mdctx, opts, strlen(opts)); MD5Final(digest, &mdctx); - sprintf(sc->port[p].ident, "BHYVE-%02X%02X-%02X%02X-%02X%02X", + snprintf(sc->port[p].ident, AHCI_PORT_IDENT, + "BHYVE-%02X%02X-%02X%02X-%02X%02X", digest[0], digest[1], digest[2], digest[3], digest[4], digest[5]); Modified: head/usr.sbin/bhyve/pci_virtio_block.c ============================================================================== --- head/usr.sbin/bhyve/pci_virtio_block.c Tue Nov 20 22:12:10 2018 (r340706) +++ head/usr.sbin/bhyve/pci_virtio_block.c Tue Nov 20 22:21:19 2018 (r340707) @@ -61,7 +61,7 @@ __FBSDID("$FreeBSD$"); #define VTBLK_S_IOERR 1 #define VTBLK_S_UNSUPP 2 -#define VTBLK_BLK_ID_BYTES 20 +#define VTBLK_BLK_ID_BYTES 20 + 1 /* Capability bits */ #define VTBLK_F_SEG_MAX (1 << 2) /* Maximum request segments */ @@ -344,7 +344,8 @@ pci_vtblk_init(struct vmctx *ctx, struct pci_devinst * MD5Init(&mdctx); MD5Update(&mdctx, opts, strlen(opts)); MD5Final(digest, &mdctx); - sprintf(sc->vbsc_ident, "BHYVE-%02X%02X-%02X%02X-%02X%02X", + snprintf(sc->vbsc_ident, VTBLK_BLK_ID_BYTES, + "BHYVE-%02X%02X-%02X%02X-%02X%02X", digest[0], digest[1], digest[2], digest[3], digest[4], digest[5]); /* setup virtio block config space */ From owner-svn-src-all@freebsd.org Tue Nov 20 22:24:20 2018 Return-Path: Delivered-To: svn-src-all@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 E395D114060D; Tue, 20 Nov 2018 22:24:19 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.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 8073E87192; Tue, 20 Nov 2018 22:24:19 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6185617824; Tue, 20 Nov 2018 22:24:19 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAKMOJYt071575; Tue, 20 Nov 2018 22:24:19 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAKMOJAK071574; Tue, 20 Nov 2018 22:24:19 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <201811202224.wAKMOJAK071574@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Tue, 20 Nov 2018 22:24:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r340708 - stable/12 X-SVN-Group: stable-12 X-SVN-Commit-Author: jkim X-SVN-Commit-Paths: stable/12 X-SVN-Commit-Revision: 340708 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 8073E87192 X-Spamd-Result: default: False [0.52 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.01)[0.007,0]; NEURAL_SPAM_MEDIUM(0.17)[0.172,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.34)[0.343,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Nov 2018 22:24:20 -0000 Author: jkim Date: Tue Nov 20 22:24:18 2018 New Revision: 340708 URL: https://svnweb.freebsd.org/changeset/base/340708 Log: MFC: r340706 Remove stale manual pages after OpenSSL 1.1.1a merge. Modified: stable/12/ObsoleteFiles.inc Directory Properties: stable/12/ (props changed) Modified: stable/12/ObsoleteFiles.inc ============================================================================== --- stable/12/ObsoleteFiles.inc Tue Nov 20 22:21:19 2018 (r340707) +++ stable/12/ObsoleteFiles.inc Tue Nov 20 22:24:18 2018 (r340708) @@ -38,6 +38,14 @@ # xargs -n1 | sort | uniq -d; # done +# 20181120: OpenSSL 1.1.1a +OLD_FILES+=usr/share/openssl/man/man3/SSL_CTX_add_client_CA.3.gz +OLD_FILES+=usr/share/openssl/man/man3/SSL_CTX_get_client_CA_list.3.gz +OLD_FILES+=usr/share/openssl/man/man3/SSL_CTX_set_client_CA_list.3.gz +OLD_FILES+=usr/share/openssl/man/man3/SSL_add_client_CA.3.gz +OLD_FILES+=usr/share/openssl/man/man3/SSL_get_client_CA_list.3.gz +OLD_FILES+=usr/share/openssl/man/man3/SSL_get_server_tmp_key.3.gz +OLD_FILES+=usr/share/openssl/man/man3/SSL_set_client_CA_list.3.gz # 20181030: malloc_domain(9) KPI change OLD_FILES+=usr/share/man/man9/malloc_domain.9.gz # 20181025: OpenSSL libraries version bump to avoid conflict with ports From owner-svn-src-all@freebsd.org Tue Nov 20 22:49:20 2018 Return-Path: Delivered-To: svn-src-all@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 940401140E84; Tue, 20 Nov 2018 22:49:20 +0000 (UTC) (envelope-from bwidawsk@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 3368888720; Tue, 20 Nov 2018 22:49:20 +0000 (UTC) (envelope-from bwidawsk@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0F5D817B8B; Tue, 20 Nov 2018 22:49:20 +0000 (UTC) (envelope-from bwidawsk@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAKMnJ8U082472; Tue, 20 Nov 2018 22:49:19 GMT (envelope-from bwidawsk@FreeBSD.org) Received: (from bwidawsk@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAKMnJxH082469; Tue, 20 Nov 2018 22:49:19 GMT (envelope-from bwidawsk@FreeBSD.org) Message-Id: <201811202249.wAKMnJxH082469@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bwidawsk set sender to bwidawsk@FreeBSD.org using -f From: Ben Widawsky Date: Tue, 20 Nov 2018 22:49:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340709 - in head/sys: compat/linuxkpi/common/include/linux vm X-SVN-Group: head X-SVN-Commit-Author: bwidawsk X-SVN-Commit-Paths: in head/sys: compat/linuxkpi/common/include/linux vm X-SVN-Commit-Revision: 340709 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 3368888720 X-Spamd-Result: default: False [0.06 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_MEDIUM(0.14)[0.143,0]; NEURAL_HAM_SHORT(-0.09)[-0.086,0]; NEURAL_SPAM_LONG(0.00)[0.001,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Nov 2018 22:49:20 -0000 Author: bwidawsk Date: Tue Nov 20 22:49:19 2018 New Revision: 340709 URL: https://svnweb.freebsd.org/changeset/base/340709 Log: linuxkpi: Add some basic swap functions These are used by kms-drm to determine various heuristics relate memory conditions. The number of free swap pages is just a variable, and it can be much cheaper by either adding a new getter, or simply extern'ing swap_total. However, this patch opts to use the more expensive, existing interface - since this isn't an operation in a high per path. This allows us to remove some more gpl linuxkpi and do the follo kms-drm: git rm linuxkpi/gplv2/include/linux/swap.h Reviewed by: mmacy, Johannes Lundberg Approved by: emaste (mentor) Differential Revision: https://reviews.freebsd.org/D18052 Added: head/sys/compat/linuxkpi/common/include/linux/swap.h (contents, props changed) Modified: head/sys/vm/vm_pageout.h head/sys/vm/vm_swapout.c Added: head/sys/compat/linuxkpi/common/include/linux/swap.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/compat/linuxkpi/common/include/linux/swap.h Tue Nov 20 22:49:19 2018 (r340709) @@ -0,0 +1,102 @@ +/*- + * Copyright (c) 2018 Intel Corporation + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _LINUX_SWAP_H_ +#define _LINUX_SWAP_H_ + +#include +#include + +static inline long +get_nr_swap_pages(void) +{ + int i, j; + + /* NB: This could be done cheaply by obtaining swap_total directly */ + swap_pager_status(&i, &j); + return i - j; +} + +static inline int +current_is_kswapd(void) +{ + return vm_curproc_is_vmproc(); +} + +#endif +/*- + * Copyright (c) 2018 Intel Corporation + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _LINUX_SWAP_H_ +#define _LINUX_SWAP_H_ + +#include +#include + +static inline long +get_nr_swap_pages(void) +{ + int i, j; + + /* NB: This could be done cheaply by obtaining swap_total directly */ + swap_pager_status(&i, &j); + return i - j; +} + +static inline int +current_is_kswapd(void) +{ + return vm_curproc_is_vmproc(); +} + +#endif Modified: head/sys/vm/vm_pageout.h ============================================================================== --- head/sys/vm/vm_pageout.h Tue Nov 20 22:24:18 2018 (r340708) +++ head/sys/vm/vm_pageout.h Tue Nov 20 22:49:19 2018 (r340709) @@ -106,5 +106,8 @@ void vm_pageout_oom(int shortage); void vm_swapout_run(void); void vm_swapout_run_idle(void); + +bool vm_curproc_is_vmproc(void); + #endif /* _KERNEL */ #endif /* _VM_VM_PAGEOUT_H_ */ Modified: head/sys/vm/vm_swapout.c ============================================================================== --- head/sys/vm/vm_swapout.c Tue Nov 20 22:24:18 2018 (r340708) +++ head/sys/vm/vm_swapout.c Tue Nov 20 22:49:19 2018 (r340709) @@ -961,3 +961,10 @@ swapout(struct proc *p) p->p_swtick = ticks; return (0); } + +/* Used to determine if the current process is itself the reaper. */ +bool +vm_curproc_is_vmproc(void) +{ + return curproc == vmproc; +} From owner-svn-src-all@freebsd.org Tue Nov 20 23:05:11 2018 Return-Path: Delivered-To: svn-src-all@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 DFE701141618; Tue, 20 Nov 2018 23:05:10 +0000 (UTC) (envelope-from bwidawsk@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 7B9448914C; Tue, 20 Nov 2018 23:05:10 +0000 (UTC) (envelope-from bwidawsk@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5C7BA17EF4; Tue, 20 Nov 2018 23:05:10 +0000 (UTC) (envelope-from bwidawsk@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAKN5AVH092627; Tue, 20 Nov 2018 23:05:10 GMT (envelope-from bwidawsk@FreeBSD.org) Received: (from bwidawsk@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAKN5AIA092626; Tue, 20 Nov 2018 23:05:10 GMT (envelope-from bwidawsk@FreeBSD.org) Message-Id: <201811202305.wAKN5AIA092626@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bwidawsk set sender to bwidawsk@FreeBSD.org using -f From: Ben Widawsky Date: Tue, 20 Nov 2018 23:05:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340710 - head/sys/compat/linuxkpi/common/include/linux X-SVN-Group: head X-SVN-Commit-Author: bwidawsk X-SVN-Commit-Paths: head/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 340710 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 7B9448914C X-Spamd-Result: default: False [0.03 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_LONG(-0.00)[-0.003,0]; NEURAL_SPAM_MEDIUM(0.13)[0.126,0]; NEURAL_HAM_SHORT(-0.09)[-0.089,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Nov 2018 23:05:11 -0000 Author: bwidawsk Date: Tue Nov 20 23:05:09 2018 New Revision: 340710 URL: https://svnweb.freebsd.org/changeset/base/340710 Log: linuxkpi: Remove duplicated text Somehow this got botched while moving from git -> svn Modified: head/sys/compat/linuxkpi/common/include/linux/swap.h Modified: head/sys/compat/linuxkpi/common/include/linux/swap.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/swap.h Tue Nov 20 22:49:19 2018 (r340709) +++ head/sys/compat/linuxkpi/common/include/linux/swap.h Tue Nov 20 23:05:09 2018 (r340710) @@ -49,54 +49,3 @@ current_is_kswapd(void) } #endif -/*- - * Copyright (c) 2018 Intel Corporation - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * $FreeBSD$ - */ - -#ifndef _LINUX_SWAP_H_ -#define _LINUX_SWAP_H_ - -#include -#include - -static inline long -get_nr_swap_pages(void) -{ - int i, j; - - /* NB: This could be done cheaply by obtaining swap_total directly */ - swap_pager_status(&i, &j); - return i - j; -} - -static inline int -current_is_kswapd(void) -{ - return vm_curproc_is_vmproc(); -} - -#endif From owner-svn-src-all@freebsd.org Tue Nov 20 23:07:56 2018 Return-Path: Delivered-To: svn-src-all@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 92A0B114170E; Tue, 20 Nov 2018 23:07:55 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.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 3D93D89396; Tue, 20 Nov 2018 23:07:55 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1E20117EF6; Tue, 20 Nov 2018 23:07:55 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAKN7tHV092816; Tue, 20 Nov 2018 23:07:55 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAKN7kcv092769; Tue, 20 Nov 2018 23:07:46 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <201811202307.wAKN7kcv092769@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Tue, 20 Nov 2018 23:07:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r340711 - in releng/12.0: . crypto/openssl crypto/openssl/apps crypto/openssl/crypto crypto/openssl/crypto/async/arch crypto/openssl/crypto/bio crypto/openssl/crypto/bn crypto/openssl/c... X-SVN-Group: releng X-SVN-Commit-Author: jkim X-SVN-Commit-Paths: in releng/12.0: . crypto/openssl crypto/openssl/apps crypto/openssl/crypto crypto/openssl/crypto/async/arch crypto/openssl/crypto/bio crypto/openssl/crypto/bn crypto/openssl/crypto/bn/asm crypto/opens... X-SVN-Commit-Revision: 340711 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 3D93D89396 X-Spamd-Result: default: False [0.13 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.08)[-0.080,0]; NEURAL_SPAM_LONG(0.01)[0.012,0]; NEURAL_SPAM_MEDIUM(0.19)[0.194,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Nov 2018 23:07:56 -0000 Author: jkim Date: Tue Nov 20 23:07:45 2018 New Revision: 340711 URL: https://svnweb.freebsd.org/changeset/base/340711 Log: MFC: r340705, r340708 Merge OpenSSL 1.1.1a. Approved by: re (gjb) Added: releng/12.0/crypto/openssl/crypto/getenv.c - copied unchanged from r340705, stable/12/crypto/openssl/crypto/getenv.c releng/12.0/crypto/openssl/doc/man3/SSL_get_peer_tmp_key.pod - copied unchanged from r340705, stable/12/crypto/openssl/doc/man3/SSL_get_peer_tmp_key.pod releng/12.0/secure/lib/libcrypto/man/SSL_get_peer_tmp_key.3 - copied unchanged from r340705, stable/12/secure/lib/libcrypto/man/SSL_get_peer_tmp_key.3 Deleted: releng/12.0/crypto/openssl/doc/man3/SSL_CTX_set_client_CA_list.pod releng/12.0/crypto/openssl/doc/man3/SSL_get_client_CA_list.pod releng/12.0/crypto/openssl/doc/man3/SSL_get_server_tmp_key.pod releng/12.0/secure/lib/libcrypto/man/SSL_CTX_set_client_CA_list.3 releng/12.0/secure/lib/libcrypto/man/SSL_get_client_CA_list.3 releng/12.0/secure/lib/libcrypto/man/SSL_get_server_tmp_key.3 Modified: releng/12.0/ObsoleteFiles.inc releng/12.0/crypto/openssl/CHANGES releng/12.0/crypto/openssl/Configure releng/12.0/crypto/openssl/INSTALL releng/12.0/crypto/openssl/NEWS releng/12.0/crypto/openssl/README releng/12.0/crypto/openssl/apps/app_rand.c releng/12.0/crypto/openssl/apps/apps.c releng/12.0/crypto/openssl/apps/apps.h releng/12.0/crypto/openssl/apps/ca.c releng/12.0/crypto/openssl/apps/ocsp.c releng/12.0/crypto/openssl/apps/openssl.cnf releng/12.0/crypto/openssl/apps/opt.c releng/12.0/crypto/openssl/apps/rehash.c releng/12.0/crypto/openssl/apps/rsa.c releng/12.0/crypto/openssl/apps/s_cb.c releng/12.0/crypto/openssl/apps/s_server.c releng/12.0/crypto/openssl/apps/speed.c releng/12.0/crypto/openssl/apps/x509.c releng/12.0/crypto/openssl/crypto/LPdir_unix.c releng/12.0/crypto/openssl/crypto/async/arch/async_posix.h releng/12.0/crypto/openssl/crypto/bio/b_sock2.c releng/12.0/crypto/openssl/crypto/bio/bio_lib.c releng/12.0/crypto/openssl/crypto/bio/bss_log.c releng/12.0/crypto/openssl/crypto/bn/asm/x86_64-gcc.c releng/12.0/crypto/openssl/crypto/bn/bn_exp.c releng/12.0/crypto/openssl/crypto/bn/bn_lib.c releng/12.0/crypto/openssl/crypto/build.info releng/12.0/crypto/openssl/crypto/conf/conf_api.c releng/12.0/crypto/openssl/crypto/conf/conf_mod.c releng/12.0/crypto/openssl/crypto/cryptlib.c releng/12.0/crypto/openssl/crypto/ct/ct_log.c releng/12.0/crypto/openssl/crypto/dsa/dsa_gen.c releng/12.0/crypto/openssl/crypto/dsa/dsa_ossl.c releng/12.0/crypto/openssl/crypto/ec/ec_ameth.c releng/12.0/crypto/openssl/crypto/ec/ec_mult.c releng/12.0/crypto/openssl/crypto/ec/ec_pmeth.c releng/12.0/crypto/openssl/crypto/ec/ecdh_kdf.c releng/12.0/crypto/openssl/crypto/engine/eng_devcrypto.c releng/12.0/crypto/openssl/crypto/engine/eng_list.c releng/12.0/crypto/openssl/crypto/err/openssl.txt releng/12.0/crypto/openssl/crypto/evp/e_aes.c releng/12.0/crypto/openssl/crypto/evp/e_rc2.c releng/12.0/crypto/openssl/crypto/evp/pmeth_lib.c releng/12.0/crypto/openssl/crypto/include/internal/ec_int.h releng/12.0/crypto/openssl/crypto/include/internal/rand_int.h releng/12.0/crypto/openssl/crypto/kdf/hkdf.c releng/12.0/crypto/openssl/crypto/mem_sec.c releng/12.0/crypto/openssl/crypto/o_fopen.c releng/12.0/crypto/openssl/crypto/pkcs12/p12_mutl.c releng/12.0/crypto/openssl/crypto/poly1305/poly1305_ieee754.c releng/12.0/crypto/openssl/crypto/rand/drbg_ctr.c releng/12.0/crypto/openssl/crypto/rand/drbg_lib.c releng/12.0/crypto/openssl/crypto/rand/rand_err.c releng/12.0/crypto/openssl/crypto/rand/rand_lcl.h releng/12.0/crypto/openssl/crypto/rand/rand_lib.c releng/12.0/crypto/openssl/crypto/rand/rand_unix.c releng/12.0/crypto/openssl/crypto/rand/randfile.c releng/12.0/crypto/openssl/crypto/rsa/rsa_lib.c releng/12.0/crypto/openssl/crypto/rsa/rsa_meth.c releng/12.0/crypto/openssl/crypto/rsa/rsa_ossl.c releng/12.0/crypto/openssl/crypto/sha/asm/keccak1600-s390x.pl releng/12.0/crypto/openssl/crypto/sha/asm/sha512p8-ppc.pl releng/12.0/crypto/openssl/crypto/siphash/siphash.c releng/12.0/crypto/openssl/crypto/sm2/sm2_crypt.c releng/12.0/crypto/openssl/crypto/sm2/sm2_sign.c releng/12.0/crypto/openssl/crypto/ui/ui_openssl.c releng/12.0/crypto/openssl/crypto/x509/by_dir.c releng/12.0/crypto/openssl/crypto/x509/by_file.c releng/12.0/crypto/openssl/crypto/x509/x509_vfy.c releng/12.0/crypto/openssl/doc/man1/ca.pod releng/12.0/crypto/openssl/doc/man1/enc.pod releng/12.0/crypto/openssl/doc/man1/openssl.pod releng/12.0/crypto/openssl/doc/man1/req.pod releng/12.0/crypto/openssl/doc/man1/rsa.pod releng/12.0/crypto/openssl/doc/man1/s_server.pod releng/12.0/crypto/openssl/doc/man1/storeutl.pod releng/12.0/crypto/openssl/doc/man1/x509.pod releng/12.0/crypto/openssl/doc/man3/DES_random_key.pod releng/12.0/crypto/openssl/doc/man3/EVP_DigestInit.pod releng/12.0/crypto/openssl/doc/man3/EVP_PKEY_CTX_ctrl.pod releng/12.0/crypto/openssl/doc/man3/EVP_PKEY_CTX_set_hkdf_md.pod releng/12.0/crypto/openssl/doc/man3/EVP_PKEY_CTX_set_rsa_pss_keygen_md.pod releng/12.0/crypto/openssl/doc/man3/EVP_PKEY_set1_RSA.pod releng/12.0/crypto/openssl/doc/man3/EVP_aes.pod releng/12.0/crypto/openssl/doc/man3/EVP_aria.pod releng/12.0/crypto/openssl/doc/man3/EVP_bf_cbc.pod releng/12.0/crypto/openssl/doc/man3/EVP_camellia.pod releng/12.0/crypto/openssl/doc/man3/EVP_cast5_cbc.pod releng/12.0/crypto/openssl/doc/man3/EVP_des.pod releng/12.0/crypto/openssl/doc/man3/EVP_idea_cbc.pod releng/12.0/crypto/openssl/doc/man3/EVP_md5.pod releng/12.0/crypto/openssl/doc/man3/EVP_rc2_cbc.pod releng/12.0/crypto/openssl/doc/man3/EVP_rc5_32_12_16_cbc.pod releng/12.0/crypto/openssl/doc/man3/EVP_seed_cbc.pod releng/12.0/crypto/openssl/doc/man3/EVP_sm4_cbc.pod releng/12.0/crypto/openssl/doc/man3/OPENSSL_VERSION_NUMBER.pod releng/12.0/crypto/openssl/doc/man3/RSA_meth_new.pod releng/12.0/crypto/openssl/doc/man3/SSL_CTX_set0_CA_list.pod releng/12.0/crypto/openssl/doc/man3/SSL_CTX_set1_curves.pod releng/12.0/crypto/openssl/doc/man3/SSL_CTX_set_quiet_shutdown.pod releng/12.0/crypto/openssl/doc/man3/SSL_get_error.pod releng/12.0/crypto/openssl/doc/man3/SSL_get_peer_signature_nid.pod releng/12.0/crypto/openssl/doc/man3/SSL_set_bio.pod releng/12.0/crypto/openssl/doc/man3/SSL_set_shutdown.pod releng/12.0/crypto/openssl/doc/man3/SSL_shutdown.pod releng/12.0/crypto/openssl/doc/man7/RAND_DRBG.pod releng/12.0/crypto/openssl/e_os.h releng/12.0/crypto/openssl/include/internal/cryptlib.h releng/12.0/crypto/openssl/include/internal/tsan_assist.h releng/12.0/crypto/openssl/include/openssl/cryptoerr.h releng/12.0/crypto/openssl/include/openssl/ec.h releng/12.0/crypto/openssl/include/openssl/ocsp.h releng/12.0/crypto/openssl/include/openssl/opensslv.h releng/12.0/crypto/openssl/include/openssl/rand_drbg.h releng/12.0/crypto/openssl/include/openssl/randerr.h releng/12.0/crypto/openssl/include/openssl/rsa.h releng/12.0/crypto/openssl/include/openssl/ssl.h releng/12.0/crypto/openssl/include/openssl/symhacks.h releng/12.0/crypto/openssl/include/openssl/tls1.h releng/12.0/crypto/openssl/ssl/d1_lib.c releng/12.0/crypto/openssl/ssl/record/rec_layer_d1.c releng/12.0/crypto/openssl/ssl/record/record.h releng/12.0/crypto/openssl/ssl/record/record_locl.h releng/12.0/crypto/openssl/ssl/record/ssl3_record.c releng/12.0/crypto/openssl/ssl/s3_cbc.c releng/12.0/crypto/openssl/ssl/s3_enc.c releng/12.0/crypto/openssl/ssl/s3_lib.c releng/12.0/crypto/openssl/ssl/ssl_cert.c releng/12.0/crypto/openssl/ssl/ssl_ciph.c releng/12.0/crypto/openssl/ssl/ssl_lib.c releng/12.0/crypto/openssl/ssl/ssl_locl.h releng/12.0/crypto/openssl/ssl/statem/extensions.c releng/12.0/crypto/openssl/ssl/statem/extensions_clnt.c releng/12.0/crypto/openssl/ssl/statem/statem.c releng/12.0/crypto/openssl/ssl/statem/statem_clnt.c releng/12.0/crypto/openssl/ssl/statem/statem_lib.c releng/12.0/crypto/openssl/ssl/statem/statem_locl.h releng/12.0/crypto/openssl/ssl/statem/statem_srvr.c releng/12.0/crypto/openssl/ssl/t1_lib.c releng/12.0/crypto/openssl/ssl/tls13_enc.c releng/12.0/secure/lib/libcrypto/Makefile releng/12.0/secure/lib/libcrypto/Makefile.inc releng/12.0/secure/lib/libcrypto/Makefile.man releng/12.0/secure/lib/libcrypto/man/ADMISSIONS.3 releng/12.0/secure/lib/libcrypto/man/ASN1_INTEGER_get_int64.3 releng/12.0/secure/lib/libcrypto/man/ASN1_ITEM_lookup.3 releng/12.0/secure/lib/libcrypto/man/ASN1_OBJECT_new.3 releng/12.0/secure/lib/libcrypto/man/ASN1_STRING_TABLE_add.3 releng/12.0/secure/lib/libcrypto/man/ASN1_STRING_length.3 releng/12.0/secure/lib/libcrypto/man/ASN1_STRING_new.3 releng/12.0/secure/lib/libcrypto/man/ASN1_STRING_print_ex.3 releng/12.0/secure/lib/libcrypto/man/ASN1_TIME_set.3 releng/12.0/secure/lib/libcrypto/man/ASN1_TYPE_get.3 releng/12.0/secure/lib/libcrypto/man/ASN1_generate_nconf.3 releng/12.0/secure/lib/libcrypto/man/ASYNC_WAIT_CTX_new.3 releng/12.0/secure/lib/libcrypto/man/ASYNC_start_job.3 releng/12.0/secure/lib/libcrypto/man/BF_encrypt.3 releng/12.0/secure/lib/libcrypto/man/BIO_ADDR.3 releng/12.0/secure/lib/libcrypto/man/BIO_ADDRINFO.3 releng/12.0/secure/lib/libcrypto/man/BIO_connect.3 releng/12.0/secure/lib/libcrypto/man/BIO_ctrl.3 releng/12.0/secure/lib/libcrypto/man/BIO_f_base64.3 releng/12.0/secure/lib/libcrypto/man/BIO_f_buffer.3 releng/12.0/secure/lib/libcrypto/man/BIO_f_cipher.3 releng/12.0/secure/lib/libcrypto/man/BIO_f_md.3 releng/12.0/secure/lib/libcrypto/man/BIO_f_null.3 releng/12.0/secure/lib/libcrypto/man/BIO_f_ssl.3 releng/12.0/secure/lib/libcrypto/man/BIO_find_type.3 releng/12.0/secure/lib/libcrypto/man/BIO_get_data.3 releng/12.0/secure/lib/libcrypto/man/BIO_get_ex_new_index.3 releng/12.0/secure/lib/libcrypto/man/BIO_meth_new.3 releng/12.0/secure/lib/libcrypto/man/BIO_new.3 releng/12.0/secure/lib/libcrypto/man/BIO_new_CMS.3 releng/12.0/secure/lib/libcrypto/man/BIO_parse_hostserv.3 releng/12.0/secure/lib/libcrypto/man/BIO_printf.3 releng/12.0/secure/lib/libcrypto/man/BIO_push.3 releng/12.0/secure/lib/libcrypto/man/BIO_read.3 releng/12.0/secure/lib/libcrypto/man/BIO_s_accept.3 releng/12.0/secure/lib/libcrypto/man/BIO_s_bio.3 releng/12.0/secure/lib/libcrypto/man/BIO_s_connect.3 releng/12.0/secure/lib/libcrypto/man/BIO_s_fd.3 releng/12.0/secure/lib/libcrypto/man/BIO_s_file.3 releng/12.0/secure/lib/libcrypto/man/BIO_s_mem.3 releng/12.0/secure/lib/libcrypto/man/BIO_s_null.3 releng/12.0/secure/lib/libcrypto/man/BIO_s_socket.3 releng/12.0/secure/lib/libcrypto/man/BIO_set_callback.3 releng/12.0/secure/lib/libcrypto/man/BIO_should_retry.3 releng/12.0/secure/lib/libcrypto/man/BN_BLINDING_new.3 releng/12.0/secure/lib/libcrypto/man/BN_CTX_new.3 releng/12.0/secure/lib/libcrypto/man/BN_CTX_start.3 releng/12.0/secure/lib/libcrypto/man/BN_add.3 releng/12.0/secure/lib/libcrypto/man/BN_add_word.3 releng/12.0/secure/lib/libcrypto/man/BN_bn2bin.3 releng/12.0/secure/lib/libcrypto/man/BN_cmp.3 releng/12.0/secure/lib/libcrypto/man/BN_copy.3 releng/12.0/secure/lib/libcrypto/man/BN_generate_prime.3 releng/12.0/secure/lib/libcrypto/man/BN_mod_inverse.3 releng/12.0/secure/lib/libcrypto/man/BN_mod_mul_montgomery.3 releng/12.0/secure/lib/libcrypto/man/BN_mod_mul_reciprocal.3 releng/12.0/secure/lib/libcrypto/man/BN_new.3 releng/12.0/secure/lib/libcrypto/man/BN_num_bytes.3 releng/12.0/secure/lib/libcrypto/man/BN_rand.3 releng/12.0/secure/lib/libcrypto/man/BN_security_bits.3 releng/12.0/secure/lib/libcrypto/man/BN_set_bit.3 releng/12.0/secure/lib/libcrypto/man/BN_swap.3 releng/12.0/secure/lib/libcrypto/man/BN_zero.3 releng/12.0/secure/lib/libcrypto/man/BUF_MEM_new.3 releng/12.0/secure/lib/libcrypto/man/CMS_add0_cert.3 releng/12.0/secure/lib/libcrypto/man/CMS_add1_recipient_cert.3 releng/12.0/secure/lib/libcrypto/man/CMS_add1_signer.3 releng/12.0/secure/lib/libcrypto/man/CMS_compress.3 releng/12.0/secure/lib/libcrypto/man/CMS_decrypt.3 releng/12.0/secure/lib/libcrypto/man/CMS_encrypt.3 releng/12.0/secure/lib/libcrypto/man/CMS_final.3 releng/12.0/secure/lib/libcrypto/man/CMS_get0_RecipientInfos.3 releng/12.0/secure/lib/libcrypto/man/CMS_get0_SignerInfos.3 releng/12.0/secure/lib/libcrypto/man/CMS_get0_type.3 releng/12.0/secure/lib/libcrypto/man/CMS_get1_ReceiptRequest.3 releng/12.0/secure/lib/libcrypto/man/CMS_sign.3 releng/12.0/secure/lib/libcrypto/man/CMS_sign_receipt.3 releng/12.0/secure/lib/libcrypto/man/CMS_uncompress.3 releng/12.0/secure/lib/libcrypto/man/CMS_verify.3 releng/12.0/secure/lib/libcrypto/man/CMS_verify_receipt.3 releng/12.0/secure/lib/libcrypto/man/CONF_modules_free.3 releng/12.0/secure/lib/libcrypto/man/CONF_modules_load_file.3 releng/12.0/secure/lib/libcrypto/man/CRYPTO_THREAD_run_once.3 releng/12.0/secure/lib/libcrypto/man/CRYPTO_get_ex_new_index.3 releng/12.0/secure/lib/libcrypto/man/CTLOG_STORE_get0_log_by_id.3 releng/12.0/secure/lib/libcrypto/man/CTLOG_STORE_new.3 releng/12.0/secure/lib/libcrypto/man/CTLOG_new.3 releng/12.0/secure/lib/libcrypto/man/CT_POLICY_EVAL_CTX_new.3 releng/12.0/secure/lib/libcrypto/man/DEFINE_STACK_OF.3 releng/12.0/secure/lib/libcrypto/man/DES_random_key.3 releng/12.0/secure/lib/libcrypto/man/DH_generate_key.3 releng/12.0/secure/lib/libcrypto/man/DH_generate_parameters.3 releng/12.0/secure/lib/libcrypto/man/DH_get0_pqg.3 releng/12.0/secure/lib/libcrypto/man/DH_get_1024_160.3 releng/12.0/secure/lib/libcrypto/man/DH_meth_new.3 releng/12.0/secure/lib/libcrypto/man/DH_new.3 releng/12.0/secure/lib/libcrypto/man/DH_new_by_nid.3 releng/12.0/secure/lib/libcrypto/man/DH_set_method.3 releng/12.0/secure/lib/libcrypto/man/DH_size.3 releng/12.0/secure/lib/libcrypto/man/DSA_SIG_new.3 releng/12.0/secure/lib/libcrypto/man/DSA_do_sign.3 releng/12.0/secure/lib/libcrypto/man/DSA_dup_DH.3 releng/12.0/secure/lib/libcrypto/man/DSA_generate_key.3 releng/12.0/secure/lib/libcrypto/man/DSA_generate_parameters.3 releng/12.0/secure/lib/libcrypto/man/DSA_get0_pqg.3 releng/12.0/secure/lib/libcrypto/man/DSA_meth_new.3 releng/12.0/secure/lib/libcrypto/man/DSA_new.3 releng/12.0/secure/lib/libcrypto/man/DSA_set_method.3 releng/12.0/secure/lib/libcrypto/man/DSA_sign.3 releng/12.0/secure/lib/libcrypto/man/DSA_size.3 releng/12.0/secure/lib/libcrypto/man/DTLS_get_data_mtu.3 releng/12.0/secure/lib/libcrypto/man/DTLS_set_timer_cb.3 releng/12.0/secure/lib/libcrypto/man/DTLSv1_listen.3 releng/12.0/secure/lib/libcrypto/man/ECDSA_SIG_new.3 releng/12.0/secure/lib/libcrypto/man/ECPKParameters_print.3 releng/12.0/secure/lib/libcrypto/man/EC_GFp_simple_method.3 releng/12.0/secure/lib/libcrypto/man/EC_GROUP_copy.3 releng/12.0/secure/lib/libcrypto/man/EC_GROUP_new.3 releng/12.0/secure/lib/libcrypto/man/EC_KEY_get_enc_flags.3 releng/12.0/secure/lib/libcrypto/man/EC_KEY_new.3 releng/12.0/secure/lib/libcrypto/man/EC_POINT_add.3 releng/12.0/secure/lib/libcrypto/man/EC_POINT_new.3 releng/12.0/secure/lib/libcrypto/man/ENGINE_add.3 releng/12.0/secure/lib/libcrypto/man/ERR_GET_LIB.3 releng/12.0/secure/lib/libcrypto/man/ERR_clear_error.3 releng/12.0/secure/lib/libcrypto/man/ERR_error_string.3 releng/12.0/secure/lib/libcrypto/man/ERR_get_error.3 releng/12.0/secure/lib/libcrypto/man/ERR_load_crypto_strings.3 releng/12.0/secure/lib/libcrypto/man/ERR_load_strings.3 releng/12.0/secure/lib/libcrypto/man/ERR_print_errors.3 releng/12.0/secure/lib/libcrypto/man/ERR_put_error.3 releng/12.0/secure/lib/libcrypto/man/ERR_remove_state.3 releng/12.0/secure/lib/libcrypto/man/ERR_set_mark.3 releng/12.0/secure/lib/libcrypto/man/EVP_BytesToKey.3 releng/12.0/secure/lib/libcrypto/man/EVP_CIPHER_CTX_get_cipher_data.3 releng/12.0/secure/lib/libcrypto/man/EVP_CIPHER_meth_new.3 releng/12.0/secure/lib/libcrypto/man/EVP_DigestInit.3 releng/12.0/secure/lib/libcrypto/man/EVP_DigestSignInit.3 releng/12.0/secure/lib/libcrypto/man/EVP_DigestVerifyInit.3 releng/12.0/secure/lib/libcrypto/man/EVP_EncodeInit.3 releng/12.0/secure/lib/libcrypto/man/EVP_EncryptInit.3 releng/12.0/secure/lib/libcrypto/man/EVP_MD_meth_new.3 releng/12.0/secure/lib/libcrypto/man/EVP_OpenInit.3 releng/12.0/secure/lib/libcrypto/man/EVP_PKEY_ASN1_METHOD.3 releng/12.0/secure/lib/libcrypto/man/EVP_PKEY_CTX_ctrl.3 releng/12.0/secure/lib/libcrypto/man/EVP_PKEY_CTX_new.3 releng/12.0/secure/lib/libcrypto/man/EVP_PKEY_CTX_set1_pbe_pass.3 releng/12.0/secure/lib/libcrypto/man/EVP_PKEY_CTX_set_hkdf_md.3 releng/12.0/secure/lib/libcrypto/man/EVP_PKEY_CTX_set_rsa_pss_keygen_md.3 releng/12.0/secure/lib/libcrypto/man/EVP_PKEY_CTX_set_scrypt_N.3 releng/12.0/secure/lib/libcrypto/man/EVP_PKEY_CTX_set_tls1_prf_md.3 releng/12.0/secure/lib/libcrypto/man/EVP_PKEY_asn1_get_count.3 releng/12.0/secure/lib/libcrypto/man/EVP_PKEY_cmp.3 releng/12.0/secure/lib/libcrypto/man/EVP_PKEY_decrypt.3 releng/12.0/secure/lib/libcrypto/man/EVP_PKEY_derive.3 releng/12.0/secure/lib/libcrypto/man/EVP_PKEY_encrypt.3 releng/12.0/secure/lib/libcrypto/man/EVP_PKEY_get_default_digest_nid.3 releng/12.0/secure/lib/libcrypto/man/EVP_PKEY_keygen.3 releng/12.0/secure/lib/libcrypto/man/EVP_PKEY_meth_get_count.3 releng/12.0/secure/lib/libcrypto/man/EVP_PKEY_meth_new.3 releng/12.0/secure/lib/libcrypto/man/EVP_PKEY_new.3 releng/12.0/secure/lib/libcrypto/man/EVP_PKEY_print_private.3 releng/12.0/secure/lib/libcrypto/man/EVP_PKEY_set1_RSA.3 releng/12.0/secure/lib/libcrypto/man/EVP_PKEY_sign.3 releng/12.0/secure/lib/libcrypto/man/EVP_PKEY_verify.3 releng/12.0/secure/lib/libcrypto/man/EVP_PKEY_verify_recover.3 releng/12.0/secure/lib/libcrypto/man/EVP_SealInit.3 releng/12.0/secure/lib/libcrypto/man/EVP_SignInit.3 releng/12.0/secure/lib/libcrypto/man/EVP_VerifyInit.3 releng/12.0/secure/lib/libcrypto/man/EVP_aes.3 releng/12.0/secure/lib/libcrypto/man/EVP_aria.3 releng/12.0/secure/lib/libcrypto/man/EVP_bf_cbc.3 releng/12.0/secure/lib/libcrypto/man/EVP_blake2b512.3 releng/12.0/secure/lib/libcrypto/man/EVP_camellia.3 releng/12.0/secure/lib/libcrypto/man/EVP_cast5_cbc.3 releng/12.0/secure/lib/libcrypto/man/EVP_chacha20.3 releng/12.0/secure/lib/libcrypto/man/EVP_des.3 releng/12.0/secure/lib/libcrypto/man/EVP_desx_cbc.3 releng/12.0/secure/lib/libcrypto/man/EVP_idea_cbc.3 releng/12.0/secure/lib/libcrypto/man/EVP_md2.3 releng/12.0/secure/lib/libcrypto/man/EVP_md4.3 releng/12.0/secure/lib/libcrypto/man/EVP_md5.3 releng/12.0/secure/lib/libcrypto/man/EVP_mdc2.3 releng/12.0/secure/lib/libcrypto/man/EVP_rc2_cbc.3 releng/12.0/secure/lib/libcrypto/man/EVP_rc4.3 releng/12.0/secure/lib/libcrypto/man/EVP_rc5_32_12_16_cbc.3 releng/12.0/secure/lib/libcrypto/man/EVP_ripemd160.3 releng/12.0/secure/lib/libcrypto/man/EVP_seed_cbc.3 releng/12.0/secure/lib/libcrypto/man/EVP_sha1.3 releng/12.0/secure/lib/libcrypto/man/EVP_sha224.3 releng/12.0/secure/lib/libcrypto/man/EVP_sha3_224.3 releng/12.0/secure/lib/libcrypto/man/EVP_sm3.3 releng/12.0/secure/lib/libcrypto/man/EVP_sm4_cbc.3 releng/12.0/secure/lib/libcrypto/man/EVP_whirlpool.3 releng/12.0/secure/lib/libcrypto/man/HMAC.3 releng/12.0/secure/lib/libcrypto/man/MD5.3 releng/12.0/secure/lib/libcrypto/man/MDC2_Init.3 releng/12.0/secure/lib/libcrypto/man/OBJ_nid2obj.3 releng/12.0/secure/lib/libcrypto/man/OCSP_REQUEST_new.3 releng/12.0/secure/lib/libcrypto/man/OCSP_cert_to_id.3 releng/12.0/secure/lib/libcrypto/man/OCSP_request_add1_nonce.3 releng/12.0/secure/lib/libcrypto/man/OCSP_resp_find_status.3 releng/12.0/secure/lib/libcrypto/man/OCSP_response_status.3 releng/12.0/secure/lib/libcrypto/man/OCSP_sendreq_new.3 releng/12.0/secure/lib/libcrypto/man/OPENSSL_Applink.3 releng/12.0/secure/lib/libcrypto/man/OPENSSL_LH_COMPFUNC.3 releng/12.0/secure/lib/libcrypto/man/OPENSSL_LH_stats.3 releng/12.0/secure/lib/libcrypto/man/OPENSSL_VERSION_NUMBER.3 releng/12.0/secure/lib/libcrypto/man/OPENSSL_config.3 releng/12.0/secure/lib/libcrypto/man/OPENSSL_fork_prepare.3 releng/12.0/secure/lib/libcrypto/man/OPENSSL_ia32cap.3 releng/12.0/secure/lib/libcrypto/man/OPENSSL_init_crypto.3 releng/12.0/secure/lib/libcrypto/man/OPENSSL_init_ssl.3 releng/12.0/secure/lib/libcrypto/man/OPENSSL_instrument_bus.3 releng/12.0/secure/lib/libcrypto/man/OPENSSL_load_builtin_modules.3 releng/12.0/secure/lib/libcrypto/man/OPENSSL_malloc.3 releng/12.0/secure/lib/libcrypto/man/OPENSSL_secure_malloc.3 releng/12.0/secure/lib/libcrypto/man/OSSL_STORE_INFO.3 releng/12.0/secure/lib/libcrypto/man/OSSL_STORE_LOADER.3 releng/12.0/secure/lib/libcrypto/man/OSSL_STORE_SEARCH.3 releng/12.0/secure/lib/libcrypto/man/OSSL_STORE_expect.3 releng/12.0/secure/lib/libcrypto/man/OSSL_STORE_open.3 releng/12.0/secure/lib/libcrypto/man/OpenSSL_add_all_algorithms.3 releng/12.0/secure/lib/libcrypto/man/PEM_bytes_read_bio.3 releng/12.0/secure/lib/libcrypto/man/PEM_read.3 releng/12.0/secure/lib/libcrypto/man/PEM_read_CMS.3 releng/12.0/secure/lib/libcrypto/man/PEM_read_bio_PrivateKey.3 releng/12.0/secure/lib/libcrypto/man/PEM_read_bio_ex.3 releng/12.0/secure/lib/libcrypto/man/PEM_write_bio_CMS_stream.3 releng/12.0/secure/lib/libcrypto/man/PEM_write_bio_PKCS7_stream.3 releng/12.0/secure/lib/libcrypto/man/PKCS12_create.3 releng/12.0/secure/lib/libcrypto/man/PKCS12_newpass.3 releng/12.0/secure/lib/libcrypto/man/PKCS12_parse.3 releng/12.0/secure/lib/libcrypto/man/PKCS5_PBKDF2_HMAC.3 releng/12.0/secure/lib/libcrypto/man/PKCS7_decrypt.3 releng/12.0/secure/lib/libcrypto/man/PKCS7_encrypt.3 releng/12.0/secure/lib/libcrypto/man/PKCS7_sign.3 releng/12.0/secure/lib/libcrypto/man/PKCS7_sign_add_signer.3 releng/12.0/secure/lib/libcrypto/man/PKCS7_verify.3 releng/12.0/secure/lib/libcrypto/man/RAND_DRBG_generate.3 releng/12.0/secure/lib/libcrypto/man/RAND_DRBG_get0_master.3 releng/12.0/secure/lib/libcrypto/man/RAND_DRBG_new.3 releng/12.0/secure/lib/libcrypto/man/RAND_DRBG_reseed.3 releng/12.0/secure/lib/libcrypto/man/RAND_DRBG_set_callbacks.3 releng/12.0/secure/lib/libcrypto/man/RAND_DRBG_set_ex_data.3 releng/12.0/secure/lib/libcrypto/man/RAND_add.3 releng/12.0/secure/lib/libcrypto/man/RAND_bytes.3 releng/12.0/secure/lib/libcrypto/man/RAND_cleanup.3 releng/12.0/secure/lib/libcrypto/man/RAND_egd.3 releng/12.0/secure/lib/libcrypto/man/RAND_load_file.3 releng/12.0/secure/lib/libcrypto/man/RAND_set_rand_method.3 releng/12.0/secure/lib/libcrypto/man/RC4_set_key.3 releng/12.0/secure/lib/libcrypto/man/RIPEMD160_Init.3 releng/12.0/secure/lib/libcrypto/man/RSA_blinding_on.3 releng/12.0/secure/lib/libcrypto/man/RSA_check_key.3 releng/12.0/secure/lib/libcrypto/man/RSA_generate_key.3 releng/12.0/secure/lib/libcrypto/man/RSA_get0_key.3 releng/12.0/secure/lib/libcrypto/man/RSA_meth_new.3 releng/12.0/secure/lib/libcrypto/man/RSA_new.3 releng/12.0/secure/lib/libcrypto/man/RSA_padding_add_PKCS1_type_1.3 releng/12.0/secure/lib/libcrypto/man/RSA_print.3 releng/12.0/secure/lib/libcrypto/man/RSA_private_encrypt.3 releng/12.0/secure/lib/libcrypto/man/RSA_public_encrypt.3 releng/12.0/secure/lib/libcrypto/man/RSA_set_method.3 releng/12.0/secure/lib/libcrypto/man/RSA_sign.3 releng/12.0/secure/lib/libcrypto/man/RSA_sign_ASN1_OCTET_STRING.3 releng/12.0/secure/lib/libcrypto/man/RSA_size.3 releng/12.0/secure/lib/libcrypto/man/SCT_new.3 releng/12.0/secure/lib/libcrypto/man/SCT_print.3 releng/12.0/secure/lib/libcrypto/man/SCT_validate.3 releng/12.0/secure/lib/libcrypto/man/SHA256_Init.3 releng/12.0/secure/lib/libcrypto/man/SMIME_read_CMS.3 releng/12.0/secure/lib/libcrypto/man/SMIME_read_PKCS7.3 releng/12.0/secure/lib/libcrypto/man/SMIME_write_CMS.3 releng/12.0/secure/lib/libcrypto/man/SMIME_write_PKCS7.3 releng/12.0/secure/lib/libcrypto/man/SSL_CIPHER_get_name.3 releng/12.0/secure/lib/libcrypto/man/SSL_COMP_add_compression_method.3 releng/12.0/secure/lib/libcrypto/man/SSL_CONF_CTX_new.3 releng/12.0/secure/lib/libcrypto/man/SSL_CONF_CTX_set1_prefix.3 releng/12.0/secure/lib/libcrypto/man/SSL_CONF_CTX_set_flags.3 releng/12.0/secure/lib/libcrypto/man/SSL_CONF_CTX_set_ssl_ctx.3 releng/12.0/secure/lib/libcrypto/man/SSL_CONF_cmd.3 releng/12.0/secure/lib/libcrypto/man/SSL_CONF_cmd_argv.3 releng/12.0/secure/lib/libcrypto/man/SSL_CTX_add1_chain_cert.3 releng/12.0/secure/lib/libcrypto/man/SSL_CTX_add_extra_chain_cert.3 releng/12.0/secure/lib/libcrypto/man/SSL_CTX_add_session.3 releng/12.0/secure/lib/libcrypto/man/SSL_CTX_config.3 releng/12.0/secure/lib/libcrypto/man/SSL_CTX_ctrl.3 releng/12.0/secure/lib/libcrypto/man/SSL_CTX_dane_enable.3 releng/12.0/secure/lib/libcrypto/man/SSL_CTX_flush_sessions.3 releng/12.0/secure/lib/libcrypto/man/SSL_CTX_free.3 releng/12.0/secure/lib/libcrypto/man/SSL_CTX_get0_param.3 releng/12.0/secure/lib/libcrypto/man/SSL_CTX_get_verify_mode.3 releng/12.0/secure/lib/libcrypto/man/SSL_CTX_has_client_custom_ext.3 releng/12.0/secure/lib/libcrypto/man/SSL_CTX_load_verify_locations.3 releng/12.0/secure/lib/libcrypto/man/SSL_CTX_new.3 releng/12.0/secure/lib/libcrypto/man/SSL_CTX_sess_number.3 releng/12.0/secure/lib/libcrypto/man/SSL_CTX_sess_set_cache_size.3 releng/12.0/secure/lib/libcrypto/man/SSL_CTX_sess_set_get_cb.3 releng/12.0/secure/lib/libcrypto/man/SSL_CTX_sessions.3 releng/12.0/secure/lib/libcrypto/man/SSL_CTX_set0_CA_list.3 releng/12.0/secure/lib/libcrypto/man/SSL_CTX_set1_curves.3 releng/12.0/secure/lib/libcrypto/man/SSL_CTX_set1_sigalgs.3 releng/12.0/secure/lib/libcrypto/man/SSL_CTX_set1_verify_cert_store.3 releng/12.0/secure/lib/libcrypto/man/SSL_CTX_set_alpn_select_cb.3 releng/12.0/secure/lib/libcrypto/man/SSL_CTX_set_cert_cb.3 releng/12.0/secure/lib/libcrypto/man/SSL_CTX_set_cert_store.3 releng/12.0/secure/lib/libcrypto/man/SSL_CTX_set_cert_verify_callback.3 releng/12.0/secure/lib/libcrypto/man/SSL_CTX_set_cipher_list.3 releng/12.0/secure/lib/libcrypto/man/SSL_CTX_set_client_cert_cb.3 releng/12.0/secure/lib/libcrypto/man/SSL_CTX_set_client_hello_cb.3 releng/12.0/secure/lib/libcrypto/man/SSL_CTX_set_ct_validation_callback.3 releng/12.0/secure/lib/libcrypto/man/SSL_CTX_set_ctlog_list_file.3 releng/12.0/secure/lib/libcrypto/man/SSL_CTX_set_default_passwd_cb.3 releng/12.0/secure/lib/libcrypto/man/SSL_CTX_set_ex_data.3 releng/12.0/secure/lib/libcrypto/man/SSL_CTX_set_generate_session_id.3 releng/12.0/secure/lib/libcrypto/man/SSL_CTX_set_info_callback.3 releng/12.0/secure/lib/libcrypto/man/SSL_CTX_set_keylog_callback.3 releng/12.0/secure/lib/libcrypto/man/SSL_CTX_set_max_cert_list.3 releng/12.0/secure/lib/libcrypto/man/SSL_CTX_set_min_proto_version.3 releng/12.0/secure/lib/libcrypto/man/SSL_CTX_set_mode.3 releng/12.0/secure/lib/libcrypto/man/SSL_CTX_set_msg_callback.3 releng/12.0/secure/lib/libcrypto/man/SSL_CTX_set_num_tickets.3 releng/12.0/secure/lib/libcrypto/man/SSL_CTX_set_options.3 releng/12.0/secure/lib/libcrypto/man/SSL_CTX_set_psk_client_callback.3 releng/12.0/secure/lib/libcrypto/man/SSL_CTX_set_quiet_shutdown.3 releng/12.0/secure/lib/libcrypto/man/SSL_CTX_set_read_ahead.3 releng/12.0/secure/lib/libcrypto/man/SSL_CTX_set_record_padding_callback.3 releng/12.0/secure/lib/libcrypto/man/SSL_CTX_set_security_level.3 releng/12.0/secure/lib/libcrypto/man/SSL_CTX_set_session_cache_mode.3 releng/12.0/secure/lib/libcrypto/man/SSL_CTX_set_session_id_context.3 releng/12.0/secure/lib/libcrypto/man/SSL_CTX_set_session_ticket_cb.3 releng/12.0/secure/lib/libcrypto/man/SSL_CTX_set_split_send_fragment.3 releng/12.0/secure/lib/libcrypto/man/SSL_CTX_set_ssl_version.3 releng/12.0/secure/lib/libcrypto/man/SSL_CTX_set_stateless_cookie_generate_cb.3 releng/12.0/secure/lib/libcrypto/man/SSL_CTX_set_timeout.3 releng/12.0/secure/lib/libcrypto/man/SSL_CTX_set_tlsext_servername_callback.3 releng/12.0/secure/lib/libcrypto/man/SSL_CTX_set_tlsext_status_cb.3 releng/12.0/secure/lib/libcrypto/man/SSL_CTX_set_tlsext_ticket_key_cb.3 releng/12.0/secure/lib/libcrypto/man/SSL_CTX_set_tlsext_use_srtp.3 releng/12.0/secure/lib/libcrypto/man/SSL_CTX_set_tmp_dh_callback.3 releng/12.0/secure/lib/libcrypto/man/SSL_CTX_set_verify.3 releng/12.0/secure/lib/libcrypto/man/SSL_CTX_use_certificate.3 releng/12.0/secure/lib/libcrypto/man/SSL_CTX_use_psk_identity_hint.3 releng/12.0/secure/lib/libcrypto/man/SSL_CTX_use_serverinfo.3 releng/12.0/secure/lib/libcrypto/man/SSL_SESSION_free.3 releng/12.0/secure/lib/libcrypto/man/SSL_SESSION_get0_cipher.3 releng/12.0/secure/lib/libcrypto/man/SSL_SESSION_get0_hostname.3 releng/12.0/secure/lib/libcrypto/man/SSL_SESSION_get0_id_context.3 releng/12.0/secure/lib/libcrypto/man/SSL_SESSION_get0_peer.3 releng/12.0/secure/lib/libcrypto/man/SSL_SESSION_get_compress_id.3 releng/12.0/secure/lib/libcrypto/man/SSL_SESSION_get_ex_data.3 releng/12.0/secure/lib/libcrypto/man/SSL_SESSION_get_protocol_version.3 releng/12.0/secure/lib/libcrypto/man/SSL_SESSION_get_time.3 releng/12.0/secure/lib/libcrypto/man/SSL_SESSION_has_ticket.3 releng/12.0/secure/lib/libcrypto/man/SSL_SESSION_is_resumable.3 releng/12.0/secure/lib/libcrypto/man/SSL_SESSION_print.3 releng/12.0/secure/lib/libcrypto/man/SSL_SESSION_set1_id.3 releng/12.0/secure/lib/libcrypto/man/SSL_accept.3 releng/12.0/secure/lib/libcrypto/man/SSL_alert_type_string.3 releng/12.0/secure/lib/libcrypto/man/SSL_alloc_buffers.3 releng/12.0/secure/lib/libcrypto/man/SSL_check_chain.3 releng/12.0/secure/lib/libcrypto/man/SSL_clear.3 releng/12.0/secure/lib/libcrypto/man/SSL_connect.3 releng/12.0/secure/lib/libcrypto/man/SSL_do_handshake.3 releng/12.0/secure/lib/libcrypto/man/SSL_export_keying_material.3 releng/12.0/secure/lib/libcrypto/man/SSL_extension_supported.3 releng/12.0/secure/lib/libcrypto/man/SSL_free.3 releng/12.0/secure/lib/libcrypto/man/SSL_get0_peer_scts.3 releng/12.0/secure/lib/libcrypto/man/SSL_get_SSL_CTX.3 releng/12.0/secure/lib/libcrypto/man/SSL_get_all_async_fds.3 releng/12.0/secure/lib/libcrypto/man/SSL_get_ciphers.3 releng/12.0/secure/lib/libcrypto/man/SSL_get_client_random.3 releng/12.0/secure/lib/libcrypto/man/SSL_get_current_cipher.3 releng/12.0/secure/lib/libcrypto/man/SSL_get_default_timeout.3 releng/12.0/secure/lib/libcrypto/man/SSL_get_error.3 releng/12.0/secure/lib/libcrypto/man/SSL_get_extms_support.3 releng/12.0/secure/lib/libcrypto/man/SSL_get_fd.3 releng/12.0/secure/lib/libcrypto/man/SSL_get_peer_cert_chain.3 releng/12.0/secure/lib/libcrypto/man/SSL_get_peer_certificate.3 releng/12.0/secure/lib/libcrypto/man/SSL_get_peer_signature_nid.3 releng/12.0/secure/lib/libcrypto/man/SSL_get_psk_identity.3 releng/12.0/secure/lib/libcrypto/man/SSL_get_rbio.3 releng/12.0/secure/lib/libcrypto/man/SSL_get_session.3 releng/12.0/secure/lib/libcrypto/man/SSL_get_shared_sigalgs.3 releng/12.0/secure/lib/libcrypto/man/SSL_get_verify_result.3 releng/12.0/secure/lib/libcrypto/man/SSL_get_version.3 releng/12.0/secure/lib/libcrypto/man/SSL_in_init.3 releng/12.0/secure/lib/libcrypto/man/SSL_key_update.3 releng/12.0/secure/lib/libcrypto/man/SSL_library_init.3 releng/12.0/secure/lib/libcrypto/man/SSL_load_client_CA_file.3 releng/12.0/secure/lib/libcrypto/man/SSL_new.3 releng/12.0/secure/lib/libcrypto/man/SSL_pending.3 releng/12.0/secure/lib/libcrypto/man/SSL_read.3 releng/12.0/secure/lib/libcrypto/man/SSL_read_early_data.3 releng/12.0/secure/lib/libcrypto/man/SSL_rstate_string.3 releng/12.0/secure/lib/libcrypto/man/SSL_session_reused.3 releng/12.0/secure/lib/libcrypto/man/SSL_set1_host.3 releng/12.0/secure/lib/libcrypto/man/SSL_set_bio.3 releng/12.0/secure/lib/libcrypto/man/SSL_set_connect_state.3 releng/12.0/secure/lib/libcrypto/man/SSL_set_fd.3 releng/12.0/secure/lib/libcrypto/man/SSL_set_session.3 releng/12.0/secure/lib/libcrypto/man/SSL_set_shutdown.3 releng/12.0/secure/lib/libcrypto/man/SSL_set_verify_result.3 releng/12.0/secure/lib/libcrypto/man/SSL_shutdown.3 releng/12.0/secure/lib/libcrypto/man/SSL_state_string.3 releng/12.0/secure/lib/libcrypto/man/SSL_want.3 releng/12.0/secure/lib/libcrypto/man/SSL_write.3 releng/12.0/secure/lib/libcrypto/man/UI_STRING.3 releng/12.0/secure/lib/libcrypto/man/UI_UTIL_read_pw.3 releng/12.0/secure/lib/libcrypto/man/UI_create_method.3 releng/12.0/secure/lib/libcrypto/man/UI_new.3 releng/12.0/secure/lib/libcrypto/man/X509V3_get_d2i.3 releng/12.0/secure/lib/libcrypto/man/X509_ALGOR_dup.3 releng/12.0/secure/lib/libcrypto/man/X509_CRL_get0_by_serial.3 releng/12.0/secure/lib/libcrypto/man/X509_EXTENSION_set_object.3 releng/12.0/secure/lib/libcrypto/man/X509_LOOKUP_hash_dir.3 releng/12.0/secure/lib/libcrypto/man/X509_LOOKUP_meth_new.3 releng/12.0/secure/lib/libcrypto/man/X509_NAME_ENTRY_get_object.3 releng/12.0/secure/lib/libcrypto/man/X509_NAME_add_entry_by_txt.3 releng/12.0/secure/lib/libcrypto/man/X509_NAME_get0_der.3 releng/12.0/secure/lib/libcrypto/man/X509_NAME_get_index_by_NID.3 releng/12.0/secure/lib/libcrypto/man/X509_NAME_print_ex.3 releng/12.0/secure/lib/libcrypto/man/X509_PUBKEY_new.3 releng/12.0/secure/lib/libcrypto/man/X509_SIG_get0.3 releng/12.0/secure/lib/libcrypto/man/X509_STORE_CTX_get_error.3 releng/12.0/secure/lib/libcrypto/man/X509_STORE_CTX_new.3 releng/12.0/secure/lib/libcrypto/man/X509_STORE_CTX_set_verify_cb.3 releng/12.0/secure/lib/libcrypto/man/X509_STORE_add_cert.3 releng/12.0/secure/lib/libcrypto/man/X509_STORE_get0_param.3 releng/12.0/secure/lib/libcrypto/man/X509_STORE_new.3 releng/12.0/secure/lib/libcrypto/man/X509_STORE_set_verify_cb_func.3 releng/12.0/secure/lib/libcrypto/man/X509_VERIFY_PARAM_set_flags.3 releng/12.0/secure/lib/libcrypto/man/X509_check_ca.3 releng/12.0/secure/lib/libcrypto/man/X509_check_host.3 releng/12.0/secure/lib/libcrypto/man/X509_check_issued.3 releng/12.0/secure/lib/libcrypto/man/X509_check_private_key.3 releng/12.0/secure/lib/libcrypto/man/X509_cmp_time.3 releng/12.0/secure/lib/libcrypto/man/X509_digest.3 releng/12.0/secure/lib/libcrypto/man/X509_dup.3 releng/12.0/secure/lib/libcrypto/man/X509_get0_notBefore.3 releng/12.0/secure/lib/libcrypto/man/X509_get0_signature.3 releng/12.0/secure/lib/libcrypto/man/X509_get0_uids.3 releng/12.0/secure/lib/libcrypto/man/X509_get_extension_flags.3 releng/12.0/secure/lib/libcrypto/man/X509_get_pubkey.3 releng/12.0/secure/lib/libcrypto/man/X509_get_serialNumber.3 releng/12.0/secure/lib/libcrypto/man/X509_get_subject_name.3 releng/12.0/secure/lib/libcrypto/man/X509_get_version.3 releng/12.0/secure/lib/libcrypto/man/X509_new.3 releng/12.0/secure/lib/libcrypto/man/X509_sign.3 releng/12.0/secure/lib/libcrypto/man/X509_verify_cert.3 releng/12.0/secure/lib/libcrypto/man/X509v3_get_ext_by_NID.3 releng/12.0/secure/lib/libcrypto/man/d2i_DHparams.3 releng/12.0/secure/lib/libcrypto/man/d2i_PKCS8PrivateKey_bio.3 releng/12.0/secure/lib/libcrypto/man/d2i_PrivateKey.3 releng/12.0/secure/lib/libcrypto/man/d2i_SSL_SESSION.3 releng/12.0/secure/lib/libcrypto/man/d2i_X509.3 releng/12.0/secure/lib/libcrypto/man/i2d_CMS_bio_stream.3 releng/12.0/secure/lib/libcrypto/man/i2d_PKCS7_bio_stream.3 releng/12.0/secure/lib/libcrypto/man/i2d_re_X509_tbs.3 releng/12.0/secure/lib/libcrypto/man/o2i_SCT_LIST.3 releng/12.0/secure/lib/libssl/Version.map (contents, props changed) releng/12.0/secure/usr.bin/openssl/man/CA.pl.1 releng/12.0/secure/usr.bin/openssl/man/asn1parse.1 releng/12.0/secure/usr.bin/openssl/man/ca.1 releng/12.0/secure/usr.bin/openssl/man/ciphers.1 releng/12.0/secure/usr.bin/openssl/man/cms.1 releng/12.0/secure/usr.bin/openssl/man/crl.1 releng/12.0/secure/usr.bin/openssl/man/crl2pkcs7.1 releng/12.0/secure/usr.bin/openssl/man/dgst.1 releng/12.0/secure/usr.bin/openssl/man/dhparam.1 releng/12.0/secure/usr.bin/openssl/man/dsa.1 releng/12.0/secure/usr.bin/openssl/man/dsaparam.1 releng/12.0/secure/usr.bin/openssl/man/ec.1 releng/12.0/secure/usr.bin/openssl/man/ecparam.1 releng/12.0/secure/usr.bin/openssl/man/enc.1 releng/12.0/secure/usr.bin/openssl/man/engine.1 releng/12.0/secure/usr.bin/openssl/man/errstr.1 releng/12.0/secure/usr.bin/openssl/man/gendsa.1 releng/12.0/secure/usr.bin/openssl/man/genpkey.1 releng/12.0/secure/usr.bin/openssl/man/genrsa.1 releng/12.0/secure/usr.bin/openssl/man/list.1 releng/12.0/secure/usr.bin/openssl/man/nseq.1 releng/12.0/secure/usr.bin/openssl/man/ocsp.1 releng/12.0/secure/usr.bin/openssl/man/openssl.1 releng/12.0/secure/usr.bin/openssl/man/passwd.1 releng/12.0/secure/usr.bin/openssl/man/pkcs12.1 releng/12.0/secure/usr.bin/openssl/man/pkcs7.1 releng/12.0/secure/usr.bin/openssl/man/pkcs8.1 releng/12.0/secure/usr.bin/openssl/man/pkey.1 releng/12.0/secure/usr.bin/openssl/man/pkeyparam.1 releng/12.0/secure/usr.bin/openssl/man/pkeyutl.1 releng/12.0/secure/usr.bin/openssl/man/prime.1 releng/12.0/secure/usr.bin/openssl/man/rand.1 releng/12.0/secure/usr.bin/openssl/man/req.1 releng/12.0/secure/usr.bin/openssl/man/rsa.1 releng/12.0/secure/usr.bin/openssl/man/rsautl.1 releng/12.0/secure/usr.bin/openssl/man/s_client.1 releng/12.0/secure/usr.bin/openssl/man/s_server.1 releng/12.0/secure/usr.bin/openssl/man/s_time.1 releng/12.0/secure/usr.bin/openssl/man/sess_id.1 releng/12.0/secure/usr.bin/openssl/man/smime.1 releng/12.0/secure/usr.bin/openssl/man/speed.1 releng/12.0/secure/usr.bin/openssl/man/spkac.1 releng/12.0/secure/usr.bin/openssl/man/srp.1 releng/12.0/secure/usr.bin/openssl/man/storeutl.1 releng/12.0/secure/usr.bin/openssl/man/ts.1 releng/12.0/secure/usr.bin/openssl/man/tsget.1 releng/12.0/secure/usr.bin/openssl/man/verify.1 releng/12.0/secure/usr.bin/openssl/man/version.1 releng/12.0/secure/usr.bin/openssl/man/x509.1 Directory Properties: releng/12.0/ (props changed) releng/12.0/secure/lib/libcrypto/Version.map (props changed) Modified: releng/12.0/ObsoleteFiles.inc ============================================================================== --- releng/12.0/ObsoleteFiles.inc Tue Nov 20 23:05:09 2018 (r340710) +++ releng/12.0/ObsoleteFiles.inc Tue Nov 20 23:07:45 2018 (r340711) @@ -38,6 +38,14 @@ # xargs -n1 | sort | uniq -d; # done +# 20181120: OpenSSL 1.1.1a +OLD_FILES+=usr/share/openssl/man/man3/SSL_CTX_add_client_CA.3.gz +OLD_FILES+=usr/share/openssl/man/man3/SSL_CTX_get_client_CA_list.3.gz +OLD_FILES+=usr/share/openssl/man/man3/SSL_CTX_set_client_CA_list.3.gz +OLD_FILES+=usr/share/openssl/man/man3/SSL_add_client_CA.3.gz +OLD_FILES+=usr/share/openssl/man/man3/SSL_get_client_CA_list.3.gz +OLD_FILES+=usr/share/openssl/man/man3/SSL_get_server_tmp_key.3.gz +OLD_FILES+=usr/share/openssl/man/man3/SSL_set_client_CA_list.3.gz # 20181030: malloc_domain(9) KPI change OLD_FILES+=share/man/man9/malloc_domain.9.gz # 20181025: OpenSSL libraries version bump to avoid conflict with ports Modified: releng/12.0/crypto/openssl/CHANGES ============================================================================== --- releng/12.0/crypto/openssl/CHANGES Tue Nov 20 23:05:09 2018 (r340710) +++ releng/12.0/crypto/openssl/CHANGES Tue Nov 20 23:07:45 2018 (r340711) @@ -7,6 +7,42 @@ https://github.com/openssl/openssl/commits/ and pick the appropriate release branch. + Changes between 1.1.1 and 1.1.1a [20 Nov 2018] + + *) Timing vulnerability in DSA signature generation + + The OpenSSL DSA signature algorithm has been shown to be vulnerable to a + timing side channel attack. An attacker could use variations in the signing + algorithm to recover the private key. + + This issue was reported to OpenSSL on 16th October 2018 by Samuel Weiser. + (CVE-2018-0734) + [Paul Dale] + + *) Timing vulnerability in ECDSA signature generation + + The OpenSSL ECDSA signature algorithm has been shown to be vulnerable to a + timing side channel attack. An attacker could use variations in the signing + algorithm to recover the private key. + + This issue was reported to OpenSSL on 25th October 2018 by Samuel Weiser. + (CVE-2018-0735) + [Paul Dale] + + *) Added EVP_PKEY_ECDH_KDF_X9_63 and ecdh_KDF_X9_63() as replacements for + the EVP_PKEY_ECDH_KDF_X9_62 KDF type and ECDH_KDF_X9_62(). The old names + are retained for backwards compatibility. + [Antoine Salon] + + *) Fixed the issue that RAND_add()/RAND_seed() silently discards random input + if its length exceeds 4096 bytes. The limit has been raised to a buffer size + of two gigabytes and the error handling improved. + + This issue was reported to OpenSSL by Dr. Falko Strenzke. It has been + categorized as a normal bug, not a security issue, because the DRBG reseeds + automatically and is fully functional even without additional randomness + provided by the application. + Changes between 1.1.0i and 1.1.1 [11 Sep 2018] *) Add a new ClientHello callback. Provides a callback interface that gives @@ -13103,4 +13139,3 @@ des-cbc 3624.96k 5258.21k 5530.91k *) A minor bug in ssl/s3_clnt.c where there would always be 4 0 bytes sent in the client random. [Edward Bishop ] - Modified: releng/12.0/crypto/openssl/Configure ============================================================================== --- releng/12.0/crypto/openssl/Configure Tue Nov 20 23:05:09 2018 (r340710) +++ releng/12.0/crypto/openssl/Configure Tue Nov 20 23:07:45 2018 (r340711) @@ -1013,13 +1013,18 @@ if (scalar(@seed_sources) == 0) { if (scalar(grep { $_ eq 'none' } @seed_sources) > 0) { die "Cannot seed with none and anything else" if scalar(@seed_sources) > 1; warn <<_____ if scalar(@seed_sources) == 1; -You have selected the --with-rand-seed=none option, which effectively disables -automatic reseeding of the OpenSSL random generator. All operations depending -on the random generator such as creating keys will not work unless the random -generator is seeded manually by the application. -Please read the 'Note on random number generation' section in the INSTALL -instructions and the RAND_DRBG(7) manual page for more details. +============================== WARNING =============================== +You have selected the --with-rand-seed=none option, which effectively +disables automatic reseeding of the OpenSSL random generator. +All operations depending on the random generator such as creating keys +will not work unless the random generator is seeded manually by the +application. + +Please read the 'Note on random number generation' section in the +INSTALL instructions and the RAND_DRBG(7) manual page for more details. +============================== WARNING =============================== + _____ } push @{$config{openssl_other_defines}}, @@ -2174,6 +2179,16 @@ EOF # Massage the result + # If the user configured no-shared, we allow no shared sources + if ($disabled{shared}) { + foreach (keys %{$unified_info{shared_sources}}) { + foreach (keys %{$unified_info{shared_sources}->{$_}}) { + delete $unified_info{sources}->{$_}; + } + } + $unified_info{shared_sources} = {}; + } + # If we depend on a header file or a perl module, add an inclusion of # its directory to allow smoothe inclusion foreach my $dest (keys %{$unified_info{depends}}) { @@ -2198,8 +2213,8 @@ EOF next unless defined($unified_info{includes}->{$dest}->{$k}); my @incs = reverse @{$unified_info{includes}->{$dest}->{$k}}; foreach my $obj (grep /\.o$/, - (keys %{$unified_info{sources}->{$dest}}, - keys %{$unified_info{shared_sources}->{$dest}})) { + (keys %{$unified_info{sources}->{$dest} // {}}, + keys %{$unified_info{shared_sources}->{$dest} // {}})) { foreach my $inc (@incs) { unshift @{$unified_info{includes}->{$obj}->{$k}}, $inc unless grep { $_ eq $inc } @{$unified_info{includes}->{$obj}->{$k}}; @@ -2238,6 +2253,42 @@ EOF [ @{$unified_info{includes}->{$dest}->{source}} ]; } } + + # For convenience collect information regarding directories where + # files are generated, those generated files and the end product + # they end up in where applicable. Then, add build rules for those + # directories + my %loopinfo = ( "lib" => [ @{$unified_info{libraries}} ], + "dso" => [ @{$unified_info{engines}} ], + "bin" => [ @{$unified_info{programs}} ], + "script" => [ @{$unified_info{scripts}} ] ); + foreach my $type (keys %loopinfo) { + foreach my $product (@{$loopinfo{$type}}) { + my %dirs = (); + my $pd = dirname($product); + + foreach (@{$unified_info{sources}->{$product} // []}, + @{$unified_info{shared_sources}->{$product} // []}) { + my $d = dirname($_); + + # We don't want to create targets for source directories + # when building out of source + next if ($config{sourcedir} ne $config{builddir} + && $d =~ m|^\Q$config{sourcedir}\E|); + # We already have a "test" target, and the current directory + # is just silly to make a target for + next if $d eq "test" || $d eq "."; + + $dirs{$d} = 1; + push @{$unified_info{dirinfo}->{$d}->{deps}}, $_ + if $d ne $pd; + } + foreach (keys %dirs) { + push @{$unified_info{dirinfo}->{$_}->{products}->{$type}}, + $product; + } + } + } } # For the schemes that need it, we provide the old *_obj configs @@ -2712,10 +2763,16 @@ print <<"EOF"; ********************************************************************** *** *** -*** If you want to report a building issue, please include the *** -*** output from this command: *** +*** OpenSSL has been successfully configured *** *** *** -*** perl configdata.pm --dump *** +*** If you encounter a problem while building, please open an *** +*** issue on GitHub *** +*** and include the output from the following command: *** +*** *** +*** perl configdata.pm --dump *** +*** *** +*** (If you are new to OpenSSL, you might want to consult the *** +*** 'Troubleshooting' section in the INSTALL file first) *** *** *** ********************************************************************** EOF Modified: releng/12.0/crypto/openssl/INSTALL ============================================================================== --- releng/12.0/crypto/openssl/INSTALL Tue Nov 20 23:05:09 2018 (r340710) +++ releng/12.0/crypto/openssl/INSTALL Tue Nov 20 23:07:45 2018 (r340711) @@ -614,8 +614,8 @@ Windows, and as a comma separated list of libraries on VMS. RANLIB The library archive indexer. - RC The Windows resources manipulator. - RCFLAGS Flags for the Windows reources manipulator. + RC The Windows resource compiler. + RCFLAGS Flags for the Windows resource compiler. RM The command to remove files and directories. These cannot be mixed with compiling / linking flags given @@ -969,7 +969,7 @@ BUILDFILE Use a different build file name than the platform default - ("Makefile" on Unixly platforms, "makefile" on native Windows, + ("Makefile" on Unix-like platforms, "makefile" on native Windows, "descrip.mms" on OpenVMS). This requires that there is a corresponding build file template. See Configurations/README for further information. @@ -1171,7 +1171,7 @@ part of the file name, i.e. for OpenSSL 1.1.x, 1.1 is somehow part of the name. - On most POSIXly platforms, shared libraries are named libcrypto.so.1.1 + On most POSIX platforms, shared libraries are named libcrypto.so.1.1 and libssl.so.1.1. on Cygwin, shared libraries are named cygcrypto-1.1.dll and cygssl-1.1.dll @@ -1202,7 +1202,7 @@ The seeding method can be configured using the --with-rand-seed option, which can be used to specify a comma separated list of seed methods. However in most cases OpenSSL will choose a suitable default method, - so it is not necessary to explicitely provide this option. Note also + so it is not necessary to explicitly provide this option. Note also that not all methods are available on all platforms. I) On operating systems which provide a suitable randomness source (in Modified: releng/12.0/crypto/openssl/NEWS ============================================================================== --- releng/12.0/crypto/openssl/NEWS Tue Nov 20 23:05:09 2018 (r340710) +++ releng/12.0/crypto/openssl/NEWS Tue Nov 20 23:07:45 2018 (r340711) @@ -5,6 +5,11 @@ This file gives a brief overview of the major changes between each OpenSSL release. For more details please read the CHANGES file. + Major changes between OpenSSL 1.1.1 and OpenSSL 1.1.1a [20 Nov 2018] + + o Timing vulnerability in DSA signature generation (CVE-2018-0734) + o Timing vulnerability in ECDSA signature generation (CVE-2018-0735) + Major changes between OpenSSL 1.1.0i and OpenSSL 1.1.1 [11 Sep 2018] o Support for TLSv1.3 added (see https://wiki.openssl.org/index.php/TLS1.3 Modified: releng/12.0/crypto/openssl/README ============================================================================== --- releng/12.0/crypto/openssl/README Tue Nov 20 23:05:09 2018 (r340710) +++ releng/12.0/crypto/openssl/README Tue Nov 20 23:07:45 2018 (r340711) @@ -1,5 +1,5 @@ - OpenSSL 1.1.1 11 Sep 2018 + OpenSSL 1.1.1a 20 Nov 2018 Copyright (c) 1998-2018 The OpenSSL Project Copyright (c) 1995-1998 Eric A. Young, Tim J. Hudson Modified: releng/12.0/crypto/openssl/apps/app_rand.c ============================================================================== --- releng/12.0/crypto/openssl/apps/app_rand.c Tue Nov 20 23:05:09 2018 (r340710) +++ releng/12.0/crypto/openssl/apps/app_rand.c Tue Nov 20 23:07:45 2018 (r340711) @@ -1,5 +1,5 @@ /* - * Copyright 1995-2017 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -26,7 +26,6 @@ void app_RAND_load_conf(CONF *c, const char *section) if (RAND_load_file(randfile, -1) < 0) { BIO_printf(bio_err, "Can't load %s into RNG\n", randfile); ERR_print_errors(bio_err); - return; } if (save_rand_file == NULL) save_rand_file = OPENSSL_strdup(randfile); Modified: releng/12.0/crypto/openssl/apps/apps.c ============================================================================== --- releng/12.0/crypto/openssl/apps/apps.c Tue Nov 20 23:05:09 2018 (r340710) +++ releng/12.0/crypto/openssl/apps/apps.c Tue Nov 20 23:07:45 2018 (r340711) @@ -1831,6 +1831,12 @@ X509_NAME *parse_name(const char *cp, long chtype, int opt_getprog(), typestr); continue; } + if (*valstr == '\0') { + BIO_printf(bio_err, + "%s: No value provided for Subject Attribute %s, skipped\n", + opt_getprog(), typestr); + continue; + } if (!X509_NAME_add_entry_by_NID(n, nid, chtype, valstr, strlen((char *)valstr), -1, ismulti ? -1 : 0)) Modified: releng/12.0/crypto/openssl/apps/apps.h ============================================================================== --- releng/12.0/crypto/openssl/apps/apps.h Tue Nov 20 23:05:09 2018 (r340710) +++ releng/12.0/crypto/openssl/apps/apps.h Tue Nov 20 23:07:45 2018 (r340711) @@ -369,7 +369,7 @@ typedef struct string_int_pair_st { # define OPT_FMT_SMIME (1L << 3) # define OPT_FMT_ENGINE (1L << 4) # define OPT_FMT_MSBLOB (1L << 5) -# define OPT_FMT_NETSCAPE (1L << 6) +/* (1L << 6) was OPT_FMT_NETSCAPE, but wasn't used */ # define OPT_FMT_NSS (1L << 7) # define OPT_FMT_TEXT (1L << 8) # define OPT_FMT_HTTP (1L << 9) @@ -378,8 +378,8 @@ typedef struct string_int_pair_st { # define OPT_FMT_PDS (OPT_FMT_PEMDER | OPT_FMT_SMIME) # define OPT_FMT_ANY ( \ OPT_FMT_PEMDER | OPT_FMT_PKCS12 | OPT_FMT_SMIME | \ - OPT_FMT_ENGINE | OPT_FMT_MSBLOB | OPT_FMT_NETSCAPE | \ - OPT_FMT_NSS | OPT_FMT_TEXT | OPT_FMT_HTTP | OPT_FMT_PVK) + OPT_FMT_ENGINE | OPT_FMT_MSBLOB | OPT_FMT_NSS | \ + OPT_FMT_TEXT | OPT_FMT_HTTP | OPT_FMT_PVK) char *opt_progname(const char *argv0); char *opt_getprog(void); Modified: releng/12.0/crypto/openssl/apps/ca.c ============================================================================== --- releng/12.0/crypto/openssl/apps/ca.c Tue Nov 20 23:05:09 2018 (r340710) +++ releng/12.0/crypto/openssl/apps/ca.c Tue Nov 20 23:07:45 2018 (r340711) @@ -605,7 +605,7 @@ end_of_options: /* * outdir is a directory spec, but access() for VMS demands a * filename. We could use the DEC C routine to convert the - * directory syntax to Unixly, and give that to app_isdir, + * directory syntax to Unix, and give that to app_isdir, * but for now the fopen will catch the error if it's not a * directory */ @@ -976,7 +976,7 @@ end_of_options: BIO_printf(bio_err, "Write out database with %d new entries\n", sk_X509_num(cert_sk)); - if (!rand_ser + if (serialfile != NULL && !save_serial(serialfile, "new", serial, NULL)) goto end; @@ -1044,7 +1044,8 @@ end_of_options: if (sk_X509_num(cert_sk)) { /* Rename the database and the serial file */ - if (!rotate_serial(serialfile, "new", "old")) + if (serialfile != NULL + && !rotate_serial(serialfile, "new", "old")) goto end; if (!rotate_index(dbfile, "new", "old")) @@ -1177,10 +1178,9 @@ end_of_options: } /* we have a CRL number that need updating */ - if (crlnumberfile != NULL) - if (!rand_ser - && !save_serial(crlnumberfile, "new", crlnumber, NULL)) - goto end; + if (crlnumberfile != NULL + && !save_serial(crlnumberfile, "new", crlnumber, NULL)) + goto end; BN_free(crlnumber); crlnumber = NULL; @@ -1195,9 +1195,10 @@ end_of_options: PEM_write_bio_X509_CRL(Sout, crl); - if (crlnumberfile != NULL) /* Rename the crlnumber file */ - if (!rotate_serial(crlnumberfile, "new", "old")) - goto end; + /* Rename the crlnumber file */ + if (crlnumberfile != NULL + && !rotate_serial(crlnumberfile, "new", "old")) + goto end; } /*****************************************************************/ Modified: releng/12.0/crypto/openssl/apps/ocsp.c ============================================================================== --- releng/12.0/crypto/openssl/apps/ocsp.c Tue Nov 20 23:05:09 2018 (r340710) +++ releng/12.0/crypto/openssl/apps/ocsp.c Tue Nov 20 23:07:45 2018 (r340711) @@ -950,6 +950,7 @@ static void spawn_loop(void) sleep(30); break; case 0: /* child */ + OPENSSL_free(kidpids); signal(SIGINT, SIG_DFL); signal(SIGTERM, SIG_DFL); if (termsig) @@ -976,6 +977,7 @@ static void spawn_loop(void) } /* The loop above can only break on termsig */ + OPENSSL_free(kidpids); syslog(LOG_INFO, "terminating on signal: %d", termsig); killall(0, kidpids); } Modified: releng/12.0/crypto/openssl/apps/openssl.cnf ============================================================================== --- releng/12.0/crypto/openssl/apps/openssl.cnf Tue Nov 20 23:05:09 2018 (r340710) +++ releng/12.0/crypto/openssl/apps/openssl.cnf Tue Nov 20 23:07:45 2018 (r340711) @@ -11,7 +11,6 @@ # This definition stops the following lines choking if HOME isn't # defined. HOME = . -RANDFILE = $ENV::HOME/.rnd # Extra OBJECT IDENTIFIER info: #oid_file = $ENV::HOME/.oid @@ -58,7 +57,6 @@ crlnumber = $dir/crlnumber # the current crl number # must be commented out to leave a V1 CRL crl = $dir/crl.pem # The current CRL private_key = $dir/private/cakey.pem# The private key -RANDFILE = $dir/private/.rand # private random number file x509_extensions = usr_cert # The extensions to add to the cert Modified: releng/12.0/crypto/openssl/apps/opt.c ============================================================================== --- releng/12.0/crypto/openssl/apps/opt.c Tue Nov 20 23:05:09 2018 (r340710) +++ releng/12.0/crypto/openssl/apps/opt.c Tue Nov 20 23:07:45 2018 (r340711) @@ -168,7 +168,6 @@ static OPT_PAIR formats[] = { {"smime", OPT_FMT_SMIME}, {"engine", OPT_FMT_ENGINE}, {"msblob", OPT_FMT_MSBLOB}, - {"netscape", OPT_FMT_NETSCAPE}, {"nss", OPT_FMT_NSS}, {"text", OPT_FMT_TEXT}, {"http", OPT_FMT_HTTP}, Modified: releng/12.0/crypto/openssl/apps/rehash.c ============================================================================== --- releng/12.0/crypto/openssl/apps/rehash.c Tue Nov 20 23:05:09 2018 (r340710) +++ releng/12.0/crypto/openssl/apps/rehash.c Tue Nov 20 23:07:45 2018 (r340711) @@ -1,6 +1,6 @@ /* * Copyright 2015-2018 The OpenSSL Project Authors. All Rights Reserved. - * Copyright (c) 2013-2014 Timo Teräs + * Copyright (c) 2013-2014 Timo Teräs * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy Modified: releng/12.0/crypto/openssl/apps/rsa.c ============================================================================== --- releng/12.0/crypto/openssl/apps/rsa.c Tue Nov 20 23:05:09 2018 (r340710) +++ releng/12.0/crypto/openssl/apps/rsa.c Tue Nov 20 23:07:45 2018 (r340711) @@ -38,8 +38,8 @@ typedef enum OPTION_choice { const OPTIONS rsa_options[] = { {"help", OPT_HELP, '-', "Display this summary"}, - {"inform", OPT_INFORM, 'f', "Input format, one of DER NET PEM"}, - {"outform", OPT_OUTFORM, 'f', "Output format, one of DER NET PEM PVK"}, + {"inform", OPT_INFORM, 'f', "Input format, one of DER PEM"}, + {"outform", OPT_OUTFORM, 'f', "Output format, one of DER PEM PVK"}, {"in", OPT_IN, 's', "Input file"}, {"out", OPT_OUT, '>', "Output file"}, {"pubin", OPT_PUBIN, '-', "Expect a public key in input file"}, @@ -269,6 +269,9 @@ int rsa_main(int argc, char **argv) } else if (outformat == FORMAT_MSBLOB || outformat == FORMAT_PVK) { EVP_PKEY *pk; pk = EVP_PKEY_new(); + if (pk == NULL) + goto end; + EVP_PKEY_set1_RSA(pk, rsa); if (outformat == FORMAT_PVK) { if (pubin) { Modified: releng/12.0/crypto/openssl/apps/s_cb.c ============================================================================== --- releng/12.0/crypto/openssl/apps/s_cb.c Tue Nov 20 23:05:09 2018 (r340710) +++ releng/12.0/crypto/openssl/apps/s_cb.c Tue Nov 20 23:07:45 2018 (r340711) @@ -394,7 +394,8 @@ int ssl_print_groups(BIO *out, SSL *s, int noshared) int ssl_print_tmp_key(BIO *out, SSL *s) { EVP_PKEY *key; - if (!SSL_get_server_tmp_key(s, &key)) + + if (!SSL_get_peer_tmp_key(s, &key)) return 1; BIO_puts(out, "Server Temp Key: "); switch (EVP_PKEY_id(key)) { Modified: releng/12.0/crypto/openssl/apps/s_server.c ============================================================================== --- releng/12.0/crypto/openssl/apps/s_server.c Tue Nov 20 23:05:09 2018 (r340710) +++ releng/12.0/crypto/openssl/apps/s_server.c Tue Nov 20 23:07:45 2018 (r340711) @@ -193,9 +193,8 @@ static int psk_find_session_cb(SSL *ssl, const unsigne if (strlen(psk_identity) != identity_len || memcmp(psk_identity, identity, identity_len) != 0) { - BIO_printf(bio_s_out, - "PSK warning: client identity not what we expected" - " (got '%s' expected '%s')\n", identity, psk_identity); + *sess = NULL; + return 1; } if (psksess != NULL) { @@ -1622,6 +1621,11 @@ int s_server_main(int argc, char *argv[]) goto end; } #endif + if (early_data && (www > 0 || rev)) { + BIO_printf(bio_err, + "Can't use -early_data in combination with -www, -WWW, -HTTP, or -rev\n"); + goto end; + } #ifndef OPENSSL_NO_SCTP if (protocol == IPPROTO_SCTP) { Modified: releng/12.0/crypto/openssl/apps/speed.c ============================================================================== --- releng/12.0/crypto/openssl/apps/speed.c Tue Nov 20 23:05:09 2018 (r340710) +++ releng/12.0/crypto/openssl/apps/speed.c Tue Nov 20 23:07:45 2018 (r340711) @@ -2896,7 +2896,7 @@ int speed_main(int argc, char **argv) if (rsa_count <= 1) { /* if longer than 10s, don't do any more */ - for (testnum++; testnum < EC_NUM; testnum++) + for (testnum++; testnum < ECDSA_NUM; testnum++) ecdsa_doit[testnum] = 0; } } Modified: releng/12.0/crypto/openssl/apps/x509.c ============================================================================== --- releng/12.0/crypto/openssl/apps/x509.c Tue Nov 20 23:05:09 2018 (r340710) +++ releng/12.0/crypto/openssl/apps/x509.c Tue Nov 20 23:07:45 2018 (r340711) @@ -67,10 +67,10 @@ typedef enum OPTION_choice { const OPTIONS x509_options[] = { {"help", OPT_HELP, '-', "Display this summary"}, {"inform", OPT_INFORM, 'f', - "Input format - default PEM (one of DER, NET or PEM)"}, + "Input format - default PEM (one of DER or PEM)"}, {"in", OPT_IN, '<', "Input file - default stdin"}, {"outform", OPT_OUTFORM, 'f', - "Output format - default PEM (one of DER, NET or PEM)"}, + "Output format - default PEM (one of DER or PEM)"}, {"out", OPT_OUT, '>', "Output file - default stdout"}, {"keyform", OPT_KEYFORM, 'F', "Private key format - default PEM"}, {"passin", OPT_PASSIN, 's', "Private key password/pass-phrase source"}, Modified: releng/12.0/crypto/openssl/crypto/LPdir_unix.c ============================================================================== --- releng/12.0/crypto/openssl/crypto/LPdir_unix.c Tue Nov 20 23:05:09 2018 (r340710) +++ releng/12.0/crypto/openssl/crypto/LPdir_unix.c Tue Nov 20 23:07:45 2018 (r340711) @@ -51,7 +51,7 @@ #endif /* - * The POSIXly macro for the maximum number of characters in a file path is + * The POSIX macro for the maximum number of characters in a file path is * NAME_MAX. However, some operating systems use PATH_MAX instead. * Therefore, it seems natural to first check for PATH_MAX and use that, and * if it doesn't exist, use NAME_MAX. Modified: releng/12.0/crypto/openssl/crypto/async/arch/async_posix.h ============================================================================== --- releng/12.0/crypto/openssl/crypto/async/arch/async_posix.h Tue Nov 20 23:05:09 2018 (r340710) +++ releng/12.0/crypto/openssl/crypto/async/arch/async_posix.h Tue Nov 20 23:07:45 2018 (r340711) @@ -17,7 +17,8 @@ # include -# if _POSIX_VERSION >= 200112L +# if _POSIX_VERSION >= 200112L \ + && (_POSIX_VERSION < 200809L || defined(__GLIBC__)) # include Modified: releng/12.0/crypto/openssl/crypto/bio/b_sock2.c ============================================================================== --- releng/12.0/crypto/openssl/crypto/bio/b_sock2.c Tue Nov 20 23:05:09 2018 (r340710) +++ releng/12.0/crypto/openssl/crypto/bio/b_sock2.c Tue Nov 20 23:07:45 2018 (r340711) @@ -133,7 +133,9 @@ int BIO_connect(int sock, const BIO_ADDR *addr, int op */ int BIO_bind(int sock, const BIO_ADDR *addr, int options) { +# ifndef OPENSSL_SYS_WINDOWS int on = 1; +# endif if (sock == -1) { BIOerr(BIO_F_BIO_BIND, BIO_R_INVALID_SOCKET); Modified: releng/12.0/crypto/openssl/crypto/bio/bio_lib.c ============================================================================== --- releng/12.0/crypto/openssl/crypto/bio/bio_lib.c Tue Nov 20 23:05:09 2018 (r340710) +++ releng/12.0/crypto/openssl/crypto/bio/bio_lib.c Tue Nov 20 23:07:45 2018 (r340711) @@ -52,7 +52,7 @@ static long bio_call_callback(BIO *b, int oper, const argi = (int)len; } - if (inret && (oper & BIO_CB_RETURN) && bareoper != BIO_CB_CTRL) { + if (inret > 0 && (oper & BIO_CB_RETURN) && bareoper != BIO_CB_CTRL) { if (*processed > INT_MAX) return -1; inret = *processed; @@ -60,7 +60,7 @@ static long bio_call_callback(BIO *b, int oper, const ret = b->callback(b, oper, argp, argi, argl, inret); - if (ret >= 0 && (oper & BIO_CB_RETURN) && bareoper != BIO_CB_CTRL) { + if (ret > 0 && (oper & BIO_CB_RETURN) && bareoper != BIO_CB_CTRL) { *processed = (size_t)ret; ret = 1; } Modified: releng/12.0/crypto/openssl/crypto/bio/bss_log.c ============================================================================== --- releng/12.0/crypto/openssl/crypto/bio/bss_log.c Tue Nov 20 23:05:09 2018 (r340710) +++ releng/12.0/crypto/openssl/crypto/bio/bss_log.c Tue Nov 20 23:07:45 2018 (r340711) @@ -408,4 +408,9 @@ static void xcloselog(BIO *bp) # endif /* Unix */ +#else /* NO_SYSLOG */ +const BIO_METHOD *BIO_s_log(void) +{ + return NULL; +} #endif /* NO_SYSLOG */ Modified: releng/12.0/crypto/openssl/crypto/bn/asm/x86_64-gcc.c ============================================================================== --- releng/12.0/crypto/openssl/crypto/bn/asm/x86_64-gcc.c Tue Nov 20 23:05:09 2018 (r340710) +++ releng/12.0/crypto/openssl/crypto/bn/asm/x86_64-gcc.c Tue Nov 20 23:07:45 2018 (r340711) @@ -1,5 +1,5 @@ /* - * Copyright 2002-2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2002-2018 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -63,12 +63,6 @@ * very much like 64-bit code compiled with no-asm on the same * machine. */ - -# if defined(_WIN64) || !defined(__LP64__) -# define BN_ULONG unsigned long long -# else -# define BN_ULONG unsigned long -# endif # undef mul # undef mul_add Modified: releng/12.0/crypto/openssl/crypto/bn/bn_exp.c ============================================================================== --- releng/12.0/crypto/openssl/crypto/bn/bn_exp.c Tue Nov 20 23:05:09 2018 (r340710) +++ releng/12.0/crypto/openssl/crypto/bn/bn_exp.c Tue Nov 20 23:07:45 2018 (r340711) @@ -1077,7 +1077,7 @@ int BN_mod_exp_mont_consttime(BIGNUM *rr, const BIGNUM * is not only slower but also makes each bit vulnerable to * EM (and likely other) side-channel attacks like One&Done * (for details see "One&Done: A Single-Decryption EM-Based - * Attack on OpenSSL’s Constant-Time Blinded RSA" by M. Alam, + * Attack on OpenSSL's Constant-Time Blinded RSA" by M. Alam, * H. Khan, M. Dey, N. Sinha, R. Callan, A. Zajic, and * M. Prvulovic, in USENIX Security'18) */ Modified: releng/12.0/crypto/openssl/crypto/bn/bn_lib.c ============================================================================== --- releng/12.0/crypto/openssl/crypto/bn/bn_lib.c Tue Nov 20 23:05:09 2018 (r340710) +++ releng/12.0/crypto/openssl/crypto/bn/bn_lib.c Tue Nov 20 23:07:45 2018 (r340711) @@ -767,26 +767,30 @@ void BN_consttime_swap(BN_ULONG condition, BIGNUM *a, b->neg ^= t; /*- - * Idea behind BN_FLG_STATIC_DATA is actually to - * indicate that data may not be written to. - * Intention is actually to treat it as it's - * read-only data, and some (if not most) of it does - * reside in read-only segment. In other words - * observation of BN_FLG_STATIC_DATA in - * BN_consttime_swap should be treated as fatal - * condition. It would either cause SEGV or - * effectively cause data corruption. - * BN_FLG_MALLOCED refers to BN structure itself, - * and hence must be preserved. Remaining flags are - * BN_FLG_CONSTIME and BN_FLG_SECURE. Latter must be - * preserved, because it determines how x->d was - * allocated and hence how to free it. This leaves - * BN_FLG_CONSTTIME that one can do something about. - * To summarize it's sufficient to mask and swap - * BN_FLG_CONSTTIME alone. BN_FLG_STATIC_DATA should - * be treated as fatal. + * BN_FLG_STATIC_DATA: indicates that data may not be written to. Intention + * is actually to treat it as it's read-only data, and some (if not most) + * of it does reside in read-only segment. In other words observation of + * BN_FLG_STATIC_DATA in BN_consttime_swap should be treated as fatal + * condition. It would either cause SEGV or effectively cause data + * corruption. + * + * BN_FLG_MALLOCED: refers to BN structure itself, and hence must be + * preserved. + * + * BN_FLG_SECURE: must be preserved, because it determines how x->d was + * allocated and hence how to free it. + * + * BN_FLG_CONSTTIME: sufficient to mask and swap + * + * BN_FLG_FIXED_TOP: indicates that we haven't called bn_correct_top() on + * the data, so the d array may be padded with additional 0 values (i.e. + * top could be greater than the minimal value that it could be). We should + * be swapping it */ - t = ((a->flags ^ b->flags) & BN_FLG_CONSTTIME) & condition; + +#define BN_CONSTTIME_SWAP_FLAGS (BN_FLG_CONSTTIME | BN_FLG_FIXED_TOP) + + t = ((a->flags ^ b->flags) & BN_CONSTTIME_SWAP_FLAGS) & condition; a->flags ^= t; b->flags ^= t; Modified: releng/12.0/crypto/openssl/crypto/build.info ============================================================================== --- releng/12.0/crypto/openssl/crypto/build.info Tue Nov 20 23:05:09 2018 (r340710) +++ releng/12.0/crypto/openssl/crypto/build.info Tue Nov 20 23:07:45 2018 (r340711) @@ -2,7 +2,7 @@ LIBS=../libcrypto SOURCE[../libcrypto]=\ cryptlib.c mem.c mem_dbg.c cversion.c ex_data.c cpt_err.c \ ebcdic.c uid.c o_time.c o_str.c o_dir.c o_fopen.c ctype.c \ - threads_pthread.c threads_win.c threads_none.c \ + threads_pthread.c threads_win.c threads_none.c getenv.c \ o_init.c o_fips.c mem_sec.c init.c {- $target{cpuid_asm_src} -} \ {- $target{uplink_aux_src} -} EXTRA= ../ms/uplink-x86.pl ../ms/uplink.c ../ms/applink.c \ Modified: releng/12.0/crypto/openssl/crypto/conf/conf_api.c ============================================================================== --- releng/12.0/crypto/openssl/crypto/conf/conf_api.c Tue Nov 20 23:05:09 2018 (r340710) +++ releng/12.0/crypto/openssl/crypto/conf/conf_api.c Tue Nov 20 23:07:45 2018 (r340711) @@ -10,6 +10,7 @@ /* Part of the code in here was originally in conf.c, which is now removed */ #include "e_os.h" +#include "internal/cryptlib.h" #include #include #include @@ -82,7 +83,7 @@ char *_CONF_get_string(const CONF *conf, const char *s if (v != NULL) return v->value; if (strcmp(section, "ENV") == 0) { - p = getenv(name); + p = ossl_safe_getenv(name); if (p != NULL) return p; } @@ -95,7 +96,7 @@ char *_CONF_get_string(const CONF *conf, const char *s else return NULL; } else - return getenv(name); + return ossl_safe_getenv(name); } static unsigned long conf_value_hash(const CONF_VALUE *v) Modified: releng/12.0/crypto/openssl/crypto/conf/conf_mod.c ============================================================================== --- releng/12.0/crypto/openssl/crypto/conf/conf_mod.c Tue Nov 20 23:05:09 2018 (r340710) +++ releng/12.0/crypto/openssl/crypto/conf/conf_mod.c Tue Nov 20 23:07:45 2018 (r340711) @@ -480,11 +480,8 @@ char *CONF_get1_default_config_file(void) char *file, *sep = ""; int len; - if (!OPENSSL_issetugid()) { - file = getenv("OPENSSL_CONF"); - if (file) - return OPENSSL_strdup(file); - } + if ((file = ossl_safe_getenv("OPENSSL_CONF")) != NULL) + return OPENSSL_strdup(file); len = strlen(X509_get_default_cert_area()); #ifndef OPENSSL_SYS_VMS Modified: releng/12.0/crypto/openssl/crypto/cryptlib.c ============================================================================== --- releng/12.0/crypto/openssl/crypto/cryptlib.c Tue Nov 20 23:05:09 2018 (r340710) +++ releng/12.0/crypto/openssl/crypto/cryptlib.c Tue Nov 20 23:07:45 2018 (r340711) @@ -204,7 +204,7 @@ int OPENSSL_isservice(void) if (_OPENSSL_isservice.p == NULL) { HANDLE mod = GetModuleHandle(NULL); - FARPROC f; + FARPROC f = NULL; if (mod != NULL) f = GetProcAddress(mod, "_OPENSSL_isservice"); Modified: releng/12.0/crypto/openssl/crypto/ct/ct_log.c ============================================================================== --- releng/12.0/crypto/openssl/crypto/ct/ct_log.c Tue Nov 20 23:05:09 2018 (r340710) +++ releng/12.0/crypto/openssl/crypto/ct/ct_log.c Tue Nov 20 23:07:45 2018 (r340711) @@ -137,7 +137,7 @@ static int ctlog_new_from_conf(CTLOG **ct_log, const C int CTLOG_STORE_load_default_file(CTLOG_STORE *store) { - const char *fpath = getenv(CTLOG_FILE_EVP); + const char *fpath = ossl_safe_getenv(CTLOG_FILE_EVP); if (fpath == NULL) fpath = CTLOG_FILE; Modified: releng/12.0/crypto/openssl/crypto/dsa/dsa_gen.c ============================================================================== --- releng/12.0/crypto/openssl/crypto/dsa/dsa_gen.c Tue Nov 20 23:05:09 2018 (r340710) +++ releng/12.0/crypto/openssl/crypto/dsa/dsa_gen.c Tue Nov 20 23:07:45 2018 (r340711) @@ -327,6 +327,12 @@ int dsa_builtin_paramgen2(DSA *ret, size_t L, size_t N if (mctx == NULL) goto err; + /* make sure L > N, otherwise we'll get trapped in an infinite loop */ + if (L <= N) { + DSAerr(DSA_F_DSA_BUILTIN_PARAMGEN2, DSA_R_INVALID_PARAMETERS); + goto err; + } + if (evpmd == NULL) { if (N == 160) evpmd = EVP_sha1(); Modified: releng/12.0/crypto/openssl/crypto/dsa/dsa_ossl.c ============================================================================== --- releng/12.0/crypto/openssl/crypto/dsa/dsa_ossl.c Tue Nov 20 23:05:09 2018 (r340710) +++ releng/12.0/crypto/openssl/crypto/dsa/dsa_ossl.c Tue Nov 20 23:07:45 2018 (r340711) @@ -9,6 +9,7 @@ #include #include "internal/cryptlib.h" +#include "internal/bn_int.h" #include #include #include "dsa_locl.h" @@ -23,6 +24,8 @@ static int dsa_do_verify(const unsigned char *dgst, in DSA_SIG *sig, DSA *dsa); static int dsa_init(DSA *dsa); static int dsa_finish(DSA *dsa); +static BIGNUM *dsa_mod_inverse_fermat(const BIGNUM *k, const BIGNUM *q, + BN_CTX *ctx); static DSA_METHOD openssl_dsa_meth = { "OpenSSL DSA method", @@ -178,9 +181,9 @@ static int dsa_sign_setup(DSA *dsa, BN_CTX *ctx_in, { BN_CTX *ctx = NULL; BIGNUM *k, *kinv = NULL, *r = *rp; - BIGNUM *l, *m; + BIGNUM *l; int ret = 0; - int q_bits; + int q_bits, q_words; if (!dsa->p || !dsa->q || !dsa->g) { DSAerr(DSA_F_DSA_SIGN_SETUP, DSA_R_MISSING_PARAMETERS); @@ -189,8 +192,7 @@ static int dsa_sign_setup(DSA *dsa, BN_CTX *ctx_in, k = BN_new(); l = BN_new(); - m = BN_new(); - if (k == NULL || l == NULL || m == NULL) + if (k == NULL || l == NULL) goto err; if (ctx_in == NULL) { @@ -201,9 +203,9 @@ static int dsa_sign_setup(DSA *dsa, BN_CTX *ctx_in, /* Preallocate space */ q_bits = BN_num_bits(dsa->q); - if (!BN_set_bit(k, q_bits) - || !BN_set_bit(l, q_bits) - || !BN_set_bit(m, q_bits)) + q_words = bn_get_top(dsa->q); + if (!bn_wexpand(k, q_words + 2) + || !bn_wexpand(l, q_words + 2)) goto err; /* Get random k */ @@ -221,6 +223,7 @@ static int dsa_sign_setup(DSA *dsa, BN_CTX *ctx_in, } while (BN_is_zero(k)); BN_set_flags(k, BN_FLG_CONSTTIME); + BN_set_flags(l, BN_FLG_CONSTTIME); if (dsa->flags & DSA_FLAG_CACHE_MONT_P) { if (!BN_MONT_CTX_set_locked(&dsa->method_mont_p, @@ -238,14 +241,17 @@ static int dsa_sign_setup(DSA *dsa, BN_CTX *ctx_in, * small timing information leakage. We then choose the sum that is * one bit longer than the modulus. * - * TODO: revisit the BN_copy aiming for a memory access agnostic - * conditional copy. + * There are some concerns about the efficacy of doing this. More + * specificly refer to the discussion starting with: + * https://github.com/openssl/openssl/pull/7486#discussion_r228323705 + * The fix is to rework BN so these gymnastics aren't required. */ if (!BN_add(l, k, dsa->q) - || !BN_add(m, l, dsa->q) - || !BN_copy(k, BN_num_bits(l) > q_bits ? l : m)) + || !BN_add(k, l, dsa->q)) goto err; + BN_consttime_swap(BN_is_bit_set(l, q_bits), k, l, q_words + 2); + if ((dsa)->meth->bn_mod_exp != NULL) { if (!dsa->meth->bn_mod_exp(dsa, r, dsa->g, k, dsa->p, ctx, dsa->method_mont_p)) @@ -258,8 +264,8 @@ static int dsa_sign_setup(DSA *dsa, BN_CTX *ctx_in, if (!BN_mod(r, r, dsa->q, ctx)) goto err; - /* Compute part of 's = inv(k) (m + xr) mod q' */ - if ((kinv = BN_mod_inverse(NULL, k, dsa->q, ctx)) == NULL) + /* Compute part of 's = inv(k) (m + xr) mod q' */ + if ((kinv = dsa_mod_inverse_fermat(k, dsa->q, ctx)) == NULL) goto err; BN_clear_free(*kinvp); @@ -273,7 +279,6 @@ static int dsa_sign_setup(DSA *dsa, BN_CTX *ctx_in, BN_CTX_free(ctx); BN_clear_free(k); BN_clear_free(l); - BN_clear_free(m); return ret; } @@ -392,4 +397,32 @@ static int dsa_finish(DSA *dsa) { BN_MONT_CTX_free(dsa->method_mont_p); return 1; +} + +/* + * Compute the inverse of k modulo q. + * Since q is prime, Fermat's Little Theorem applies, which reduces this to + * mod-exp operation. Both the exponent and modulus are public information + * so a mod-exp that doesn't leak the base is sufficient. A newly allocated + * BIGNUM is returned which the caller must free. + */ +static BIGNUM *dsa_mod_inverse_fermat(const BIGNUM *k, const BIGNUM *q, + BN_CTX *ctx) +{ + BIGNUM *res = NULL; + BIGNUM *r, *e; + + if ((r = BN_new()) == NULL) + return NULL; + + BN_CTX_start(ctx); + if ((e = BN_CTX_get(ctx)) != NULL + && BN_set_word(r, 2) + && BN_sub(e, q, r) + && BN_mod_exp_mont(r, k, e, q, ctx, NULL)) + res = r; + else + BN_free(r); + BN_CTX_end(ctx); + return res; } Modified: releng/12.0/crypto/openssl/crypto/ec/ec_ameth.c ============================================================================== --- releng/12.0/crypto/openssl/crypto/ec/ec_ameth.c Tue Nov 20 23:05:09 2018 (r340710) +++ releng/12.0/crypto/openssl/crypto/ec/ec_ameth.c Tue Nov 20 23:07:45 2018 (r340711) @@ -699,7 +699,7 @@ static int ecdh_cms_set_kdf_param(EVP_PKEY_CTX *pctx, if (EVP_PKEY_CTX_set_ecdh_cofactor_mode(pctx, cofactor) <= 0) return 0; - if (EVP_PKEY_CTX_set_ecdh_kdf_type(pctx, EVP_PKEY_ECDH_KDF_X9_62) <= 0) + if (EVP_PKEY_CTX_set_ecdh_kdf_type(pctx, EVP_PKEY_ECDH_KDF_X9_63) <= 0) return 0; kdf_md = EVP_get_digestbynid(kdfmd_nid); @@ -864,7 +864,7 @@ static int ecdh_cms_encrypt(CMS_RecipientInfo *ri) ecdh_nid = NID_dh_cofactor_kdf; if (kdf_type == EVP_PKEY_ECDH_KDF_NONE) { - kdf_type = EVP_PKEY_ECDH_KDF_X9_62; + kdf_type = EVP_PKEY_ECDH_KDF_X9_63; if (EVP_PKEY_CTX_set_ecdh_kdf_type(pctx, kdf_type) <= 0) goto err; } else Modified: releng/12.0/crypto/openssl/crypto/ec/ec_mult.c ============================================================================== --- releng/12.0/crypto/openssl/crypto/ec/ec_mult.c Tue Nov 20 23:05:09 2018 (r340710) +++ releng/12.0/crypto/openssl/crypto/ec/ec_mult.c Tue Nov 20 23:07:45 2018 (r340711) @@ -206,8 +206,8 @@ int ec_scalar_mul_ladder(const EC_GROUP *group, EC_POI */ cardinality_bits = BN_num_bits(cardinality); group_top = bn_get_top(cardinality); - if ((bn_wexpand(k, group_top + 1) == NULL) - || (bn_wexpand(lambda, group_top + 1) == NULL)) { + if ((bn_wexpand(k, group_top + 2) == NULL) + || (bn_wexpand(lambda, group_top + 2) == NULL)) { ECerr(EC_F_EC_SCALAR_MUL_LADDER, ERR_R_BN_LIB); goto err; } @@ -244,7 +244,7 @@ int ec_scalar_mul_ladder(const EC_GROUP *group, EC_POI * k := scalar + 2*cardinality */ kbit = BN_is_bit_set(lambda, cardinality_bits); - BN_consttime_swap(kbit, k, lambda, group_top + 1); + BN_consttime_swap(kbit, k, lambda, group_top + 2); group_top = bn_get_top(group->field); if ((bn_wexpand(s->X, group_top) == NULL) Modified: releng/12.0/crypto/openssl/crypto/ec/ec_pmeth.c ============================================================================== --- releng/12.0/crypto/openssl/crypto/ec/ec_pmeth.c Tue Nov 20 23:05:09 2018 (r340710) +++ releng/12.0/crypto/openssl/crypto/ec/ec_pmeth.c Tue Nov 20 23:07:45 2018 (r340711) @@ -209,7 +209,7 @@ static int pkey_ec_kdf_derive(EVP_PKEY_CTX *ctx, if (!pkey_ec_derive(ctx, ktmp, &ktmplen)) goto err; /* Do KDF stuff */ - if (!ECDH_KDF_X9_62(key, *keylen, ktmp, ktmplen, + if (!ecdh_KDF_X9_63(key, *keylen, ktmp, ktmplen, dctx->kdf_ukm, dctx->kdf_ukmlen, dctx->kdf_md)) goto err; rv = 1; @@ -281,7 +281,7 @@ static int pkey_ec_ctrl(EVP_PKEY_CTX *ctx, int type, i case EVP_PKEY_CTRL_EC_KDF_TYPE: if (p1 == -2) return dctx->kdf_type; - if (p1 != EVP_PKEY_ECDH_KDF_NONE && p1 != EVP_PKEY_ECDH_KDF_X9_62) + if (p1 != EVP_PKEY_ECDH_KDF_NONE && p1 != EVP_PKEY_ECDH_KDF_X9_63) return -2; dctx->kdf_type = p1; return 1; Modified: releng/12.0/crypto/openssl/crypto/ec/ecdh_kdf.c ============================================================================== --- releng/12.0/crypto/openssl/crypto/ec/ecdh_kdf.c Tue Nov 20 23:05:09 2018 (r340710) +++ releng/12.0/crypto/openssl/crypto/ec/ecdh_kdf.c Tue Nov 20 23:07:45 2018 (r340711) @@ -1,5 +1,5 @@ /* - * Copyright 2015-2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2015-2018 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -10,12 +10,13 @@ #include #include #include +#include "ec_lcl.h" -/* Key derivation function from X9.62/SECG */ +/* Key derivation function from X9.63/SECG */ /* Way more than we will ever need */ #define ECDH_KDF_MAX (1 << 30) -int ECDH_KDF_X9_62(unsigned char *out, size_t outlen, +int ecdh_KDF_X9_63(unsigned char *out, size_t outlen, const unsigned char *Z, size_t Zlen, const unsigned char *sinfo, size_t sinfolen, const EVP_MD *md) @@ -65,4 +66,16 @@ int ECDH_KDF_X9_62(unsigned char *out, size_t outlen, err: EVP_MD_CTX_free(mctx); return rv; +} + +/*- + * The old name for ecdh_KDF_X9_63 + * Retained for ABI compatibility + */ +int ECDH_KDF_X9_62(unsigned char *out, size_t outlen, + const unsigned char *Z, size_t Zlen, + const unsigned char *sinfo, size_t sinfolen, + const EVP_MD *md) +{ + return ecdh_KDF_X9_63(out, outlen, Z, Zlen, sinfo, sinfolen, md); } Modified: releng/12.0/crypto/openssl/crypto/engine/eng_devcrypto.c ============================================================================== --- releng/12.0/crypto/openssl/crypto/engine/eng_devcrypto.c Tue Nov 20 23:05:09 2018 (r340710) +++ releng/12.0/crypto/openssl/crypto/engine/eng_devcrypto.c Tue Nov 20 23:07:45 2018 (r340711) @@ -28,6 +28,13 @@ # define CHECK_BSD_STYLE_MACROS #endif +/* + * ONE global file descriptor for all sessions. This allows operations + * such as digest session data copying (see digest_copy()), but is also + * saner... why re-open /dev/crypto for every session? + */ +static int cfd; + *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Tue Nov 20 23:27:16 2018 Return-Path: Delivered-To: svn-src-all@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 86EA01141F54; Tue, 20 Nov 2018 23:27:16 +0000 (UTC) (envelope-from bwidawsk@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 2854C89E4D; Tue, 20 Nov 2018 23:27:16 +0000 (UTC) (envelope-from bwidawsk@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0920A1824A; Tue, 20 Nov 2018 23:27:16 +0000 (UTC) (envelope-from bwidawsk@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAKNRFmS003013; Tue, 20 Nov 2018 23:27:15 GMT (envelope-from bwidawsk@FreeBSD.org) Received: (from bwidawsk@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAKNRFKr003012; Tue, 20 Nov 2018 23:27:15 GMT (envelope-from bwidawsk@FreeBSD.org) Message-Id: <201811202327.wAKNRFKr003012@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bwidawsk set sender to bwidawsk@FreeBSD.org using -f From: Ben Widawsky Date: Tue, 20 Nov 2018 23:27:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340712 - head/tools/tools/git X-SVN-Group: head X-SVN-Commit-Author: bwidawsk X-SVN-Commit-Paths: head/tools/tools/git X-SVN-Commit-Revision: 340712 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 2854C89E4D X-Spamd-Result: default: False [0.03 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.09)[-0.089,0]; NEURAL_HAM_LONG(-0.00)[-0.003,0]; NEURAL_SPAM_MEDIUM(0.13)[0.126,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Nov 2018 23:27:16 -0000 Author: bwidawsk Date: Tue Nov 20 23:27:15 2018 New Revision: 340712 URL: https://svnweb.freebsd.org/changeset/base/340712 Log: git-svn-init: Add docs to the choice of repos Modified: head/tools/tools/git/git-svn-init Modified: head/tools/tools/git/git-svn-init ============================================================================== --- head/tools/tools/git/git-svn-init Tue Nov 20 23:07:45 2018 (r340711) +++ head/tools/tools/git/git-svn-init Tue Nov 20 23:27:15 2018 (r340712) @@ -35,6 +35,10 @@ GIT_IN_PATH=$(which git) GIT=${GIT-${GIT_IN_PATH}} +GIT_DOCS_REPO=${GIT_DOCS_REPO-git://github.com/freebsd/freebsd-doc.git} +GIT_SVN_DOCS_ROOT_URI=${GIT_SVN_DOCS_ROOT_URI-svn.freebsd.org/doc} +GIT_SVN_DOCS_URI=${GIV_SVN_DOCS_URI-repo.freebsd.org/doc} + GIT_PORTS_REPO=${GIT_PORTS_REPO-git://github.com/freebsd/freebsd-ports.git} GIT_SVN_PORTS_ROOT_URI=${GIT_SVN_PORTS_ROOT_URI-svn.freebsd.org/ports} GIT_SVN_PORTS_URI=${GIT_SVN_PORTS_URI-repo.freebsd.org/ports} @@ -43,6 +47,7 @@ GIT_SRC_REPO=${GIT_SRC_REPO-git://github.com/freebsd/f GIT_SVN_SRC_ROOT_URI=${GIT_SVN_SRC_ROOT_URI-svn.freebsd.org/base} GIT_SVN_SRC_URI=${GIT_SVN_SRC_URI-repo.freebsd.org/base} +GIT_SVN_DOCS_PUSH_URI=$GIT_SVN_DOCS_URI GIT_SVN_PORTS_PUSH_URI=$GIT_SVN_PORTS_URI GIT_SVN_SRC_PUSH_URI=$GIT_SVN_SRC_URI @@ -58,6 +63,7 @@ both ports and src under freebsd in the current workin -n Dry run -p Exclude ports -s Exclude src +-d Exclude docs EOF } @@ -138,7 +144,11 @@ doit() local svn_root_uri=$GIT_SVN_SRC_ROOT_URI local svn_uri=$GIT_SVN_SRC_URI local svn_push_uri=$GIT_SVN_SRC_PUSH_URI - else + elif [ "$3" = "docs" ] ; then + local svn_root_uri=$GIT_SVN_DOCS_ROOT_URI + local svn_uri=$GIT_SVN_DOCS_URI + local svn_push_uri=$GIT_SVN_DOCS_PUSH_URI + elif [ "$3" = "ports" ] ; then local svn_root_uri=$GIT_SVN_PORTS_ROOT_URI local svn_uri=$GIT_SVN_PORTS_URI local svn_push_uri=$GIT_SVN_PORTS_PUSH_URI @@ -160,7 +170,8 @@ doit() ports=1 source=1 -while getopts "hb:nr:sp" opt; do +docs=1 +while getopts "hb:nr:sdp" opt; do case "$opt" in b) base_path="$OPTARG" @@ -174,6 +185,9 @@ while getopts "hb:nr:sp" opt; do s) source=0 ;; + d) + docs=0 + ;; h|*) usage exit 0 @@ -190,4 +204,8 @@ fi if [ "$ports" -eq 1 ]; then doit ${GIT_PORTS_REPO} ${base_path:-freebsd} "ports" +fi + +if [ "$docs" -eq 1 ]; then + doit ${GIT_DOCS_REPO} ${base_path:-freebsd} "docs" fi From owner-svn-src-all@freebsd.org Wed Nov 21 00:00:01 2018 Return-Path: Delivered-To: svn-src-all@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 671271142B19; Wed, 21 Nov 2018 00:00:01 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.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 0CEB28AC3F; Wed, 21 Nov 2018 00:00:01 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E2BC71872A; Wed, 21 Nov 2018 00:00:00 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAL000K7018457; Wed, 21 Nov 2018 00:00:00 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAL0001L018456; Wed, 21 Nov 2018 00:00:00 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <201811210000.wAL0001L018456@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Wed, 21 Nov 2018 00:00:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340713 - head X-SVN-Group: head X-SVN-Commit-Author: jkim X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 340713 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 0CEB28AC3F X-Spamd-Result: default: False [0.39 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.27)[0.271,0]; NEURAL_HAM_LONG(-0.00)[-0.003,0]; NEURAL_SPAM_MEDIUM(0.13)[0.126,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Nov 2018 00:00:01 -0000 Author: jkim Date: Wed Nov 21 00:00:00 2018 New Revision: 340713 URL: https://svnweb.freebsd.org/changeset/base/340713 Log: Revert r340706. Some files became symlinks and vice versa. Pointy hat to: jkim Modified: head/ObsoleteFiles.inc Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Tue Nov 20 23:27:15 2018 (r340712) +++ head/ObsoleteFiles.inc Wed Nov 21 00:00:00 2018 (r340713) @@ -38,14 +38,6 @@ # xargs -n1 | sort | uniq -d; # done -# 20181120: OpenSSL 1.1.1a -OLD_FILES+=usr/share/openssl/man/man3/SSL_CTX_add_client_CA.3.gz -OLD_FILES+=usr/share/openssl/man/man3/SSL_CTX_get_client_CA_list.3.gz -OLD_FILES+=usr/share/openssl/man/man3/SSL_CTX_set_client_CA_list.3.gz -OLD_FILES+=usr/share/openssl/man/man3/SSL_add_client_CA.3.gz -OLD_FILES+=usr/share/openssl/man/man3/SSL_get_client_CA_list.3.gz -OLD_FILES+=usr/share/openssl/man/man3/SSL_get_server_tmp_key.3.gz -OLD_FILES+=usr/share/openssl/man/man3/SSL_set_client_CA_list.3.gz # 20181116: Rename test file. OLD_FILES+=usr/tests/sys/netinet/reuseport_lb # 20181112: Cleanup old libcap_dns. From owner-svn-src-all@freebsd.org Wed Nov 21 00:04:39 2018 Return-Path: Delivered-To: svn-src-all@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 B3B041142FA0; Wed, 21 Nov 2018 00:04:39 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.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 573FB8B1CA; Wed, 21 Nov 2018 00:04:39 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 38016188D2; Wed, 21 Nov 2018 00:04:39 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAL04d5V023414; Wed, 21 Nov 2018 00:04:39 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAL04cLU023413; Wed, 21 Nov 2018 00:04:38 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <201811210004.wAL04cLU023413@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Wed, 21 Nov 2018 00:04:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r340714 - stable/12 X-SVN-Group: stable-12 X-SVN-Commit-Author: jkim X-SVN-Commit-Paths: stable/12 X-SVN-Commit-Revision: 340714 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 573FB8B1CA X-Spamd-Result: default: False [0.40 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.01)[0.007,0]; NEURAL_SPAM_MEDIUM(0.17)[0.172,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.22)[0.223,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Nov 2018 00:04:39 -0000 Author: jkim Date: Wed Nov 21 00:04:38 2018 New Revision: 340714 URL: https://svnweb.freebsd.org/changeset/base/340714 Log: MFC: r340713. Revert r340708. Some files became symlinks and vice versa. Modified: stable/12/ObsoleteFiles.inc Directory Properties: stable/12/ (props changed) Modified: stable/12/ObsoleteFiles.inc ============================================================================== --- stable/12/ObsoleteFiles.inc Wed Nov 21 00:00:00 2018 (r340713) +++ stable/12/ObsoleteFiles.inc Wed Nov 21 00:04:38 2018 (r340714) @@ -38,14 +38,6 @@ # xargs -n1 | sort | uniq -d; # done -# 20181120: OpenSSL 1.1.1a -OLD_FILES+=usr/share/openssl/man/man3/SSL_CTX_add_client_CA.3.gz -OLD_FILES+=usr/share/openssl/man/man3/SSL_CTX_get_client_CA_list.3.gz -OLD_FILES+=usr/share/openssl/man/man3/SSL_CTX_set_client_CA_list.3.gz -OLD_FILES+=usr/share/openssl/man/man3/SSL_add_client_CA.3.gz -OLD_FILES+=usr/share/openssl/man/man3/SSL_get_client_CA_list.3.gz -OLD_FILES+=usr/share/openssl/man/man3/SSL_get_server_tmp_key.3.gz -OLD_FILES+=usr/share/openssl/man/man3/SSL_set_client_CA_list.3.gz # 20181030: malloc_domain(9) KPI change OLD_FILES+=usr/share/man/man9/malloc_domain.9.gz # 20181025: OpenSSL libraries version bump to avoid conflict with ports From owner-svn-src-all@freebsd.org Wed Nov 21 00:16:44 2018 Return-Path: Delivered-To: svn-src-all@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 4668E114360A; Wed, 21 Nov 2018 00:16:44 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.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 DBD918B968; Wed, 21 Nov 2018 00:16:43 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B858618A7F; Wed, 21 Nov 2018 00:16:43 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAL0Ghks028665; Wed, 21 Nov 2018 00:16:43 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAL0GhHb028664; Wed, 21 Nov 2018 00:16:43 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <201811210016.wAL0GhHb028664@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Wed, 21 Nov 2018 00:16:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r340715 - releng/12.0 X-SVN-Group: releng X-SVN-Commit-Author: jkim X-SVN-Commit-Paths: releng/12.0 X-SVN-Commit-Revision: 340715 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: DBD918B968 X-Spamd-Result: default: False [0.39 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.27)[0.271,0]; NEURAL_HAM_LONG(-0.00)[-0.003,0]; NEURAL_SPAM_MEDIUM(0.13)[0.126,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Nov 2018 00:16:44 -0000 Author: jkim Date: Wed Nov 21 00:16:43 2018 New Revision: 340715 URL: https://svnweb.freebsd.org/changeset/base/340715 Log: MFC: r340714 Revert r340708. Some files became symlinks and vice versa. Approved by: re (gjb) Modified: releng/12.0/ObsoleteFiles.inc Directory Properties: releng/12.0/ (props changed) Modified: releng/12.0/ObsoleteFiles.inc ============================================================================== --- releng/12.0/ObsoleteFiles.inc Wed Nov 21 00:04:38 2018 (r340714) +++ releng/12.0/ObsoleteFiles.inc Wed Nov 21 00:16:43 2018 (r340715) @@ -38,14 +38,6 @@ # xargs -n1 | sort | uniq -d; # done -# 20181120: OpenSSL 1.1.1a -OLD_FILES+=usr/share/openssl/man/man3/SSL_CTX_add_client_CA.3.gz -OLD_FILES+=usr/share/openssl/man/man3/SSL_CTX_get_client_CA_list.3.gz -OLD_FILES+=usr/share/openssl/man/man3/SSL_CTX_set_client_CA_list.3.gz -OLD_FILES+=usr/share/openssl/man/man3/SSL_add_client_CA.3.gz -OLD_FILES+=usr/share/openssl/man/man3/SSL_get_client_CA_list.3.gz -OLD_FILES+=usr/share/openssl/man/man3/SSL_get_server_tmp_key.3.gz -OLD_FILES+=usr/share/openssl/man/man3/SSL_set_client_CA_list.3.gz # 20181030: malloc_domain(9) KPI change OLD_FILES+=share/man/man9/malloc_domain.9.gz # 20181025: OpenSSL libraries version bump to avoid conflict with ports From owner-svn-src-all@freebsd.org Wed Nov 21 00:21:59 2018 Return-Path: Delivered-To: svn-src-all@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 416B011437F6; Wed, 21 Nov 2018 00:21:59 +0000 (UTC) (envelope-from bwidawsk@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 DC0178BD4B; Wed, 21 Nov 2018 00:21:58 +0000 (UTC) (envelope-from bwidawsk@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A41EF18BEA; Wed, 21 Nov 2018 00:21:58 +0000 (UTC) (envelope-from bwidawsk@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAL0LwHt030665; Wed, 21 Nov 2018 00:21:58 GMT (envelope-from bwidawsk@FreeBSD.org) Received: (from bwidawsk@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAL0Lw2q030664; Wed, 21 Nov 2018 00:21:58 GMT (envelope-from bwidawsk@FreeBSD.org) Message-Id: <201811210021.wAL0Lw2q030664@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bwidawsk set sender to bwidawsk@FreeBSD.org using -f From: Ben Widawsky Date: Wed, 21 Nov 2018 00:21:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340716 - head/sys/x86/include X-SVN-Group: head X-SVN-Commit-Author: bwidawsk X-SVN-Commit-Paths: head/sys/x86/include X-SVN-Commit-Revision: 340716 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: DC0178BD4B X-Spamd-Result: default: False [0.42 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.00)[0.001,0]; NEURAL_SPAM_SHORT(0.27)[0.273,0]; NEURAL_SPAM_MEDIUM(0.14)[0.143,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Nov 2018 00:21:59 -0000 Author: bwidawsk Date: Wed Nov 21 00:21:58 2018 New Revision: 340716 URL: https://svnweb.freebsd.org/changeset/base/340716 Log: Add definitions for Intel Speed Shift These definitions will be used by a driver to implement Hardware P-States (autonomous control of HWP, via Intel Speed Shift technology). Reviewed by: kib Approved by: emaste (mentor) Differential Revision: https://reviews.freebsd.org/D18050 Modified: head/sys/x86/include/specialreg.h Modified: head/sys/x86/include/specialreg.h ============================================================================== --- head/sys/x86/include/specialreg.h Wed Nov 21 00:16:43 2018 (r340715) +++ head/sys/x86/include/specialreg.h Wed Nov 21 00:21:58 2018 (r340716) @@ -189,6 +189,12 @@ #define CPUTPM1_SENSOR 0x00000001 #define CPUTPM1_TURBO 0x00000002 #define CPUTPM1_ARAT 0x00000004 +#define CPUTPM1_HWP 0x00000080 +#define CPUTPM1_HWP_NOTIFICATION 0x00000100 +#define CPUTPM1_HWP_ACTIVITY_WINDOW 0x00000200 +#define CPUTPM1_HWP_PERF_PREF 0x00000400 +#define CPUTPM1_HWP_PKG 0x00000800 +#define CPUTPM1_HWP_FLEXIBLE 0x00020000 #define CPUTPM2_EFFREQ 0x00000001 /* Intel Processor Trace CPUID. */ @@ -541,7 +547,14 @@ #define MSR_DRAM_ENERGY_STATUS 0x619 #define MSR_PP0_ENERGY_STATUS 0x639 #define MSR_PP1_ENERGY_STATUS 0x641 +#define MSR_PPERF 0x64e #define MSR_TSC_DEADLINE 0x6e0 /* Writes are not serializing */ +#define MSR_IA32_PM_ENABLE 0x770 +#define MSR_IA32_HWP_CAPABILITIES 0x771 +#define MSR_IA32_HWP_REQUEST_PKG 0x772 +#define MSR_IA32_HWP_INTERRUPT 0x773 +#define MSR_IA32_HWP_REQUEST 0x774 +#define MSR_IA32_HWP_STATUS 0x777 /* * VMX MSRs @@ -717,6 +730,25 @@ /* MSR IA32_FLUSH_CMD */ #define IA32_FLUSH_CMD_L1D 0x00000001 + +/* MSR IA32_HWP_CAPABILITIES */ +#define IA32_HWP_CAPABILITIES_HIGHEST_PERFORMANCE(x) (((x) >> 0) & 0xff) +#define IA32_HWP_CAPABILITIES_GUARANTEED_PERFORMANCE(x) (((x) >> 8) & 0xff) +#define IA32_HWP_CAPABILITIES_EFFICIENT_PERFORMANCE(x) (((x) >> 16) & 0xff) +#define IA32_HWP_CAPABILITIES_LOWEST_PERFORMANCE(x) (((x) >> 24) & 0xff) + +/* MSR IA32_HWP_REQUEST */ +#define IA32_HWP_REQUEST_MINIMUM_VALID (1ULL << 63) +#define IA32_HWP_REQUEST_MAXIMUM_VALID (1ULL << 62) +#define IA32_HWP_REQUEST_DESIRED_VALID (1ULL << 61) +#define IA32_HWP_REQUEST_EPP_VALID (1ULL << 60) +#define IA32_HWP_REQUEST_ACTIVITY_WINDOW_VALID (1ULL << 59) +#define IA32_HWP_REQUEST_PACKAGE_CONTROL (1ULL << 42) +#define IA32_HWP_ACTIVITY_WINDOW (0x3ffULL << 32) +#define IA32_HWP_REQUEST_ENERGY_PERFORMANCE_PREFERENCE (0xffULL << 24) +#define IA32_HWP_DESIRED_PERFORMANCE (0xffULL << 16) +#define IA32_HWP_REQUEST_MAXIMUM_PERFORMANCE (0xffULL << 8) +#define IA32_HWP_MINIMUM_PERFORMANCE (0xffULL << 0) /* * PAT modes. From owner-svn-src-all@freebsd.org Wed Nov 21 00:22:32 2018 Return-Path: Delivered-To: svn-src-all@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 5CEB0114395A; Wed, 21 Nov 2018 00:22:32 +0000 (UTC) (envelope-from ygy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.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 F412C8BEFD; Wed, 21 Nov 2018 00:22:31 +0000 (UTC) (envelope-from ygy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D65EA18C19; Wed, 21 Nov 2018 00:22:31 +0000 (UTC) (envelope-from ygy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAL0MVqH033661; Wed, 21 Nov 2018 00:22:31 GMT (envelope-from ygy@FreeBSD.org) Received: (from ygy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAL0MVIt033660; Wed, 21 Nov 2018 00:22:31 GMT (envelope-from ygy@FreeBSD.org) Message-Id: <201811210022.wAL0MVIt033660@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ygy set sender to ygy@FreeBSD.org using -f From: Guangyuan Yang Date: Wed, 21 Nov 2018 00:22:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340717 - head/sbin/ipfw X-SVN-Group: head X-SVN-Commit-Author: ygy X-SVN-Commit-Paths: head/sbin/ipfw X-SVN-Commit-Revision: 340717 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: F412C8BEFD X-Spamd-Result: default: False [0.39 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.27)[0.271,0]; NEURAL_HAM_LONG(-0.00)[-0.003,0]; NEURAL_SPAM_MEDIUM(0.13)[0.126,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Nov 2018 00:22:32 -0000 Author: ygy (doc committer) Date: Wed Nov 21 00:22:31 2018 New Revision: 340717 URL: https://svnweb.freebsd.org/changeset/base/340717 Log: Fix incorrect DSCP value range from 0..64 to 0..63. PR: 232786 Submitted by: Sergey Akhmatov Reviewed by: AllanJude MFC after: 1 week Modified: head/sbin/ipfw/ipfw.8 Modified: head/sbin/ipfw/ipfw.8 ============================================================================== --- head/sbin/ipfw/ipfw.8 Wed Nov 21 00:21:58 2018 (r340716) +++ head/sbin/ipfw/ipfw.8 Wed Nov 21 00:22:31 2018 (r340717) @@ -1159,11 +1159,11 @@ Supported values are: .Pq Dv 101110 , .Cm be .Pq Dv 000000 . -Additionally, DSCP value can be specified by number (0..64). +Additionally, DSCP value can be specified by number (0..63). It is also possible to use the .Cm tablearg keyword with setdscp. -If the tablearg value is not within the 0..64 range, lower 6 bits of supplied +If the tablearg value is not within the 0..63 range, lower 6 bits of supplied value are used. .It Cm tcp-setmss Ar mss Set the Maximum Segment Size (MSS) in the TCP segment to value From owner-svn-src-all@freebsd.org Wed Nov 21 00:23:34 2018 Return-Path: Delivered-To: svn-src-all@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 A73681143A38 for ; Wed, 21 Nov 2018 00:23:34 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: from mail-wr1-x42d.google.com (mail-wr1-x42d.google.com [IPv6:2a00:1450:4864:20::42d]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 40BDC8C0A9 for ; Wed, 21 Nov 2018 00:23:33 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: by mail-wr1-x42d.google.com with SMTP id t3so3829831wrr.3 for ; Tue, 20 Nov 2018 16:23:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hardenedbsd.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=MnMjrYYU1ZNkJ/O+MfB9+TbwnvfAVAzgS/G7QcwJvpk=; b=OrmO9GGwX38UVIEky+IPaWX3mB6qzTOtXSnvd53GrQdTL3mWino5aXfuR3HMPtW7Q0 i2HTijeUFtrvkLaE3iu3yfqbMK9wdXl0hQEENhU3JEfpyuBiEJ7EOEypywpwmXQ3MH1N NB/hj4Xy6gT54ZCaTAip5LTVjCj0Og2rRa/gHJmxRxswsfyMjx13FGfsKFNNxF6b5XBq ENHu8ylSwWZOpy5J8QBgqxe53Mol+4sHYhY5gV84aKMlqh6clyjNFKPre49GOKmpuMG2 XVI/jiPJAOGMI2QervcREzp3nt2XtJ59ErSPc5AAAiYexBUXjQ+tosOfFBfxP4SzOh2j UKhA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=MnMjrYYU1ZNkJ/O+MfB9+TbwnvfAVAzgS/G7QcwJvpk=; b=afw+aJhrMSYB8VgAeXBqCpMA+ujo33w5gLxPKSiRrnQOAv8ew45VMzY9zTYlirbGvV RmX/9akIM6buxgyPNA3GnCT0ciOWgeUHdsRyQgvxzBZP4TRgqx502aaIFyVu88Qujtxp vpnbrzTp4ph2zhbs8OwSxZFuiLawuiD7/wSl4SvDig7UzCQqdB7Oct4uGa4qqailG+J/ e1kGhcNIPZ9pBQq2B2Ibwp5BvPiEalQYcFzTApru7X0dYaK4ndtwuRMbXDe4XhIH8wwj CQutSpGXJNKZnJjmH9TfEtoirguRrW4I5suX528b66/AynyNaUbT6EchATSePmkryBgQ 8Jfw== X-Gm-Message-State: AA+aEWa4mGJU5B16Ig9R6zg+6ytUkNDroDvMrfGfO7LomTt46n+WOzIw pQnwJ/9jN/W/exUKCR3tHMiOzQ== X-Google-Smtp-Source: AFSGD/ViQ5ScBlalMBwNMcMFNtEGSRbVruYuCwbcyHCE2a9KKV7tmNYCpWT2QODtX+JfOCOoJydcPg== X-Received: by 2002:a5d:4ec4:: with SMTP id s4mr3920249wrv.187.1542759811603; Tue, 20 Nov 2018 16:23:31 -0800 (PST) Received: from mutt-hbsd (lumumba.torservers.net. [77.247.181.163]) by smtp.gmail.com with ESMTPSA id g5-v6sm58049097wrw.97.2018.11.20.16.23.28 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 20 Nov 2018 16:23:30 -0800 (PST) Date: Tue, 20 Nov 2018 19:22:54 -0500 From: Shawn Webb To: Marcelo Araujo Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r340707 - head/usr.sbin/bhyve Message-ID: <20181121002254.efitgf45bzajh5sj@mutt-hbsd> References: <201811202221.wAKMLJ3W068166@repo.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="qf5lp2runf5q3qgd" Content-Disposition: inline In-Reply-To: <201811202221.wAKMLJ3W068166@repo.freebsd.org> X-Operating-System: FreeBSD mutt-hbsd 13.0-CURRENT FreeBSD 13.0-CURRENT HARDENEDBSD-13-CURRENT amd64 X-PGP-Key: http://pgp.mit.edu/pks/lookup?op=vindex&search=0x6A84658F52456EEE User-Agent: NeoMutt/20180622 X-Rspamd-Queue-Id: 40BDC8C0A9 X-Spamd-Result: default: False [-5.65 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_DKIM_ALLOW(-0.20)[hardenedbsd.org]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_SPF_ALLOW(-0.20)[+ip6:2a00:1450:4000::/36]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.20)[multipart/signed,text/plain]; PREVIOUSLY_DELIVERED(0.00)[svn-src-all@freebsd.org]; DMARC_NA(0.00)[hardenedbsd.org]; TO_DN_SOME(0.00)[]; RCVD_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[hardenedbsd.org:+]; MX_GOOD(-0.01)[alt1.aspmx.l.google.com,aspmx.l.google.com,aspmx2.googlemail.com,alt2.aspmx.l.google.com,aspmx3.googlemail.com]; RCVD_IN_DNSWL_NONE(0.00)[d.2.4.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.5.4.1.0.0.a.2.list.dnswl.org : 127.0.5.0]; NEURAL_HAM_SHORT(-0.89)[-0.888,0]; SIGNED_PGP(-2.00)[]; FROM_EQ_ENVFROM(0.00)[]; MID_RHS_NOT_FQDN(0.50)[]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US]; IP_SCORE(-0.65)[ipnet: 2a00:1450::/32(-1.58), asn: 15169(-1.58), country: US(-0.09)] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Nov 2018 00:23:35 -0000 --qf5lp2runf5q3qgd Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Nov 20, 2018 at 10:21:19PM +0000, Marcelo Araujo wrote: > Author: araujo > Date: Tue Nov 20 22:21:19 2018 > New Revision: 340707 > URL: https://svnweb.freebsd.org/changeset/base/340707 >=20 > Log: > Define AHCI_PORT_IDENT and increase by 1 the VTBLK_BLK_ID_BYTES > to avoid buffer accessed out of bounds, also switch to snprintf(3). > =20 > PR: 200859 > Submitted by: Caglar > Obtained from: https://github.com/mist64/xhyve/pull/24 > MFC after: 4 weeks > Sponsored by: iXsystems Inc. >=20 > Modified: > head/usr.sbin/bhyve/pci_ahci.c > head/usr.sbin/bhyve/pci_virtio_block.c >=20 > Modified: head/usr.sbin/bhyve/pci_ahci.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/usr.sbin/bhyve/pci_ahci.c Tue Nov 20 22:12:10 2018 (r340706) > +++ head/usr.sbin/bhyve/pci_ahci.c Tue Nov 20 22:21:19 2018 (r340707) > @@ -105,7 +105,7 @@ enum sata_fis_type { > * ATA commands > */ > #define ATA_SF_ENAB_SATA_SF 0x10 > -#define ATA_SATA_SF_AN 0x05 > +#define ATA_SATA_SF_AN 0x05 > #define ATA_SF_DIS_SATA_SF 0x90 > =20 > /* > @@ -119,6 +119,8 @@ static FILE *dbg; > #endif > #define WPRINTF(format, arg...) printf(format, ##arg) > =20 > +#define AHCI_PORT_IDENT 20 + 1 > + > struct ahci_ioreq { > struct blockif_req io_req; > struct ahci_port *io_pr; > @@ -136,7 +138,7 @@ struct ahci_port { > struct pci_ahci_softc *pr_sc; > uint8_t *cmd_lst; > uint8_t *rfis; > - char ident[20 + 1]; > + char ident[AHCI_PORT_IDENT]; > int port; > int atapi; > int reset; > @@ -2374,7 +2376,8 @@ pci_ahci_init(struct vmctx *ctx, struct pci_devinst= *p > MD5Init(&mdctx); > MD5Update(&mdctx, opts, strlen(opts)); > MD5Final(digest, &mdctx); > - sprintf(sc->port[p].ident, "BHYVE-%02X%02X-%02X%02X-%02X%02X", > + snprintf(sc->port[p].ident, AHCI_PORT_IDENT, > + "BHYVE-%02X%02X-%02X%02X-%02X%02X", > digest[0], digest[1], digest[2], digest[3], digest[4], > digest[5]); > =20 >=20 > Modified: head/usr.sbin/bhyve/pci_virtio_block.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/usr.sbin/bhyve/pci_virtio_block.c Tue Nov 20 22:12:10 2018 (r340= 706) > +++ head/usr.sbin/bhyve/pci_virtio_block.c Tue Nov 20 22:21:19 2018 (r340= 707) > @@ -61,7 +61,7 @@ __FBSDID("$FreeBSD$"); > #define VTBLK_S_IOERR 1 > #define VTBLK_S_UNSUPP 2 > =20 > -#define VTBLK_BLK_ID_BYTES 20 > +#define VTBLK_BLK_ID_BYTES 20 + 1 > =20 > /* Capability bits */ > #define VTBLK_F_SEG_MAX (1 << 2) /* Maximum request segments */ > @@ -344,7 +344,8 @@ pci_vtblk_init(struct vmctx *ctx, struct pci_devinst * > MD5Init(&mdctx); > MD5Update(&mdctx, opts, strlen(opts)); > MD5Final(digest, &mdctx); > - sprintf(sc->vbsc_ident, "BHYVE-%02X%02X-%02X%02X-%02X%02X", > + snprintf(sc->vbsc_ident, VTBLK_BLK_ID_BYTES, > + "BHYVE-%02X%02X-%02X%02X-%02X%02X", > digest[0], digest[1], digest[2], digest[3], digest[4], digest[5]); > =20 > /* setup virtio block config space */ Hey Marcelo, Thanks for committing this. Could VTBLK_BLK_ID_BYTES and AHCI_PORT_IDENT be merged into the same macro, defined in usr.sbin/bhyve/pci_emul.h? Especially since both equate to the same value. Thanks, --=20 Shawn Webb Cofounder and Security Engineer HardenedBSD Tor-ified Signal: +1 443-546-8752 Tor+XMPP+OTR: lattera@is.a.hacker.sx GPG Key ID: 0x6A84658F52456EEE GPG Key Fingerprint: 2ABA B6BD EF6A F486 BE89 3D9E 6A84 658F 5245 6EEE --qf5lp2runf5q3qgd Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEKrq2ve9q9Ia+iT2eaoRlj1JFbu4FAlv0pV0ACgkQaoRlj1JF bu7sEQ//RqaPN3xVSxteX4+el9RGjOEHxqV2/yaSJZbgOvmM9cbByivnEL59v4q/ 8t9O8KbrPrnBmLPqtNpwQCnEHxafBRhboSmzSiIrrsR2tfPkZ6h13l/0jChQMxXV AyutHMbyROJ6/d4vjGQEy1oiswBjcKWQGy+9qt5bjOmMgjDDZvvfHdsEQlJ5ZXEe 0umTnhX6wR/mt6JKlvOnF110ceZn6O5Y/TiTn8s22L6PjNOZmOfVsDHhQZ5Dmc2A TWzNIY7KiHQF+K42jLlQF0QUNAczeuLnjAopWsVF5uganBw/g7qmlFAo5Dru/HFz wGLY0wjsfbOMq6VnFq97UuPUakYxIaNXbOd1UX6SpHm0wGT8MTifBQG5BoKL5JNI pAOHOj38yMCrRt2TcmMGia3++OpSU6nTiEgNjdazHfdj4zceLCuYYZUZX9gYLFeK Gn747fbRUKeRvZ43DK0TlOV5lmuiafLO4B9aGbMFqYB6Ty33IbzhiFr1yj8XBKL7 oj/V8gBEajTSux+/2X0rXaKsCIbMPwOV23ZYqO/2iLldssompbZGzn6aFSvctSMP SzlcJ7jXfvSCbZ1+AC0DSH96ADkRLTp+IziRTg88LwZZt4Uu9r4ljTwgM5yNt5z2 oT5ij4B8t/kyTqeWhBuZQXbodJq4m+OFKG7Tp9UHDcsmCCCAHEc= =mQ8k -----END PGP SIGNATURE----- --qf5lp2runf5q3qgd-- From owner-svn-src-all@freebsd.org Wed Nov 21 00:35:22 2018 Return-Path: Delivered-To: svn-src-all@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 1A2371143ED5; Wed, 21 Nov 2018 00:35:22 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-it1-x129.google.com (mail-it1-x129.google.com [IPv6:2607:f8b0:4864:20::129]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EB7DD8C69F; Wed, 21 Nov 2018 00:35:20 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by mail-it1-x129.google.com with SMTP id h65so6502079ith.3; Tue, 20 Nov 2018 16:35:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=SwU8ZFIqrqpzkdMIS8M38DCiXnwEXDXiYKgO+9KHI50=; b=XHqZ+J86sQx8EPPZmM459+XHoqpv/pqzAPnc+DST7cv4D6W/96uJVIXhX1pSlJ3Fzb bkUMXdGimet6oUy1xXLiOVWj4EM3CYdyX0VInTWxJ8s4bIxs0Lwm0MMvkkH9RrnTbhVp 9kH5uO+jzEOb8RC/N1dsUTbROrLSawyBcyCTcZN5+7hhcFkO6s/I6E/KzKRwG2Ccnw42 qnWp7tjn9OK5v3UCMdj7DWlXzhc2ZNBl2Nyuic7y5dVkABjTvv8LpbuxLy1O/C8xPJum wKm74Bm+mRpVGZXmNbX5jrCZvVkGFwpgAbulCKlvUyAImN/392hnaZzsjoq68jwTWqBH PvWw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=SwU8ZFIqrqpzkdMIS8M38DCiXnwEXDXiYKgO+9KHI50=; b=blAEtpARzN7eoPMdVTmaqQwNGcZfKb2srougWCZeSw6QLagDrUgYBTpx+CiQRomB7I 7XmEKuR4Jt6/ppbqFcwjLx4X9TdeWurFyHXiL08JKHoMy/ooQrKy2PbkC/5UJFxfQZ51 fqq2HditirG0fHjf3490MS0Om6WeRotF6pP4la/NLXO5olqu3vO8hswe8rINSk2LHDHb xg2x9QClukCor3AnMEDhwV0C3Z6kO3BZ++W+ZaBS74RSCjLxQVb7ikDjdUGK4JQO57nV C8nSmuhtG6SuCjil7WNUo9g8pCgeySH5nY5BZsCVRL+HbE649JiEXsAQ1rNRnMwG8PVv fH8A== X-Gm-Message-State: AA+aEWZn2Cx5BqwTWvuRwgUdZMvw63UJmYrhc2EmnP2hykufhWVmsDFz y2Dob+M1UzQJpiopFHM92mrbGLjeTQk= X-Google-Smtp-Source: AJdET5dx1yUzdGFLqsmjFux50ddJc2N9LEIXOJ4qV+gepQ+4Doi77FNfqooxjOidq7Zfh/1AXrwV+w== X-Received: by 2002:a24:4052:: with SMTP id n79-v6mr3598292ita.99.1542760518232; Tue, 20 Nov 2018 16:35:18 -0800 (PST) Received: from raichu (toroon0560w-lp130-07-64-229-95-98.dsl.bell.ca. [64.229.95.98]) by smtp.gmail.com with ESMTPSA id d128sm11777070iof.37.2018.11.20.16.35.17 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 20 Nov 2018 16:35:17 -0800 (PST) Sender: Mark Johnston Date: Tue, 20 Nov 2018 19:35:15 -0500 From: Mark Johnston To: Ben Widawsky Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r340709 - in head/sys: compat/linuxkpi/common/include/linux vm Message-ID: <20181121003515.GE2630@raichu> References: <201811202249.wAKMnJxH082469@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201811202249.wAKMnJxH082469@repo.freebsd.org> User-Agent: Mutt/1.10.1 (2018-07-13) X-Rspamd-Queue-Id: EB7DD8C69F X-Spamd-Result: default: False [-4.84 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_DKIM_ALLOW(-0.20)[gmail.com]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; RCVD_TLS_LAST(0.00)[]; DMARC_NA(0.00)[freebsd.org]; TO_DN_SOME(0.00)[]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; RCVD_COUNT_THREE(0.00)[3]; IP_SCORE(-2.15)[ip: (-6.70), ipnet: 2607:f8b0::/32(-2.38), asn: 15169(-1.58), country: US(-0.09)]; MX_GOOD(-0.01)[cached: alt3.gmail-smtp-in.l.google.com]; DKIM_TRACE(0.00)[gmail.com:+]; RCVD_IN_DNSWL_NONE(0.00)[9.2.1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.0]; NEURAL_HAM_SHORT(-0.98)[-0.981,0]; FORGED_SENDER(0.30)[markj@freebsd.org,markjdb@gmail.com]; MID_RHS_NOT_FQDN(0.50)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; FROM_NEQ_ENVFROM(0.00)[markj@freebsd.org,markjdb@gmail.com] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Nov 2018 00:35:22 -0000 On Tue, Nov 20, 2018 at 10:49:19PM +0000, Ben Widawsky wrote: > Author: bwidawsk > Date: Tue Nov 20 22:49:19 2018 > New Revision: 340709 > URL: https://svnweb.freebsd.org/changeset/base/340709 > > Log: > linuxkpi: Add some basic swap functions > > These are used by kms-drm to determine various heuristics relate > memory conditions. > > The number of free swap pages is just a variable, and it can be > much cheaper by either adding a new getter, or simply extern'ing > swap_total. However, this patch opts to use the more expensive, > existing interface - since this isn't an operation in a high per > path. > > This allows us to remove some more gpl linuxkpi and do the follo > kms-drm: > git rm linuxkpi/gplv2/include/linux/swap.h > > Reviewed by: mmacy, Johannes Lundberg > Approved by: emaste (mentor) > Differential Revision: https://reviews.freebsd.org/D18052 > > Added: > head/sys/compat/linuxkpi/common/include/linux/swap.h (contents, props changed) > Modified: > head/sys/vm/vm_pageout.h > head/sys/vm/vm_swapout.c > > [...] > Modified: head/sys/vm/vm_swapout.c > ============================================================================== > --- head/sys/vm/vm_swapout.c Tue Nov 20 22:24:18 2018 (r340708) > +++ head/sys/vm/vm_swapout.c Tue Nov 20 22:49:19 2018 (r340709) > @@ -961,3 +961,10 @@ swapout(struct proc *p) > p->p_swtick = ticks; > return (0); > } > + > +/* Used to determine if the current process is itself the reaper. */ > +bool > +vm_curproc_is_vmproc(void) > +{ > + return curproc == vmproc; > +} >From a look at how this is used, it should probably be pageproc rather than vmproc. There are various code paths that just check curproc == pageproc inline. From owner-svn-src-all@freebsd.org Wed Nov 21 00:42:42 2018 Return-Path: Delivered-To: svn-src-all@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 A44F01144171; Wed, 21 Nov 2018 00:42:42 +0000 (UTC) (envelope-from bwidawsk@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4949E8CB29; Wed, 21 Nov 2018 00:42:42 +0000 (UTC) (envelope-from bwidawsk@freebsd.org) Received: from smtp.freebsd.org (c-73-25-164-31.hsd1.or.comcast.net [73.25.164.31]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: bwidawsk) by smtp.freebsd.org (Postfix) with ESMTPSA id 8F9AE1E070; Wed, 21 Nov 2018 00:42:41 +0000 (UTC) (envelope-from bwidawsk@freebsd.org) Date: Tue, 20 Nov 2018 16:42:39 -0800 From: Ben Widawsky To: Mark Johnston Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r340709 - in head/sys: compat/linuxkpi/common/include/linux vm Message-ID: <20181121004239.spk72g2pikvse4y7@smtp.freebsd.org> Mail-Followup-To: Mark Johnston , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201811202249.wAKMnJxH082469@repo.freebsd.org> <20181121003515.GE2630@raichu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20181121003515.GE2630@raichu> User-Agent: NeoMutt/20180716 X-Rspamd-Queue-Id: 4949E8CB29 X-Spamd-Result: default: False [0.45 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_SPAM_SHORT(0.47)[0.469,0]; NEURAL_HAM_LONG(-0.18)[-0.183,0]; NEURAL_SPAM_MEDIUM(0.17)[0.166,0]; ASN(0.00)[asn:11403, ipnet:96.47.64.0/20, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Nov 2018 00:42:42 -0000 On 18-11-20 19:35:15, Mark Johnston wrote: > On Tue, Nov 20, 2018 at 10:49:19PM +0000, Ben Widawsky wrote: > > Author: bwidawsk > > Date: Tue Nov 20 22:49:19 2018 > > New Revision: 340709 > > URL: https://svnweb.freebsd.org/changeset/base/340709 > > > > Log: > > linuxkpi: Add some basic swap functions > > > > These are used by kms-drm to determine various heuristics relate > > memory conditions. > > > > The number of free swap pages is just a variable, and it can be > > much cheaper by either adding a new getter, or simply extern'ing > > swap_total. However, this patch opts to use the more expensive, > > existing interface - since this isn't an operation in a high per > > path. > > > > This allows us to remove some more gpl linuxkpi and do the follo > > kms-drm: > > git rm linuxkpi/gplv2/include/linux/swap.h > > > > Reviewed by: mmacy, Johannes Lundberg > > Approved by: emaste (mentor) > > Differential Revision: https://reviews.freebsd.org/D18052 > > > > Added: > > head/sys/compat/linuxkpi/common/include/linux/swap.h (contents, props changed) > > Modified: > > head/sys/vm/vm_pageout.h > > head/sys/vm/vm_swapout.c > > > > [...] > > Modified: head/sys/vm/vm_swapout.c > > ============================================================================== > > --- head/sys/vm/vm_swapout.c Tue Nov 20 22:24:18 2018 (r340708) > > +++ head/sys/vm/vm_swapout.c Tue Nov 20 22:49:19 2018 (r340709) > > @@ -961,3 +961,10 @@ swapout(struct proc *p) > > p->p_swtick = ticks; > > return (0); > > } > > + > > +/* Used to determine if the current process is itself the reaper. */ > > +bool > > +vm_curproc_is_vmproc(void) > > +{ > > + return curproc == vmproc; > > +} > > From a look at how this is used, it should probably be pageproc rather > than vmproc. There are various code paths that just check > curproc == pageproc inline. > Could I trouble you for a quick explanation of the difference between the two? From owner-svn-src-all@freebsd.org Wed Nov 21 00:51:53 2018 Return-Path: Delivered-To: svn-src-all@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 474CB11444D3; Wed, 21 Nov 2018 00:51:53 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-io1-xd42.google.com (mail-io1-xd42.google.com [IPv6:2607:f8b0:4864:20::d42]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7539B8D23E; Wed, 21 Nov 2018 00:51:52 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by mail-io1-xd42.google.com with SMTP id f6so2845345iob.1; Tue, 20 Nov 2018 16:51:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=KNCYtomE2T37Gc9EUOx7eVuL0VE+93XAoOzyFEf1vcI=; b=DOKSpZD3j6NmNcE/HupWqcsuPUKxoyPBzemDaGVYHcuN2pD057BVOPj0BV2GjbfDJg 0yzJY9loz96kYfgiklb/x+8/ct8X8Kg6RC479LzrcR2XgiBlqB8Ko/9az3qYkOBmJSWj 9TZt2WGZYw99HmzaaYIxdm2KI0uznpWxCs1ldTe9JtKt/4yY7F69hRuRUu0GgZgxpUMZ eJwl/49HzkUMD5HjvX8SK6qOOyox7AoqUpthhTrCqFXgKGTXniSlbXxVkaEEjm6hiETj bTDHuSJL43b18g5nldWJqLM4uG15F5B4WHxeMgpGxz0i1CjK09nlSULLUd1CMEFm+2s/ SP0A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=KNCYtomE2T37Gc9EUOx7eVuL0VE+93XAoOzyFEf1vcI=; b=ahXPEf3nm2ZT4xM2UPlQ2b05+TqNQVmLYJ6xmx/Alx1o3juMdPcbmmeErYSIx7d3pJ MUy5vHmkHILB4R7Rip8jdEhUpHf7/uLr8FJgjoEUq1tLmvihOS6d7XZvg/lNj6KUgsEK suXO3noVh/dLSUR8jmyFWrAYVogwk5xnw4NV/DIITw8oAcz6LXm6TLO35td6t5giQlJx Ebw3/B73Uj+Cjg8fgsD13zrOozneVdl0FlMgc4QUXYfe6ak4HmVB8rsmAo1SJDzgujdy M1PUE/3wFdglrn6y3Lqo1xR3g7opRNRvli0XOatEwljM/8+BwYBau3uU5EsfFdHSu43d bXQw== X-Gm-Message-State: AA+aEWYZvLhglQiOEVIYV9lqZs6Y7J4ipA26jtPqZbMlIN4lg2gsakN0 Kdn+woTwkc3IjLXXzocfuhzwSG9E4Ak= X-Google-Smtp-Source: AFSGD/UNaFJRbl7SwsSatKnqiuHu4U93VpiNhBBnQ5yimiISNFwuduANmETYvScJHpX98T5dbfegrg== X-Received: by 2002:a6b:4f14:: with SMTP id d20-v6mr3469983iob.68.1542761511494; Tue, 20 Nov 2018 16:51:51 -0800 (PST) Received: from raichu (toroon0560w-lp130-07-64-229-95-98.dsl.bell.ca. [64.229.95.98]) by smtp.gmail.com with ESMTPSA id b192sm1083077itb.12.2018.11.20.16.51.50 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 20 Nov 2018 16:51:50 -0800 (PST) Sender: Mark Johnston Date: Tue, 20 Nov 2018 19:51:48 -0500 From: Mark Johnston To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r340709 - in head/sys: compat/linuxkpi/common/include/linux vm Message-ID: <20181121005148.GF2630@raichu> References: <201811202249.wAKMnJxH082469@repo.freebsd.org> <20181121003515.GE2630@raichu> <20181121004239.spk72g2pikvse4y7@smtp.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20181121004239.spk72g2pikvse4y7@smtp.freebsd.org> User-Agent: Mutt/1.10.1 (2018-07-13) X-Rspamd-Queue-Id: 7539B8D23E X-Spamd-Result: default: False [-2.76 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_DKIM_ALLOW(-0.20)[gmail.com]; NEURAL_HAM_MEDIUM(-0.93)[-0.926,0]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; DMARC_NA(0.00)[freebsd.org]; NEURAL_HAM_LONG(-0.92)[-0.923,0]; RCVD_COUNT_THREE(0.00)[3]; RCVD_TLS_LAST(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; MX_GOOD(-0.01)[cached: alt3.gmail-smtp-in.l.google.com]; RCVD_IN_DNSWL_NONE(0.00)[2.4.d.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.0]; NEURAL_HAM_SHORT(-0.91)[-0.915,0]; IP_SCORE(-0.28)[ip: (2.63), ipnet: 2607:f8b0::/32(-2.38), asn: 15169(-1.58), country: US(-0.09)]; FORGED_SENDER(0.30)[markj@freebsd.org,markjdb@gmail.com]; MID_RHS_NOT_FQDN(0.50)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; FROM_NEQ_ENVFROM(0.00)[markj@freebsd.org,markjdb@gmail.com] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Nov 2018 00:51:53 -0000 On Tue, Nov 20, 2018 at 04:42:39PM -0800, Ben Widawsky wrote: > On 18-11-20 19:35:15, Mark Johnston wrote: > > On Tue, Nov 20, 2018 at 10:49:19PM +0000, Ben Widawsky wrote: > > > Author: bwidawsk > > > Date: Tue Nov 20 22:49:19 2018 > > > New Revision: 340709 > > > URL: https://svnweb.freebsd.org/changeset/base/340709 > > > > > > Log: > > > linuxkpi: Add some basic swap functions > > > > > > These are used by kms-drm to determine various heuristics relate > > > memory conditions. > > > > > > The number of free swap pages is just a variable, and it can be > > > much cheaper by either adding a new getter, or simply extern'ing > > > swap_total. However, this patch opts to use the more expensive, > > > existing interface - since this isn't an operation in a high per > > > path. > > > > > > This allows us to remove some more gpl linuxkpi and do the follo > > > kms-drm: > > > git rm linuxkpi/gplv2/include/linux/swap.h > > > > > > Reviewed by: mmacy, Johannes Lundberg > > > Approved by: emaste (mentor) > > > Differential Revision: https://reviews.freebsd.org/D18052 > > > > > > Added: > > > head/sys/compat/linuxkpi/common/include/linux/swap.h (contents, props changed) > > > Modified: > > > head/sys/vm/vm_pageout.h > > > head/sys/vm/vm_swapout.c > > > > > > [...] > > > Modified: head/sys/vm/vm_swapout.c > > > ============================================================================== > > > --- head/sys/vm/vm_swapout.c Tue Nov 20 22:24:18 2018 (r340708) > > > +++ head/sys/vm/vm_swapout.c Tue Nov 20 22:49:19 2018 (r340709) > > > @@ -961,3 +961,10 @@ swapout(struct proc *p) > > > p->p_swtick = ticks; > > > return (0); > > > } > > > + > > > +/* Used to determine if the current process is itself the reaper. */ > > > +bool > > > +vm_curproc_is_vmproc(void) > > > +{ > > > + return curproc == vmproc; > > > +} > > > > From a look at how this is used, it should probably be pageproc rather > > than vmproc. There are various code paths that just check > > curproc == pageproc inline. > > > > Could I trouble you for a quick explanation of the difference between the two? pageproc contains the page daemon and laundry threads, which are responsible for managing the LRU page queues and writing back dirty pages. vmproc's main task is to swap out kernel stacks when the system is under memory pressure, and swap them back in when necessary. It's a somewhat legacy component of the system and isn't required. You can build a kernel without it by specifying "options NO_SWAPPING" (which is a somewhat misleading name), in which vm_swapout_dummy.c is compiled instead of vm_swapout.c. From owner-svn-src-all@freebsd.org Wed Nov 21 00:58:42 2018 Return-Path: Delivered-To: svn-src-all@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 C85B411446ED; Wed, 21 Nov 2018 00:58:41 +0000 (UTC) (envelope-from bwidawsk@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1C69B8D6C6; Wed, 21 Nov 2018 00:58:40 +0000 (UTC) (envelope-from bwidawsk@freebsd.org) Received: from smtp.freebsd.org (c-73-25-164-31.hsd1.or.comcast.net [73.25.164.31]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: bwidawsk) by smtp.freebsd.org (Postfix) with ESMTPSA id 089061E16D; Wed, 21 Nov 2018 00:58:35 +0000 (UTC) (envelope-from bwidawsk@freebsd.org) Date: Tue, 20 Nov 2018 16:58:32 -0800 From: Ben Widawsky To: Mark Johnston Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r340709 - in head/sys: compat/linuxkpi/common/include/linux vm Message-ID: <20181121005832.ongabjesxlsd7cqu@smtp.freebsd.org> Mail-Followup-To: Mark Johnston , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201811202249.wAKMnJxH082469@repo.freebsd.org> <20181121003515.GE2630@raichu> <20181121004239.spk72g2pikvse4y7@smtp.freebsd.org> <20181121005148.GF2630@raichu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20181121005148.GF2630@raichu> User-Agent: NeoMutt/20180716 X-Rspamd-Queue-Id: 1C69B8D6C6 X-Spamd-Result: default: False [0.76 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_SPAM_MEDIUM(0.18)[0.180,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.76)[0.760,0]; NEURAL_HAM_LONG(-0.18)[-0.182,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Nov 2018 00:58:42 -0000 On 18-11-20 19:51:48, Mark Johnston wrote: > On Tue, Nov 20, 2018 at 04:42:39PM -0800, Ben Widawsky wrote: > > On 18-11-20 19:35:15, Mark Johnston wrote: > > > On Tue, Nov 20, 2018 at 10:49:19PM +0000, Ben Widawsky wrote: > > > > Author: bwidawsk > > > > Date: Tue Nov 20 22:49:19 2018 > > > > New Revision: 340709 > > > > URL: https://svnweb.freebsd.org/changeset/base/340709 > > > > > > > > Log: > > > > linuxkpi: Add some basic swap functions > > > > > > > > These are used by kms-drm to determine various heuristics relate > > > > memory conditions. > > > > > > > > The number of free swap pages is just a variable, and it can be > > > > much cheaper by either adding a new getter, or simply extern'ing > > > > swap_total. However, this patch opts to use the more expensive, > > > > existing interface - since this isn't an operation in a high per > > > > path. > > > > > > > > This allows us to remove some more gpl linuxkpi and do the follo > > > > kms-drm: > > > > git rm linuxkpi/gplv2/include/linux/swap.h > > > > > > > > Reviewed by: mmacy, Johannes Lundberg > > > > Approved by: emaste (mentor) > > > > Differential Revision: https://reviews.freebsd.org/D18052 > > > > > > > > Added: > > > > head/sys/compat/linuxkpi/common/include/linux/swap.h (contents, props changed) > > > > Modified: > > > > head/sys/vm/vm_pageout.h > > > > head/sys/vm/vm_swapout.c > > > > > > > > [...] > > > > Modified: head/sys/vm/vm_swapout.c > > > > ============================================================================== > > > > --- head/sys/vm/vm_swapout.c Tue Nov 20 22:24:18 2018 (r340708) > > > > +++ head/sys/vm/vm_swapout.c Tue Nov 20 22:49:19 2018 (r340709) > > > > @@ -961,3 +961,10 @@ swapout(struct proc *p) > > > > p->p_swtick = ticks; > > > > return (0); > > > > } > > > > + > > > > +/* Used to determine if the current process is itself the reaper. */ > > > > +bool > > > > +vm_curproc_is_vmproc(void) > > > > +{ > > > > + return curproc == vmproc; > > > > +} > > > > > > From a look at how this is used, it should probably be pageproc rather > > > than vmproc. There are various code paths that just check > > > curproc == pageproc inline. > > > > > > > Could I trouble you for a quick explanation of the difference between the two? > > pageproc contains the page daemon and laundry threads, which are > responsible for managing the LRU page queues and writing back dirty > pages. vmproc's main task is to swap out kernel stacks when the system > is under memory pressure, and swap them back in when necessary. It's a > somewhat legacy component of the system and isn't required. You can > build a kernel without it by specifying "options NO_SWAPPING" (which is > a somewhat misleading name), in which vm_swapout_dummy.c is compiled > instead of vm_swapout.c. > Thanks for the explanation. I indeed want the page daemon. I will put up a patch to do that the correct way. Thanks. From owner-svn-src-all@freebsd.org Wed Nov 21 01:00:59 2018 Return-Path: Delivered-To: svn-src-all@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 88CC211447B7 for ; Wed, 21 Nov 2018 01:00:59 +0000 (UTC) (envelope-from oliver.pinter@hardenedbsd.org) Received: from mail-yw1-xc33.google.com (mail-yw1-xc33.google.com [IPv6:2607:f8b0:4864:20::c33]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D7BE08D8D8 for ; Wed, 21 Nov 2018 01:00:58 +0000 (UTC) (envelope-from oliver.pinter@hardenedbsd.org) Received: by mail-yw1-xc33.google.com with SMTP id l200so1575430ywe.10 for ; Tue, 20 Nov 2018 17:00:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hardenedbsd.org; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=BCQFzJqNVMace6HaNdkKixqTVhX4x6ag78Dr6xZP0hk=; b=OHvcz3G1HLuHX6cwQYQOEaCp4R2Ft0RIruug0QZIpQv7ZWkbYrwvuNrh74lyFkjsmL GCRb/Q/tFv0JrC4NU72XvVGshLvh2YJNZflL6cRTdylAdX1+LQDbFgSuP6un1QiFSeAI XLP/TYYhlreALaxVRrPEuFvC7dvhh+GpmIKIznJe1rRlpkmeJwweMNdhr+qyho7mbZH8 HL2QHj8gYPoEF54efRYh7sPeAvZNfYr8tCSm0pi3naa4U7sq5AStWsCXPSsvg7e++ZTf gdBPkdvjv8/6BMTB0Nxn6Kg8ZbnS1nLN2CZpAjGlo2zT/httRbklh+rQNCVWDTUMYpe5 y/YA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=BCQFzJqNVMace6HaNdkKixqTVhX4x6ag78Dr6xZP0hk=; b=bhQq01kvxEJbyZpdsJqid8jfoIiPfbW6asWwcmwN7M10bZDJzfbAG0YQXhYZUVEjKk MUqjyV280GCUTue+FR493kSzOVbbKzYROSJhEHQe5e8KGobdeeNfVLIrZ2RS7o7OPaLk UyipZ18N23aByFItLIokID67fORKLNjpcDcZZYXNr5eKXCRExskCz2Qtk+vRUJ+dvZ03 KBmUqx6TzechaklGjxWYfLD3PZ7M+5j22Yt/CpxhsJExSnoHDBQe/VfLnFlXKwcMY1TN iE+Q49NvIV4GaHbLgnmadef/EWFJ3fI63O1IDplgVVgf2NeR+dU3885OllsA1m9dRFHd VqWg== X-Gm-Message-State: AGRZ1gJQ9Wh3udZL64K3mZRiR2YD6WhxuaB8FrAqeDs6mpYQwwQnC6Rt /FYjWYcOXniSagwh+2nMh3e2nm+mRDIcqGmqrLn4xg== X-Google-Smtp-Source: AJdET5f6ymbEW1OywA8q7TFnyA0IV4IkQ6c8RKeHBu1HJzd3gOZ1Y++ylWHnGHk3b9Pk/OSaKaSZuKOIqWF2kZVRE6o= X-Received: by 2002:a0d:e081:: with SMTP id j123-v6mr4467025ywe.267.1542762058257; Tue, 20 Nov 2018 17:00:58 -0800 (PST) MIME-Version: 1.0 Received: by 2002:a25:84d2:0:0:0:0:0 with HTTP; Tue, 20 Nov 2018 17:00:57 -0800 (PST) In-Reply-To: <201811202249.wAKMnJxH082469@repo.freebsd.org> References: <201811202249.wAKMnJxH082469@repo.freebsd.org> From: Oliver Pinter Date: Wed, 21 Nov 2018 02:00:57 +0100 Message-ID: Subject: Re: svn commit: r340709 - in head/sys: compat/linuxkpi/common/include/linux vm To: Ben Widawsky Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" X-Rspamd-Queue-Id: D7BE08D8D8 X-Spamd-Result: default: False [-4.29 / 15.00]; ARC_NA(0.00)[]; TO_DN_EQ_ADDR_SOME(0.00)[]; R_DKIM_ALLOW(-0.20)[hardenedbsd.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.996,0]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36]; NEURAL_HAM_LONG(-0.99)[-0.991,0]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[svn-src-all@freebsd.org]; DMARC_NA(0.00)[hardenedbsd.org]; TO_DN_SOME(0.00)[]; RCVD_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[hardenedbsd.org:+]; MX_GOOD(-0.01)[cached: alt1.aspmx.l.google.com]; RCVD_IN_DNSWL_NONE(0.00)[3.3.c.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.0]; NEURAL_HAM_SHORT(-0.98)[-0.983,0]; FROM_EQ_ENVFROM(0.00)[]; RCVD_TLS_LAST(0.00)[]; IP_SCORE(-0.81)[ipnet: 2607:f8b0::/32(-2.38), asn: 15169(-1.58), country: US(-0.09)]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US] X-Rspamd-Server: mx1.freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Nov 2018 01:00:59 -0000 On Tuesday, November 20, 2018, Ben Widawsky wrote: > Author: bwidawsk > Date: Tue Nov 20 22:49:19 2018 > New Revision: 340709 > URL: https://svnweb.freebsd.org/changeset/base/340709 > > Log: > linuxkpi: Add some basic swap functions > > These are used by kms-drm to determine various heuristics relate > memory conditions. > > The number of free swap pages is just a variable, and it can be > much cheaper by either adding a new getter, or simply extern'ing > swap_total. However, this patch opts to use the more expensive, > existing interface - since this isn't an operation in a high per > path. > > This allows us to remove some more gpl linuxkpi and do the follo > kms-drm: > git rm linuxkpi/gplv2/include/linux/swap.h > > Reviewed by: mmacy, Johannes Lundberg > Approved by: emaste (mentor) > Differential Revision: https://reviews.freebsd.org/D18052 > > Added: > head/sys/compat/linuxkpi/common/include/linux/swap.h (contents, props > changed) > Modified: > head/sys/vm/vm_pageout.h > head/sys/vm/vm_swapout.c > > Added: head/sys/compat/linuxkpi/common/include/linux/swap.h > ============================================================ > ================== > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/sys/compat/linuxkpi/common/include/linux/swap.h Tue Nov > 20 22:49:19 2018 (r340709) > @@ -0,0 +1,102 @@ > +/*- > + * Copyright (c) 2018 Intel Corporation > + * > + * Redistribution and use in source and binary forms, with or without > + * modification, are permitted provided that the following conditions are > + * met: > + * 1. Redistributions of source code must retain the above copyright > + * notice, this list of conditions and the following disclaimer. > + * 2. Redistributions in binary form must reproduce the above copyright > + * notice, this list of conditions and the following disclaimer in > + * the documentation and/or other materials provided with the > + * distribution. > + * > + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND > + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE > + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR > PURPOSE > + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE > + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR > CONSEQUENTIAL > + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS > + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) > + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, > STRICT > + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY > WAY > + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF > + * SUCH DAMAGE. > + * > + * $FreeBSD$ > + */ > + > +#ifndef _LINUX_SWAP_H_ > +#define _LINUX_SWAP_H_ > + > +#include > +#include > + > +static inline long > +get_nr_swap_pages(void) > +{ > + int i, j; > + > + /* NB: This could be done cheaply by obtaining swap_total directly > */ > + swap_pager_status(&i, &j); > + return i - j; > +} > + > +static inline int > +current_is_kswapd(void) > +{ > + return vm_curproc_is_vmproc(); > +} > + > +#endif Probably I'm wrong, but this file contains twice the same intended content. > +/*- > + * Copyright (c) 2018 Intel Corporation > + * > + * Redistribution and use in source and binary forms, with or without > + * modification, are permitted provided that the following conditions are > + * met: > + * 1. Redistributions of source code must retain the above copyright > + * notice, this list of conditions and the following disclaimer. > + * 2. Redistributions in binary form must reproduce the above copyright > + * notice, this list of conditions and the following disclaimer in > + * the documentation and/or other materials provided with the > + * distribution. > + * > + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND > + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE > + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR > PURPOSE > + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE > + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR > CONSEQUENTIAL > + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS > + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) > + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, > STRICT > + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY > WAY > + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF > + * SUCH DAMAGE. > + * > + * $FreeBSD$ > + */ > + > +#ifndef _LINUX_SWAP_H_ > +#define _LINUX_SWAP_H_ > + > +#include > +#include > + > +static inline long > +get_nr_swap_pages(void) > +{ > + int i, j; > + > + /* NB: This could be done cheaply by obtaining swap_total directly > */ > + swap_pager_status(&i, &j); > + return i - j; > +} > + > +static inline int > +current_is_kswapd(void) > +{ > + return vm_curproc_is_vmproc(); > +} > + > +#endif > > Modified: head/sys/vm/vm_pageout.h > ============================================================ > ================== > --- head/sys/vm/vm_pageout.h Tue Nov 20 22:24:18 2018 (r340708) > +++ head/sys/vm/vm_pageout.h Tue Nov 20 22:49:19 2018 (r340709) > @@ -106,5 +106,8 @@ void vm_pageout_oom(int shortage); > > void vm_swapout_run(void); > void vm_swapout_run_idle(void); > + > +bool vm_curproc_is_vmproc(void); > + > #endif /* _KERNEL */ > #endif /* _VM_VM_PAGEOUT_H_ */ > > Modified: head/sys/vm/vm_swapout.c > ============================================================ > ================== > --- head/sys/vm/vm_swapout.c Tue Nov 20 22:24:18 2018 (r340708) > +++ head/sys/vm/vm_swapout.c Tue Nov 20 22:49:19 2018 (r340709) > @@ -961,3 +961,10 @@ swapout(struct proc *p) > p->p_swtick = ticks; > return (0); > } > + > +/* Used to determine if the current process is itself the reaper. */ > +bool > +vm_curproc_is_vmproc(void) > +{ > + return curproc == vmproc; > +} > _______________________________________________ > svn-src-head@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/svn-src-head > To unsubscribe, send any mail to "svn-src-head-unsubscribe@freebsd.org" > From owner-svn-src-all@freebsd.org Wed Nov 21 01:09:34 2018 Return-Path: Delivered-To: svn-src-all@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 51FEC1144B35; Wed, 21 Nov 2018 01:09:34 +0000 (UTC) (envelope-from bwidawsk@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EC03E8DD67; Wed, 21 Nov 2018 01:09:33 +0000 (UTC) (envelope-from bwidawsk@freebsd.org) Received: from smtp.freebsd.org (c-73-25-164-31.hsd1.or.comcast.net [73.25.164.31]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: bwidawsk) by smtp.freebsd.org (Postfix) with ESMTPSA id CA3B21E26A; Wed, 21 Nov 2018 01:09:32 +0000 (UTC) (envelope-from bwidawsk@freebsd.org) Date: Tue, 20 Nov 2018 17:09:30 -0800 From: Ben Widawsky To: Oliver Pinter Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Subject: Re: svn commit: r340709 - in head/sys: compat/linuxkpi/common/include/linux vm Message-ID: <20181121010930.vjeuugd72lzun3tn@smtp.freebsd.org> Mail-Followup-To: Oliver Pinter , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" References: <201811202249.wAKMnJxH082469@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: NeoMutt/20180716 X-Rspamd-Queue-Id: EC03E8DD67 X-Spamd-Result: default: False [0.76 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_SPAM_SHORT(0.76)[0.760,0]; NEURAL_HAM_LONG(-0.18)[-0.182,0]; NEURAL_SPAM_MEDIUM(0.18)[0.180,0]; ASN(0.00)[asn:11403, ipnet:96.47.64.0/20, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Nov 2018 01:09:34 -0000 On 18-11-21 02:00:57, Oliver Pinter wrote: > > > On Tuesday, November 20, 2018, Ben Widawsky wrote: > > Author: bwidawsk > Date: Tue Nov 20 22:49:19 2018 > New Revision: 340709 > URL: https://svnweb.freebsd.org/changeset/base/340709 > > Log: >   linuxkpi: Add some basic swap functions > >   These are used by kms-drm to determine various heuristics relate >   memory conditions. > >   The number of free swap pages is just a variable, and it can be >   much cheaper by either adding a new getter, or simply extern'ing >   swap_total. However, this patch opts to use the more expensive, >   existing interface - since this isn't an operation in a high per >   path. > >   This allows us to remove some more gpl linuxkpi and do the follo >   kms-drm: >   git rm linuxkpi/gplv2/include/linux/swap.h > >   Reviewed by:    mmacy, Johannes Lundberg >   Approved by:    emaste (mentor) >   Differential Revision:  https://reviews.freebsd.org/D18052 > > Added: >   head/sys/compat/linuxkpi/common/include/linux/swap.h   (contents, props > changed) > Modified: >   head/sys/vm/vm_pageout.h >   head/sys/vm/vm_swapout.c > > Added: head/sys/compat/linuxkpi/common/include/linux/swap.h > =========================================================================== > === > --- /dev/null   00:00:00 1970   (empty, because file is newly added) > +++ head/sys/compat/linuxkpi/common/include/linux/swap.h        Tue Nov 20 > 22:49:19 2018        (r340709) > @@ -0,0 +1,102 @@ > +/*- > + * Copyright (c) 2018 Intel Corporation > + * > + * Redistribution and use in source and binary forms, with or without > + * modification, are permitted provided that the following conditions are > + * met: > + * 1. Redistributions of source code must retain the above copyright > + *    notice, this list of conditions and the following disclaimer. > + * 2. Redistributions in binary form must reproduce the above copyright > + *    notice, this list of conditions and the following disclaimer in > + *    the documentation and/or other materials provided with the > + *    distribution. > + * > + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND > + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE > + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR > PURPOSE > + * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE > + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR > CONSEQUENTIAL > + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS > + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) > + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, > STRICT > + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY > WAY > + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF > + * SUCH DAMAGE. > + * > + * $FreeBSD$ > + */ > + > +#ifndef        _LINUX_SWAP_H_ > +#define        _LINUX_SWAP_H_ > + > +#include > +#include > + > +static inline long > +get_nr_swap_pages(void) > +{ > +       int i, j; > + > +       /* NB: This could be done cheaply by obtaining swap_total directly > */ > +       swap_pager_status(&i, &j); > +       return i - j; > +} > + > +static inline int > +current_is_kswapd(void) > +{ > +       return vm_curproc_is_vmproc(); > +} > + > +#endif > > > Probably I'm wrong, but this file contains twice the same intended content.  >   You are correct, but I have already fixed it. I have some problems with my workflow still, apparently. :( > > +/*- > + * Copyright (c) 2018 Intel Corporation > + * > + * Redistribution and use in source and binary forms, with or without > + * modification, are permitted provided that the following conditions are > + * met: > + * 1. Redistributions of source code must retain the above copyright > + *    notice, this list of conditions and the following disclaimer. > + * 2. Redistributions in binary form must reproduce the above copyright > + *    notice, this list of conditions and the following disclaimer in > + *    the documentation and/or other materials provided with the > + *    distribution. > + * > + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND > + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE > + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR > PURPOSE > + * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE > + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR > CONSEQUENTIAL > + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS > + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) > + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, > STRICT > + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY > WAY > + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF > + * SUCH DAMAGE. > + * > + * $FreeBSD$ > + */ > + > +#ifndef        _LINUX_SWAP_H_ > +#define        _LINUX_SWAP_H_ > + > +#include > +#include > + > +static inline long > +get_nr_swap_pages(void) > +{ > +       int i, j; > + > +       /* NB: This could be done cheaply by obtaining swap_total directly > */ > +       swap_pager_status(&i, &j); > +       return i - j; > +} > + > +static inline int > +current_is_kswapd(void) > +{ > +       return vm_curproc_is_vmproc(); > +} > + > +#endif > > Modified: head/sys/vm/vm_pageout.h > =========================================================================== > === > --- head/sys/vm/vm_pageout.h    Tue Nov 20 22:24:18 2018        (r340708) > +++ head/sys/vm/vm_pageout.h    Tue Nov 20 22:49:19 2018        (r340709) > @@ -106,5 +106,8 @@ void vm_pageout_oom(int shortage); > >  void vm_swapout_run(void); >  void vm_swapout_run_idle(void); > + > +bool vm_curproc_is_vmproc(void); > + >  #endif /* _KERNEL */ >  #endif /* _VM_VM_PAGEOUT_H_ */ > > Modified: head/sys/vm/vm_swapout.c > =========================================================================== > === > --- head/sys/vm/vm_swapout.c    Tue Nov 20 22:24:18 2018        (r340708) > +++ head/sys/vm/vm_swapout.c    Tue Nov 20 22:49:19 2018        (r340709) > @@ -961,3 +961,10 @@ swapout(struct proc *p) >         p->p_swtick = ticks; >         return (0); >  } > + > +/* Used to determine if the current process is itself the reaper. */ > +bool > +vm_curproc_is_vmproc(void) > +{ > +       return curproc == vmproc; > +} > _______________________________________________ > svn-src-head@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/svn-src-head > To unsubscribe, send any mail to "svn-src-head-unsubscribe@freebsd.org" > From owner-svn-src-all@freebsd.org Wed Nov 21 01:24:28 2018 Return-Path: Delivered-To: svn-src-all@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 78E4C1145292; Wed, 21 Nov 2018 01:24:28 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.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 204F68E67D; Wed, 21 Nov 2018 01:24:28 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E7A98195FD; Wed, 21 Nov 2018 01:24:27 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAL1ORxH064260; Wed, 21 Nov 2018 01:24:27 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAL1OR2f064258; Wed, 21 Nov 2018 01:24:27 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <201811210124.wAL1OR2f064258@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Wed, 21 Nov 2018 01:24:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r340718 - in stable/12: lib/libpmc lib/libpmc/pmu-events lib/libpmc/pmu-events/arch/x86/amdfam17h sys/dev/hwpmc X-SVN-Group: stable-12 X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: in stable/12: lib/libpmc lib/libpmc/pmu-events lib/libpmc/pmu-events/arch/x86/amdfam17h sys/dev/hwpmc X-SVN-Commit-Revision: 340718 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 204F68E67D X-Spamd-Result: default: False [0.68 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.42)[0.422,0]; NEURAL_SPAM_MEDIUM(0.24)[0.240,0]; NEURAL_SPAM_LONG(0.02)[0.022,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Nov 2018 01:24:28 -0000 Author: mmacy Date: Wed Nov 21 01:24:27 2018 New Revision: 340718 URL: https://svnweb.freebsd.org/changeset/base/340718 Log: hwpmc: new counters and bug fix MFCs MFC r340108 and r340149 Added: stable/12/lib/libpmc/pmu-events/arch/x86/amdfam17h/data-fabric.json - copied unchanged from r340108, head/lib/libpmc/pmu-events/arch/x86/amdfam17h/data-fabric.json stable/12/lib/libpmc/pmu-events/arch/x86/amdfam17h/l3cache.json - copied unchanged from r340108, head/lib/libpmc/pmu-events/arch/x86/amdfam17h/l3cache.json Modified: stable/12/lib/libpmc/libpmc_pmu_util.c stable/12/lib/libpmc/pmu-events/jevents.c stable/12/sys/dev/hwpmc/hwpmc_amd.c stable/12/sys/dev/hwpmc/hwpmc_amd.h stable/12/sys/dev/hwpmc/hwpmc_mod.c Directory Properties: stable/12/ (props changed) Modified: stable/12/lib/libpmc/libpmc_pmu_util.c ============================================================================== --- stable/12/lib/libpmc/libpmc_pmu_util.c Wed Nov 21 00:22:31 2018 (r340717) +++ stable/12/lib/libpmc/libpmc_pmu_util.c Wed Nov 21 01:24:27 2018 (r340718) @@ -146,6 +146,8 @@ pmu_alias_get(const char *name) struct pmu_event_desc { uint64_t ped_period; uint64_t ped_offcore_rsp; + uint64_t ped_l3_thread; + uint64_t ped_l3_slice; uint32_t ped_event; uint32_t ped_frontend; uint32_t ped_ldlat; @@ -270,6 +272,10 @@ pmu_parse_event(struct pmu_event_desc *ped, const char ped->ped_ch_mask = strtol(value, NULL, 16); else if (strcmp(key, "config1") == 0) ped->ped_config1 = strtol(value, NULL, 16); + else if (strcmp(key, "l3_thread_mask") == 0) + ped->ped_l3_thread = strtol(value, NULL, 16); + else if (strcmp(key, "l3_slice_mask") == 0) + ped->ped_l3_slice = strtol(value, NULL, 16); else { debug = getenv("PMUDEBUG"); if (debug != NULL && strcmp(debug, "true") == 0 && value != NULL) @@ -407,33 +413,50 @@ pmc_pmu_print_counter_full(const char *ev) } static int -pmc_pmu_amd_pmcallocate(const char *event_name __unused, struct pmc_op_pmcallocate *pm, +pmc_pmu_amd_pmcallocate(const char *event_name, struct pmc_op_pmcallocate *pm, struct pmu_event_desc *ped) { struct pmc_md_amd_op_pmcallocate *amd; + const struct pmu_event *pe; + int idx = -1; amd = &pm->pm_md.pm_amd; - amd->pm_amd_config = AMD_PMC_TO_EVENTMASK(ped->ped_event); if (ped->ped_umask > 0) { pm->pm_caps |= PMC_CAP_QUALIFIER; amd->pm_amd_config |= AMD_PMC_TO_UNITMASK(ped->ped_umask); } pm->pm_class = PMC_CLASS_K8; + pe = pmu_event_get(NULL, event_name, &idx); - if ((pm->pm_caps & (PMC_CAP_USER|PMC_CAP_SYSTEM)) == 0 || - (pm->pm_caps & (PMC_CAP_USER|PMC_CAP_SYSTEM)) == - (PMC_CAP_USER|PMC_CAP_SYSTEM)) - amd->pm_amd_config |= (AMD_PMC_USR | AMD_PMC_OS); - else if (pm->pm_caps & PMC_CAP_USER) - amd->pm_amd_config |= AMD_PMC_USR; - else if (pm->pm_caps & PMC_CAP_SYSTEM) - amd->pm_amd_config |= AMD_PMC_OS; - if (ped->ped_edge) - amd->pm_amd_config |= AMD_PMC_EDGE; - if (ped->ped_inv) - amd->pm_amd_config |= AMD_PMC_EDGE; - if (pm->pm_caps & PMC_CAP_INTERRUPT) - amd->pm_amd_config |= AMD_PMC_INT; + if (strcmp("l3cache", pe->topic) == 0){ + amd->pm_amd_config |= AMD_PMC_TO_EVENTMASK(ped->ped_event); + amd->pm_amd_sub_class = PMC_AMD_SUB_CLASS_L3_CACHE; + amd->pm_amd_config |= AMD_PMC_TO_L3SLICE(ped->ped_l3_slice); + amd->pm_amd_config |= AMD_PMC_TO_L3CORE(ped->ped_l3_thread); + } + else if (strcmp("data fabric", pe->topic) == 0){ + + amd->pm_amd_config |= AMD_PMC_TO_EVENTMASK_DF(ped->ped_event); + amd->pm_amd_sub_class = PMC_AMD_SUB_CLASS_DATA_FABRIC; + } + else{ + amd->pm_amd_config |= AMD_PMC_TO_EVENTMASK(ped->ped_event); + amd->pm_amd_sub_class = PMC_AMD_SUB_CLASS_CORE; + if ((pm->pm_caps & (PMC_CAP_USER|PMC_CAP_SYSTEM)) == 0 || + (pm->pm_caps & (PMC_CAP_USER|PMC_CAP_SYSTEM)) == + (PMC_CAP_USER|PMC_CAP_SYSTEM)) + amd->pm_amd_config |= (AMD_PMC_USR | AMD_PMC_OS); + else if (pm->pm_caps & PMC_CAP_USER) + amd->pm_amd_config |= AMD_PMC_USR; + else if (pm->pm_caps & PMC_CAP_SYSTEM) + amd->pm_amd_config |= AMD_PMC_OS; + if (ped->ped_edge) + amd->pm_amd_config |= AMD_PMC_EDGE; + if (ped->ped_inv) + amd->pm_amd_config |= AMD_PMC_EDGE; + if (pm->pm_caps & PMC_CAP_INTERRUPT) + amd->pm_amd_config |= AMD_PMC_INT; + } return (0); } Copied: stable/12/lib/libpmc/pmu-events/arch/x86/amdfam17h/data-fabric.json (from r340108, head/lib/libpmc/pmu-events/arch/x86/amdfam17h/data-fabric.json) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/12/lib/libpmc/pmu-events/arch/x86/amdfam17h/data-fabric.json Wed Nov 21 01:24:27 2018 (r340718, copy of r340108, head/lib/libpmc/pmu-events/arch/x86/amdfam17h/data-fabric.json) @@ -0,0 +1,2668 @@ +[ + { + "EventName": "df_ccm_reqa.Node0.anydram", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Any DRAM transaction", + "UMask": "0x0F" + }, + { + "EventName": "df_ccm_reqa.Node1.anydram", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Any DRAM transaction", + "UMask": "0x2F" + }, + { + "EventName": "df_ccm_reqa.Node2.anydram", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Any DRAM transaction", + "UMask": "0x4F" + }, + { + "EventName": "df_ccm_reqa.Node3.anydram", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Any DRAM transaction", + "UMask": "0x6F" + }, + { + "EventName": "df_ccm_reqa.Node4.anydram", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Any DRAM transaction", + "UMask": "0x8F" + }, + { + "EventName": "df_ccm_reqa.Node5.anydram", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Any DRAM transaction", + "UMask": "0xAF" + }, + { + "EventName": "df_ccm_reqa.Node6.anydram", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Any DRAM transaction", + "UMask": "0xCF" + }, + { + "EventName": "df_ccm_reqa.Node7.anydram", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Any DRAM transaction", + "UMask": "0xEF" + }, + { + "EventName": "df_ccm_reqa.Node0.wrsizedfullzero", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered WrSizedFullZero", + "UMask": "0x0E" + }, + { + "EventName": "df_ccm_reqa.Node1.wrsizedfullzero", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered WrSizedFullZero", + "UMask": "0x2E" + }, + { + "EventName": "df_ccm_reqa.Node2.wrsizedfullzero", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered WrSizedFullZero", + "UMask": "0x4E" + }, + { + "EventName": "df_ccm_reqa.Node3.wrsizedfullzero", + "EventCode": "0x8E", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered WrSizedFullZero", + "UMask": "0x6E" + }, + { + "EventName": "df_ccm_reqa.Node4.wrsizedfullzero", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered WrSizedFullZero", + "UMask": "0x8E" + }, + { + "EventName": "df_ccm_reqa.Node5.wrsizedfullzero", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered WrSizedFullZero", + "UMask": "0xAE" + }, + { + "EventName": "df_ccm_reqa.Node6.wrsizedfullzero", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered WrSizedFullZero", + "UMask": "0xCE" + }, + { + "EventName": "df_ccm_reqa.Node7.wrsizedfullzero", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered WrSizedFullZero", + "UMask": "0xEE" + }, + { + "EventName": "df_ccm_reqa.Node0.wrsizedfullnc", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered wrsizedfullnc", + "UMask": "0x0D" + }, + { + "EventName": "df_ccm_reqa.Node1.wrsizedfullnc", + "EventCode": "0x8A", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered wrsizedfullnc", + "UMask": "0x2D" + }, + { + "EventName": "df_ccm_reqa.Node2.wrsizedfullnc", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered wrsizedfullnc", + "UMask": "0x4D" + }, + { + "EventName": "df_ccm_reqa.Node3.wrsizedfullnc", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered wrsizedfullnc", + "UMask": "0x6D" + }, + { + "EventName": "df_ccm_reqa.Node4.wrsizedfullnc", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered wrsizedfullnc", + "UMask": "0x8D" + }, + { + "EventName": "df_ccm_reqa.Node5.wrsizedfullnc", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered wrsizedfullnc", + "UMask": "0xAD" + }, + { + "EventName": "df_ccm_reqa.Node6.wrsizedfullnc", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered wrsizedfullnc", + "UMask": "0xCD" + }, + { + "EventName": "df_ccm_reqa.Node7.wrsizedfullnc", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered wrsizedfullnc", + "UMask": "0xED" + }, + { + "EventName": "df_ccm_reqa.Node0.wrsized", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered wrsized", + "UMask": "0x0C" + }, + { + "EventName": "df_ccm_reqa.Node1.wrsized", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered wrsized", + "UMask": "0x2C" + }, + { + "EventName": "df_ccm_reqa.Node2.wrsized", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered wrsized", + "UMask": "0x4C" + }, + { + "EventName": "df_ccm_reqa.Node3.wrsized", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered wrsized", + "UMask": "0x6C" + }, + { + "EventName": "df_ccm_reqa.Node4.wrsized", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered wrsized", + "UMask": "0x8C" + }, + { + "EventName": "df_ccm_reqa.Node5.wrsized", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered wrsized", + "UMask": "0xAC" + }, + { + "EventName": "df_ccm_reqa.Node6.wrsized", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered wrsized", + "UMask": "0xCC" + }, + { + "EventName": "df_ccm_reqa.Node7.wrsized", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered wrsized", + "UMask": "0xEC" + }, + { + "EventName": "df_ccm_reqa.Node0.wrsizedfullzero", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered wrsizedfullzero", + "UMask": "0x0B" + }, + { + "EventName": "df_ccm_reqa.Node1.wrsizedfullzero", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered wrsizedfullzero", + "UMask": "0x2B" + }, + { + "EventName": "df_ccm_reqa.Node2.wrsizedfullzero", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered wrsizedfullzero", + "UMask": "0x4B" + }, + { + "EventName": "df_ccm_reqa.Node3.wrsizedfullzero", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered wrsizedfullzero", + "UMask": "0x6B" + }, + { + "EventName": "df_ccm_reqa.Node4.wrsizedfullzero", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered wrsizedfullzero", + "UMask": "0x8B" + }, + { + "EventName": "df_ccm_reqa.Node5.wrsizedfullzero", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered wrsizedfullzero", + "UMask": "0xAB" + }, + { + "EventName": "df_ccm_reqa.Node6.wrsizedfullzero", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered wrsizedfullzero", + "UMask": "0xCB" + }, + { + "EventName": "df_ccm_reqa.Node7.wrsizedfullzero", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered wrsizedfullzero", + "UMask": "0xEB" + }, + { + "EventName": "df_ccm_reqa.Node0.wrsizedfullnc", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered wrsizedfullnc", + "UMask": "0x0A" + }, + { + "EventName": "df_ccm_reqa.Node1.wrsizedfullnc", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered wrsizedfullnc", + "UMask": "0x2A" + }, + { + "EventName": "df_ccm_reqa.Node2.wrsizedfullnc", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered wrsizedfullnc", + "UMask": "0x4A" + }, + { + "EventName": "df_ccm_reqa.Node3.wrsizedfullnc", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered wrsizedfullnc", + "UMask": "0x6A" + }, + { + "EventName": "df_ccm_reqa.Node4.wrsizedfullnc", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered wrsizedfullnc", + "UMask": "0x8A" + }, + { + "EventName": "df_ccm_reqa.Node5.wrsizedfullnc", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered wrsizedfullnc", + "UMask": "0xAA" + }, + { + "EventName": "df_ccm_reqa.Node6.wrsizedfullnc", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered wrsizedfullnc", + "UMask": "0xCA" + }, + { + "EventName": "df_ccm_reqa.Node7.wrsizedfullnc", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered wrsizedfullnc", + "UMask": "0xEA" + }, + { + "EventName": "df_ccm_reqa.Node0.wrsized", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered wrsized", + "UMask": "0x09" + }, + { + "EventName": "df_ccm_reqa.Node1.wrsized", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered wrsized", + "UMask": "0x29" + }, + { + "EventName": "df_ccm_reqa.Node2.wrsized", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered wrsized", + "UMask": "0x49" + }, + { + "EventName": "df_ccm_reqa.Node3.wrsized", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered wrsized", + "UMask": "0x69" + }, + { + "EventName": "df_ccm_reqa.Node4.wrsized", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered wrsized", + "UMask": "0x89" + }, + { + "EventName": "df_ccm_reqa.Node5.wrsized", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered wrsized", + "UMask": "0xA9" + }, + { + "EventName": "df_ccm_reqa.Node6.wrsized", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered wrsized", + "UMask": "0xC9" + }, + { + "EventName": "df_ccm_reqa.Node7.wrsized", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered wrsized", + "UMask": "0xE9" + }, + { + "EventName": "df_ccm_reqa.Node0.rdsizednc", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered rdsizednc", + "UMask": "0x08" + }, + { + "EventName": "df_ccm_reqa.Node1.rdsizednc", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered rdsizednc", + "UMask": "0x28" + }, + { + "EventName": "df_ccm_reqa.Node2.rdsizednc", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered rdsizednc", + "UMask": "0x48" + }, + { + "EventName": "df_ccm_reqa.Node3.rdsizednc", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered rdsizednc", + "UMask": "0x68" + }, + { + "EventName": "df_ccm_reqa.Node4.rdsizednc", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered rdsizednc", + "UMask": "0x88" + }, + { + "EventName": "df_ccm_reqa.Node5.rdsizednc", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered rdsizednc", + "UMask": "0xA8" + }, + { + "EventName": "df_ccm_reqa.Node6.rdsizednc", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered rdsizednc", + "UMask": "0xC8" + }, + { + "EventName": "df_ccm_reqa.Node7.rdsizednc", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered rdsizednc", + "UMask": "0xE8" + }, + { + "EventName": "df_ccm_reqa.Node0.rdsized", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered rdsized", + "UMask": "0x07" + }, + { + "EventName": "df_ccm_reqa.Node1.rdsized", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered rdsized", + "UMask": "0x27" + }, + { + "EventName": "df_ccm_reqa.Node2.rdsized", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered rdsized", + "UMask": "0x47" + }, + { + "EventName": "df_ccm_reqa.Node3.rdsized", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered rdsized", + "UMask": "0x67" + }, + { + "EventName": "df_ccm_reqa.Node4.rdsized", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered rdsized", + "UMask": "0x87" + }, + { + "EventName": "df_ccm_reqa.Node5.rdsized", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered rdsized", + "UMask": "0xA7" + }, + { + "EventName": "df_ccm_reqa.Node6.rdsized", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered rdsized", + "UMask": "0xC7" + }, + { + "EventName": "df_ccm_reqa.Node7.rdsized", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered rdsized", + "UMask": "0xE7" + }, + { + "EventName": "df_ccm_reqa.Node0.specdramrd", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered specdramrd", + "UMask": "0x06" + }, + { + "EventName": "df_ccm_reqa.Node1.specdramrd", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered specdramrd", + "UMask": "0x26" + }, + { + "EventName": "df_ccm_reqa.Node2.specdramrd", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered specdramrd", + "UMask": "0x46" + }, + { + "EventName": "df_ccm_reqa.Node3.specdramrd", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered specdramrd", + "UMask": "0x66" + }, + { + "EventName": "df_ccm_reqa.Node4.specdramrd", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered specdramrd", + "UMask": "0x86" + }, + { + "EventName": "df_ccm_reqa.Node5.specdramrd", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered specdramrd", + "UMask": "0xA6" + }, + { + "EventName": "df_ccm_reqa.Node6.specdramrd", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered specdramrd", + "UMask": "0xC6" + }, + { + "EventName": "df_ccm_reqa.Node7.specdramrd", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered specdramrd", + "UMask": "0xE6" + }, + { + "EventName": "df_ccm_reqa.Node0.anyrdblk", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered anyrdblk", + "UMask": "0x05" + }, + { + "EventName": "df_ccm_reqa.Node1.anyrdblk", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered anyrdblk", + "UMask": "0x25" + }, + { + "EventName": "df_ccm_reqa.Node2.anyrdblk", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered anyrdblk", + "UMask": "0x45" + }, + { + "EventName": "df_ccm_reqa.Node3.anyrdblk", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered anyrdblk", + "UMask": "0x65" + }, + { + "EventName": "df_ccm_reqa.Node4.anyrdblk", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered anyrdblk", + "UMask": "0x85" + }, + { + "EventName": "df_ccm_reqa.Node5.anyrdblk", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered anyrdblk", + "UMask": "0xA5" + }, + { + "EventName": "df_ccm_reqa.Node6.anyrdblk", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered anyrdblk", + "UMask": "0xC5" + }, + { + "EventName": "df_ccm_reqa.Node7.anyrdblk", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered anyrdblk", + "UMask": "0xE5" + }, + { + "EventName": "df_ccm_reqa.Node0.rdvlkc", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered rdvlkc", + "UMask": "0x04" + }, + { + "EventName": "df_ccm_reqa.Node1.rdvlkc", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered rdvlkc", + "UMask": "0x24" + }, + { + "EventName": "df_ccm_reqa.Node2.rdvlkc", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered rdvlkc", + "UMask": "0x44" + }, + { + "EventName": "df_ccm_reqa.Node3.rdvlkc", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered rdvlkc", + "UMask": "0x64" + }, + { + "EventName": "df_ccm_reqa.Node4.rdvlkc", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered rdvlkc", + "UMask": "0x84" + }, + { + "EventName": "df_ccm_reqa.Node5.rdvlkc", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered rdvlkc", + "UMask": "0xA4" + }, + { + "EventName": "df_ccm_reqa.Node6.rdvlkc", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered rdvlkc", + "UMask": "0xC4" + }, + { + "EventName": "df_ccm_reqa.Node7.rdvlkc", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered rdvlkc", + "UMask": "0xE4" + }, + { + "EventName": "df_ccm_reqa.Node0.rdvlkx", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered rdvlkx", + "UMask": "0x03" + }, + { + "EventName": "df_ccm_reqa.Node1.rdvlkx", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered rdvlkx", + "UMask": "0x23" + }, + { + "EventName": "df_ccm_reqa.Node2.rdvlkx", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered rdvlkx", + "UMask": "0x43" + }, + { + "EventName": "df_ccm_reqa.Node3.rdvlkx", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered rdvlkx", + "UMask": "0x63" + }, + { + "EventName": "df_ccm_reqa.Node4.rdvlkx", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered rdvlkx", + "UMask": "0x83" + }, + { + "EventName": "df_ccm_reqa.Node5.rdvlkx", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered rdvlkx", + "UMask": "0xA3" + }, + { + "EventName": "df_ccm_reqa.Node6.rdvlkx", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered rdvlkx", + "UMask": "0xC3" + }, + { + "EventName": "df_ccm_reqa.Node7.rdvlkx", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered rdvlkx", + "UMask": "0xE3" + }, + { + "EventName": "df_ccm_reqa.Node0.rdvlks", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered rdvlks", + "UMask": "0x02" + }, + { + "EventName": "df_ccm_reqa.Node1.rdvlks", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered rdvlks", + "UMask": "0x22" + }, + { + "EventName": "df_ccm_reqa.Node2.rdvlks", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered rdvlks", + "UMask": "0x42" + }, + { + "EventName": "df_ccm_reqa.Node3.rdvlks", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered rdvlks", + "UMask": "0x62" + }, + { + "EventName": "df_ccm_reqa.Node4.rdvlks", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered rdvlks", + "UMask": "0x82" + }, + { + "EventName": "df_ccm_reqa.Node5.rdvlks", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered rdvlks", + "UMask": "0xA2" + }, + { + "EventName": "df_ccm_reqa.Node6.rdvlks", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered rdvlks", + "UMask": "0xC2" + }, + { + "EventName": "df_ccm_reqa.Node7.rdvlks", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered rdvlks", + "UMask": "0xE2" + }, + { + "EventName": "df_ccm_reqa.Node0.rdvlkl", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered rdvlkl", + "UMask": "0x01" + }, + { + "EventName": "df_ccm_reqa.Node1.rdvlkl", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered rdvlkl", + "UMask": "0x21" + }, + { + "EventName": "df_ccm_reqa.Node2.rdvlkl", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered rdvlkl", + "UMask": "0x41" + }, + { + "EventName": "df_ccm_reqa.Node3.rdvlkl", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered rdvlkl", + "UMask": "0x61" + }, + { + "EventName": "df_ccm_reqa.Node4.rdvlkl", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered rdvlkl", + "UMask": "0x81" + }, + { + "EventName": "df_ccm_reqa.Node5.rdvlkl", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered rdvlkl", + "UMask": "0xA1" + }, + { + "EventName": "df_ccm_reqa.Node6.rdvlkl", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered rdvlkl", + "UMask": "0xC1" + }, + { + "EventName": "df_ccm_reqa.Node7.rdvlkl", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered rdvlkl", + "UMask": "0xE1" + }, + { + "EventName": "df_ccm_reqb.Node0.chgtox", + "EventCode": "0x8c", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered chgtox", + "UMask": "0x0E" + }, + { + "EventName": "df_ccm_reqb.Node1.chgtox", + "EventCode": "0x8c", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered chgtox", + "UMask": "0x2E" + }, + { + "EventName": "df_ccm_reqb.Node2.chgtox", + "EventCode": "0x8c", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered chgtox", + "UMask": "0x4E" + }, + { + "EventName": "df_ccm_reqb.Node3.chgtox", + "EventCode": "0x8E", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered chgtox", + "UMask": "0x6E" + }, + { + "EventName": "df_ccm_reqb.Node4.chgtox", + "EventCode": "0x8c", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered chgtox", + "UMask": "0x8E" + }, + { + "EventName": "df_ccm_reqb.Node5.chgtox", + "EventCode": "0x8c", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered chgtox", + "UMask": "0xAE" + }, + { + "EventName": "df_ccm_reqb.Node6.chgtox", + "EventCode": "0x8c", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered chgtox", + "UMask": "0xCE" + }, + { + "EventName": "df_ccm_reqb.Node7.chgtox", + "EventCode": "0x8c", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered chgtox", + "UMask": "0xEE" + }, + { + "EventName": "df_ccm_reqb.Node0.vicblkfull.", + "EventCode": "0x8c", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered vicblkfull.", + "UMask": "0x0D" + }, + { + "EventName": "df_ccm_reqb.Node1.vicblkfull.", + "EventCode": "0x8A", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered vicblkfull.", + "UMask": "0x2D" + }, + { + "EventName": "df_ccm_reqb.Node2.vicblkfull.", + "EventCode": "0x8c", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered vicblkfull.", + "UMask": "0x4D" + }, + { + "EventName": "df_ccm_reqb.Node3.vicblkfull.", + "EventCode": "0x8c", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered vicblkfull.", + "UMask": "0x6D" + }, + { + "EventName": "df_ccm_reqb.Node4.vicblkfull.", + "EventCode": "0x8c", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered vicblkfull.", + "UMask": "0x8D" + }, + { + "EventName": "df_ccm_reqb.Node5.vicblkfull.", + "EventCode": "0x8c", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered vicblkfull.", + "UMask": "0xAD" + }, + { + "EventName": "df_ccm_reqb.Node6.vicblkfull.", + "EventCode": "0x8c", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered vicblkfull.", + "UMask": "0xCD" + }, + { + "EventName": "df_ccm_reqb.Node7.vicblkfull.", + "EventCode": "0x8c", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered vicblkfull.", + "UMask": "0xED" + }, + { + "EventName": "df_ccm_reqb.Node0.wbinvblkall", + "EventCode": "0x8c", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered wbinvblkall", + "UMask": "0x0C" + }, + { + "EventName": "df_ccm_reqb.Node1.wbinvblkall", + "EventCode": "0x8c", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered wbinvblkall", + "UMask": "0x2C" + }, + { + "EventName": "df_ccm_reqb.Node2.wbinvblkall", + "EventCode": "0x8c", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered wbinvblkall", + "UMask": "0x4C" + }, + { + "EventName": "df_ccm_reqb.Node3.wbinvblkall", + "EventCode": "0x8c", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered wbinvblkall", + "UMask": "0x6C" + }, + { + "EventName": "df_ccm_reqb.Node4.wbinvblkall", + "EventCode": "0x8c", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered wbinvblkall", + "UMask": "0x8C" + }, + { + "EventName": "df_ccm_reqb.Node5.wbinvblkall", + "EventCode": "0x8c", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered wbinvblkall", + "UMask": "0xAC" + }, + { + "EventName": "df_ccm_reqb.Node6.wbinvblkall", + "EventCode": "0x8c", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered wbinvblkall", + "UMask": "0xCC" + }, + { + "EventName": "df_ccm_reqb.Node7.wbinvblkall", + "EventCode": "0x8c", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered wbinvblkall", + "UMask": "0xEC" + }, + { + "EventName": "df_ccm_reqb.Node0.vicblkfullzero", + "EventCode": "0x8c", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered vicblkfullzero", + "UMask": "0x0B" + }, + { + "EventName": "df_ccm_reqb.Node1.vicblkfullzero", + "EventCode": "0x8c", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered vicblkfullzero", + "UMask": "0x2B" + }, + { + "EventName": "df_ccm_reqb.Node2.vicblkfullzero", + "EventCode": "0x8c", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered vicblkfullzero", + "UMask": "0x4B" + }, + { + "EventName": "df_ccm_reqb.Node3.vicblkfullzero", + "EventCode": "0x8c", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered vicblkfullzero", + "UMask": "0x6B" + }, + { + "EventName": "df_ccm_reqb.Node4.vicblkfullzero", + "EventCode": "0x8c", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered vicblkfullzero", + "UMask": "0x8B" + }, + { + "EventName": "df_ccm_reqb.Node5.vicblkfullzero", + "EventCode": "0x8c", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered vicblkfullzero", + "UMask": "0xAB" + }, + { + "EventName": "df_ccm_reqb.Node6.vicblkfullzero", + "EventCode": "0x8c", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered vicblkfullzero", + "UMask": "0xCB" + }, + { *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Wed Nov 21 01:32:29 2018 Return-Path: Delivered-To: svn-src-all@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 87A3311455AF; Wed, 21 Nov 2018 01:32:29 +0000 (UTC) (envelope-from araujobsdport@gmail.com) Received: from mail-lj1-x230.google.com (mail-lj1-x230.google.com [IPv6:2a00:1450:4864:20::230]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AF8A28EAEB; Wed, 21 Nov 2018 01:32:28 +0000 (UTC) (envelope-from araujobsdport@gmail.com) Received: by mail-lj1-x230.google.com with SMTP id g11-v6so3375235ljk.3; Tue, 20 Nov 2018 17:32:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:reply-to:from:date:message-id :subject:to:cc; bh=HHh1xudadHax7t48qsANHkBnb/KZepv3jiYEmofvgHw=; b=gwMHu1EzlosZHLoLaReYEP4OEXoM501vcQr9Vy5t4Y2kP21ITeoLIqPvRX2cP6E3Gm qqE3638oY38Bx4AJt8d3xfU0xSStDJd19/eGW1QKqQPiYlHOhb7B8mkhaso8iINT88jL hoEgqRHlvM0Dx+Lfacmp7gFjKSNvqmSW0hhOTr7hEqPdT2HVPcOYdJVPEz3PH8xQI+Eq er3VGwXM+VOlprQi1S5bnQlISGTeqaU6lyM4whSgXDzJlrze5MWgDaMRNxVz3cSoIAQW 59MqsihaiMW4IzeUVtiZSf6nlV8asBgmH3Oyqov4u2tIaozihPnJ8V9vfYy0pATEm25b gv1Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:reply-to :from:date:message-id:subject:to:cc; bh=HHh1xudadHax7t48qsANHkBnb/KZepv3jiYEmofvgHw=; b=hHwUSks6AryYYPK8F2RJej0SjicuBnEwSCBgORqOztRxn4wIYxDHwR5hMD/0DvbirQ pH28147+BLQsAcuJHllAivhG1BSbURDb8lUpnrLp5FgseDYIxZ0UCJcCPdrnYz46snzZ y8TqXNIbS9COkPiMzyFYDqESF3nNwFYLPO5NuCJsfG6H/Jky253kxvV5hWZOwmf+qE0Z EYifHGNGQv9gJ46pXDYduoqzAsT+7Ob1iPJJ4EcXCU1jPV1QGxUAQYW5ZtZxxwbv0MMd KjYuQBUhk28uN8dAtwk7noiLZ4Rs0k3sT8ut5ECP+PtqmOm3Nj7Vc5YlNOCJCn8h4TtG leMg== X-Gm-Message-State: AA+aEWbjVzVeB3e3mp3dIz9ZA8lA1Iw8JMKSdB2Ik6+8nS1i2U57y8iV 5VjsLkzhs6w+i6jjx3h7oqAs6oTUSVS5fMn1sgg= X-Google-Smtp-Source: AFSGD/Wpk1ypK/7xLfA2SgStGQsaryB+Z6tihLB9j9gBf/0N79C7I+JLuMXeCi0+5dgiTCQSsrtY2hEiBvhpNCPsM+M= X-Received: by 2002:a2e:5418:: with SMTP id i24-v6mr2823184ljb.51.1542763946834; Tue, 20 Nov 2018 17:32:26 -0800 (PST) MIME-Version: 1.0 References: <201811202221.wAKMLJ3W068166@repo.freebsd.org> <20181121002254.efitgf45bzajh5sj@mutt-hbsd> In-Reply-To: <20181121002254.efitgf45bzajh5sj@mutt-hbsd> Reply-To: araujo@freebsd.org From: Marcelo Araujo Date: Wed, 21 Nov 2018 09:32:14 +0800 Message-ID: Subject: Re: svn commit: r340707 - head/usr.sbin/bhyve To: Shawn Webb Cc: Marcelo Araujo , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org X-Rspamd-Queue-Id: AF8A28EAEB X-Spamd-Result: default: False [-3.63 / 15.00]; ARC_NA(0.00)[]; HAS_REPLYTO(0.00)[araujo@freebsd.org]; R_DKIM_ALLOW(-0.20)[gmail.com]; NEURAL_HAM_MEDIUM(-1.00)[-0.995,0]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; FREEMAIL_FROM(0.00)[gmail.com]; R_SPF_ALLOW(-0.20)[+ip6:2a00:1450:4000::/36]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; REPLYTO_DOM_NEQ_FROM_DOM(0.00)[]; NEURAL_HAM_LONG(-0.99)[-0.993,0]; URI_COUNT_ODD(1.00)[7]; RCPT_COUNT_FIVE(0.00)[5]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; MX_GOOD(-0.01)[cached: alt3.gmail-smtp-in.l.google.com]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; RCVD_IN_DNSWL_NONE(0.00)[0.3.2.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.5.4.1.0.0.a.2.list.dnswl.org : 127.0.5.0]; IP_SCORE(-0.65)[ipnet: 2a00:1450::/32(-1.58), asn: 15169(-1.58), country: US(-0.09)]; NEURAL_HAM_SHORT(-0.98)[-0.978,0]; FROM_EQ_ENVFROM(0.00)[]; RCVD_TLS_LAST(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US]; RCVD_COUNT_TWO(0.00)[2] X-Rspamd-Server: mx1.freebsd.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Nov 2018 01:32:29 -0000 Em qua, 21 de nov de 2018 =C3=A0s 08:23, Shawn Webb escreveu: > On Tue, Nov 20, 2018 at 10:21:19PM +0000, Marcelo Araujo wrote: > > Author: araujo > > Date: Tue Nov 20 22:21:19 2018 > > New Revision: 340707 > > URL: https://svnweb.freebsd.org/changeset/base/340707 > > > > Log: > > Define AHCI_PORT_IDENT and increase by 1 the VTBLK_BLK_ID_BYTES > > to avoid buffer accessed out of bounds, also switch to snprintf(3). > > > > PR: 200859 > > Submitted by: Caglar > > Obtained from: https://github.com/mist64/xhyve/pull/24 > > MFC after: 4 weeks > > Sponsored by: iXsystems Inc. > > > > Modified: > > head/usr.sbin/bhyve/pci_ahci.c > > head/usr.sbin/bhyve/pci_virtio_block.c > > > > Modified: head/usr.sbin/bhyve/pci_ahci.c > > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > > --- head/usr.sbin/bhyve/pci_ahci.c Tue Nov 20 22:12:10 2018 > (r340706) > > +++ head/usr.sbin/bhyve/pci_ahci.c Tue Nov 20 22:21:19 2018 > (r340707) > > @@ -105,7 +105,7 @@ enum sata_fis_type { > > * ATA commands > > */ > > #define ATA_SF_ENAB_SATA_SF 0x10 > > -#define ATA_SATA_SF_AN 0x05 > > +#define ATA_SATA_SF_AN 0x05 > > #define ATA_SF_DIS_SATA_SF 0x90 > > > > /* > > @@ -119,6 +119,8 @@ static FILE *dbg; > > #endif > > #define WPRINTF(format, arg...) printf(format, ##arg) > > > > +#define AHCI_PORT_IDENT 20 + 1 > > + > > struct ahci_ioreq { > > struct blockif_req io_req; > > struct ahci_port *io_pr; > > @@ -136,7 +138,7 @@ struct ahci_port { > > struct pci_ahci_softc *pr_sc; > > uint8_t *cmd_lst; > > uint8_t *rfis; > > - char ident[20 + 1]; > > + char ident[AHCI_PORT_IDENT]; > > int port; > > int atapi; > > int reset; > > @@ -2374,7 +2376,8 @@ pci_ahci_init(struct vmctx *ctx, struct > pci_devinst *p > > MD5Init(&mdctx); > > MD5Update(&mdctx, opts, strlen(opts)); > > MD5Final(digest, &mdctx); > > - sprintf(sc->port[p].ident, > "BHYVE-%02X%02X-%02X%02X-%02X%02X", > > + snprintf(sc->port[p].ident, AHCI_PORT_IDENT, > > + "BHYVE-%02X%02X-%02X%02X-%02X%02X", > > digest[0], digest[1], digest[2], digest[3], digest[4]= , > > digest[5]); > > > > > > Modified: head/usr.sbin/bhyve/pci_virtio_block.c > > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > > --- head/usr.sbin/bhyve/pci_virtio_block.c Tue Nov 20 22:12:10 2018 > (r340706) > > +++ head/usr.sbin/bhyve/pci_virtio_block.c Tue Nov 20 22:21:19 2018 > (r340707) > > @@ -61,7 +61,7 @@ __FBSDID("$FreeBSD$"); > > #define VTBLK_S_IOERR 1 > > #define VTBLK_S_UNSUPP 2 > > > > -#define VTBLK_BLK_ID_BYTES 20 > > +#define VTBLK_BLK_ID_BYTES 20 + 1 > > > > /* Capability bits */ > > #define VTBLK_F_SEG_MAX (1 << 2) /* Maximum reques= t > segments */ > > @@ -344,7 +344,8 @@ pci_vtblk_init(struct vmctx *ctx, struct pci_devins= t > * > > MD5Init(&mdctx); > > MD5Update(&mdctx, opts, strlen(opts)); > > MD5Final(digest, &mdctx); > > - sprintf(sc->vbsc_ident, "BHYVE-%02X%02X-%02X%02X-%02X%02X", > > + snprintf(sc->vbsc_ident, VTBLK_BLK_ID_BYTES, > > + "BHYVE-%02X%02X-%02X%02X-%02X%02X", > > digest[0], digest[1], digest[2], digest[3], digest[4], > digest[5]); > > > > /* setup virtio block config space */ > > Hey Marcelo, > > Thanks for committing this. Could VTBLK_BLK_ID_BYTES and > AHCI_PORT_IDENT be merged into the same macro, defined in > usr.sbin/bhyve/pci_emul.h? Especially since both equate to the same > value. > The macro could be merged, but it is safer to have it in this way, in case something changes specifically for one of the drivers. I don't think pci_emul.h would be the right place for that, this file is in charge of PCI emulation functions and it is pretty much generic among the other drivers. Best. > > Thanks, > > -- > Shawn Webb > Cofounder and Security Engineer > HardenedBSD > > Tor-ified Signal: +1 443-546-8752 > Tor+XMPP+OTR: lattera@is.a.hacker.sx > GPG Key ID: 0x6A84658F52456EEE > GPG Key Fingerprint: 2ABA B6BD EF6A F486 BE89 3D9E 6A84 658F 5245 6EEE > --=20 --=20 Marcelo Araujo (__)araujo@FreeBSD.org \\\'',)http://www.FreeBSD.org \/ \ ^ Power To Server. .\. /_) From owner-svn-src-all@freebsd.org Wed Nov 21 02:20:27 2018 Return-Path: Delivered-To: svn-src-all@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 8A765114655F for ; Wed, 21 Nov 2018 02:20:27 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: from mail-wm1-x32b.google.com (mail-wm1-x32b.google.com [IPv6:2a00:1450:4864:20::32b]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 949F48FD49 for ; Wed, 21 Nov 2018 02:20:26 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: by mail-wm1-x32b.google.com with SMTP id r63-v6so3962069wma.4 for ; Tue, 20 Nov 2018 18:20:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hardenedbsd.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=19QkhDYDGJ4nqMZ9CrYjqKCJJmb/l6762AFXa3fJH9E=; b=ISt0CFTj8WTBFP9+QW4R/iUkbXtOpVcY2WVJETHLre7FS7Khf1HtJxpimPVyFJ+YvU FCvNlcgY6ZGVod/X1Odapc/Ki+XVO229Ypzsw8NbMs6og6ehfdd2z7xO6LvNhSy2xD0I V8jozqovSLdpAUiK16m7gtGfS/ds3HkdENzEL1s+r3YBY4n9I5SbWvoN5TG+LWynKrZt XWntnq/M1KAyvk+N89ApcFaUhTZIyZrAyHwysnNT4UkNmLCmWsJmzJaZtT0zrld9ZkpT yOp5CiPrEnlATSTKbmt1EeCxBxvhmYsB9QtJ5E8xMkTqh2ActSPsiRg36/RPKJDYk1IK rJYw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=19QkhDYDGJ4nqMZ9CrYjqKCJJmb/l6762AFXa3fJH9E=; b=JENF2apWJEIfc87u0aqCEgFSm9x7tzsjk4RZ0yrqy+yAhmnJClwo9Cz3Jalah+Ejwx QE3s6/4i76KwpnrLheBJ4wEU9PCVq+1aw2LbOyKiI8BhYmPDsXS1bNOPnBubb03to5qk 40xbJDOaNRbpS5/8qyi45I/n13JbCFhgUscIZAmiYuTA35vKiPe/S9fU4qoNUXB5Jecf a1zDE7/XG+Bk/XHpbcCmViJoKCCBTmG0C1yeKQP4zcvA6phH5AdQCsEjHLs/vkPAMG8O yoeticx0LQMVzsGv7/7ImlA26wqkHT5qjwzXKULaJzu5xvXhdJ9+cS4CtSTnnxBLSjOc VQ1A== X-Gm-Message-State: AGRZ1gKmqNMHWZ+e8T0LNu9YA9U8FDdcftF1VOliopmX2oT+fAV+4j8a s+BNah+biIPTNcsdEU+xzAa3A0TKmzeQ+w== X-Google-Smtp-Source: AJdET5fYNDOANIhUOXMKs6EgA7Dk+OBwDBcqRhdvpI91DFD3jEu3HiE83Kp/O8pkFiBdrlsz+ysOTQ== X-Received: by 2002:a1c:248b:: with SMTP id k133-v6mr3872465wmk.148.1542766825084; Tue, 20 Nov 2018 18:20:25 -0800 (PST) Received: from mutt-hbsd ([185.24.218.172]) by smtp.gmail.com with ESMTPSA id q20-v6sm25263237wmc.33.2018.11.20.18.20.22 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 20 Nov 2018 18:20:24 -0800 (PST) Date: Tue, 20 Nov 2018 21:19:49 -0500 From: Shawn Webb To: Konstantin Belousov Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r339898 - head/lib/libc/amd64/sys Message-ID: <20181121021949.vk7u5mji375fsy7h@mutt-hbsd> References: <201810300011.w9U0BUui038857@repo.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="v5kqyhyamip2vsp4" Content-Disposition: inline In-Reply-To: <201810300011.w9U0BUui038857@repo.freebsd.org> X-Operating-System: FreeBSD mutt-hbsd 13.0-CURRENT FreeBSD 13.0-CURRENT HARDENEDBSD-13-CURRENT amd64 X-PGP-Key: http://pgp.mit.edu/pks/lookup?op=vindex&search=0x6A84658F52456EEE User-Agent: NeoMutt/20180622 X-Rspamd-Queue-Id: 949F48FD49 X-Spamd-Result: default: False [-4.04 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(0.00)[+ip6:2a00:1450:4000::/36]; RCVD_COUNT_THREE(0.00)[3]; DKIM_TRACE(0.00)[hardenedbsd.org:+]; MX_GOOD(-0.01)[cached: alt1.aspmx.l.google.com]; NEURAL_HAM_SHORT(-0.97)[-0.971,0]; SIGNED_PGP(-2.00)[]; FROM_EQ_ENVFROM(0.00)[]; RCVD_TLS_LAST(0.00)[]; IP_SCORE(-2.46)[ip: (-9.03), ipnet: 2a00:1450::/32(-1.58), asn: 15169(-1.58), country: US(-0.09)]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; R_DKIM_ALLOW(0.00)[hardenedbsd.org]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; RECEIVED_SPAMHAUS_XBL(3.00)[172.218.24.185.zen.spamhaus.org : 127.0.0.4]; MIME_GOOD(-0.20)[multipart/signed,text/plain]; PREVIOUSLY_DELIVERED(0.00)[svn-src-all@freebsd.org]; DMARC_NA(0.00)[hardenedbsd.org]; BAD_REP_POLICIES(0.10)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[b.2.3.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.5.4.1.0.0.a.2.list.dnswl.org : 127.0.5.0]; MID_RHS_NOT_FQDN(0.50)[] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Nov 2018 02:20:27 -0000 --v5kqyhyamip2vsp4 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Oct 30, 2018 at 12:11:30AM +0000, Konstantin Belousov wrote: > Author: kib > Date: Tue Oct 30 00:11:30 2018 > New Revision: 339898 > URL: https://svnweb.freebsd.org/changeset/base/339898 >=20 > Log: > Convert amd64_get/set_fs/gsbase to ifunc. > =20 > Note that this is the first use of ifuncs in our userspace. Hey Kostik, It appears this commit broke building/linking libc with LTO. I'm running into this assertion from clang/lld 7.0.0 (from the projects/clang700-import feature branch): https://github.com/HardenedBSD/hardenedBSD-playground/blob/hardened/current= /cross-dso-cfi/contrib/llvm/include/llvm/Support/Casting.h#L255 I'm likely going to file a bug report upstream in llvm. I'm wondering if lld doesn't support mixing ifuncs and LTO. Thanks, --=20 Shawn Webb Cofounder and Security Engineer HardenedBSD Tor-ified Signal: +1 443-546-8752 Tor+XMPP+OTR: lattera@is.a.hacker.sx GPG Key ID: 0x6A84658F52456EEE GPG Key Fingerprint: 2ABA B6BD EF6A F486 BE89 3D9E 6A84 658F 5245 6EEE --v5kqyhyamip2vsp4 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEKrq2ve9q9Ia+iT2eaoRlj1JFbu4FAlv0wL8ACgkQaoRlj1JF bu5AqBAAtZ0R+MwC6p5ufuDk+gUGjYxTQkHqnf4wTWZ4Vu+AfxOqNe5MS+mNbMhQ xJqJ4TM8+lKXwx85WcS1+l4tlGUxDGiNPRDZKEl6QHJDElgBeFUR0YUZuzsePitD dkUeb4GOVp7cn6TYiwn4rduvWBzis+IBDHOe2M+TcIlE//Jy+B+3N9PbUh/pASp3 KiTjnvH5fpXsJ+QYGug2L1Cw45gONpmWvZutEYpPWD5bp/GwLaKSDnJvnsbBs8HA djcQuKiVVSLSeg6q0tNBUrR4hHGG9GQ0cs/T/F7tNBqjIprF0U+8lLCsmvEHuD7C Af4RPX2tS5WZ7pYr0DcDkBRRINsNY6k3O8uWz/vpal2NufkqHKvwfuggj/PVEysz WQ77LS8p1dEt8qVhD0ek1joD28e0fvuUvEhWjOxZxj0VN9I3cTHPfsuitli8oxMY sL6e5BvgWRnW5VWortLC8jLTuRLORydEiwtzaZj9IdEEgjQAy7ANthfAk+HQe9/A ACAgtiObkFXbLcoz+E+YxfWa66tZxVNfLnwWyFov5DLyz71uNdzVPUhZTVdzmYjw OJnHyLBUtfjF6fcELHjr5IgUi8H6WfN9rBxc6SHxt1+6rWv8zPrL03HpBKgC3NaZ J3if1t4Pn6hpDlC1FjrkPLqu2z5zbJnZfUCHNHz5Nf9tVF8efK0= =njfv -----END PGP SIGNATURE----- --v5kqyhyamip2vsp4-- From owner-svn-src-all@freebsd.org Wed Nov 21 03:05:57 2018 Return-Path: Delivered-To: svn-src-all@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 626BD11007D5; Wed, 21 Nov 2018 03:05:57 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BA3F06B0FD; Wed, 21 Nov 2018 03:05:56 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id wAL35s3D069880; Tue, 20 Nov 2018 19:05:54 -0800 (PST) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id wAL35sEJ069879; Tue, 20 Nov 2018 19:05:54 -0800 (PST) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201811210305.wAL35sEJ069879@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r340695 - in stable/12/sys: amd64/conf i386/conf In-Reply-To: To: Niclas Zeising Date: Tue, 20 Nov 2018 19:05:54 -0800 (PST) CC: rgrimes@freebsd.org, src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Rspamd-Queue-Id: BA3F06B0FD X-Spamd-Result: default: False [1.28 / 15.00]; ARC_NA(0.00)[]; HAS_REPLYTO(0.00)[rgrimes@freebsd.org]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[dnsmgr.net]; REPLYTO_DOM_NEQ_FROM_DOM(0.00)[]; AUTH_NA(1.00)[]; RCPT_COUNT_FIVE(0.00)[6]; RCVD_COUNT_THREE(0.00)[3]; IP_SCORE(-0.02)[country: US(-0.09)]; MX_GOOD(-0.01)[cached: pdx.rh.CN85.dnsmgr.net]; NEURAL_SPAM_LONG(0.54)[0.536,0]; NEURAL_HAM_SHORT(-0.64)[-0.644,0]; NEURAL_SPAM_MEDIUM(0.52)[0.515,0]; R_SPF_NA(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:13868, ipnet:69.59.192.0/19, country:US]; MID_RHS_MATCH_FROM(0.00)[] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Nov 2018 03:05:57 -0000 > On 11/20/18 9:07 PM, Rodney W. Grimes wrote: > >> Author: zeising (doc,ports committer) > >> Date: Tue Nov 20 19:37:09 2018 > >> New Revision: 340695 > >> URL: https://svnweb.freebsd.org/changeset/base/340695 > >> > >> Log: > >> MFC r340387: Add evdev support to amd64 and i386 > >> > >> This merge is done sans sys/i386/conf/MINIMAL, since that doesn't exist in > >> stable/12, only current. > > > > Could you do me a favor and track down why MINIMAL has > > not be mfc'ed? And if there is not a good reason for > > it to not be MFC'ed see that it does get done. > > > > I asked about it cem (the original author of i386/conf/MINIMAL) about it > here: > https://lists.freebsd.org/pipermail/svn-src-all/2018-November/172337.html > The reply is here: > https://lists.freebsd.org/pipermail/svn-src-all/2018-November/172353.html Thanks. I'll find another way to deal with this. -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Wed Nov 21 03:22:38 2018 Return-Path: Delivered-To: svn-src-all@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 0A3C9110214D; Wed, 21 Nov 2018 03:22:38 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B0C3A6BE2C; Wed, 21 Nov 2018 03:22:37 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 91AF81AA20; Wed, 21 Nov 2018 03:22:37 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAL3MbKg026627; Wed, 21 Nov 2018 03:22:37 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAL3Mbor026624; Wed, 21 Nov 2018 03:22:37 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201811210322.wAL3Mbor026624@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Wed, 21 Nov 2018 03:22:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r340719 - in releng/12.0: lib/libpmc lib/libpmc/pmu-events lib/libpmc/pmu-events/arch/x86/amdfam17h sys/dev/hwpmc X-SVN-Group: releng X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: in releng/12.0: lib/libpmc lib/libpmc/pmu-events lib/libpmc/pmu-events/arch/x86/amdfam17h sys/dev/hwpmc X-SVN-Commit-Revision: 340719 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B0C3A6BE2C X-Spamd-Result: default: False [0.57 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.36)[0.362,0]; NEURAL_SPAM_MEDIUM(0.19)[0.194,0]; NEURAL_SPAM_LONG(0.01)[0.012,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Nov 2018 03:22:38 -0000 Author: mjg Date: Wed Nov 21 03:22:37 2018 New Revision: 340719 URL: https://svnweb.freebsd.org/changeset/base/340719 Log: MFC r340108 and r340149 hwpmc: limit wait for user callchain collection to 1 tick Add aditional counter descriptions to AMD 0x17 Approved by: re (rgrimes) Added: releng/12.0/lib/libpmc/pmu-events/arch/x86/amdfam17h/data-fabric.json - copied unchanged from r340718, stable/12/lib/libpmc/pmu-events/arch/x86/amdfam17h/data-fabric.json releng/12.0/lib/libpmc/pmu-events/arch/x86/amdfam17h/l3cache.json - copied unchanged from r340718, stable/12/lib/libpmc/pmu-events/arch/x86/amdfam17h/l3cache.json Modified: releng/12.0/lib/libpmc/libpmc_pmu_util.c releng/12.0/lib/libpmc/pmu-events/jevents.c releng/12.0/sys/dev/hwpmc/hwpmc_amd.c releng/12.0/sys/dev/hwpmc/hwpmc_amd.h releng/12.0/sys/dev/hwpmc/hwpmc_mod.c Directory Properties: releng/12.0/ (props changed) Modified: releng/12.0/lib/libpmc/libpmc_pmu_util.c ============================================================================== --- releng/12.0/lib/libpmc/libpmc_pmu_util.c Wed Nov 21 01:24:27 2018 (r340718) +++ releng/12.0/lib/libpmc/libpmc_pmu_util.c Wed Nov 21 03:22:37 2018 (r340719) @@ -146,6 +146,8 @@ pmu_alias_get(const char *name) struct pmu_event_desc { uint64_t ped_period; uint64_t ped_offcore_rsp; + uint64_t ped_l3_thread; + uint64_t ped_l3_slice; uint32_t ped_event; uint32_t ped_frontend; uint32_t ped_ldlat; @@ -270,6 +272,10 @@ pmu_parse_event(struct pmu_event_desc *ped, const char ped->ped_ch_mask = strtol(value, NULL, 16); else if (strcmp(key, "config1") == 0) ped->ped_config1 = strtol(value, NULL, 16); + else if (strcmp(key, "l3_thread_mask") == 0) + ped->ped_l3_thread = strtol(value, NULL, 16); + else if (strcmp(key, "l3_slice_mask") == 0) + ped->ped_l3_slice = strtol(value, NULL, 16); else { debug = getenv("PMUDEBUG"); if (debug != NULL && strcmp(debug, "true") == 0 && value != NULL) @@ -407,33 +413,50 @@ pmc_pmu_print_counter_full(const char *ev) } static int -pmc_pmu_amd_pmcallocate(const char *event_name __unused, struct pmc_op_pmcallocate *pm, +pmc_pmu_amd_pmcallocate(const char *event_name, struct pmc_op_pmcallocate *pm, struct pmu_event_desc *ped) { struct pmc_md_amd_op_pmcallocate *amd; + const struct pmu_event *pe; + int idx = -1; amd = &pm->pm_md.pm_amd; - amd->pm_amd_config = AMD_PMC_TO_EVENTMASK(ped->ped_event); if (ped->ped_umask > 0) { pm->pm_caps |= PMC_CAP_QUALIFIER; amd->pm_amd_config |= AMD_PMC_TO_UNITMASK(ped->ped_umask); } pm->pm_class = PMC_CLASS_K8; + pe = pmu_event_get(NULL, event_name, &idx); - if ((pm->pm_caps & (PMC_CAP_USER|PMC_CAP_SYSTEM)) == 0 || - (pm->pm_caps & (PMC_CAP_USER|PMC_CAP_SYSTEM)) == - (PMC_CAP_USER|PMC_CAP_SYSTEM)) - amd->pm_amd_config |= (AMD_PMC_USR | AMD_PMC_OS); - else if (pm->pm_caps & PMC_CAP_USER) - amd->pm_amd_config |= AMD_PMC_USR; - else if (pm->pm_caps & PMC_CAP_SYSTEM) - amd->pm_amd_config |= AMD_PMC_OS; - if (ped->ped_edge) - amd->pm_amd_config |= AMD_PMC_EDGE; - if (ped->ped_inv) - amd->pm_amd_config |= AMD_PMC_EDGE; - if (pm->pm_caps & PMC_CAP_INTERRUPT) - amd->pm_amd_config |= AMD_PMC_INT; + if (strcmp("l3cache", pe->topic) == 0){ + amd->pm_amd_config |= AMD_PMC_TO_EVENTMASK(ped->ped_event); + amd->pm_amd_sub_class = PMC_AMD_SUB_CLASS_L3_CACHE; + amd->pm_amd_config |= AMD_PMC_TO_L3SLICE(ped->ped_l3_slice); + amd->pm_amd_config |= AMD_PMC_TO_L3CORE(ped->ped_l3_thread); + } + else if (strcmp("data fabric", pe->topic) == 0){ + + amd->pm_amd_config |= AMD_PMC_TO_EVENTMASK_DF(ped->ped_event); + amd->pm_amd_sub_class = PMC_AMD_SUB_CLASS_DATA_FABRIC; + } + else{ + amd->pm_amd_config |= AMD_PMC_TO_EVENTMASK(ped->ped_event); + amd->pm_amd_sub_class = PMC_AMD_SUB_CLASS_CORE; + if ((pm->pm_caps & (PMC_CAP_USER|PMC_CAP_SYSTEM)) == 0 || + (pm->pm_caps & (PMC_CAP_USER|PMC_CAP_SYSTEM)) == + (PMC_CAP_USER|PMC_CAP_SYSTEM)) + amd->pm_amd_config |= (AMD_PMC_USR | AMD_PMC_OS); + else if (pm->pm_caps & PMC_CAP_USER) + amd->pm_amd_config |= AMD_PMC_USR; + else if (pm->pm_caps & PMC_CAP_SYSTEM) + amd->pm_amd_config |= AMD_PMC_OS; + if (ped->ped_edge) + amd->pm_amd_config |= AMD_PMC_EDGE; + if (ped->ped_inv) + amd->pm_amd_config |= AMD_PMC_EDGE; + if (pm->pm_caps & PMC_CAP_INTERRUPT) + amd->pm_amd_config |= AMD_PMC_INT; + } return (0); } Copied: releng/12.0/lib/libpmc/pmu-events/arch/x86/amdfam17h/data-fabric.json (from r340718, stable/12/lib/libpmc/pmu-events/arch/x86/amdfam17h/data-fabric.json) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ releng/12.0/lib/libpmc/pmu-events/arch/x86/amdfam17h/data-fabric.json Wed Nov 21 03:22:37 2018 (r340719, copy of r340718, stable/12/lib/libpmc/pmu-events/arch/x86/amdfam17h/data-fabric.json) @@ -0,0 +1,2668 @@ +[ + { + "EventName": "df_ccm_reqa.Node0.anydram", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Any DRAM transaction", + "UMask": "0x0F" + }, + { + "EventName": "df_ccm_reqa.Node1.anydram", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Any DRAM transaction", + "UMask": "0x2F" + }, + { + "EventName": "df_ccm_reqa.Node2.anydram", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Any DRAM transaction", + "UMask": "0x4F" + }, + { + "EventName": "df_ccm_reqa.Node3.anydram", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Any DRAM transaction", + "UMask": "0x6F" + }, + { + "EventName": "df_ccm_reqa.Node4.anydram", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Any DRAM transaction", + "UMask": "0x8F" + }, + { + "EventName": "df_ccm_reqa.Node5.anydram", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Any DRAM transaction", + "UMask": "0xAF" + }, + { + "EventName": "df_ccm_reqa.Node6.anydram", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Any DRAM transaction", + "UMask": "0xCF" + }, + { + "EventName": "df_ccm_reqa.Node7.anydram", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Any DRAM transaction", + "UMask": "0xEF" + }, + { + "EventName": "df_ccm_reqa.Node0.wrsizedfullzero", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered WrSizedFullZero", + "UMask": "0x0E" + }, + { + "EventName": "df_ccm_reqa.Node1.wrsizedfullzero", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered WrSizedFullZero", + "UMask": "0x2E" + }, + { + "EventName": "df_ccm_reqa.Node2.wrsizedfullzero", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered WrSizedFullZero", + "UMask": "0x4E" + }, + { + "EventName": "df_ccm_reqa.Node3.wrsizedfullzero", + "EventCode": "0x8E", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered WrSizedFullZero", + "UMask": "0x6E" + }, + { + "EventName": "df_ccm_reqa.Node4.wrsizedfullzero", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered WrSizedFullZero", + "UMask": "0x8E" + }, + { + "EventName": "df_ccm_reqa.Node5.wrsizedfullzero", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered WrSizedFullZero", + "UMask": "0xAE" + }, + { + "EventName": "df_ccm_reqa.Node6.wrsizedfullzero", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered WrSizedFullZero", + "UMask": "0xCE" + }, + { + "EventName": "df_ccm_reqa.Node7.wrsizedfullzero", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered WrSizedFullZero", + "UMask": "0xEE" + }, + { + "EventName": "df_ccm_reqa.Node0.wrsizedfullnc", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered wrsizedfullnc", + "UMask": "0x0D" + }, + { + "EventName": "df_ccm_reqa.Node1.wrsizedfullnc", + "EventCode": "0x8A", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered wrsizedfullnc", + "UMask": "0x2D" + }, + { + "EventName": "df_ccm_reqa.Node2.wrsizedfullnc", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered wrsizedfullnc", + "UMask": "0x4D" + }, + { + "EventName": "df_ccm_reqa.Node3.wrsizedfullnc", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered wrsizedfullnc", + "UMask": "0x6D" + }, + { + "EventName": "df_ccm_reqa.Node4.wrsizedfullnc", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered wrsizedfullnc", + "UMask": "0x8D" + }, + { + "EventName": "df_ccm_reqa.Node5.wrsizedfullnc", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered wrsizedfullnc", + "UMask": "0xAD" + }, + { + "EventName": "df_ccm_reqa.Node6.wrsizedfullnc", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered wrsizedfullnc", + "UMask": "0xCD" + }, + { + "EventName": "df_ccm_reqa.Node7.wrsizedfullnc", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered wrsizedfullnc", + "UMask": "0xED" + }, + { + "EventName": "df_ccm_reqa.Node0.wrsized", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered wrsized", + "UMask": "0x0C" + }, + { + "EventName": "df_ccm_reqa.Node1.wrsized", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered wrsized", + "UMask": "0x2C" + }, + { + "EventName": "df_ccm_reqa.Node2.wrsized", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered wrsized", + "UMask": "0x4C" + }, + { + "EventName": "df_ccm_reqa.Node3.wrsized", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered wrsized", + "UMask": "0x6C" + }, + { + "EventName": "df_ccm_reqa.Node4.wrsized", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered wrsized", + "UMask": "0x8C" + }, + { + "EventName": "df_ccm_reqa.Node5.wrsized", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered wrsized", + "UMask": "0xAC" + }, + { + "EventName": "df_ccm_reqa.Node6.wrsized", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered wrsized", + "UMask": "0xCC" + }, + { + "EventName": "df_ccm_reqa.Node7.wrsized", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered wrsized", + "UMask": "0xEC" + }, + { + "EventName": "df_ccm_reqa.Node0.wrsizedfullzero", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered wrsizedfullzero", + "UMask": "0x0B" + }, + { + "EventName": "df_ccm_reqa.Node1.wrsizedfullzero", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered wrsizedfullzero", + "UMask": "0x2B" + }, + { + "EventName": "df_ccm_reqa.Node2.wrsizedfullzero", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered wrsizedfullzero", + "UMask": "0x4B" + }, + { + "EventName": "df_ccm_reqa.Node3.wrsizedfullzero", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered wrsizedfullzero", + "UMask": "0x6B" + }, + { + "EventName": "df_ccm_reqa.Node4.wrsizedfullzero", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered wrsizedfullzero", + "UMask": "0x8B" + }, + { + "EventName": "df_ccm_reqa.Node5.wrsizedfullzero", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered wrsizedfullzero", + "UMask": "0xAB" + }, + { + "EventName": "df_ccm_reqa.Node6.wrsizedfullzero", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered wrsizedfullzero", + "UMask": "0xCB" + }, + { + "EventName": "df_ccm_reqa.Node7.wrsizedfullzero", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered wrsizedfullzero", + "UMask": "0xEB" + }, + { + "EventName": "df_ccm_reqa.Node0.wrsizedfullnc", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered wrsizedfullnc", + "UMask": "0x0A" + }, + { + "EventName": "df_ccm_reqa.Node1.wrsizedfullnc", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered wrsizedfullnc", + "UMask": "0x2A" + }, + { + "EventName": "df_ccm_reqa.Node2.wrsizedfullnc", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered wrsizedfullnc", + "UMask": "0x4A" + }, + { + "EventName": "df_ccm_reqa.Node3.wrsizedfullnc", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered wrsizedfullnc", + "UMask": "0x6A" + }, + { + "EventName": "df_ccm_reqa.Node4.wrsizedfullnc", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered wrsizedfullnc", + "UMask": "0x8A" + }, + { + "EventName": "df_ccm_reqa.Node5.wrsizedfullnc", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered wrsizedfullnc", + "UMask": "0xAA" + }, + { + "EventName": "df_ccm_reqa.Node6.wrsizedfullnc", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered wrsizedfullnc", + "UMask": "0xCA" + }, + { + "EventName": "df_ccm_reqa.Node7.wrsizedfullnc", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered wrsizedfullnc", + "UMask": "0xEA" + }, + { + "EventName": "df_ccm_reqa.Node0.wrsized", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered wrsized", + "UMask": "0x09" + }, + { + "EventName": "df_ccm_reqa.Node1.wrsized", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered wrsized", + "UMask": "0x29" + }, + { + "EventName": "df_ccm_reqa.Node2.wrsized", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered wrsized", + "UMask": "0x49" + }, + { + "EventName": "df_ccm_reqa.Node3.wrsized", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered wrsized", + "UMask": "0x69" + }, + { + "EventName": "df_ccm_reqa.Node4.wrsized", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered wrsized", + "UMask": "0x89" + }, + { + "EventName": "df_ccm_reqa.Node5.wrsized", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered wrsized", + "UMask": "0xA9" + }, + { + "EventName": "df_ccm_reqa.Node6.wrsized", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered wrsized", + "UMask": "0xC9" + }, + { + "EventName": "df_ccm_reqa.Node7.wrsized", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered wrsized", + "UMask": "0xE9" + }, + { + "EventName": "df_ccm_reqa.Node0.rdsizednc", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered rdsizednc", + "UMask": "0x08" + }, + { + "EventName": "df_ccm_reqa.Node1.rdsizednc", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered rdsizednc", + "UMask": "0x28" + }, + { + "EventName": "df_ccm_reqa.Node2.rdsizednc", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered rdsizednc", + "UMask": "0x48" + }, + { + "EventName": "df_ccm_reqa.Node3.rdsizednc", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered rdsizednc", + "UMask": "0x68" + }, + { + "EventName": "df_ccm_reqa.Node4.rdsizednc", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered rdsizednc", + "UMask": "0x88" + }, + { + "EventName": "df_ccm_reqa.Node5.rdsizednc", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered rdsizednc", + "UMask": "0xA8" + }, + { + "EventName": "df_ccm_reqa.Node6.rdsizednc", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered rdsizednc", + "UMask": "0xC8" + }, + { + "EventName": "df_ccm_reqa.Node7.rdsizednc", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered rdsizednc", + "UMask": "0xE8" + }, + { + "EventName": "df_ccm_reqa.Node0.rdsized", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered rdsized", + "UMask": "0x07" + }, + { + "EventName": "df_ccm_reqa.Node1.rdsized", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered rdsized", + "UMask": "0x27" + }, + { + "EventName": "df_ccm_reqa.Node2.rdsized", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered rdsized", + "UMask": "0x47" + }, + { + "EventName": "df_ccm_reqa.Node3.rdsized", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered rdsized", + "UMask": "0x67" + }, + { + "EventName": "df_ccm_reqa.Node4.rdsized", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered rdsized", + "UMask": "0x87" + }, + { + "EventName": "df_ccm_reqa.Node5.rdsized", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered rdsized", + "UMask": "0xA7" + }, + { + "EventName": "df_ccm_reqa.Node6.rdsized", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered rdsized", + "UMask": "0xC7" + }, + { + "EventName": "df_ccm_reqa.Node7.rdsized", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered rdsized", + "UMask": "0xE7" + }, + { + "EventName": "df_ccm_reqa.Node0.specdramrd", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered specdramrd", + "UMask": "0x06" + }, + { + "EventName": "df_ccm_reqa.Node1.specdramrd", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered specdramrd", + "UMask": "0x26" + }, + { + "EventName": "df_ccm_reqa.Node2.specdramrd", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered specdramrd", + "UMask": "0x46" + }, + { + "EventName": "df_ccm_reqa.Node3.specdramrd", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered specdramrd", + "UMask": "0x66" + }, + { + "EventName": "df_ccm_reqa.Node4.specdramrd", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered specdramrd", + "UMask": "0x86" + }, + { + "EventName": "df_ccm_reqa.Node5.specdramrd", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered specdramrd", + "UMask": "0xA6" + }, + { + "EventName": "df_ccm_reqa.Node6.specdramrd", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered specdramrd", + "UMask": "0xC6" + }, + { + "EventName": "df_ccm_reqa.Node7.specdramrd", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered specdramrd", + "UMask": "0xE6" + }, + { + "EventName": "df_ccm_reqa.Node0.anyrdblk", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered anyrdblk", + "UMask": "0x05" + }, + { + "EventName": "df_ccm_reqa.Node1.anyrdblk", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered anyrdblk", + "UMask": "0x25" + }, + { + "EventName": "df_ccm_reqa.Node2.anyrdblk", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered anyrdblk", + "UMask": "0x45" + }, + { + "EventName": "df_ccm_reqa.Node3.anyrdblk", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered anyrdblk", + "UMask": "0x65" + }, + { + "EventName": "df_ccm_reqa.Node4.anyrdblk", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered anyrdblk", + "UMask": "0x85" + }, + { + "EventName": "df_ccm_reqa.Node5.anyrdblk", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered anyrdblk", + "UMask": "0xA5" + }, + { + "EventName": "df_ccm_reqa.Node6.anyrdblk", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered anyrdblk", + "UMask": "0xC5" + }, + { + "EventName": "df_ccm_reqa.Node7.anyrdblk", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered anyrdblk", + "UMask": "0xE5" + }, + { + "EventName": "df_ccm_reqa.Node0.rdvlkc", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered rdvlkc", + "UMask": "0x04" + }, + { + "EventName": "df_ccm_reqa.Node1.rdvlkc", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered rdvlkc", + "UMask": "0x24" + }, + { + "EventName": "df_ccm_reqa.Node2.rdvlkc", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered rdvlkc", + "UMask": "0x44" + }, + { + "EventName": "df_ccm_reqa.Node3.rdvlkc", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered rdvlkc", + "UMask": "0x64" + }, + { + "EventName": "df_ccm_reqa.Node4.rdvlkc", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered rdvlkc", + "UMask": "0x84" + }, + { + "EventName": "df_ccm_reqa.Node5.rdvlkc", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered rdvlkc", + "UMask": "0xA4" + }, + { + "EventName": "df_ccm_reqa.Node6.rdvlkc", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered rdvlkc", + "UMask": "0xC4" + }, + { + "EventName": "df_ccm_reqa.Node7.rdvlkc", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered rdvlkc", + "UMask": "0xE4" + }, + { + "EventName": "df_ccm_reqa.Node0.rdvlkx", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered rdvlkx", + "UMask": "0x03" + }, + { + "EventName": "df_ccm_reqa.Node1.rdvlkx", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered rdvlkx", + "UMask": "0x23" + }, + { + "EventName": "df_ccm_reqa.Node2.rdvlkx", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered rdvlkx", + "UMask": "0x43" + }, + { + "EventName": "df_ccm_reqa.Node3.rdvlkx", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered rdvlkx", + "UMask": "0x63" + }, + { + "EventName": "df_ccm_reqa.Node4.rdvlkx", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered rdvlkx", + "UMask": "0x83" + }, + { + "EventName": "df_ccm_reqa.Node5.rdvlkx", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered rdvlkx", + "UMask": "0xA3" + }, + { + "EventName": "df_ccm_reqa.Node6.rdvlkx", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered rdvlkx", + "UMask": "0xC3" + }, + { + "EventName": "df_ccm_reqa.Node7.rdvlkx", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered rdvlkx", + "UMask": "0xE3" + }, + { + "EventName": "df_ccm_reqa.Node0.rdvlks", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered rdvlks", + "UMask": "0x02" + }, + { + "EventName": "df_ccm_reqa.Node1.rdvlks", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered rdvlks", + "UMask": "0x22" + }, + { + "EventName": "df_ccm_reqa.Node2.rdvlks", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered rdvlks", + "UMask": "0x42" + }, + { + "EventName": "df_ccm_reqa.Node3.rdvlks", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered rdvlks", + "UMask": "0x62" + }, + { + "EventName": "df_ccm_reqa.Node4.rdvlks", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered rdvlks", + "UMask": "0x82" + }, + { + "EventName": "df_ccm_reqa.Node5.rdvlks", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered rdvlks", + "UMask": "0xA2" + }, + { + "EventName": "df_ccm_reqa.Node6.rdvlks", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered rdvlks", + "UMask": "0xC2" + }, + { + "EventName": "df_ccm_reqa.Node7.rdvlks", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered rdvlks", + "UMask": "0xE2" + }, + { + "EventName": "df_ccm_reqa.Node0.rdvlkl", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered rdvlkl", + "UMask": "0x01" + }, + { + "EventName": "df_ccm_reqa.Node1.rdvlkl", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered rdvlkl", + "UMask": "0x21" + }, + { + "EventName": "df_ccm_reqa.Node2.rdvlkl", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered rdvlkl", + "UMask": "0x41" + }, + { + "EventName": "df_ccm_reqa.Node3.rdvlkl", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered rdvlkl", + "UMask": "0x61" + }, + { + "EventName": "df_ccm_reqa.Node4.rdvlkl", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered rdvlkl", + "UMask": "0x81" + }, + { + "EventName": "df_ccm_reqa.Node5.rdvlkl", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered rdvlkl", + "UMask": "0xA1" + }, + { + "EventName": "df_ccm_reqa.Node6.rdvlkl", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered rdvlkl", + "UMask": "0xC1" + }, + { + "EventName": "df_ccm_reqa.Node7.rdvlkl", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered rdvlkl", + "UMask": "0xE1" + }, + { + "EventName": "df_ccm_reqb.Node0.chgtox", + "EventCode": "0x8c", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered chgtox", + "UMask": "0x0E" + }, + { + "EventName": "df_ccm_reqb.Node1.chgtox", + "EventCode": "0x8c", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered chgtox", + "UMask": "0x2E" + }, + { + "EventName": "df_ccm_reqb.Node2.chgtox", + "EventCode": "0x8c", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered chgtox", + "UMask": "0x4E" + }, + { + "EventName": "df_ccm_reqb.Node3.chgtox", + "EventCode": "0x8E", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered chgtox", + "UMask": "0x6E" + }, + { + "EventName": "df_ccm_reqb.Node4.chgtox", + "EventCode": "0x8c", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered chgtox", + "UMask": "0x8E" + }, + { + "EventName": "df_ccm_reqb.Node5.chgtox", + "EventCode": "0x8c", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered chgtox", + "UMask": "0xAE" + }, + { + "EventName": "df_ccm_reqb.Node6.chgtox", + "EventCode": "0x8c", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered chgtox", + "UMask": "0xCE" + }, + { + "EventName": "df_ccm_reqb.Node7.chgtox", + "EventCode": "0x8c", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered chgtox", + "UMask": "0xEE" + }, + { + "EventName": "df_ccm_reqb.Node0.vicblkfull.", + "EventCode": "0x8c", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered vicblkfull.", + "UMask": "0x0D" + }, + { + "EventName": "df_ccm_reqb.Node1.vicblkfull.", + "EventCode": "0x8A", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered vicblkfull.", + "UMask": "0x2D" + }, + { + "EventName": "df_ccm_reqb.Node2.vicblkfull.", + "EventCode": "0x8c", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered vicblkfull.", + "UMask": "0x4D" + }, + { + "EventName": "df_ccm_reqb.Node3.vicblkfull.", + "EventCode": "0x8c", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered vicblkfull.", + "UMask": "0x6D" + }, + { + "EventName": "df_ccm_reqb.Node4.vicblkfull.", + "EventCode": "0x8c", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered vicblkfull.", + "UMask": "0x8D" + }, + { + "EventName": "df_ccm_reqb.Node5.vicblkfull.", + "EventCode": "0x8c", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered vicblkfull.", + "UMask": "0xAD" + }, + { + "EventName": "df_ccm_reqb.Node6.vicblkfull.", + "EventCode": "0x8c", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered vicblkfull.", + "UMask": "0xCD" + }, + { + "EventName": "df_ccm_reqb.Node7.vicblkfull.", + "EventCode": "0x8c", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered vicblkfull.", + "UMask": "0xED" + }, + { + "EventName": "df_ccm_reqb.Node0.wbinvblkall", + "EventCode": "0x8c", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered wbinvblkall", + "UMask": "0x0C" + }, + { + "EventName": "df_ccm_reqb.Node1.wbinvblkall", + "EventCode": "0x8c", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered wbinvblkall", + "UMask": "0x2C" + }, + { + "EventName": "df_ccm_reqb.Node2.wbinvblkall", + "EventCode": "0x8c", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered wbinvblkall", + "UMask": "0x4C" + }, + { + "EventName": "df_ccm_reqb.Node3.wbinvblkall", + "EventCode": "0x8c", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered wbinvblkall", + "UMask": "0x6C" + }, + { + "EventName": "df_ccm_reqb.Node4.wbinvblkall", + "EventCode": "0x8c", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered wbinvblkall", + "UMask": "0x8C" + }, + { + "EventName": "df_ccm_reqb.Node5.wbinvblkall", + "EventCode": "0x8c", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered wbinvblkall", + "UMask": "0xAC" + }, + { + "EventName": "df_ccm_reqb.Node6.wbinvblkall", + "EventCode": "0x8c", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered wbinvblkall", + "UMask": "0xCC" + }, + { + "EventName": "df_ccm_reqb.Node7.wbinvblkall", + "EventCode": "0x8c", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered wbinvblkall", + "UMask": "0xEC" + }, + { + "EventName": "df_ccm_reqb.Node0.vicblkfullzero", + "EventCode": "0x8c", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered vicblkfullzero", + "UMask": "0x0B" + }, + { + "EventName": "df_ccm_reqb.Node1.vicblkfullzero", + "EventCode": "0x8c", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered vicblkfullzero", + "UMask": "0x2B" + }, + { + "EventName": "df_ccm_reqb.Node2.vicblkfullzero", + "EventCode": "0x8c", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered vicblkfullzero", + "UMask": "0x4B" + }, + { + "EventName": "df_ccm_reqb.Node3.vicblkfullzero", + "EventCode": "0x8c", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered vicblkfullzero", + "UMask": "0x6B" + }, + { + "EventName": "df_ccm_reqb.Node4.vicblkfullzero", + "EventCode": "0x8c", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered vicblkfullzero", + "UMask": "0x8B" + }, + { + "EventName": "df_ccm_reqb.Node5.vicblkfullzero", + "EventCode": "0x8c", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered vicblkfullzero", + "UMask": "0xAB" + }, + { + "EventName": "df_ccm_reqb.Node6.vicblkfullzero", + "EventCode": "0x8c", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered vicblkfullzero", + "UMask": "0xCB" + }, + { *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Wed Nov 21 03:23:14 2018 Return-Path: Delivered-To: svn-src-all@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 882C911021D4 for ; Wed, 21 Nov 2018 03:23:14 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-io1-xd31.google.com (mail-io1-xd31.google.com [IPv6:2607:f8b0:4864:20::d31]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0135A6BF67 for ; Wed, 21 Nov 2018 03:23:12 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-io1-xd31.google.com with SMTP id j18-v6so3027079iog.6 for ; Tue, 20 Nov 2018 19:23:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=6nTXJAOvBxbkmR5CQZRCwJez7XYEdLWdmC0o23ZM4r8=; b=lcC+siOih5fdLvF3FtEcFRr2uc/fTyukh9beboe9Cl0gu0anuzrQzLUDsLbKatOFaI 0S1OOBTpBV1XfG0E5SVWjn7ReZ3nxq48xMOfwk6W4YzfeHmygqVjUdvzxEzHqcNWYJKC qPczu8bAtvLsxOeFUdc1tIfAhqzfpIWlmXTMHXvnLMkYRhJvd28c6hNmpk41QGG3vFjZ HZY4qBcqs5AQY6V9RvdLkTocOVlwz4eFFV+uamUvkoH1HfdJxYr4GeMjEP8GQVVvqVui tx9Wr48D1IRSdsvOCfTVKNREU0P/DWb/8XqIkYI5/pVmYpjgNeYCVPVvUMTBSIKH23Eq HElA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=6nTXJAOvBxbkmR5CQZRCwJez7XYEdLWdmC0o23ZM4r8=; b=tXW/zb7preliLUarj0rj7B8M68m/Fdv63mbomcuKr5rx30xIqtQnN97Xrz6dayU/j7 l+Yj3h6sVuAXyBeKF0Dlw9NRS5U3n/lqbKKiqgE8xTJrDsNBmghsHzNY6j9Fafzjy0PZ AV11Xqs27o6o73VFzxDE05tHZe5pwvgQtPLgvJzVHs8KTux6x0x1oUNuEVYCNM/SVoaj nlcWixblx2m6Z79zhmEeVe+H1dT9GE3YTQARDgFhN/StF9yCa3OEaew67SSmmynhS46d otFeGaiCGZwrw6oU0VDbctmwA06eyECHckR3n3h96ocCmKD+fcVJWcMACqoSkwnMzHtE nZnQ== X-Gm-Message-State: AA+aEWYiD1mG7FuO8Q/49tRHnpS4EzPl9P7oFzXhkRO5GskKrw1xlthf wMUPG7Px4rILgf2EviAZQjFdquwGRzmRzoIm2xq+wA== X-Google-Smtp-Source: AFSGD/XH2bnYL7d7to+sPxfx5M70Qy7njz3VOOaYYTh3iTGVlPg3BvG1qe5aDn2e2qoCMjsLUhrAglXDobLYvriQfr8= X-Received: by 2002:a5d:870c:: with SMTP id u12mr3134493iom.168.1542770592243; Tue, 20 Nov 2018 19:23:12 -0800 (PST) MIME-Version: 1.0 References: <201811210305.wAL35sEJ069879@pdx.rh.CN85.dnsmgr.net> In-Reply-To: <201811210305.wAL35sEJ069879@pdx.rh.CN85.dnsmgr.net> From: Warner Losh Date: Tue, 20 Nov 2018 20:23:00 -0700 Message-ID: Subject: Re: svn commit: r340695 - in stable/12/sys: amd64/conf i386/conf To: "Rodney W. Grimes" Cc: Niclas Zeising , src-committers , svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org X-Rspamd-Queue-Id: 0135A6BF67 X-Spamd-Result: default: False [-3.67 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.98)[-0.983,0]; R_DKIM_ALLOW(-0.20)[bsdimp-com.20150623.gappssmtp.com]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; NEURAL_HAM_LONG(-0.98)[-0.983,0]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[svn-src-all@freebsd.org]; DMARC_NA(0.00)[bsdimp.com]; RCPT_COUNT_FIVE(0.00)[6]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[bsdimp-com.20150623.gappssmtp.com:+]; MX_GOOD(-0.01)[ALT1.aspmx.l.google.com,aspmx.l.google.com,ALT2.aspmx.l.google.com]; RCVD_IN_DNSWL_NONE(0.00)[1.3.d.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.0]; NEURAL_HAM_SHORT(-0.88)[-0.882,0]; R_SPF_NA(0.00)[]; FORGED_SENDER(0.30)[imp@bsdimp.com,wlosh@bsdimp.com]; RCVD_TLS_LAST(0.00)[]; IP_SCORE(-0.81)[ipnet: 2607:f8b0::/32(-2.38), asn: 15169(-1.59), country: US(-0.09)]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; FROM_NEQ_ENVFROM(0.00)[imp@bsdimp.com,wlosh@bsdimp.com]; RCVD_COUNT_TWO(0.00)[2] X-Rspamd-Server: mx1.freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Nov 2018 03:23:14 -0000 On Tue, Nov 20, 2018, 8:06 PM Rodney W. Grimes < freebsd@pdx.rh.cn85.dnsmgr.net wrote: > > On 11/20/18 9:07 PM, Rodney W. Grimes wrote: > > >> Author: zeising (doc,ports committer) > > >> Date: Tue Nov 20 19:37:09 2018 > > >> New Revision: 340695 > > >> URL: https://svnweb.freebsd.org/changeset/base/340695 > > >> > > >> Log: > > >> MFC r340387: Add evdev support to amd64 and i386 > > >> > > >> This merge is done sans sys/i386/conf/MINIMAL, since that doesn't > exist in > > >> stable/12, only current. > > > > > > Could you do me a favor and track down why MINIMAL has > > > not be mfc'ed? And if there is not a good reason for > > > it to not be MFC'ed see that it does get done. > > > > > > > I asked about it cem (the original author of i386/conf/MINIMAL) about it > > here: > > > https://lists.freebsd.org/pipermail/svn-src-all/2018-November/172337.html > > The reply is here: > > > https://lists.freebsd.org/pipermail/svn-src-all/2018-November/172353.html > > Thanks. I'll find another way to deal I was thinking of implementing the GENERIC is MINIMAL plus stuff, and that would be a good time to fix this.. Warner > From owner-svn-src-all@freebsd.org Wed Nov 21 03:32:17 2018 Return-Path: Delivered-To: svn-src-all@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 74D1A1102794; Wed, 21 Nov 2018 03:32:17 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B34BD6C58D; Wed, 21 Nov 2018 03:32:16 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id wAL3WEKm069991; Tue, 20 Nov 2018 19:32:14 -0800 (PST) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id wAL3WEjV069990; Tue, 20 Nov 2018 19:32:14 -0800 (PST) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201811210332.wAL3WEjV069990@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r340695 - in stable/12/sys: amd64/conf i386/conf In-Reply-To: To: Warner Losh Date: Tue, 20 Nov 2018 19:32:14 -0800 (PST) CC: "Rodney W. Grimes" , Niclas Zeising , src-committers , svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Rspamd-Queue-Id: B34BD6C58D X-Spamd-Result: default: False [1.12 / 15.00]; ARC_NA(0.00)[]; HAS_REPLYTO(0.00)[rgrimes@freebsd.org]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[dnsmgr.net]; REPLYTO_DOM_NEQ_FROM_DOM(0.00)[]; AUTH_NA(1.00)[]; NEURAL_SPAM_MEDIUM(0.40)[0.403,0]; RCVD_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; MX_GOOD(-0.01)[cached: pdx.rh.CN85.dnsmgr.net]; NEURAL_SPAM_LONG(0.45)[0.451,0]; RCPT_COUNT_SEVEN(0.00)[7]; NEURAL_HAM_SHORT(-0.60)[-0.603,0]; R_SPF_NA(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:13868, ipnet:69.59.192.0/19, country:US]; MID_RHS_MATCH_FROM(0.00)[]; IP_SCORE(-0.02)[country: US(-0.09)] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Nov 2018 03:32:17 -0000 > On Tue, Nov 20, 2018, 8:06 PM Rodney W. Grimes < > freebsd@pdx.rh.cn85.dnsmgr.net wrote: > > > > On 11/20/18 9:07 PM, Rodney W. Grimes wrote: > > > >> Author: zeising (doc,ports committer) > > > >> Date: Tue Nov 20 19:37:09 2018 > > > >> New Revision: 340695 > > > >> URL: https://svnweb.freebsd.org/changeset/base/340695 > > > >> > > > >> Log: > > > >> MFC r340387: Add evdev support to amd64 and i386 > > > >> > > > >> This merge is done sans sys/i386/conf/MINIMAL, since that doesn't > > exist in > > > >> stable/12, only current. > > > > > > > > Could you do me a favor and track down why MINIMAL has > > > > not be mfc'ed? And if there is not a good reason for > > > > it to not be MFC'ed see that it does get done. > > > > > > > > > > I asked about it cem (the original author of i386/conf/MINIMAL) about it > > > here: > > > > > https://lists.freebsd.org/pipermail/svn-src-all/2018-November/172337.html > > > The reply is here: > > > > > https://lists.freebsd.org/pipermail/svn-src-all/2018-November/172353.html > > > > Thanks. I'll find another way to deal > > > I was thinking of implementing the GENERIC is MINIMAL plus stuff, and that > would be a good time to fix this.. If you can get this done before I get mentor approval to do the MFC adding it to stable/12 and stable/11 and fixing up the merged bits that got left out because it was not there then wonderful, if not I should have MINIMAL correctly merged and cleaned up by end of week. > > Warner -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Wed Nov 21 04:34:19 2018 Return-Path: Delivered-To: svn-src-all@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 5D7881103C4B; Wed, 21 Nov 2018 04:34:19 +0000 (UTC) (envelope-from bwidawsk@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 053F06DDA0; Wed, 21 Nov 2018 04:34:19 +0000 (UTC) (envelope-from bwidawsk@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DA9F21B5A4; Wed, 21 Nov 2018 04:34:18 +0000 (UTC) (envelope-from bwidawsk@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAL4YIsb062182; Wed, 21 Nov 2018 04:34:18 GMT (envelope-from bwidawsk@FreeBSD.org) Received: (from bwidawsk@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAL4YIfW062180; Wed, 21 Nov 2018 04:34:18 GMT (envelope-from bwidawsk@FreeBSD.org) Message-Id: <201811210434.wAL4YIfW062180@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bwidawsk set sender to bwidawsk@FreeBSD.org using -f From: Ben Widawsky Date: Wed, 21 Nov 2018 04:34:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340720 - in head/sys: compat/linuxkpi/common/include/linux vm X-SVN-Group: head X-SVN-Commit-Author: bwidawsk X-SVN-Commit-Paths: in head/sys: compat/linuxkpi/common/include/linux vm X-SVN-Commit-Revision: 340720 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 053F06DDA0 X-Spamd-Result: default: False [0.26 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_MEDIUM(0.13)[0.126,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.13)[0.132,0]; NEURAL_HAM_LONG(-0.00)[-0.003,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Nov 2018 04:34:19 -0000 Author: bwidawsk Date: Wed Nov 21 04:34:18 2018 New Revision: 340720 URL: https://svnweb.freebsd.org/changeset/base/340720 Log: linuxkpi: Use pageproc instead of vmproc According to markj@: pageproc contains the page daemon and laundry threads, which are responsible for managing the LRU page queues and writing back dirty pages. vmproc's main task is to swap out kernel stacks when the system is under memory pressure, and swap them back in when necessary. It's a somewhat legacy component of the system and isn't required. You can build a kernel without it by specifying "options NO_SWAPPING" (which is a somewhat misleading name), in which vm_swapout_dummy.c is compiled instead of vm_swapout.c. Based on this, we want pageproc to emulate kswapd, not vmproc. Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D18061 Modified: head/sys/compat/linuxkpi/common/include/linux/swap.h head/sys/vm/vm_pageout.h head/sys/vm/vm_swapout.c Modified: head/sys/compat/linuxkpi/common/include/linux/swap.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/swap.h Wed Nov 21 03:22:37 2018 (r340719) +++ head/sys/compat/linuxkpi/common/include/linux/swap.h Wed Nov 21 04:34:18 2018 (r340720) @@ -45,7 +45,8 @@ get_nr_swap_pages(void) static inline int current_is_kswapd(void) { - return vm_curproc_is_vmproc(); + + return (curproc == pageproc); } #endif Modified: head/sys/vm/vm_pageout.h ============================================================================== --- head/sys/vm/vm_pageout.h Wed Nov 21 03:22:37 2018 (r340719) +++ head/sys/vm/vm_pageout.h Wed Nov 21 04:34:18 2018 (r340720) @@ -107,7 +107,5 @@ void vm_pageout_oom(int shortage); void vm_swapout_run(void); void vm_swapout_run_idle(void); -bool vm_curproc_is_vmproc(void); - #endif /* _KERNEL */ #endif /* _VM_VM_PAGEOUT_H_ */ Modified: head/sys/vm/vm_swapout.c ============================================================================== --- head/sys/vm/vm_swapout.c Wed Nov 21 03:22:37 2018 (r340719) +++ head/sys/vm/vm_swapout.c Wed Nov 21 04:34:18 2018 (r340720) @@ -961,10 +961,3 @@ swapout(struct proc *p) p->p_swtick = ticks; return (0); } - -/* Used to determine if the current process is itself the reaper. */ -bool -vm_curproc_is_vmproc(void) -{ - return curproc == vmproc; -} From owner-svn-src-all@freebsd.org Wed Nov 21 06:07:28 2018 Return-Path: Delivered-To: svn-src-all@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 3944D1106E5F; Wed, 21 Nov 2018 06:07:28 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6297570ACF; Wed, 21 Nov 2018 06:07:27 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id wAL67GJB073613 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Wed, 21 Nov 2018 08:07:19 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua wAL67GJB073613 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id wAL67GkI073612; Wed, 21 Nov 2018 08:07:16 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Wed, 21 Nov 2018 08:07:16 +0200 From: Konstantin Belousov To: Mark Johnston , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r340709 - in head/sys: compat/linuxkpi/common/include/linux vm Message-ID: <20181121060716.GE2378@kib.kiev.ua> References: <201811202249.wAKMnJxH082469@repo.freebsd.org> <20181121003515.GE2630@raichu> <20181121004239.spk72g2pikvse4y7@smtp.freebsd.org> <20181121005148.GF2630@raichu> <20181121005832.ongabjesxlsd7cqu@smtp.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20181121005832.ongabjesxlsd7cqu@smtp.freebsd.org> User-Agent: Mutt/1.10.1 (2018-07-13) X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on tom.home X-Rspamd-Queue-Id: 6297570ACF X-Spamd-Result: default: False [-5.18 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; FREEMAIL_FROM(0.00)[gmail.com]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; HAS_XAW(0.00)[]; NEURAL_HAM_LONG(-1.00)[-0.998,0]; R_SPF_SOFTFAIL(0.00)[~all]; RCVD_COUNT_THREE(0.00)[3]; TO_DN_SOME(0.00)[]; MX_GOOD(-0.01)[cached: alt3.gmail-smtp-in.l.google.com]; NEURAL_HAM_SHORT(-0.97)[-0.974,0]; IP_SCORE(-2.20)[ip: (-2.84), ipnet: 2001:470::/32(-4.55), asn: 6939(-3.53), country: US(-0.09)]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:6939, ipnet:2001:470::/32, country:US]; RCVD_TLS_LAST(0.00)[]; DMARC_POLICY_SOFTFAIL(0.10)[gmail.com : No valid SPF, No valid DKIM,none] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Nov 2018 06:07:28 -0000 On Tue, Nov 20, 2018 at 04:58:32PM -0800, Ben Widawsky wrote: > On 18-11-20 19:51:48, Mark Johnston wrote: > > On Tue, Nov 20, 2018 at 04:42:39PM -0800, Ben Widawsky wrote: > > > On 18-11-20 19:35:15, Mark Johnston wrote: > > > > On Tue, Nov 20, 2018 at 10:49:19PM +0000, Ben Widawsky wrote: > > > > > Author: bwidawsk > > > > > Date: Tue Nov 20 22:49:19 2018 > > > > > New Revision: 340709 > > > > > URL: https://svnweb.freebsd.org/changeset/base/340709 > > > > > > > > > > Log: > > > > > linuxkpi: Add some basic swap functions > > > > > > > > > > These are used by kms-drm to determine various heuristics relate > > > > > memory conditions. > > > > > > > > > > The number of free swap pages is just a variable, and it can be > > > > > much cheaper by either adding a new getter, or simply extern'ing > > > > > swap_total. However, this patch opts to use the more expensive, > > > > > existing interface - since this isn't an operation in a high per > > > > > path. > > > > > > > > > > This allows us to remove some more gpl linuxkpi and do the follo > > > > > kms-drm: > > > > > git rm linuxkpi/gplv2/include/linux/swap.h > > > > > > > > > > Reviewed by: mmacy, Johannes Lundberg > > > > > Approved by: emaste (mentor) > > > > > Differential Revision: https://reviews.freebsd.org/D18052 > > > > > > > > > > Added: > > > > > head/sys/compat/linuxkpi/common/include/linux/swap.h (contents, props changed) > > > > > Modified: > > > > > head/sys/vm/vm_pageout.h > > > > > head/sys/vm/vm_swapout.c > > > > > > > > > > [...] > > > > > Modified: head/sys/vm/vm_swapout.c > > > > > ============================================================================== > > > > > --- head/sys/vm/vm_swapout.c Tue Nov 20 22:24:18 2018 (r340708) > > > > > +++ head/sys/vm/vm_swapout.c Tue Nov 20 22:49:19 2018 (r340709) > > > > > @@ -961,3 +961,10 @@ swapout(struct proc *p) > > > > > p->p_swtick = ticks; > > > > > return (0); > > > > > } > > > > > + > > > > > +/* Used to determine if the current process is itself the reaper. */ > > > > > +bool > > > > > +vm_curproc_is_vmproc(void) > > > > > +{ > > > > > + return curproc == vmproc; > > > > > +} > > > > > > > > From a look at how this is used, it should probably be pageproc rather > > > > than vmproc. There are various code paths that just check > > > > curproc == pageproc inline. > > > > > > > > > > Could I trouble you for a quick explanation of the difference between the two? > > > > pageproc contains the page daemon and laundry threads, which are > > responsible for managing the LRU page queues and writing back dirty > > pages. vmproc's main task is to swap out kernel stacks when the system > > is under memory pressure, and swap them back in when necessary. It's a > > somewhat legacy component of the system and isn't required. You can > > build a kernel without it by specifying "options NO_SWAPPING" (which is > > a somewhat misleading name), in which vm_swapout_dummy.c is compiled > > instead of vm_swapout.c. > > > > Thanks for the explanation. I indeed want the page daemon. I will put up a patch > to do that the correct way. Thanks. What is the intent ? If the goal is to avoid wait for memory in deadlock- prone contexts, then you perhaps want to return true for both pagedaemon and vm daemon, and might be even the buf daemon threads as well. From owner-svn-src-all@freebsd.org Wed Nov 21 06:36:19 2018 Return-Path: Delivered-To: svn-src-all@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 0D01F1107B8F; Wed, 21 Nov 2018 06:36:19 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A5DBD71728; Wed, 21 Nov 2018 06:36:18 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 86F841C960; Wed, 21 Nov 2018 06:36:18 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAL6aISa023463; Wed, 21 Nov 2018 06:36:18 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAL6aGC4023449; Wed, 21 Nov 2018 06:36:16 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201811210636.wAL6aGC4023449@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 21 Nov 2018 06:36:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r340721 - in stable/12: lib/libc/sys share/man/man5 sys/cddl/contrib/opensolaris/uts/common/fs/zfs sys/fs/cd9660 sys/fs/devfs sys/fs/ext2fs sys/fs/fdescfs sys/fs/msdosfs sys/fs/nandfs s... X-SVN-Group: stable-12 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in stable/12: lib/libc/sys share/man/man5 sys/cddl/contrib/opensolaris/uts/common/fs/zfs sys/fs/cd9660 sys/fs/devfs sys/fs/ext2fs sys/fs/fdescfs sys/fs/msdosfs sys/fs/nandfs sys/fs/pseudofs sys/fs/udf... X-SVN-Commit-Revision: 340721 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A5DBD71728 X-Spamd-Result: default: False [0.45 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.01)[0.014,0]; NEURAL_SPAM_MEDIUM(0.31)[0.308,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.13)[0.129,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Nov 2018 06:36:19 -0000 Author: kib Date: Wed Nov 21 06:36:15 2018 New Revision: 340721 URL: https://svnweb.freebsd.org/changeset/base/340721 Log: MFC r340431: Add d_off support for multiple filesystems. Modified: stable/12/lib/libc/sys/getdirentries.2 stable/12/share/man/man5/dir.5 stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c stable/12/sys/fs/cd9660/cd9660_vnops.c stable/12/sys/fs/devfs/devfs_vnops.c stable/12/sys/fs/ext2fs/ext2_lookup.c stable/12/sys/fs/fdescfs/fdesc_vnops.c stable/12/sys/fs/msdosfs/msdosfs_vnops.c stable/12/sys/fs/nandfs/nandfs_vnops.c stable/12/sys/fs/pseudofs/pseudofs_vnops.c stable/12/sys/fs/udf/udf_vnops.c stable/12/sys/ufs/ufs/ufs_vnops.c Directory Properties: stable/12/ (props changed) Modified: stable/12/lib/libc/sys/getdirentries.2 ============================================================================== --- stable/12/lib/libc/sys/getdirentries.2 Wed Nov 21 04:34:18 2018 (r340720) +++ stable/12/lib/libc/sys/getdirentries.2 Wed Nov 21 06:36:15 2018 (r340721) @@ -28,7 +28,7 @@ .\" @(#)getdirentries.2 8.2 (Berkeley) 5/3/95 .\" $FreeBSD$ .\" -.Dd May 28, 2017 +.Dd Nov 14, 2018 .Dt GETDIRENTRIES 2 .Os .Sh NAME @@ -88,6 +88,11 @@ Files that are linked by hard links (see have the same .Fa d_fileno . The +.Fa d_off +field returns a cookie which can be used with +.Xr lseek 2 +to position the directory descriptor to the next entry. +The .Fa d_reclen entry is the length, in bytes, of the directory record. The @@ -140,8 +145,17 @@ a value returned in the location pointed to by .Fa basep .Po Fn getdirentries only -.Pc +.Pc , +a value returned in the +.Fa d_off +field, or zero. +.Sh IMPLEMENTATION NOTES +The +.Fa d_off +field is being used as a cookie to readdir for nfs servers. +These cookies can be cached and allow to read directory entries at a specific +offset on demand. .Sh RETURN VALUES If successful, the number of bytes actually transferred is returned. Otherwise, -1 is returned and the global variable Modified: stable/12/share/man/man5/dir.5 ============================================================================== --- stable/12/share/man/man5/dir.5 Wed Nov 21 04:34:18 2018 (r340720) +++ stable/12/share/man/man5/dir.5 Wed Nov 21 06:36:15 2018 (r340721) @@ -28,7 +28,7 @@ .\" @(#)dir.5 8.3 (Berkeley) 4/19/94 .\" $FreeBSD$ .\" -.Dd June 20, 2018 +.Dd November 14, 2018 .Dt DIR 5 .Os .Sh NAME @@ -101,7 +101,7 @@ The directory entry format is defined in the file struct dirent { ino_t d_fileno; /* file number of entry */ - off_t d_off; /* directory offset of entry */ + off_t d_off; /* directory offset of the next entry */ __uint16_t d_reclen; /* length of this record */ __uint8_t d_type; /* file type, see below */ __uint8_t d_namlen; /* length of string in d_name */ Modified: stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c ============================================================================== --- stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c Wed Nov 21 04:34:18 2018 (r340720) +++ stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c Wed Nov 21 06:36:15 2018 (r340721) @@ -1097,6 +1097,8 @@ zfsctl_snapdir_readdir(ap) strcpy(entry.d_name, snapname); entry.d_namlen = strlen(entry.d_name); entry.d_reclen = sizeof(entry); + /* NOTE: d_off is the offset for the *next* entry. */ + entry.d_off = cookie + dots_offset; error = vfs_read_dirent(ap, &entry, uio->uio_offset); if (error != 0) { if (error == ENAMETOOLONG) Modified: stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c ============================================================================== --- stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Wed Nov 21 04:34:18 2018 (r340720) +++ stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Wed Nov 21 06:36:15 2018 (r340721) @@ -2529,8 +2529,8 @@ zfs_readdir(vnode_t *vp, uio_t *uio, cred_t *cr, int * */ eodp->ed_ino = objnum; eodp->ed_reclen = reclen; - /* NOTE: ed_off is the offset for the *next* entry */ - next = &(eodp->ed_off); + /* NOTE: ed_off is the offset for the *next* entry. */ + next = &eodp->ed_off; eodp->ed_eflags = zap.za_normalization_conflict ? ED_CASE_CONFLICT : 0; (void) strncpy(eodp->ed_name, zap.za_name, @@ -2543,6 +2543,8 @@ zfs_readdir(vnode_t *vp, uio_t *uio, cred_t *cr, int * odp->d_ino = objnum; odp->d_reclen = reclen; odp->d_namlen = strlen(zap.za_name); + /* NOTE: d_off is the offset for the *next* entry. */ + next = &odp->d_off; (void) strlcpy(odp->d_name, zap.za_name, odp->d_namlen + 1); odp->d_type = type; odp = (dirent64_t *)((intptr_t)odp + reclen); @@ -2567,6 +2569,9 @@ zfs_readdir(vnode_t *vp, uio_t *uio, cred_t *cr, int * offset += 1; } + /* Fill the offset right after advancing the cursor. */ + if (next != NULL) + *next = offset; if (cooks != NULL) { *cooks++ = offset; ncooks--; Modified: stable/12/sys/fs/cd9660/cd9660_vnops.c ============================================================================== --- stable/12/sys/fs/cd9660/cd9660_vnops.c Wed Nov 21 04:34:18 2018 (r340720) +++ stable/12/sys/fs/cd9660/cd9660_vnops.c Wed Nov 21 06:36:15 2018 (r340721) @@ -576,6 +576,8 @@ cd9660_readdir(ap) entryoffsetinblock; idp->curroff += reclen; + /* NOTE: d_off is the offset of *next* entry. */ + idp->current.d_off = idp->curroff; switch (imp->iso_ftype) { case ISO_FTYPE_RRIP: Modified: stable/12/sys/fs/devfs/devfs_vnops.c ============================================================================== --- stable/12/sys/fs/devfs/devfs_vnops.c Wed Nov 21 04:34:18 2018 (r340720) +++ stable/12/sys/fs/devfs/devfs_vnops.c Wed Nov 21 06:36:15 2018 (r340721) @@ -1355,6 +1355,8 @@ devfs_readdir(struct vop_readdir_args *ap) if (dp->d_reclen > uio->uio_resid) break; dp->d_fileno = de->de_inode; + /* NOTE: d_off is the offset for the *next* entry. */ + dp->d_off = off + dp->d_reclen; if (off >= uio->uio_offset) { error = vfs_read_dirent(ap, dp, off); if (error) Modified: stable/12/sys/fs/ext2fs/ext2_lookup.c ============================================================================== --- stable/12/sys/fs/ext2fs/ext2_lookup.c Wed Nov 21 04:34:18 2018 (r340720) +++ stable/12/sys/fs/ext2fs/ext2_lookup.c Wed Nov 21 06:36:15 2018 (r340721) @@ -224,6 +224,8 @@ ext2_readdir(struct vop_readdir_args *ap) dstdp.d_reclen = GENERIC_DIRSIZ(&dstdp); bcopy(dp->e2d_name, dstdp.d_name, dstdp.d_namlen); dstdp.d_name[dstdp.d_namlen] = '\0'; + /* NOTE: d_off is the offset of the *next* entry. */ + dstdp.d_off = offset + dp->e2d_reclen; if (dstdp.d_reclen > uio->uio_resid) { if (uio->uio_resid == startresid) error = EINVAL; Modified: stable/12/sys/fs/fdescfs/fdesc_vnops.c ============================================================================== --- stable/12/sys/fs/fdescfs/fdesc_vnops.c Wed Nov 21 04:34:18 2018 (r340720) +++ stable/12/sys/fs/fdescfs/fdesc_vnops.c Wed Nov 21 06:36:15 2018 (r340721) @@ -574,6 +574,8 @@ fdesc_readdir(struct vop_readdir_args *ap) dp->d_fileno = i + FD_DESC; break; } + /* NOTE: d_off is the offset of the *next* entry. */ + dp->d_off = UIO_MX * (i + 1); if (dp->d_namlen != 0) { /* * And ship to userland Modified: stable/12/sys/fs/msdosfs/msdosfs_vnops.c ============================================================================== --- stable/12/sys/fs/msdosfs/msdosfs_vnops.c Wed Nov 21 04:34:18 2018 (r340720) +++ stable/12/sys/fs/msdosfs/msdosfs_vnops.c Wed Nov 21 06:36:15 2018 (r340721) @@ -1558,6 +1558,8 @@ msdosfs_readdir(struct vop_readdir_args *ap) break; } dirbuf.d_reclen = GENERIC_DIRSIZ(&dirbuf); + /* NOTE: d_off is the offset of the *next* entry. */ + dirbuf.d_off = offset + sizeof(struct direntry); if (uio->uio_resid < dirbuf.d_reclen) goto out; error = uiomove(&dirbuf, dirbuf.d_reclen, uio); @@ -1681,6 +1683,8 @@ msdosfs_readdir(struct vop_readdir_args *ap) mbnambuf_flush(&nb, &dirbuf); chksum = -1; dirbuf.d_reclen = GENERIC_DIRSIZ(&dirbuf); + /* NOTE: d_off is the offset of the *next* entry. */ + dirbuf.d_off = offset + sizeof(struct direntry); if (uio->uio_resid < dirbuf.d_reclen) { brelse(bp); goto out; Modified: stable/12/sys/fs/nandfs/nandfs_vnops.c ============================================================================== --- stable/12/sys/fs/nandfs/nandfs_vnops.c Wed Nov 21 04:34:18 2018 (r340720) +++ stable/12/sys/fs/nandfs/nandfs_vnops.c Wed Nov 21 06:36:15 2018 (r340721) @@ -1233,6 +1233,8 @@ nandfs_readdir(struct vop_readdir_args *ap) dirent.d_namlen = name_len; strncpy(dirent.d_name, ndirent->name, name_len); dirent.d_reclen = GENERIC_DIRSIZ(&dirent); + /* NOTE: d_off is the offset of the *next* entry. */ + dirent.d_off = diroffset + ndirent->rec_len; DPRINTF(READDIR, ("copying `%*.*s`\n", name_len, name_len, dirent.d_name)); } Modified: stable/12/sys/fs/pseudofs/pseudofs_vnops.c ============================================================================== --- stable/12/sys/fs/pseudofs/pseudofs_vnops.c Wed Nov 21 04:34:18 2018 (r340720) +++ stable/12/sys/fs/pseudofs/pseudofs_vnops.c Wed Nov 21 06:36:15 2018 (r340721) @@ -830,6 +830,8 @@ pfs_readdir(struct vop_readdir_args *va) pfsent->entry.d_name[i] = pn->pn_name[i]; pfsent->entry.d_name[i] = 0; pfsent->entry.d_namlen = i; + /* NOTE: d_off is the offset of the *next* entry. */ + pfsent->entry.d_off = offset + PFS_DELEN; switch (pn->pn_type) { case pfstype_procdir: KASSERT(p != NULL, Modified: stable/12/sys/fs/udf/udf_vnops.c ============================================================================== --- stable/12/sys/fs/udf/udf_vnops.c Wed Nov 21 04:34:18 2018 (r340720) +++ stable/12/sys/fs/udf/udf_vnops.c Wed Nov 21 06:36:15 2018 (r340721) @@ -846,6 +846,7 @@ udf_readdir(struct vop_readdir_args *a) dir.d_name[1] = '\0'; dir.d_namlen = 1; dir.d_reclen = GENERIC_DIRSIZ(&dir); + dir.d_off = 1; uiodir.dirent = &dir; error = udf_uiodir(&uiodir, dir.d_reclen, uio, 1); if (error) @@ -858,6 +859,7 @@ udf_readdir(struct vop_readdir_args *a) dir.d_name[2] = '\0'; dir.d_namlen = 2; dir.d_reclen = GENERIC_DIRSIZ(&dir); + dir.d_off = 2; uiodir.dirent = &dir; error = udf_uiodir(&uiodir, dir.d_reclen, uio, 2); } else { @@ -867,6 +869,7 @@ udf_readdir(struct vop_readdir_args *a) dir.d_type = (fid->file_char & UDF_FILE_CHAR_DIR) ? DT_DIR : DT_UNKNOWN; dir.d_reclen = GENERIC_DIRSIZ(&dir); + dir.d_off = ds->this_off; uiodir.dirent = &dir; error = udf_uiodir(&uiodir, dir.d_reclen, uio, ds->this_off); Modified: stable/12/sys/ufs/ufs/ufs_vnops.c ============================================================================== --- stable/12/sys/ufs/ufs/ufs_vnops.c Wed Nov 21 04:34:18 2018 (r340720) +++ stable/12/sys/ufs/ufs/ufs_vnops.c Wed Nov 21 06:36:15 2018 (r340721) @@ -2218,6 +2218,8 @@ ufs_readdir(ap) dstdp.d_reclen = GENERIC_DIRSIZ(&dstdp); bcopy(dp->d_name, dstdp.d_name, dstdp.d_namlen); dstdp.d_name[dstdp.d_namlen] = '\0'; + /* NOTE: d_off is the offset of the *next* entry. */ + dstdp.d_off = offset + dp->d_reclen; if (dstdp.d_reclen > uio->uio_resid) { if (uio->uio_resid == startresid) error = EINVAL; From owner-svn-src-all@freebsd.org Wed Nov 21 11:22:45 2018 Return-Path: Delivered-To: svn-src-all@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 3A12F1134C2F; Wed, 21 Nov 2018 11:22:45 +0000 (UTC) (envelope-from 0mp@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 CE9097B117; Wed, 21 Nov 2018 11:22:44 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AFACC1F9DA; Wed, 21 Nov 2018 11:22:44 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wALBMifI071059; Wed, 21 Nov 2018 11:22:44 GMT (envelope-from 0mp@FreeBSD.org) Received: (from 0mp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wALBMiCt071058; Wed, 21 Nov 2018 11:22:44 GMT (envelope-from 0mp@FreeBSD.org) Message-Id: <201811211122.wALBMiCt071058@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: 0mp set sender to 0mp@FreeBSD.org using -f From: Mateusz Piotrowski <0mp@FreeBSD.org> Date: Wed, 21 Nov 2018 11:22:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340722 - head/lib/libbe X-SVN-Group: head X-SVN-Commit-Author: 0mp X-SVN-Commit-Paths: head/lib/libbe X-SVN-Commit-Revision: 340722 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: CE9097B117 X-Spamd-Result: default: False [0.44 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_MEDIUM(0.23)[0.231,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.21)[0.214,0]; NEURAL_HAM_LONG(-0.00)[-0.003,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Nov 2018 11:22:45 -0000 Author: 0mp (ports committer) Date: Wed Nov 21 11:22:44 2018 New Revision: 340722 URL: https://svnweb.freebsd.org/changeset/base/340722 Log: libbe(3): Put each error value in separate line. As requested by a TODO in the source code. Reviewed by: bcr Approved by: krion (mentor, implicit), mat (mentor, implicit) Differential Revision: https://reviews.freebsd.org/D18063 Modified: head/lib/libbe/libbe.3 Modified: head/lib/libbe/libbe.3 ============================================================================== --- head/lib/libbe/libbe.3 Wed Nov 21 06:36:15 2018 (r340721) +++ head/lib/libbe/libbe.3 Wed Nov 21 11:22:44 2018 (r340722) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 17, 2018 +.Dd November 21, 2018 .Dt LIBBE 3 .Os .Sh NAME @@ -440,30 +440,49 @@ The .Fn be_prop_list_free function will free the property list. .Sh DIAGNOSTICS -Upon error, one of the following values will be returned. -.\" TODO: make each entry on its own line. -.Bd -ragged -offset indent -BE_ERR_SUCCESS, -BE_ERR_INVALIDNAME, -BE_ERR_EXISTS, -BE_ERR_NOENT, -BE_ERR_PERMS, -BE_ERR_DESTROYACT, -BE_ERR_DESTROYMNT, -BE_ERR_BADPATH, -BE_ERR_PATHBUSY, -BE_ERR_PATHLEN, -BE_ERR_BADMOUNT, -BE_ERR_NOORIGIN, -BE_ERR_MOUNTED, -BE_ERR_NOMOUNT, -BE_ERR_ZFSOPEN, -BE_ERR_ZFSCLONE, -BE_ERR_IO, -BE_ERR_NOPOOL, -BE_ERR_NOMEM, +Upon error, one of the following values will be returned: +.Bl -dash -offset indent -compact +.It +BE_ERR_SUCCESS +.It +BE_ERR_INVALIDNAME +.It +BE_ERR_EXISTS +.It +BE_ERR_NOENT +.It +BE_ERR_PERMS +.It +BE_ERR_DESTROYACT +.It +BE_ERR_DESTROYMNT +.It +BE_ERR_BADPATH +.It +BE_ERR_PATHBUSY +.It +BE_ERR_PATHLEN +.It +BE_ERR_BADMOUNT +.It +BE_ERR_NOORIGIN +.It +BE_ERR_MOUNTED +.It +BE_ERR_NOMOUNT +.It +BE_ERR_ZFSOPEN +.It +BE_ERR_ZFSCLONE +.It +BE_ERR_IO +.It +BE_ERR_NOPOOL +.It +BE_ERR_NOMEM +.It BE_ERR_UNKNOWN -.Ed +.El .Sh SEE ALSO .Xr be 1 .Sh HISTORY From owner-svn-src-all@freebsd.org Wed Nov 21 12:46:29 2018 Return-Path: Delivered-To: svn-src-all@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 C7DD61137D94; Wed, 21 Nov 2018 12:46:29 +0000 (UTC) (envelope-from 0mp@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 6543A7E195; Wed, 21 Nov 2018 12:46:29 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 440B02097E; Wed, 21 Nov 2018 12:46:29 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wALCkTf2016219; Wed, 21 Nov 2018 12:46:29 GMT (envelope-from 0mp@FreeBSD.org) Received: (from 0mp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wALCkSB6016217; Wed, 21 Nov 2018 12:46:28 GMT (envelope-from 0mp@FreeBSD.org) Message-Id: <201811211246.wALCkSB6016217@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: 0mp set sender to 0mp@FreeBSD.org using -f From: Mateusz Piotrowski <0mp@FreeBSD.org> Date: Wed, 21 Nov 2018 12:46:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340723 - in head: lib/libbe sbin/bectl X-SVN-Group: head X-SVN-Commit-Author: 0mp X-SVN-Commit-Paths: in head: lib/libbe sbin/bectl X-SVN-Commit-Revision: 340723 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 6543A7E195 X-Spamd-Result: default: False [0.83 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.60)[0.602,0]; NEURAL_HAM_LONG(-0.00)[-0.003,0]; NEURAL_SPAM_MEDIUM(0.23)[0.231,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Nov 2018 12:46:30 -0000 Author: 0mp (ports committer) Date: Wed Nov 21 12:46:28 2018 New Revision: 340723 URL: https://svnweb.freebsd.org/changeset/base/340723 Log: Cross-reference libbe(3) and bectl(8). Those two manual pages are already referencing each other in the HISTORY sections, which people might skip. Mention those manual pages explicitly in the SEE ALSO sections. Also, remove a reference to be(1) from libbe(3). Reviewed by: bcr Approved by: krion (mentor, implicit), mat (mentor, implicit) Differential Revision: https://reviews.freebsd.org/D18136 Modified: head/lib/libbe/libbe.3 head/sbin/bectl/bectl.8 Modified: head/lib/libbe/libbe.3 ============================================================================== --- head/lib/libbe/libbe.3 Wed Nov 21 11:22:44 2018 (r340722) +++ head/lib/libbe/libbe.3 Wed Nov 21 12:46:28 2018 (r340723) @@ -484,7 +484,7 @@ BE_ERR_NOMEM BE_ERR_UNKNOWN .El .Sh SEE ALSO -.Xr be 1 +.Xr bectl 8 .Sh HISTORY .Nm and its corresponding command, Modified: head/sbin/bectl/bectl.8 ============================================================================== --- head/sbin/bectl/bectl.8 Wed Nov 21 11:22:44 2018 (r340722) +++ head/sbin/bectl/bectl.8 Wed Nov 21 12:46:28 2018 (r340723) @@ -18,7 +18,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 24, 2018 +.Dd November 21, 2018 .Dt BECTL 8 .Os .Sh NAME @@ -263,6 +263,7 @@ will force the unmount if busy. To fill in with jail upgrade example when behavior is firm. .El .Sh SEE ALSO +.Xr libbe 3 , .Xr jail 8 , .Xr zfs 8 , .Xr zpool 8 From owner-svn-src-all@freebsd.org Wed Nov 21 13:34:22 2018 Return-Path: Delivered-To: svn-src-all@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 DD8AB1139378; Wed, 21 Nov 2018 13:34:22 +0000 (UTC) (envelope-from oleg@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 835C8803F3; Wed, 21 Nov 2018 13:34:22 +0000 (UTC) (envelope-from oleg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 65779211AF; Wed, 21 Nov 2018 13:34:22 +0000 (UTC) (envelope-from oleg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wALDYMN7041239; Wed, 21 Nov 2018 13:34:22 GMT (envelope-from oleg@FreeBSD.org) Received: (from oleg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wALDYMIB041238; Wed, 21 Nov 2018 13:34:22 GMT (envelope-from oleg@FreeBSD.org) Message-Id: <201811211334.wALDYMIB041238@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: oleg set sender to oleg@FreeBSD.org using -f From: Oleg Bulyzhin Date: Wed, 21 Nov 2018 13:34:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340724 - head/sys/net X-SVN-Group: head X-SVN-Commit-Author: oleg X-SVN-Commit-Paths: head/sys/net X-SVN-Commit-Revision: 340724 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 835C8803F3 X-Spamd-Result: default: False [0.25 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.02)[0.020,0]; NEURAL_HAM_LONG(-0.00)[-0.003,0]; NEURAL_SPAM_MEDIUM(0.23)[0.231,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Nov 2018 13:34:23 -0000 Author: oleg Date: Wed Nov 21 13:34:21 2018 New Revision: 340724 URL: https://svnweb.freebsd.org/changeset/base/340724 Log: Unbreak kernel build with VLAN_ARRAY defined. MFC after: 1 week Modified: head/sys/net/if_vlan.c Modified: head/sys/net/if_vlan.c ============================================================================== --- head/sys/net/if_vlan.c Wed Nov 21 12:46:28 2018 (r340723) +++ head/sys/net/if_vlan.c Wed Nov 21 13:34:21 2018 (r340724) @@ -314,15 +314,15 @@ VNET_DEFINE_STATIC(struct if_clone *, vlan_cloner); #define V_vlan_cloner VNET(vlan_cloner) #endif -#ifndef VLAN_ARRAY -#define HASH(n, m) ((((n) >> 8) ^ ((n) >> 4) ^ (n)) & (m)) - static void vlan_mc_free(struct epoch_context *ctx) { struct vlan_mc_entry *mc = __containerof(ctx, struct vlan_mc_entry, mc_epoch_ctx); free(mc, M_VLAN); } + +#ifndef VLAN_ARRAY +#define HASH(n, m) ((((n) >> 8) ^ ((n) >> 4) ^ (n)) & (m)) static void vlan_inithash(struct ifvlantrunk *trunk) From owner-svn-src-all@freebsd.org Wed Nov 21 14:50:47 2018 Return-Path: Delivered-To: svn-src-all@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 CA246113B2E7; Wed, 21 Nov 2018 14:50:47 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.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 6E31C8378F; Wed, 21 Nov 2018 14:50:47 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3805521D07; Wed, 21 Nov 2018 14:50:47 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wALEolAe077512; Wed, 21 Nov 2018 14:50:47 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wALEoj3K077506; Wed, 21 Nov 2018 14:50:45 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201811211450.wALEoj3K077506@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 21 Nov 2018 14:50:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340725 - head/tools/build/options X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/tools/build/options X-SVN-Commit-Revision: 340725 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 6E31C8378F X-Spamd-Result: default: False [0.38 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.00)[0.001,0]; NEURAL_SPAM_SHORT(0.13)[0.128,0]; NEURAL_SPAM_MEDIUM(0.25)[0.253,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Nov 2018 14:50:48 -0000 Author: emaste Date: Wed Nov 21 14:50:45 2018 New Revision: 340725 URL: https://svnweb.freebsd.org/changeset/base/340725 Log: Add some non-default src.conf(5) knob descriptions Some WITH_/WITHOUT_ defaults will likey change in the future (e.g. as we migrate to copyfree base system components). Add non-default descriptions for the benefit of WIP branches. Added: head/tools/build/options/WITHOUT_BSD_GREP (contents, props changed) head/tools/build/options/WITH_GCOV (contents, props changed) head/tools/build/options/WITH_GNU_DIFF (contents, props changed) head/tools/build/options/WITH_GNU_GREP (contents, props changed) head/tools/build/options/WITH_SENDMAIL (contents, props changed) head/tools/build/options/WITH_TCP_WRAPPERS (contents, props changed) Added: head/tools/build/options/WITHOUT_BSD_GREP ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/build/options/WITHOUT_BSD_GREP Wed Nov 21 14:50:45 2018 (r340725) @@ -0,0 +1,2 @@ +.\" $FreeBSD$ +Install GNU grep as '[ef]grep' instead of BSD grep. Added: head/tools/build/options/WITH_GCOV ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/build/options/WITH_GCOV Wed Nov 21 14:50:45 2018 (r340725) @@ -0,0 +1,4 @@ +.\" $FreeBSD$ +Build and install the GNU +.Xr gcov 1 +tool. Added: head/tools/build/options/WITH_GNU_DIFF ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/build/options/WITH_GNU_DIFF Wed Nov 21 14:50:45 2018 (r340725) @@ -0,0 +1,5 @@ +.\" $FreeBSD$ +Build and install GNU +.Xr diff 1 +and +.Xr diff3 1 . Added: head/tools/build/options/WITH_GNU_GREP ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/build/options/WITH_GNU_GREP Wed Nov 21 14:50:45 2018 (r340725) @@ -0,0 +1,3 @@ +.\" $FreeBSD$ +Build and install GNU +.Xr grep 1 . Added: head/tools/build/options/WITH_SENDMAIL ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/build/options/WITH_SENDMAIL Wed Nov 21 14:50:45 2018 (r340725) @@ -0,0 +1,4 @@ +.\" $FreeBSD$ +Build and install +.Xr sendmail 8 +and related programs. Added: head/tools/build/options/WITH_TCP_WRAPPERS ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/build/options/WITH_TCP_WRAPPERS Wed Nov 21 14:50:45 2018 (r340725) @@ -0,0 +1,4 @@ +.\" $FreeBSD$ +Build and install +.Xr tcpd 8 , +and related utilities. From owner-svn-src-all@freebsd.org Wed Nov 21 15:42:10 2018 Return-Path: Delivered-To: svn-src-all@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 33E85113C529; Wed, 21 Nov 2018 15:42:10 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: from mail-it1-f171.google.com (mail-it1-f171.google.com [209.85.166.171]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 97F1185119; Wed, 21 Nov 2018 15:42:09 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: by mail-it1-f171.google.com with SMTP id i7so9481388iti.2; Wed, 21 Nov 2018 07:42:09 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=J9SnJll+ySPs5ZZb20WOq5j5kusQhiPc19l0t3zOnjI=; b=iowzZZMDPM+9sZr+MIQCSjTyVQBhE+dL0BHnjzfw8XbEbBIff3E61EpTOIsNsgcYZ8 UiBMeAeLoX0PRM9oD/Ftsf3AFffy8Z30uhSPgXy8YJ1shzkw27xkfaY5fB2SSj+5jLQm sKk77SHViWMmd2CnoX01pkYCDiERcpoy5EA5YQWelPHzoSDo63QklkAIruNicgLPdLK6 UMVRK/8eo/fvKxnl2DMd9yJemds7oNEkR5MLr1TF72EE5wmbJ3EqV9nvnEyiAJAI+77D A8U07eNvR+KYObr1OJYobzip7usKYbAikix/negAPJT9/3pQnqodIN9CUNgoNq0t11vR 2RDA== X-Gm-Message-State: AGRZ1gJ8f6rBXHDoxK/rfYOTJ3nvFfwr8cm02tvdBHCCaGEH83vC7YcQ xe8MEeJqTwJZ9DfwzffosecefOGDnpwn8DbjFHk= X-Google-Smtp-Source: AJdET5eVMcfzpJqlGXs51ALrD4h8NtaalKsUyHB9s91A7GGH2XLdwjrHa/BqGYEupFwX8Aa1M7XvOENTI2AgbOP9vgs= X-Received: by 2002:a24:6bce:: with SMTP id v197-v6mr6040245itc.33.1542814922871; Wed, 21 Nov 2018 07:42:02 -0800 (PST) MIME-Version: 1.0 References: <201810300011.w9U0BUui038857@repo.freebsd.org> <20181121021949.vk7u5mji375fsy7h@mutt-hbsd> In-Reply-To: <20181121021949.vk7u5mji375fsy7h@mutt-hbsd> From: Ed Maste Date: Wed, 21 Nov 2018 10:41:49 -0500 Message-ID: Subject: Re: svn commit: r339898 - head/lib/libc/amd64/sys To: Shawn Webb Cc: Konstantin Belousov , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 97F1185119 X-Spamd-Result: default: False [-5.71 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17]; NEURAL_HAM_LONG(-1.00)[-0.996,0]; MIME_GOOD(-0.10)[text/plain]; RCVD_TLS_LAST(0.00)[]; DMARC_NA(0.00)[freebsd.org]; RCPT_COUNT_FIVE(0.00)[5]; TO_MATCH_ENVRCPT_SOME(0.00)[]; MX_GOOD(-0.01)[cached: alt3.gmail-smtp-in.l.google.com]; NEURAL_HAM_SHORT(-0.98)[-0.975,0]; RCVD_IN_DNSWL_NONE(0.00)[171.166.85.209.list.dnswl.org : 127.0.5.0]; IP_SCORE(-2.73)[ip: (-8.52), ipnet: 209.85.128.0/17(-3.48), asn: 15169(-1.56), country: US(-0.09)]; FORGED_SENDER(0.30)[emaste@freebsd.org,carpeddiem@gmail.com]; R_DKIM_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; FROM_NEQ_ENVFROM(0.00)[emaste@freebsd.org,carpeddiem@gmail.com]; RCVD_COUNT_TWO(0.00)[2] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Nov 2018 15:42:10 -0000 On Tue, 20 Nov 2018 at 21:21, Shawn Webb wrote: > > Hey Kostik, > > It appears this commit broke building/linking libc with LTO. I'm > running into this assertion from clang/lld 7.0.0 (from the > projects/clang700-import feature branch): Yes, if you can reproduce with upstream clang/llvm/lld head then an llvm bug is the best way to track this. From owner-svn-src-all@freebsd.org Wed Nov 21 16:18:58 2018 Return-Path: Delivered-To: svn-src-all@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 E67EC113D3F9; Wed, 21 Nov 2018 16:18:57 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 382A1867FD; Wed, 21 Nov 2018 16:18:56 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id wALGItOd072614; Wed, 21 Nov 2018 08:18:55 -0800 (PST) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id wALGIt0N072613; Wed, 21 Nov 2018 08:18:55 -0800 (PST) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201811211618.wALGIt0N072613@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r340722 - head/lib/libbe In-Reply-To: <201811211122.wALBMiCt071058@repo.freebsd.org> To: Mateusz Piotrowski <0mp@freebsd.org> Date: Wed, 21 Nov 2018 08:18:55 -0800 (PST) CC: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Rspamd-Queue-Id: 382A1867FD X-Spamd-Result: default: False [1.39 / 15.00]; ARC_NA(0.00)[]; HAS_REPLYTO(0.00)[rgrimes@freebsd.org]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[dnsmgr.net]; REPLYTO_DOM_NEQ_FROM_DOM(0.00)[]; AUTH_NA(1.00)[]; NEURAL_SPAM_MEDIUM(0.24)[0.245,0]; RCVD_COUNT_THREE(0.00)[3]; IP_SCORE(-0.02)[country: US(-0.09)]; MX_GOOD(-0.01)[cached: pdx.rh.CN85.dnsmgr.net]; NEURAL_SPAM_LONG(0.55)[0.547,0]; NEURAL_HAM_SHORT(-0.27)[-0.275,0]; R_SPF_NA(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:13868, ipnet:69.59.192.0/19, country:US]; MID_RHS_MATCH_FROM(0.00)[] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Nov 2018 16:18:58 -0000 > Author: 0mp (ports committer) > Date: Wed Nov 21 11:22:44 2018 > New Revision: 340722 > URL: https://svnweb.freebsd.org/changeset/base/340722 > > Log: > libbe(3): Put each error value in separate line. > > As requested by a TODO in the source code. > > Reviewed by: bcr > Approved by: krion (mentor, implicit), mat (mentor, implicit) > Differential Revision: https://reviews.freebsd.org/D18063 Who with a src bit approved the commit to src? > Modified: > head/lib/libbe/libbe.3 > > Modified: head/lib/libbe/libbe.3 > ============================================================================== > --- head/lib/libbe/libbe.3 Wed Nov 21 06:36:15 2018 (r340721) > +++ head/lib/libbe/libbe.3 Wed Nov 21 11:22:44 2018 (r340722) > @@ -28,7 +28,7 @@ > .\" > .\" $FreeBSD$ > .\" > -.Dd November 17, 2018 > +.Dd November 21, 2018 > .Dt LIBBE 3 > .Os > .Sh NAME > @@ -440,30 +440,49 @@ The > .Fn be_prop_list_free > function will free the property list. > .Sh DIAGNOSTICS > -Upon error, one of the following values will be returned. > -.\" TODO: make each entry on its own line. > -.Bd -ragged -offset indent > -BE_ERR_SUCCESS, > -BE_ERR_INVALIDNAME, > -BE_ERR_EXISTS, > -BE_ERR_NOENT, > -BE_ERR_PERMS, > -BE_ERR_DESTROYACT, > -BE_ERR_DESTROYMNT, > -BE_ERR_BADPATH, > -BE_ERR_PATHBUSY, > -BE_ERR_PATHLEN, > -BE_ERR_BADMOUNT, > -BE_ERR_NOORIGIN, > -BE_ERR_MOUNTED, > -BE_ERR_NOMOUNT, > -BE_ERR_ZFSOPEN, > -BE_ERR_ZFSCLONE, > -BE_ERR_IO, > -BE_ERR_NOPOOL, > -BE_ERR_NOMEM, > +Upon error, one of the following values will be returned: > +.Bl -dash -offset indent -compact > +.It > +BE_ERR_SUCCESS > +.It > +BE_ERR_INVALIDNAME > +.It > +BE_ERR_EXISTS > +.It > +BE_ERR_NOENT > +.It > +BE_ERR_PERMS > +.It > +BE_ERR_DESTROYACT > +.It > +BE_ERR_DESTROYMNT > +.It > +BE_ERR_BADPATH > +.It > +BE_ERR_PATHBUSY > +.It > +BE_ERR_PATHLEN > +.It > +BE_ERR_BADMOUNT > +.It > +BE_ERR_NOORIGIN > +.It > +BE_ERR_MOUNTED > +.It > +BE_ERR_NOMOUNT > +.It > +BE_ERR_ZFSOPEN > +.It > +BE_ERR_ZFSCLONE > +.It > +BE_ERR_IO > +.It > +BE_ERR_NOPOOL > +.It > +BE_ERR_NOMEM > +.It > BE_ERR_UNKNOWN > -.Ed > +.El > .Sh SEE ALSO > .Xr be 1 > .Sh HISTORY > > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Wed Nov 21 16:26:54 2018 Return-Path: Delivered-To: svn-src-all@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 51762113D85A; Wed, 21 Nov 2018 16:26:54 +0000 (UTC) (envelope-from araujobsdport@gmail.com) Received: from mail-lf1-x130.google.com (mail-lf1-x130.google.com [IPv6:2a00:1450:4864:20::130]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 87EB286E6A; Wed, 21 Nov 2018 16:26:53 +0000 (UTC) (envelope-from araujobsdport@gmail.com) Received: by mail-lf1-x130.google.com with SMTP id v5so4417515lfe.7; Wed, 21 Nov 2018 08:26:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:reply-to:from:date:message-id :subject:to:cc; bh=DLa7BnGZO3h+QvJEXeTLjJlLzV8JRl9fZPS6tr77c64=; b=kcTZRHFdxm/9v077XLQzcupWni9t/HSBdw2bsyHL4YpqS5YAONQ08YoiAYNzcDf/9S UgwwVNWC9/4GSIarjX/7hwUl+CeAag4jrAUS3vemHALEly/PtH6JlBIvj0oCe6RcyY1W EMSNARL50WZ/vR3RPSiHMld8veTzNFqzNa4vZ8k34p0wKDJ8RanJ28J7hzBcgvO4MmYC lUwTtcdY4gm26dOg+8TtZWSufjMTgQ/bZqW46d33pLh2XT3oJV3hTTC/LOC+Tt7smmIN 7Zwx6/dAbKhY6ivwXQNzyh9MQBb2ZAkhyNm/QCUS/Vx0IbRapDHQZasNIINYlomO1DtV VZpA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:reply-to :from:date:message-id:subject:to:cc; bh=DLa7BnGZO3h+QvJEXeTLjJlLzV8JRl9fZPS6tr77c64=; b=QgDhpy8FViVzSCIFqfwDpDgGoDctU8giZusUPy/ytJzACZMp5rCdWOcYBjhKhdf2P5 Pp8yQV/tzVASbDPw/PfQnmYhPWMQVy+EQd0Q+B2VhDXhHd8KPSf9/29wfEXppQIzCSPj Awb0TWjYAEErzPnvoSMhEKkHD58gIUDw+xWXjUUfsrKgfZXheyhpw5S066FXXAfXyRwh Kw/Hf5D92g6kHtwU9UYUbptNDisz53rBFHlT8hdKxY8EU1LF02LU9qQj7Oc93AfnLMdq gKzl0gXNDU0+8PQQVuKclfIPABCK7VlDdShS7tvpAuIvDBo6EmZF6n1Hz7axQL6N/BgX iqKA== X-Gm-Message-State: AGRZ1gKbWs9l6/OIAVt3zdJFegwF4kX2bBhSRLdj4lOu20xjXatDmqAx z3fqUzsYtuuqLo0/Jfb4fgjSe39NQLyDnhwC1EKeYg== X-Google-Smtp-Source: AJdET5efj3zLSI4/9cgddKmiPOtCyTovV1bvAfR9+F6lpRHBcKpPCmSeMMXdNr5BaWqVdESWHNRmUbIGs+3gFHl7II4= X-Received: by 2002:a19:1d0d:: with SMTP id d13mr4074846lfd.74.1542817611629; Wed, 21 Nov 2018 08:26:51 -0800 (PST) MIME-Version: 1.0 References: <201811211122.wALBMiCt071058@repo.freebsd.org> <201811211618.wALGIt0N072613@pdx.rh.CN85.dnsmgr.net> In-Reply-To: <201811211618.wALGIt0N072613@pdx.rh.CN85.dnsmgr.net> Reply-To: araujo@freebsd.org From: Marcelo Araujo Date: Thu, 22 Nov 2018 00:26:38 +0800 Message-ID: Subject: Re: svn commit: r340722 - head/lib/libbe To: "Rodney W. Grimes" Cc: Mateusz Piotrowski <0mp@freebsd.org>, src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org X-Rspamd-Queue-Id: 87EB286E6A X-Spamd-Result: default: False [-4.63 / 15.00]; ARC_NA(0.00)[]; HAS_REPLYTO(0.00)[araujo@freebsd.org]; R_DKIM_ALLOW(-0.20)[gmail.com]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2a00:1450:4000::/36]; FREEMAIL_FROM(0.00)[gmail.com]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; TO_MATCH_ENVRCPT_ALL(0.00)[]; REPLYTO_DOM_NEQ_FROM_DOM(0.00)[]; RCPT_COUNT_FIVE(0.00)[5]; NEURAL_HAM_LONG(-0.99)[-0.994,0]; IP_SCORE(-0.64)[ipnet: 2a00:1450::/32(-1.55), asn: 15169(-1.56), country: US(-0.09)]; DKIM_TRACE(0.00)[gmail.com:+]; MX_GOOD(-0.01)[cached: alt3.gmail-smtp-in.l.google.com]; RCVD_IN_DNSWL_NONE(0.00)[0.3.1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.5.4.1.0.0.a.2.list.dnswl.org : 127.0.5.0]; NEURAL_HAM_SHORT(-0.98)[-0.984,0]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; FROM_EQ_ENVFROM(0.00)[]; RCVD_TLS_LAST(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US]; RCVD_COUNT_TWO(0.00)[2] X-Rspamd-Server: mx1.freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Nov 2018 16:26:54 -0000 On Thu, Nov 22, 2018, 12:19 AM Rodney W. Grimes < freebsd@pdx.rh.cn85.dnsmgr.net wrote: > > Author: 0mp (ports committer) > > Date: Wed Nov 21 11:22:44 2018 > > New Revision: 340722 > > URL: https://svnweb.freebsd.org/changeset/base/340722 > > > > Log: > > libbe(3): Put each error value in separate line. > > > > As requested by a TODO in the source code. > > > > Reviewed by: bcr > > Approved by: krion (mentor, implicit), mat (mentor, implicit) > > Differential Revision: https://reviews.freebsd.org/D18063 > > Who with a src bit approved the commit to src? > I was asking myself the same question!! > > Modified: > > head/lib/libbe/libbe.3 > > > > Modified: head/lib/libbe/libbe.3 > > > ============================================================================== > > --- head/lib/libbe/libbe.3 Wed Nov 21 06:36:15 2018 (r340721) > > +++ head/lib/libbe/libbe.3 Wed Nov 21 11:22:44 2018 (r340722) > > @@ -28,7 +28,7 @@ > > .\" > > .\" $FreeBSD$ > > .\" > > -.Dd November 17, 2018 > > +.Dd November 21, 2018 > > .Dt LIBBE 3 > > .Os > > .Sh NAME > > @@ -440,30 +440,49 @@ The > > .Fn be_prop_list_free > > function will free the property list. > > .Sh DIAGNOSTICS > > -Upon error, one of the following values will be returned. > > -.\" TODO: make each entry on its own line. > > -.Bd -ragged -offset indent > > -BE_ERR_SUCCESS, > > -BE_ERR_INVALIDNAME, > > -BE_ERR_EXISTS, > > -BE_ERR_NOENT, > > -BE_ERR_PERMS, > > -BE_ERR_DESTROYACT, > > -BE_ERR_DESTROYMNT, > > -BE_ERR_BADPATH, > > -BE_ERR_PATHBUSY, > > -BE_ERR_PATHLEN, > > -BE_ERR_BADMOUNT, > > -BE_ERR_NOORIGIN, > > -BE_ERR_MOUNTED, > > -BE_ERR_NOMOUNT, > > -BE_ERR_ZFSOPEN, > > -BE_ERR_ZFSCLONE, > > -BE_ERR_IO, > > -BE_ERR_NOPOOL, > > -BE_ERR_NOMEM, > > +Upon error, one of the following values will be returned: > > +.Bl -dash -offset indent -compact > > +.It > > +BE_ERR_SUCCESS > > +.It > > +BE_ERR_INVALIDNAME > > +.It > > +BE_ERR_EXISTS > > +.It > > +BE_ERR_NOENT > > +.It > > +BE_ERR_PERMS > > +.It > > +BE_ERR_DESTROYACT > > +.It > > +BE_ERR_DESTROYMNT > > +.It > > +BE_ERR_BADPATH > > +.It > > +BE_ERR_PATHBUSY > > +.It > > +BE_ERR_PATHLEN > > +.It > > +BE_ERR_BADMOUNT > > +.It > > +BE_ERR_NOORIGIN > > +.It > > +BE_ERR_MOUNTED > > +.It > > +BE_ERR_NOMOUNT > > +.It > > +BE_ERR_ZFSOPEN > > +.It > > +BE_ERR_ZFSCLONE > > +.It > > +BE_ERR_IO > > +.It > > +BE_ERR_NOPOOL > > +.It > > +BE_ERR_NOMEM > > +.It > > BE_ERR_UNKNOWN > > -.Ed > > +.El > > .Sh SEE ALSO > > .Xr be 1 > > .Sh HISTORY > > > > > > -- > Rod Grimes > rgrimes@freebsd.org > > From owner-svn-src-all@freebsd.org Wed Nov 21 16:41:52 2018 Return-Path: Delivered-To: svn-src-all@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 60AE0113DEB0; Wed, 21 Nov 2018 16:41:52 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 02CEB69908; Wed, 21 Nov 2018 16:41:52 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from mail-lj1-f182.google.com (mail-lj1-f182.google.com [209.85.208.182]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) (Authenticated sender: kevans) by smtp.freebsd.org (Postfix) with ESMTPSA id 9A48B24193; Wed, 21 Nov 2018 16:41:51 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-lj1-f182.google.com with SMTP id v1-v6so5437702ljd.0; Wed, 21 Nov 2018 08:41:51 -0800 (PST) X-Gm-Message-State: AGRZ1gJsQLMymM6YogvMRrysUhNoQO0Pmco0WooJK/SPM15BOl0czNmS gMCDPFP4h0Ebc0T6JKG26dmnj5nECzpnyCHNKDI= X-Google-Smtp-Source: AFSGD/W6BbHwcNm7GWx8lWrKeZRp8K79E7y+A3YhBkkaZkDZR+uqLjUf2yhcfoHuSkKnVGQDxtr52qoo0L884Dud7Ig= X-Received: by 2002:a2e:a202:: with SMTP id h2-v6mr4505953ljm.72.1542818510077; Wed, 21 Nov 2018 08:41:50 -0800 (PST) MIME-Version: 1.0 References: <201811211122.wALBMiCt071058@repo.freebsd.org> <201811211618.wALGIt0N072613@pdx.rh.CN85.dnsmgr.net> In-Reply-To: <201811211618.wALGIt0N072613@pdx.rh.CN85.dnsmgr.net> From: Kyle Evans Date: Wed, 21 Nov 2018 10:41:37 -0600 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r340722 - head/lib/libbe To: "Rodney W. Grimes" Cc: 0mp@freebsd.org, svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 02CEB69908 X-Spamd-Result: default: False [0.37 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_SPAM_MEDIUM(0.34)[0.342,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.06)[0.064,0]; NEURAL_HAM_LONG(-0.04)[-0.041,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Nov 2018 16:41:52 -0000 On Wed, Nov 21, 2018 at 10:19 AM Rodney W. Grimes wrote: > > > Author: 0mp (ports committer) > > Date: Wed Nov 21 11:22:44 2018 > > New Revision: 340722 > > URL: https://svnweb.freebsd.org/changeset/base/340722 > > > > Log: > > libbe(3): Put each error value in separate line. > > > > As requested by a TODO in the source code. > > > > Reviewed by: bcr > > Approved by: krion (mentor, implicit), mat (mentor, implicit) > > Differential Revision: https://reviews.freebsd.org/D18063 > > Who with a src bit approved the commit to src? > I do want to clarify- bcr approved it in the review (explicitly with "... hereby approved!") -- are you mainly pointing out that he failed to annotate this properly in the commit, or is doc bit approval for a commit to a manpage in src insufficient? As an aside, happy to approve any changes to these manpages as the current bectl/libbe maintainer for anyone that wants to improve them. =) Thanks, Kyle Evans From owner-svn-src-all@freebsd.org Wed Nov 21 16:46:07 2018 Return-Path: Delivered-To: svn-src-all@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 2C28A113DFA3; Wed, 21 Nov 2018 16:46:07 +0000 (UTC) (envelope-from srs0=vwox=oa=vega.codepro.be=kp@codepro.be) Received: from venus.codepro.be (venus.codepro.be [IPv6:2a01:4f8:162:1127::2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "smtp.codepro.be", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 11C5469D29; Wed, 21 Nov 2018 16:46:05 +0000 (UTC) (envelope-from srs0=vwox=oa=vega.codepro.be=kp@codepro.be) Received: from vega.codepro.be (unknown [172.16.1.3]) by venus.codepro.be (Postfix) with ESMTP id D13548958; Wed, 21 Nov 2018 17:42:01 +0100 (CET) Received: by vega.codepro.be (Postfix, from userid 1001) id CD20139AC; Wed, 21 Nov 2018 17:42:01 +0100 (CET) Date: Wed, 21 Nov 2018 17:42:01 +0100 From: Kristof Provost To: rgrimes@freebsd.org Cc: Mateusz Piotrowski <0mp@freebsd.org>, src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r340722 - head/lib/libbe Message-ID: <20181121164201.GA23255@vega.codepro.be> References: <201811211122.wALBMiCt071058@repo.freebsd.org> <201811211618.wALGIt0N072613@pdx.rh.CN85.dnsmgr.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <201811211618.wALGIt0N072613@pdx.rh.CN85.dnsmgr.net> X-Checked-By-NSA: Probably User-Agent: Mutt/1.10.1 (2018-07-13) X-Rspamd-Queue-Id: 11C5469D29 X-Spamd-Result: default: False [-4.43 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2a01:4f8:162:1127::2]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[freebsd.org]; NEURAL_HAM_LONG(-0.99)[-0.991,0]; RCPT_COUNT_FIVE(0.00)[5]; RCVD_COUNT_THREE(0.00)[3]; IP_SCORE(-1.25)[ipnet: 2a01:4f8::/29(-3.36), asn: 24940(-2.89), country: DE(-0.01)]; RCVD_IN_DNSWL_MED(-0.20)[2.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.7.2.1.1.2.6.1.0.8.f.4.0.1.0.a.2.list.dnswl.org : 127.0.9.2]; MX_GOOD(-0.01)[mx2.codepro.be,mx1.codepro.be]; NEURAL_HAM_SHORT(-0.98)[-0.982,0]; FORGED_SENDER(0.30)[kp@freebsd.org,srs0=vwox=oa=vega.codepro.be=kp@codepro.be]; R_DKIM_NA(0.00)[]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:24940, ipnet:2a01:4f8::/29, country:DE]; FROM_NEQ_ENVFROM(0.00)[kp@freebsd.org, srs0=vwox=oa=vega.codepro.be=kp@codepro.be] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Nov 2018 16:46:07 -0000 On 2018-11-21 08:18:55 (-0800), Rodney W. Grimes wrote: > > Author: 0mp (ports committer) > > Date: Wed Nov 21 11:22:44 2018 > > New Revision: 340722 > > URL: https://svnweb.freebsd.org/changeset/base/340722 > > > > Log: > > libbe(3): Put each error value in separate line. > > > > As requested by a TODO in the source code. > > > > Reviewed by: bcr > > Approved by: krion (mentor, implicit), mat (mentor, implicit) > > Differential Revision: https://reviews.freebsd.org/D18063 > > Who with a src bit approved the commit to src? > My understanding is that doc bits allow people to commit to src documentation, including man pages. (https://www.freebsd.org/doc/en/articles/committers-guide/committer.types.html) Best regards, Kristof From owner-svn-src-all@freebsd.org Wed Nov 21 16:47:12 2018 Return-Path: Delivered-To: svn-src-all@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 9DF5D113E039; Wed, 21 Nov 2018 16:47:12 +0000 (UTC) (envelope-from jhibbits@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 EE7E069EEA; Wed, 21 Nov 2018 16:47:11 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CF5E72305C; Wed, 21 Nov 2018 16:47:11 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wALGlBoS039309; Wed, 21 Nov 2018 16:47:11 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wALGlBBn039307; Wed, 21 Nov 2018 16:47:11 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201811211647.wALGlBBn039307@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Wed, 21 Nov 2018 16:47:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340726 - in head/sys/cddl: contrib/opensolaris/uts/common/sys dev/fbt/powerpc X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: in head/sys/cddl: contrib/opensolaris/uts/common/sys dev/fbt/powerpc X-SVN-Commit-Revision: 340726 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: EE7E069EEA X-Spamd-Result: default: False [0.43 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_MEDIUM(0.23)[0.231,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.20)[0.199,0]; NEURAL_HAM_LONG(-0.00)[-0.003,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Nov 2018 16:47:12 -0000 Author: jhibbits Date: Wed Nov 21 16:47:11 2018 New Revision: 340726 URL: https://svnweb.freebsd.org/changeset/base/340726 Log: DTrace/powerpc: Fix FBT return probes The FBT fuction boundary prober was setting one return probe marker value, but the dtrace handler was expecting another. This causes a hang when tracing return probes. Modified: head/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace.h head/sys/cddl/dev/fbt/powerpc/fbt_isa.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace.h Wed Nov 21 14:50:45 2018 (r340725) +++ head/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace.h Wed Nov 21 16:47:11 2018 (r340726) @@ -2435,12 +2435,11 @@ extern void dtrace_helpers_destroy(proc_t *); #elif defined(__powerpc__) -#define DTRACE_INVOP_RET 1 -#define DTRACE_INVOP_BCTR 2 -#define DTRACE_INVOP_BLR 3 -#define DTRACE_INVOP_JUMP 4 -#define DTRACE_INVOP_MFLR_R0 5 -#define DTRACE_INVOP_NOP 6 +#define DTRACE_INVOP_BCTR 1 +#define DTRACE_INVOP_BLR 2 +#define DTRACE_INVOP_JUMP 3 +#define DTRACE_INVOP_MFLR_R0 4 +#define DTRACE_INVOP_NOP 5 #elif defined(__arm__) Modified: head/sys/cddl/dev/fbt/powerpc/fbt_isa.c ============================================================================== --- head/sys/cddl/dev/fbt/powerpc/fbt_isa.c Wed Nov 21 14:50:45 2018 (r340725) +++ head/sys/cddl/dev/fbt/powerpc/fbt_isa.c Wed Nov 21 16:47:11 2018 (r340726) @@ -221,7 +221,7 @@ again: if (*instr == FBT_BCTR) fbt->fbtp_rval = DTRACE_INVOP_BCTR; else if (*instr == FBT_BLR) - fbt->fbtp_rval = DTRACE_INVOP_RET; + fbt->fbtp_rval = DTRACE_INVOP_BLR; else fbt->fbtp_rval = DTRACE_INVOP_JUMP; From owner-svn-src-all@freebsd.org Wed Nov 21 16:54:13 2018 Return-Path: Delivered-To: svn-src-all@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 940B3113E344; Wed, 21 Nov 2018 16:54:13 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AEEEF6A492; Wed, 21 Nov 2018 16:54:12 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id wALGsAU6072770; Wed, 21 Nov 2018 08:54:10 -0800 (PST) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id wALGsAPT072769; Wed, 21 Nov 2018 08:54:10 -0800 (PST) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201811211654.wALGsAPT072769@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r340722 - head/lib/libbe In-Reply-To: To: Kyle Evans Date: Wed, 21 Nov 2018 08:54:10 -0800 (PST) CC: "Rodney W. Grimes" , 0mp@freebsd.org, svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Rspamd-Queue-Id: AEEEF6A492 X-Spamd-Result: default: False [1.28 / 15.00]; ARC_NA(0.00)[]; HAS_REPLYTO(0.00)[rgrimes@freebsd.org]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[dnsmgr.net]; REPLYTO_DOM_NEQ_FROM_DOM(0.00)[]; AUTH_NA(1.00)[]; RCPT_COUNT_FIVE(0.00)[6]; RCVD_COUNT_THREE(0.00)[3]; IP_SCORE(-0.02)[country: US(-0.09)]; MX_GOOD(-0.01)[cached: pdx.rh.CN85.dnsmgr.net]; NEURAL_SPAM_LONG(0.57)[0.571,0]; NEURAL_HAM_SHORT(-0.43)[-0.433,0]; NEURAL_SPAM_MEDIUM(0.27)[0.267,0]; R_SPF_NA(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:13868, ipnet:69.59.192.0/19, country:US]; MID_RHS_MATCH_FROM(0.00)[] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Nov 2018 16:54:13 -0000 > On Wed, Nov 21, 2018 at 10:19 AM Rodney W. Grimes > wrote: > > > > > Author: 0mp (ports committer) > > > Date: Wed Nov 21 11:22:44 2018 > > > New Revision: 340722 > > > URL: https://svnweb.freebsd.org/changeset/base/340722 > > > > > > Log: > > > libbe(3): Put each error value in separate line. > > > > > > As requested by a TODO in the source code. > > > > > > Reviewed by: bcr > > > Approved by: krion (mentor, implicit), mat (mentor, implicit) > > > Differential Revision: https://reviews.freebsd.org/D18063 > > > > Who with a src bit approved the commit to src? > > > > I do want to clarify- bcr approved it in the review (explicitly with > "... hereby approved!") -- are you mainly pointing out that he failed > to annotate this properly in the commit, or is doc bit approval for a > commit to a manpage in src insufficient? That is defanitly a bit of a grey area, from reading and re-reading the commit bit page it is clear that a doc committer can commit to src documentation, it is not clear if they can approve a commit by someone else to the src tree, it does say ""Approved by" from a non-mentored committer with the appropriate bit" It probably would be fine to have said Approved by: bcr. I still question what a out of scope commit that is approved by: (mentor, implicit). I am not even sure what that means in this context. Have his mentors said he can commit anything anyplace without them seeing it? If so then release the mentor/mentee bit would be more appropriate? > > As an aside, happy to approve any changes to these manpages as the > current bectl/libbe maintainer for anyone that wants to improve them. > =) That defanitly would of been a cleaner path. > > Thanks, > > Kyle Evans > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Wed Nov 21 16:58:21 2018 Return-Path: Delivered-To: svn-src-all@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 6D33D113E42D; Wed, 21 Nov 2018 16:58:21 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 11F166A641; Wed, 21 Nov 2018 16:58:21 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from mail-lj1-f169.google.com (mail-lj1-f169.google.com [209.85.208.169]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) (Authenticated sender: kevans) by smtp.freebsd.org (Postfix) with ESMTPSA id A65C124290; Wed, 21 Nov 2018 16:58:20 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-lj1-f169.google.com with SMTP id e5-v6so5467273lja.4; Wed, 21 Nov 2018 08:58:20 -0800 (PST) X-Gm-Message-State: AA+aEWZP0K8O929WQ48IItOSmdwtjRvPPBCwSv6OyiTTfLg7i14C8QYP iX2ji4CspK5Pf+tZWBzqFCOgtN3qGtG855/nnuU= X-Google-Smtp-Source: AFSGD/XfnfsocKSirr/yXuPP7BqXYoIJnZVTEqs7JOpGVyKbQHuCOvWyu1lpfOFins/tCO+KL9Ak96qVrmDpCAG+pSQ= X-Received: by 2002:a2e:2019:: with SMTP id g25-v6mr4403380ljg.20.1542819499129; Wed, 21 Nov 2018 08:58:19 -0800 (PST) MIME-Version: 1.0 References: <201811211654.wALGsAPT072769@pdx.rh.CN85.dnsmgr.net> In-Reply-To: <201811211654.wALGsAPT072769@pdx.rh.CN85.dnsmgr.net> From: Kyle Evans Date: Wed, 21 Nov 2018 10:58:06 -0600 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r340722 - head/lib/libbe To: "Rodney W. Grimes" Cc: 0mp@freebsd.org, svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 11F166A641 X-Spamd-Result: default: False [0.37 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_SPAM_MEDIUM(0.34)[0.342,0]; ASN(0.00)[asn:11403, ipnet:96.47.64.0/20, country:US]; NEURAL_SPAM_SHORT(0.06)[0.064,0]; NEURAL_HAM_LONG(-0.04)[-0.041,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Nov 2018 16:58:21 -0000 On Wed, Nov 21, 2018 at 10:54 AM Rodney W. Grimes wrote: > > > On Wed, Nov 21, 2018 at 10:19 AM Rodney W. Grimes > > wrote: > > > > > > > Author: 0mp (ports committer) > > > > Date: Wed Nov 21 11:22:44 2018 > > > > New Revision: 340722 > > > > URL: https://svnweb.freebsd.org/changeset/base/340722 > > > > > > > > Log: > > > > libbe(3): Put each error value in separate line. > > > > > > > > As requested by a TODO in the source code. > > > > > > > > Reviewed by: bcr > > > > Approved by: krion (mentor, implicit), mat (mentor, implicit) > > > > Differential Revision: https://reviews.freebsd.org/D18063 > > > > > > Who with a src bit approved the commit to src? > > > > > > > I do want to clarify- bcr approved it in the review (explicitly with > > "... hereby approved!") -- are you mainly pointing out that he failed > > to annotate this properly in the commit, or is doc bit approval for a > > commit to a manpage in src insufficient? > > That is defanitly a bit of a grey area, from reading and re-reading > the commit bit page it is clear that a doc committer can commit > to src documentation, it is not clear if they can approve a commit > by someone else to the src tree, it does say > ""Approved by" from a non-mentored committer > with the appropriate bit" > > It probably would be fine to have said Approved by: bcr. > Agreed- I think this is fine given that it's within the scope of bcr's doc bit. > I still question what a out of scope commit that is > approved by: (mentor, implicit). I am not even sure > what that means in this context. Have his mentors > said he can commit anything anyplace without them > seeing it? If so then release the mentor/mentee bit > would be more appropriate? > I suspect it's that they're not interested in any doc changes he has, because they're not doc people. Well, mat@ is, but mat isn't mentoring him for docs, he's mentoring him for ports. Such approvals would just be rubber stamps anyways, because they as mentors might not necessarily be up-to-date on doc protocols. From owner-svn-src-all@freebsd.org Wed Nov 21 17:04:43 2018 Return-Path: Delivered-To: svn-src-all@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 0CFDE113E8F6; Wed, 21 Nov 2018 17:04:43 +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 A2F1B6AE0A; Wed, 21 Nov 2018 17:04:42 +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 847D52339D; Wed, 21 Nov 2018 17:04:42 +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 wALH4gH0049159; Wed, 21 Nov 2018 17:04:42 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wALH4g87049158; Wed, 21 Nov 2018 17:04:42 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201811211704.wALH4g87049158@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 21 Nov 2018 17:04:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r340727 - stable/12/sbin/dumpon X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/12/sbin/dumpon X-SVN-Commit-Revision: 340727 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A2F1B6AE0A X-Spamd-Result: default: False [0.44 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.01)[0.014,0]; NEURAL_SPAM_SHORT(0.11)[0.113,0]; NEURAL_SPAM_MEDIUM(0.31)[0.308,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Nov 2018 17:04:43 -0000 Author: markj Date: Wed Nov 21 17:04:42 2018 New Revision: 340727 URL: https://svnweb.freebsd.org/changeset/base/340727 Log: MFC r339785 (by cem): dumpon.8: Significantly revamp page Modified: stable/12/sbin/dumpon/dumpon.8 Directory Properties: stable/12/ (props changed) Modified: stable/12/sbin/dumpon/dumpon.8 ============================================================================== --- stable/12/sbin/dumpon/dumpon.8 Wed Nov 21 16:47:11 2018 (r340726) +++ stable/12/sbin/dumpon/dumpon.8 Wed Nov 21 17:04:42 2018 (r340727) @@ -59,27 +59,120 @@ .Sh DESCRIPTION The .Nm -utility is used to specify a device where the kernel can save a crash -dump in the case of a panic. +utility is used to configure where the kernel can save a crash dump in the case +of a panic. .Pp -Calls to +System administrators should typically configure .Nm -normally occur from the system multi-user initialization file -.Pa /etc/rc , -controlled by the -.Dq dumpdev +in a persistent fashion using the +.Xr rc.conf 5 +variables +.Va dumpdev and -.Dq dumpon_flags -variables in the boot time configuration file -.Pa /etc/rc.conf . +.Va dumpon_flags . +For more information on this usage, see +.Xr rc.conf 5 . +.Ss General options +.Bl -tag -width _k_pubkey +.It Fl k Ar pubkey +Configure encrypted kernel dumps. .Pp +A random, one-time symmetric key is automatically generated for bulk kernel +dump encryption every time +.Nm +is used. +The provided +.Ar pubkey +is used to encrypt a copy of the symmetric key. +The encrypted dump contents consist of a standard dump header, the +pubkey-encrypted symmetric key contents, and the symmetric key encrypted core +dump contents. +.Pp +As a result, only someone with the corresponding private key can decrypt the symmetric key. +The symmetric key is necessary to decrypt the kernel core. +The goal of the mechanism is to provide confidentiality. +.Pp +The +.Va pubkey +file should be a PEM-formatted RSA key of at least 1024 bits. +.It Fl l +List the currently configured dump device, or /dev/null if no device is +configured. +.It Fl v +Enable verbose mode. +.It Fl Z +Enable compression (Zstandard). +.It Fl z +Enable compression (gzip). +Only one compression method may be enabled at a time, so +.Fl z +is incompatible with +.Fl Z . +.Pp +Zstandard provides superior compression ratio and performance. +.El +.Ss Netdump +.Nm +may also configure the kernel to dump to a remote +.Xr netdumpd 8 +server. +(The +.Xr netdumpd 8 +server is available in ports.) +.Xr netdump 4 +eliminates the need to reserve space for crash dumps. +It is especially useful in diskless environments. +When +.Nm +is used to configure netdump, the +.Ar device +(or +.Ar iface ) +parameter should specify a network interface (e.g., +.Va igb1 ) . +The specified NIC must be up (online) to configure netdump. +.Pp +.Xr netdump 4 +specific options include: +.Bl -tag -width _g_gateway +.It Fl c Ar client +The local IP address of the +.Xr netdump 4 +client. +.It Fl g Ar gateway +Optional. +If not specified, it is assumed that the +.Ar server +is on the same link as the +.Ar client . +.Pp +If specified, +.Ar gateway +is the address of the first-hop router between the +.Ar client +and the +.Ar server . +The special value +.Dv Dq default +indicates that the currently configured system default route should be used. +.It Fl s Ar server +The IP address of the +.Xr netdumpd 8 +server. +.El +.Pp +All of these options can be specified in the +.Xr rc.conf 5 +variable +.Va dumpon_flags . +.Ss Minidumps The default type of kernel crash dump is the mini crash dump. Mini crash dumps hold only memory pages in use by the kernel. Alternatively, full memory dumps can be enabled by setting the .Va debug.minidump .Xr sysctl 8 variable to 0. -.Pp +.Ss Full dumps For systems using full memory dumps, the size of the specified dump device must be at least the size of physical memory. Even though an additional 64 kB header is added to the dump, the BIOS for a @@ -93,155 +186,18 @@ total amount of physical memory as reported by the .Va hw.physmem .Xr sysctl 8 variable. -.Pp -.Nm -is used to configure a local storage device as the dump device. -With additional parameters, the kernel can instead be configured to -transmit a dump to a remote server using -.Xr netdump 4 . -This eliminates the need to reserve space for saving crash dumps and -is especially useful in diskless environments. -The -.Xr netdump 4 -server address is specified with -.Fl s Ar server , -and the local address is specified with -.Fl c Ar client . -The -.Fl g Ar gateway -parameter may be used to specify a first-hop router to the server, -or to specify that the currently configured default gateway is to -be used. -Note that the -.Xr netdump 4 -configuration is not automatically updated if any network configuration -(e.g., the default route) changes after the -.Nm -invocation. -The name of the interface to be used must be specified as -.Ar iface . -The interface must be up in order to configure -.Xr netdump 4 . -.Pp -The -.Fl k Ar pubkey -flag causes -.Nm -to generate a one-time key for kernel crash dump encryption. -The key will be replaced by a new one when the -.Nm -utility is run again. -The key is encrypted using -.Ar pubkey . -This process is sandboxed using -.Xr capsicum 4 . -Both plain and encrypted keys are sent to the kernel using -.Dv DIOCSKERNELDUMP -.Xr ioctl 2 . -A user can specify the -.Ar pubkey -in the -.Dq dumpon_flags -variable defined in -.Pa /etc/rc.conf -for use with the -.Pa /etc/rc.d/dumpon -.Xr rc 8 -script. -This flag requires a kernel compiled with the -.Dv EKCD -kernel option. -.Pp -The -.Fl z -and -.Fl Z -options configure the kernel to compress the dump before writing it to -the dump device. -This reduces the amount of space required for the dump and accelerates -recovery with -.Xr savecore 8 -since less data needs to be copied from the dump device. -When compression is enabled, the -.Nm -utility will not verify that the dump device is sufficiently large for a full -dump. -The -.Fl z -and -.Fl Z -options cause the dump to be written in -.Xr gzip 1 -and -.Xr zstd 1 -format, respectively. -These flags require a kernel compiled with the -.Dv GZIO -or -.Dv ZSTDIO -kernel options. -.Pp -The -.Fl l -flag causes -.Nm -to print the current dump device or _PATH_DEVNULL ("/dev/null") if no device is -configured. -.Pp -The -.Fl v -flag causes -.Nm -to be verbose about its activity. .Sh IMPLEMENTATION NOTES -Since a -.Xr panic 9 -condition may occur in a situation -where the kernel cannot trust its internal representation -of the state of any given file system, -one of the system swap devices, -and -.Em not -a device containing a file system, -should be used as the dump device. +Because the file system layer is already dead by the time a crash dump +is taken, it is not possible to send crash dumps directly to a file. .Pp The -.Nm -utility operates by opening -.Ar device -and making a -.Dv DIOCSKERNELDUMP -.Xr ioctl 2 -request on it to save kernel crash dumps. -If -.Ar device -is the text string: -.Dq Li off , -.Nm -performs a -.Dv DIOCSKERNELDUMP -.Xr ioctl 2 -on -.Pa /dev/null -and thus instructs the kernel not to save crash dumps. -.Pp -Since -.Nm -cannot be used during kernel initialization, the -.Va dumpdev -variable of .Xr loader 8 -must be used to enable dumps for system panics which occur -during kernel initialization. -.Sh FILES -.Bl -tag -width "/dev/{ada,da}?s?b" -compact -.It Pa /dev/{ada,da}?s?b -standard swap areas -.It Pa /etc/rc.conf -boot-time system configuration -.El +variable +.Va dumpdev +may be used to enable early kernel core dumps for system panics which occur +before userspace starts. .Sh EXAMPLES -In order to generate an RSA private key a user can use the +In order to generate an RSA private key, a user can use the .Xr genrsa 1 tool: .Pp @@ -253,7 +209,8 @@ tool: .Pp .Dl # openssl rsa -in private.pem -out public.pem -pubout .Pp -Once the RSA keys are created the private key should be moved to a safe place. +Once the RSA keys are created in a safe place, the public key may be moved to +the untrusted netdump client machine. Now .Pa public.pem can be used by @@ -278,21 +235,23 @@ reboot: .Pp After reboot .Xr savecore 8 -should be able to save the core dump in the core directory which is +should be able to save the core dump in the +.Va Dq dumpdir +directory, which is .Pa /var/crash by default: .Pp -.Dl # savecore /var/crash /dev/ada0s1b +.Dl # savecore /dev/ada0s1b .Pp Three files should be created in the core directory: .Pa info.# , .Pa key.# and .Pa vmcore_encrypted.# -where +(where .Dq # is the number of the last core dump saved by -.Xr savecore 8 . +.Xr savecore 8 ) . The .Pa vmcore_encrypted.# can be decrypted using the @@ -320,12 +279,15 @@ The core was decrypted properly if .Xr kgdb 1 does not print any errors. Note that the live kernel might be at a different path -which can be examined by looking at the kern.bootfile sysctl. +which can be examined by looking at the +.Va kern.bootfile +.Xr sysctl 8 . .Sh SEE ALSO .Xr gzip 1 , .Xr kgdb 1 , .Xr zstd 1 , .Xr ddb 4 , +.Xr netdump 4 , .Xr fstab 5 , .Xr rc.conf 5 , .Xr config 8 , @@ -341,10 +303,49 @@ The .Nm utility appeared in .Fx 2.0.5 . -.Sh BUGS -Because the file system layer is already dead by the time a crash dump -is taken, it is not possible to send crash dumps directly to a file. .Pp +Support for encrypted kernel core dumps and netdump was added in +.Fx 12.0 . +.Sh AUTHORS +The +.Nm +manual page was written by +.An Mark Johnston Aq Mt markj@FreeBSD.org , +.An Conrad Meyer Aq Mt cem@FreeBSD.org , +.An Konrad Witaszczyk Aq Mt def@FreeBSD.org , +and countless others. +.Sh CAVEATS +To configure encrypted kernel core dumps, the running kernel must have been +compiled with the +.Dv EKCD +option. +.Pp +Netdump does not automatically update the configured +.Ar gateway +if routing topology changes. +.Pp +The size of a compressed dump or a minidump is not a fixed function of RAM +size. +Therefore, when at least one of these options is enabled, the +.Nm +utility cannot verify that the +.Ar device +has sufficient space for a dump. +.Nm +is also unable to verify that a configured +.Xr netdumpd 8 +server has sufficient space for a dump. +.Pp +.Fl Z +requires a kernel compiled with the +.Dv ZSTDIO +kernel option. +Similarly, +.Fl z +requires the +.Dv GZIO +option. +.Sh BUGS It is currently not possible to configure both compression and encryption. The encrypted dump format assumes that the kernel dump size is a multiple of the cipher block size, which may not be true when the dump is compressed. From owner-svn-src-all@freebsd.org Wed Nov 21 17:07:08 2018 Return-Path: Delivered-To: svn-src-all@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 599E5113EC2F; Wed, 21 Nov 2018 17:07:08 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.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 C36D26B0E2; Wed, 21 Nov 2018 17:07:07 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A478A233A0; Wed, 21 Nov 2018 17:07:07 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wALH77tt049332; Wed, 21 Nov 2018 17:07:07 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wALH776e049331; Wed, 21 Nov 2018 17:07:07 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201811211707.wALH776e049331@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 21 Nov 2018 17:07:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r340728 - stable/12/sbin/dumpon X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/12/sbin/dumpon X-SVN-Commit-Revision: 340728 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C36D26B0E2 X-Spamd-Result: default: False [0.41 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.01)[0.010,0]; NEURAL_SPAM_SHORT(0.11)[0.114,0]; NEURAL_SPAM_MEDIUM(0.29)[0.287,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Nov 2018 17:07:08 -0000 Author: markj Date: Wed Nov 21 17:07:07 2018 New Revision: 340728 URL: https://svnweb.freebsd.org/changeset/base/340728 Log: MFC r340547, r340686: Change dumpon(8)'s handling of -g. Modified: stable/12/sbin/dumpon/dumpon.8 stable/12/sbin/dumpon/dumpon.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sbin/dumpon/dumpon.8 ============================================================================== --- stable/12/sbin/dumpon/dumpon.8 Wed Nov 21 17:04:42 2018 (r340727) +++ stable/12/sbin/dumpon/dumpon.8 Wed Nov 21 17:07:07 2018 (r340728) @@ -28,7 +28,7 @@ .\" From: @(#)swapon.8 8.1 (Berkeley) 6/5/93 .\" $FreeBSD$ .\" -.Dd June 13, 2018 +.Dd November 17, 2018 .Dt DUMPON 8 .Os .Sh NAME @@ -46,7 +46,7 @@ .Op Fl k Ar pubkey .Op Fl Z .Op Fl z -.Op Fl g Ar gateway | Li default +.Op Fl g Ar gateway .Fl s Ar server .Fl c Ar client .Ar iface @@ -140,21 +140,22 @@ The local IP address of the .Xr netdump 4 client. .It Fl g Ar gateway -Optional. -If not specified, it is assumed that the -.Ar server -is on the same link as the -.Ar client . -.Pp -If specified, -.Ar gateway -is the address of the first-hop router between the +The first-hop router between .Ar client -and the +and .Ar server . -The special value -.Dv Dq default -indicates that the currently configured system default route should be used. +If the +.Fl g +option is not specified and the system has a default route, the default +router is used as the +.Xr netdump 4 +gateway. +If the +.Fl g +option is not specified and the system does not have a default route, +.Ar server +is assumed to be on the same link as +.Ar client . .It Fl s Ar server The IP address of the .Xr netdumpd 8 Modified: stable/12/sbin/dumpon/dumpon.c ============================================================================== --- stable/12/sbin/dumpon/dumpon.c Wed Nov 21 17:04:42 2018 (r340727) +++ stable/12/sbin/dumpon/dumpon.c Wed Nov 21 17:07:07 2018 (r340728) @@ -88,7 +88,7 @@ usage(void) fprintf(stderr, "usage: dumpon [-v] [-k ] [-Zz] \n" " dumpon [-v] [-k ] [-Zz]\n" - " [-g |default] -s -c \n" + " [-g ] -s -c \n" " dumpon [-v] off\n" " dumpon [-v] -l\n"); exit(EX_USAGE); @@ -109,8 +109,6 @@ find_gateway(const char *ifname) size_t sz; int error, i, ifindex, mib[7]; - ret = NULL; - /* First look up the interface index. */ if (getifaddrs(&ifap) != 0) err(EX_OSERR, "getifaddrs"); @@ -148,6 +146,7 @@ find_gateway(const char *ifname) free(buf); } + ret = NULL; for (next = buf; next < buf + sz; next += rtm->rtm_msglen) { rtm = (struct rt_msghdr *)(void *)next; if (rtm->rtm_version != RTM_VERSION) @@ -452,12 +451,16 @@ main(int argc, char *argv[]) if (inet_aton(client, &ndconf.ndc_client) == 0) errx(EX_USAGE, "invalid client address '%s'", client); - if (gateway == NULL) - gateway = server; - else if (strcmp(gateway, "default") == 0 && - (gateway = find_gateway(argv[0])) == NULL) - errx(EX_NOHOST, - "failed to look up next-hop router for %s", server); + if (gateway == NULL) { + gateway = find_gateway(argv[0]); + if (gateway == NULL) { + if (verbose) + printf( + "failed to look up gateway for %s\n", + server); + gateway = server; + } + } if (inet_aton(gateway, &ndconf.ndc_gateway) == 0) errx(EX_USAGE, "invalid gateway address '%s'", gateway); From owner-svn-src-all@freebsd.org Wed Nov 21 17:14:59 2018 Return-Path: Delivered-To: svn-src-all@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 DDF04113EF3E; Wed, 21 Nov 2018 17:14:58 +0000 (UTC) (envelope-from shurd@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 850376B796; Wed, 21 Nov 2018 17:14:58 +0000 (UTC) (envelope-from shurd@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6727E23538; Wed, 21 Nov 2018 17:14:58 +0000 (UTC) (envelope-from shurd@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wALHEwsM054873; Wed, 21 Nov 2018 17:14:58 GMT (envelope-from shurd@FreeBSD.org) Received: (from shurd@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wALHEw4W054872; Wed, 21 Nov 2018 17:14:58 GMT (envelope-from shurd@FreeBSD.org) Message-Id: <201811211714.wALHEw4W054872@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: shurd set sender to shurd@FreeBSD.org using -f From: Stephen Hurd Date: Wed, 21 Nov 2018 17:14:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r340729 - stable/12/sys/net X-SVN-Group: stable-12 X-SVN-Commit-Author: shurd X-SVN-Commit-Paths: stable/12/sys/net X-SVN-Commit-Revision: 340729 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 850376B796 X-Spamd-Result: default: False [0.41 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.01)[0.010,0]; NEURAL_SPAM_SHORT(0.11)[0.114,0]; NEURAL_SPAM_MEDIUM(0.29)[0.287,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Nov 2018 17:14:59 -0000 Author: shurd Date: Wed Nov 21 17:14:57 2018 New Revision: 340729 URL: https://svnweb.freebsd.org/changeset/base/340729 Log: MFC r340435: Prevent POLA violation with TSO/CSUM offload Ensure that any time CSUM_IP_TSO or CSUM_IP6_TSO is set that the corresponding CSUM_IP6?_TCP / CSUM_IP flags are also set. Rather than requireing drivers to bake-in an understanding that TSO implies checksum offloads, make it explicit. This change requires us to move the IFLIB_NEED_ZERO_CSUM implementation to ensure it's zeroed for TSO. Reported by: Jacob Keller Sponsored by: Limelight Networks Differential Revision: https://reviews.freebsd.org/D17801 Modified: stable/12/sys/net/iflib.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/net/iflib.c ============================================================================== --- stable/12/sys/net/iflib.c Wed Nov 21 17:07:07 2018 (r340728) +++ stable/12/sys/net/iflib.c Wed Nov 21 17:14:57 2018 (r340729) @@ -2974,9 +2974,6 @@ iflib_parse_header(iflib_txq_t txq, if_pkt_info_t pi, pi->ipi_ipproto = ip->ip_p; pi->ipi_flags |= IPI_TX_IPV4; - if ((sctx->isc_flags & IFLIB_NEED_ZERO_CSUM) && (pi->ipi_csum_flags & CSUM_IP)) - ip->ip_sum = 0; - /* TCP checksum offload may require TCP header length */ if (IS_TX_OFFLOAD4(pi)) { if (__predict_true(pi->ipi_ipproto == IPPROTO_TCP)) { @@ -2993,6 +2990,10 @@ iflib_parse_header(iflib_txq_t txq, if_pkt_info_t pi, if (IS_TSO4(pi)) { if (__predict_false(ip->ip_p != IPPROTO_TCP)) return (ENXIO); + /* + * TSO always requires hardware checksum offload. + */ + pi->ipi_csum_flags |= (CSUM_IP_TCP | CSUM_IP); th->th_sum = in_pseudo(ip->ip_src.s_addr, ip->ip_dst.s_addr, htons(IPPROTO_TCP)); pi->ipi_tso_segsz = m->m_pkthdr.tso_segsz; @@ -3002,6 +3003,9 @@ iflib_parse_header(iflib_txq_t txq, if_pkt_info_t pi, } } } + if ((sctx->isc_flags & IFLIB_NEED_ZERO_CSUM) && (pi->ipi_csum_flags & CSUM_IP)) + ip->ip_sum = 0; + break; } #endif @@ -3039,9 +3043,7 @@ iflib_parse_header(iflib_txq_t txq, if_pkt_info_t pi, if (__predict_false(ip6->ip6_nxt != IPPROTO_TCP)) return (ENXIO); /* - * The corresponding flag is set by the stack in the IPv4 - * TSO case, but not in IPv6 (at least in FreeBSD 10.2). - * So, set it here because the rest of the flow requires it. + * TSO always requires hardware checksum offload. */ pi->ipi_csum_flags |= CSUM_IP6_TCP; th->th_sum = in6_cksum_pseudo(ip6, 0, IPPROTO_TCP, 0); From owner-svn-src-all@freebsd.org Wed Nov 21 17:18:28 2018 Return-Path: Delivered-To: svn-src-all@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 9E602113F13D; Wed, 21 Nov 2018 17:18:28 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 401D06BB83; Wed, 21 Nov 2018 17:18:28 +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 224AC23543; Wed, 21 Nov 2018 17:18:28 +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 wALHISj1055339; Wed, 21 Nov 2018 17:18:28 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wALHIRE4055336; Wed, 21 Nov 2018 17:18:27 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201811211718.wALHIRE4055336@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 21 Nov 2018 17:18:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340730 - in head: share/man/man9 sys/kern sys/sys X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in head: share/man/man9 sys/kern sys/sys X-SVN-Commit-Revision: 340730 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 401D06BB83 X-Spamd-Result: default: False [0.45 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.00)[0.001,0]; NEURAL_SPAM_MEDIUM(0.25)[0.253,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.20)[0.198,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Nov 2018 17:18:28 -0000 Author: markj Date: Wed Nov 21 17:18:27 2018 New Revision: 340730 URL: https://svnweb.freebsd.org/changeset/base/340730 Log: Add a taskqueue_quiesce(9) KPI. This is similar to taskqueue_drain_all(9) but will wait for the queue to become idle before returning instead of only waiting for already-enqueued tasks to finish. This will be used in the opensolaris compat layer. PR: 227784 Reviewed by: cem MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D17975 Modified: head/share/man/man9/Makefile head/share/man/man9/taskqueue.9 head/sys/kern/subr_taskqueue.c head/sys/sys/taskqueue.h Modified: head/share/man/man9/Makefile ============================================================================== --- head/share/man/man9/Makefile Wed Nov 21 17:14:57 2018 (r340729) +++ head/share/man/man9/Makefile Wed Nov 21 17:18:27 2018 (r340730) @@ -2056,6 +2056,7 @@ MLINKS+=taskqueue.9 TASK_INIT.9 \ taskqueue.9 TASKQUEUE_FAST_DEFINE_THREAD.9 \ taskqueue.9 taskqueue_free.9 \ taskqueue.9 taskqueue_member.9 \ + taskqueue.9 taskqueue_quiesce.9 \ taskqueue.9 taskqueue_run.9 \ taskqueue.9 taskqueue_set_callback.9 \ taskqueue.9 taskqueue_start_threads.9 \ Modified: head/share/man/man9/taskqueue.9 ============================================================================== --- head/share/man/man9/taskqueue.9 Wed Nov 21 17:14:57 2018 (r340729) +++ head/share/man/man9/taskqueue.9 Wed Nov 21 17:18:27 2018 (r340730) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 30, 2017 +.Dd November 21, 2018 .Dt TASKQUEUE 9 .Os .Sh NAME @@ -94,6 +94,8 @@ struct timeout_task; .Ft void .Fn taskqueue_drain_all "struct taskqueue *queue" .Ft void +.Fn taskqueue_quiesce "struct taskqueue *queue" +.Ft void .Fn taskqueue_block "struct taskqueue *queue" .Ft void .Fn taskqueue_unblock "struct taskqueue *queue" @@ -298,6 +300,12 @@ do not extend the wait time of and may complete after .Fn taskqueue_drain_all returns. +The +.Fn taskqueue_quiesce +function is used to wait for the queue to become empty and for all +running tasks to finish. +To avoid blocking indefinitely, the caller must ensure by some mechanism +that tasks will eventually stop being posted to the queue. .Pp The .Fn taskqueue_block Modified: head/sys/kern/subr_taskqueue.c ============================================================================== --- head/sys/kern/subr_taskqueue.c Wed Nov 21 17:14:57 2018 (r340729) +++ head/sys/kern/subr_taskqueue.c Wed Nov 21 17:18:27 2018 (r340730) @@ -346,13 +346,13 @@ taskqueue_task_nop_fn(void *context, int pending) * have begun execution. Tasks queued during execution of * this function are ignored. */ -static void +static int taskqueue_drain_tq_queue(struct taskqueue *queue) { struct task t_barrier; if (STAILQ_EMPTY(&queue->tq_queue)) - return; + return (0); /* * Enqueue our barrier after all current tasks, but with @@ -372,6 +372,7 @@ taskqueue_drain_tq_queue(struct taskqueue *queue) */ while (t_barrier.ta_pending != 0) TQ_SLEEP(queue, &t_barrier, &queue->tq_mutex, PWAIT, "-", 0); + return (1); } /* @@ -379,13 +380,13 @@ taskqueue_drain_tq_queue(struct taskqueue *queue) * complete. Tasks that begin execution during the execution * of this function are ignored. */ -static void +static int taskqueue_drain_tq_active(struct taskqueue *queue) { struct taskqueue_busy tb_marker, *tb_first; if (TAILQ_EMPTY(&queue->tq_active)) - return; + return (0); /* Block taskq_terminate().*/ queue->tq_callouts++; @@ -412,6 +413,7 @@ taskqueue_drain_tq_active(struct taskqueue *queue) queue->tq_callouts--; if ((queue->tq_flags & TQ_FLAGS_ACTIVE) == 0) wakeup_one(queue->tq_threads); + return (1); } void @@ -582,8 +584,8 @@ taskqueue_drain_all(struct taskqueue *queue) WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, NULL, __func__); TQ_LOCK(queue); - taskqueue_drain_tq_queue(queue); - taskqueue_drain_tq_active(queue); + (void)taskqueue_drain_tq_queue(queue); + (void)taskqueue_drain_tq_active(queue); TQ_UNLOCK(queue); } @@ -609,6 +611,20 @@ taskqueue_drain_timeout(struct taskqueue *queue, */ TQ_LOCK(queue); timeout_task->f &= ~DT_DRAIN_IN_PROGRESS; + TQ_UNLOCK(queue); +} + +void +taskqueue_quiesce(struct taskqueue *queue) +{ + int ret; + + TQ_LOCK(queue); + do { + ret = taskqueue_drain_tq_queue(queue); + if (ret == 0) + ret = taskqueue_drain_tq_active(queue); + } while (ret != 0); TQ_UNLOCK(queue); } Modified: head/sys/sys/taskqueue.h ============================================================================== --- head/sys/sys/taskqueue.h Wed Nov 21 17:14:57 2018 (r340729) +++ head/sys/sys/taskqueue.h Wed Nov 21 17:18:27 2018 (r340730) @@ -93,6 +93,7 @@ void taskqueue_drain(struct taskqueue *queue, struct t void taskqueue_drain_timeout(struct taskqueue *queue, struct timeout_task *timeout_task); void taskqueue_drain_all(struct taskqueue *queue); +void taskqueue_quiesce(struct taskqueue *queue); void taskqueue_free(struct taskqueue *queue); void taskqueue_run(struct taskqueue *queue); void taskqueue_block(struct taskqueue *queue); From owner-svn-src-all@freebsd.org Wed Nov 21 17:19:09 2018 Return-Path: Delivered-To: svn-src-all@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 8AD8F113F1A0; Wed, 21 Nov 2018 17:19: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 2D9C76BD1A; Wed, 21 Nov 2018 17:19: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 0EA4B23558; Wed, 21 Nov 2018 17:19: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 wALHJ85k055430; Wed, 21 Nov 2018 17:19:08 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wALHJ8bG055429; Wed, 21 Nov 2018 17:19:08 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201811211719.wALHJ8bG055429@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 21 Nov 2018 17:19:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340731 - head/sys/cddl/compat/opensolaris/kern X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/cddl/compat/opensolaris/kern X-SVN-Commit-Revision: 340731 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 2D9C76BD1A X-Spamd-Result: default: False [0.43 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.20)[0.199,0]; NEURAL_HAM_LONG(-0.00)[-0.003,0]; NEURAL_SPAM_MEDIUM(0.23)[0.231,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Nov 2018 17:19:09 -0000 Author: markj Date: Wed Nov 21 17:19:08 2018 New Revision: 340731 URL: https://svnweb.freebsd.org/changeset/base/340731 Log: Use taskqueue_quiesce(9) to implement taskq_wait(). PR: 227784 Reviewed by: cem MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D17975 Modified: head/sys/cddl/compat/opensolaris/kern/opensolaris_taskq.c Modified: head/sys/cddl/compat/opensolaris/kern/opensolaris_taskq.c ============================================================================== --- head/sys/cddl/compat/opensolaris/kern/opensolaris_taskq.c Wed Nov 21 17:18:27 2018 (r340730) +++ head/sys/cddl/compat/opensolaris/kern/opensolaris_taskq.c Wed Nov 21 17:19:08 2018 (r340731) @@ -171,11 +171,11 @@ taskq_dispatch_ent(taskq_t *tq, task_func_t func, void void taskq_wait(taskq_t *tq) { - taskqueue_drain_all(tq->tq_queue); + taskqueue_quiesce(tq->tq_queue); } void taskq_wait_id(taskq_t *tq, taskqid_t id) { - taskq_wait(tq); + taskqueue_drain_all(tq->tq_queue); } From owner-svn-src-all@freebsd.org Wed Nov 21 17:20:15 2018 Return-Path: Delivered-To: svn-src-all@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 C8413113F254; Wed, 21 Nov 2018 17:20:15 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-io1-xd31.google.com (mail-io1-xd31.google.com [IPv6:2607:f8b0:4864:20::d31]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2A7CB6BEBA; Wed, 21 Nov 2018 17:20:15 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by mail-io1-xd31.google.com with SMTP id w7so4594946iom.12; Wed, 21 Nov 2018 09:20:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=eGQ/TPnIFSLSll9Y7FmkGDdAACqOsC0gaUU6GMT+4Jc=; b=Dg3zvMmU7KV5aGPy/gXdQIhJAOipELmz4Zlq7nPRC5s9hbeT1+FThrytN0pW0fz1Uj lDTBqI9QYGzkxwQWnR8c6P+IqYeJMU1fCF5xb0KqK4UeY4PUhow98y+XnkseTkLkZjhr cMdnOozxM/Fis+09CjdKB/BAG0z2HHXlb65Yt9r8Vq2sAdqFeAmYU/4M/Yt1pa7tLmUY ts8o9R9uaLY+zxA6gwrCBuarkHdtve8eGqEc6+eHpzAbcFHq+/sIUWbu3cATBJ0/Hee0 1WmmL8FEfSVLzsX3NaDGvvdlw2wR2/CL6qqTAEqdhSKqpjMGPyyrmJCs9x28LolCVqkH J3GQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=eGQ/TPnIFSLSll9Y7FmkGDdAACqOsC0gaUU6GMT+4Jc=; b=XUxuSUg7ojDVrguvKlBA+m4qQotv5sLwQcExqLkiYy2rxKkFOIetBidHF7g9GBINy0 oTrKavlaasTUfbh8NCFTUxdVzOEr39EUrABYGIGnFbh4ybTvkLALtAIgbswoHaW4TTAi i5WSs/Ji8/xzL6RDpl3+BvMV3U5hodM9m6fp1elogN8E36uqS7t9n5kn+7H16PT6AUAp jNOwPDwQ68DLkMiI9SsloYeV0umNbIpBPhKCb5Y/T4xUcGFTrhbaIrUftU5yS0trFzIi mPut+LOXghZOXsd/UXX60AnaSATdqoTYzIzEmshbQGjC9nEhaxS/sTXAL5DEcFkJYi+c /jWg== X-Gm-Message-State: AA+aEWZesoyJKY7RSBAY4UyKU4jCpystyBhh7frU4FJ+0gTRg40qe3Ii eFq8vfuCtwjyAgb1WyxzSjUDhzeJ9bg= X-Google-Smtp-Source: AFSGD/Xt7vWdlzuwgKvqNP56oxtER0tqCSZxyh6N9cR90NnGZQ8MzeqSP2VeQA7hcwPlQpZuOfByjA== X-Received: by 2002:a6b:7a46:: with SMTP id k6mr5783352iop.60.1542820814289; Wed, 21 Nov 2018 09:20:14 -0800 (PST) Received: from raichu (toroon0560w-lp130-07-64-229-95-98.dsl.bell.ca. [64.229.95.98]) by smtp.gmail.com with ESMTPSA id y5sm943872itb.42.2018.11.21.09.20.13 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 21 Nov 2018 09:20:13 -0800 (PST) Sender: Mark Johnston Date: Wed, 21 Nov 2018 12:20:11 -0500 From: Mark Johnston To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r340731 - head/sys/cddl/compat/opensolaris/kern Message-ID: <20181121172011.GB67072@raichu> References: <201811211719.wALHJ8bG055429@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201811211719.wALHJ8bG055429@repo.freebsd.org> User-Agent: Mutt/1.10.1 (2018-07-13) X-Rspamd-Queue-Id: 2A7CB6BEBA X-Spamd-Result: default: False [-5.23 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_DKIM_ALLOW(-0.20)[gmail.com]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; DMARC_NA(0.00)[freebsd.org]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; RCVD_COUNT_THREE(0.00)[3]; RCVD_TLS_LAST(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; MX_GOOD(-0.01)[cached: alt3.gmail-smtp-in.l.google.com]; RCVD_IN_DNSWL_NONE(0.00)[1.3.d.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.0]; NEURAL_HAM_SHORT(-0.99)[-0.991,0]; IP_SCORE(-2.53)[ip: (-8.64), ipnet: 2607:f8b0::/32(-2.34), asn: 15169(-1.56), country: US(-0.09)]; FORGED_SENDER(0.30)[markj@freebsd.org,markjdb@gmail.com]; MID_RHS_NOT_FQDN(0.50)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; FROM_NEQ_ENVFROM(0.00)[markj@freebsd.org,markjdb@gmail.com] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Nov 2018 17:20:16 -0000 On Wed, Nov 21, 2018 at 05:19:08PM +0000, Mark Johnston wrote: > Author: markj > Date: Wed Nov 21 17:19:08 2018 > New Revision: 340731 > URL: https://svnweb.freebsd.org/changeset/base/340731 > > Log: > Use taskqueue_quiesce(9) to implement taskq_wait(). > > PR: 227784 > Reviewed by: cem > MFC after: 1 week > Sponsored by: The FreeBSD Foundation > Differential Revision: https://reviews.freebsd.org/D17975 Sorry, I forgot: Tested by: wulf From owner-svn-src-all@freebsd.org Wed Nov 21 17:22:32 2018 Return-Path: Delivered-To: svn-src-all@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 5112D113F4BD; Wed, 21 Nov 2018 17:22:32 +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 ECBF16C40F; Wed, 21 Nov 2018 17:22:31 +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 CDD75236E5; Wed, 21 Nov 2018 17:22:31 +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 wALHMV7F060505; Wed, 21 Nov 2018 17:22:31 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wALHMV6p060504; Wed, 21 Nov 2018 17:22:31 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201811211722.wALHMV6p060504@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 21 Nov 2018 17:22:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r340732 - releng/12.0/sbin/dumpon X-SVN-Group: releng X-SVN-Commit-Author: markj X-SVN-Commit-Paths: releng/12.0/sbin/dumpon X-SVN-Commit-Revision: 340732 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: ECBF16C40F X-Spamd-Result: default: False [0.48 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.20)[0.197,0]; NEURAL_SPAM_MEDIUM(0.27)[0.274,0]; NEURAL_SPAM_LONG(0.00)[0.004,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Nov 2018 17:22:32 -0000 Author: markj Date: Wed Nov 21 17:22:31 2018 New Revision: 340732 URL: https://svnweb.freebsd.org/changeset/base/340732 Log: MFstable/12 r340727: dumpon.8: Significantly revamp page Approved by: re (gjb) Modified: releng/12.0/sbin/dumpon/dumpon.8 Directory Properties: releng/12.0/ (props changed) Modified: releng/12.0/sbin/dumpon/dumpon.8 ============================================================================== --- releng/12.0/sbin/dumpon/dumpon.8 Wed Nov 21 17:19:08 2018 (r340731) +++ releng/12.0/sbin/dumpon/dumpon.8 Wed Nov 21 17:22:31 2018 (r340732) @@ -59,27 +59,120 @@ .Sh DESCRIPTION The .Nm -utility is used to specify a device where the kernel can save a crash -dump in the case of a panic. +utility is used to configure where the kernel can save a crash dump in the case +of a panic. .Pp -Calls to +System administrators should typically configure .Nm -normally occur from the system multi-user initialization file -.Pa /etc/rc , -controlled by the -.Dq dumpdev +in a persistent fashion using the +.Xr rc.conf 5 +variables +.Va dumpdev and -.Dq dumpon_flags -variables in the boot time configuration file -.Pa /etc/rc.conf . +.Va dumpon_flags . +For more information on this usage, see +.Xr rc.conf 5 . +.Ss General options +.Bl -tag -width _k_pubkey +.It Fl k Ar pubkey +Configure encrypted kernel dumps. .Pp +A random, one-time symmetric key is automatically generated for bulk kernel +dump encryption every time +.Nm +is used. +The provided +.Ar pubkey +is used to encrypt a copy of the symmetric key. +The encrypted dump contents consist of a standard dump header, the +pubkey-encrypted symmetric key contents, and the symmetric key encrypted core +dump contents. +.Pp +As a result, only someone with the corresponding private key can decrypt the symmetric key. +The symmetric key is necessary to decrypt the kernel core. +The goal of the mechanism is to provide confidentiality. +.Pp +The +.Va pubkey +file should be a PEM-formatted RSA key of at least 1024 bits. +.It Fl l +List the currently configured dump device, or /dev/null if no device is +configured. +.It Fl v +Enable verbose mode. +.It Fl Z +Enable compression (Zstandard). +.It Fl z +Enable compression (gzip). +Only one compression method may be enabled at a time, so +.Fl z +is incompatible with +.Fl Z . +.Pp +Zstandard provides superior compression ratio and performance. +.El +.Ss Netdump +.Nm +may also configure the kernel to dump to a remote +.Xr netdumpd 8 +server. +(The +.Xr netdumpd 8 +server is available in ports.) +.Xr netdump 4 +eliminates the need to reserve space for crash dumps. +It is especially useful in diskless environments. +When +.Nm +is used to configure netdump, the +.Ar device +(or +.Ar iface ) +parameter should specify a network interface (e.g., +.Va igb1 ) . +The specified NIC must be up (online) to configure netdump. +.Pp +.Xr netdump 4 +specific options include: +.Bl -tag -width _g_gateway +.It Fl c Ar client +The local IP address of the +.Xr netdump 4 +client. +.It Fl g Ar gateway +Optional. +If not specified, it is assumed that the +.Ar server +is on the same link as the +.Ar client . +.Pp +If specified, +.Ar gateway +is the address of the first-hop router between the +.Ar client +and the +.Ar server . +The special value +.Dv Dq default +indicates that the currently configured system default route should be used. +.It Fl s Ar server +The IP address of the +.Xr netdumpd 8 +server. +.El +.Pp +All of these options can be specified in the +.Xr rc.conf 5 +variable +.Va dumpon_flags . +.Ss Minidumps The default type of kernel crash dump is the mini crash dump. Mini crash dumps hold only memory pages in use by the kernel. Alternatively, full memory dumps can be enabled by setting the .Va debug.minidump .Xr sysctl 8 variable to 0. -.Pp +.Ss Full dumps For systems using full memory dumps, the size of the specified dump device must be at least the size of physical memory. Even though an additional 64 kB header is added to the dump, the BIOS for a @@ -93,155 +186,18 @@ total amount of physical memory as reported by the .Va hw.physmem .Xr sysctl 8 variable. -.Pp -.Nm -is used to configure a local storage device as the dump device. -With additional parameters, the kernel can instead be configured to -transmit a dump to a remote server using -.Xr netdump 4 . -This eliminates the need to reserve space for saving crash dumps and -is especially useful in diskless environments. -The -.Xr netdump 4 -server address is specified with -.Fl s Ar server , -and the local address is specified with -.Fl c Ar client . -The -.Fl g Ar gateway -parameter may be used to specify a first-hop router to the server, -or to specify that the currently configured default gateway is to -be used. -Note that the -.Xr netdump 4 -configuration is not automatically updated if any network configuration -(e.g., the default route) changes after the -.Nm -invocation. -The name of the interface to be used must be specified as -.Ar iface . -The interface must be up in order to configure -.Xr netdump 4 . -.Pp -The -.Fl k Ar pubkey -flag causes -.Nm -to generate a one-time key for kernel crash dump encryption. -The key will be replaced by a new one when the -.Nm -utility is run again. -The key is encrypted using -.Ar pubkey . -This process is sandboxed using -.Xr capsicum 4 . -Both plain and encrypted keys are sent to the kernel using -.Dv DIOCSKERNELDUMP -.Xr ioctl 2 . -A user can specify the -.Ar pubkey -in the -.Dq dumpon_flags -variable defined in -.Pa /etc/rc.conf -for use with the -.Pa /etc/rc.d/dumpon -.Xr rc 8 -script. -This flag requires a kernel compiled with the -.Dv EKCD -kernel option. -.Pp -The -.Fl z -and -.Fl Z -options configure the kernel to compress the dump before writing it to -the dump device. -This reduces the amount of space required for the dump and accelerates -recovery with -.Xr savecore 8 -since less data needs to be copied from the dump device. -When compression is enabled, the -.Nm -utility will not verify that the dump device is sufficiently large for a full -dump. -The -.Fl z -and -.Fl Z -options cause the dump to be written in -.Xr gzip 1 -and -.Xr zstd 1 -format, respectively. -These flags require a kernel compiled with the -.Dv GZIO -or -.Dv ZSTDIO -kernel options. -.Pp -The -.Fl l -flag causes -.Nm -to print the current dump device or _PATH_DEVNULL ("/dev/null") if no device is -configured. -.Pp -The -.Fl v -flag causes -.Nm -to be verbose about its activity. .Sh IMPLEMENTATION NOTES -Since a -.Xr panic 9 -condition may occur in a situation -where the kernel cannot trust its internal representation -of the state of any given file system, -one of the system swap devices, -and -.Em not -a device containing a file system, -should be used as the dump device. +Because the file system layer is already dead by the time a crash dump +is taken, it is not possible to send crash dumps directly to a file. .Pp The -.Nm -utility operates by opening -.Ar device -and making a -.Dv DIOCSKERNELDUMP -.Xr ioctl 2 -request on it to save kernel crash dumps. -If -.Ar device -is the text string: -.Dq Li off , -.Nm -performs a -.Dv DIOCSKERNELDUMP -.Xr ioctl 2 -on -.Pa /dev/null -and thus instructs the kernel not to save crash dumps. -.Pp -Since -.Nm -cannot be used during kernel initialization, the -.Va dumpdev -variable of .Xr loader 8 -must be used to enable dumps for system panics which occur -during kernel initialization. -.Sh FILES -.Bl -tag -width "/dev/{ada,da}?s?b" -compact -.It Pa /dev/{ada,da}?s?b -standard swap areas -.It Pa /etc/rc.conf -boot-time system configuration -.El +variable +.Va dumpdev +may be used to enable early kernel core dumps for system panics which occur +before userspace starts. .Sh EXAMPLES -In order to generate an RSA private key a user can use the +In order to generate an RSA private key, a user can use the .Xr genrsa 1 tool: .Pp @@ -253,7 +209,8 @@ tool: .Pp .Dl # openssl rsa -in private.pem -out public.pem -pubout .Pp -Once the RSA keys are created the private key should be moved to a safe place. +Once the RSA keys are created in a safe place, the public key may be moved to +the untrusted netdump client machine. Now .Pa public.pem can be used by @@ -278,21 +235,23 @@ reboot: .Pp After reboot .Xr savecore 8 -should be able to save the core dump in the core directory which is +should be able to save the core dump in the +.Va Dq dumpdir +directory, which is .Pa /var/crash by default: .Pp -.Dl # savecore /var/crash /dev/ada0s1b +.Dl # savecore /dev/ada0s1b .Pp Three files should be created in the core directory: .Pa info.# , .Pa key.# and .Pa vmcore_encrypted.# -where +(where .Dq # is the number of the last core dump saved by -.Xr savecore 8 . +.Xr savecore 8 ) . The .Pa vmcore_encrypted.# can be decrypted using the @@ -320,12 +279,15 @@ The core was decrypted properly if .Xr kgdb 1 does not print any errors. Note that the live kernel might be at a different path -which can be examined by looking at the kern.bootfile sysctl. +which can be examined by looking at the +.Va kern.bootfile +.Xr sysctl 8 . .Sh SEE ALSO .Xr gzip 1 , .Xr kgdb 1 , .Xr zstd 1 , .Xr ddb 4 , +.Xr netdump 4 , .Xr fstab 5 , .Xr rc.conf 5 , .Xr config 8 , @@ -341,10 +303,49 @@ The .Nm utility appeared in .Fx 2.0.5 . -.Sh BUGS -Because the file system layer is already dead by the time a crash dump -is taken, it is not possible to send crash dumps directly to a file. .Pp +Support for encrypted kernel core dumps and netdump was added in +.Fx 12.0 . +.Sh AUTHORS +The +.Nm +manual page was written by +.An Mark Johnston Aq Mt markj@FreeBSD.org , +.An Conrad Meyer Aq Mt cem@FreeBSD.org , +.An Konrad Witaszczyk Aq Mt def@FreeBSD.org , +and countless others. +.Sh CAVEATS +To configure encrypted kernel core dumps, the running kernel must have been +compiled with the +.Dv EKCD +option. +.Pp +Netdump does not automatically update the configured +.Ar gateway +if routing topology changes. +.Pp +The size of a compressed dump or a minidump is not a fixed function of RAM +size. +Therefore, when at least one of these options is enabled, the +.Nm +utility cannot verify that the +.Ar device +has sufficient space for a dump. +.Nm +is also unable to verify that a configured +.Xr netdumpd 8 +server has sufficient space for a dump. +.Pp +.Fl Z +requires a kernel compiled with the +.Dv ZSTDIO +kernel option. +Similarly, +.Fl z +requires the +.Dv GZIO +option. +.Sh BUGS It is currently not possible to configure both compression and encryption. The encrypted dump format assumes that the kernel dump size is a multiple of the cipher block size, which may not be true when the dump is compressed. From owner-svn-src-all@freebsd.org Wed Nov 21 17:28:11 2018 Return-Path: Delivered-To: svn-src-all@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 450B4113F6F0; Wed, 21 Nov 2018 17:28:11 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.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 DCDC36C79A; Wed, 21 Nov 2018 17:28:10 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BDEB1236F3; Wed, 21 Nov 2018 17:28:10 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wALHSAAF060890; Wed, 21 Nov 2018 17:28:10 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wALHSA7P060888; Wed, 21 Nov 2018 17:28:10 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201811211728.wALHSA7P060888@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 21 Nov 2018 17:28:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340733 - in head/sys: kern sys X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in head/sys: kern sys X-SVN-Commit-Revision: 340733 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: DCDC36C79A X-Spamd-Result: default: False [0.43 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_MEDIUM(0.23)[0.231,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.20)[0.199,0]; NEURAL_HAM_LONG(-0.00)[-0.003,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Nov 2018 17:28:11 -0000 Author: markj Date: Wed Nov 21 17:28:10 2018 New Revision: 340733 URL: https://svnweb.freebsd.org/changeset/base/340733 Log: Remove KN_HASKQLOCK. It is a write-only flag whose last use was removed in r302235. No functional change intended. Reviewed by: kib MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D18059 Modified: head/sys/kern/kern_event.c head/sys/sys/event.h Modified: head/sys/kern/kern_event.c ============================================================================== --- head/sys/kern/kern_event.c Wed Nov 21 17:22:31 2018 (r340732) +++ head/sys/kern/kern_event.c Wed Nov 21 17:28:10 2018 (r340733) @@ -549,10 +549,8 @@ knote_fork(struct knlist *list, int pid) * The same as knote(), activate the event. */ if ((kn->kn_sfflags & NOTE_TRACK) == 0) { - kn->kn_status |= KN_HASKQLOCK; if (kn->kn_fop->f_event(kn, NOTE_FORK)) KNOTE_ACTIVATE(kn, 1); - kn->kn_status &= ~KN_HASKQLOCK; KQ_UNLOCK(kq); continue; } @@ -2272,10 +2270,8 @@ knote(struct knlist *list, long hint, int lockflags) KNOTE_ACTIVATE(kn, 1); KQ_UNLOCK_FLUX(kq); } else { - kn->kn_status |= KN_HASKQLOCK; if (kn->kn_fop->f_event(kn, hint)) KNOTE_ACTIVATE(kn, 1); - kn->kn_status &= ~KN_HASKQLOCK; KQ_UNLOCK(kq); } } Modified: head/sys/sys/event.h ============================================================================== --- head/sys/sys/event.h Wed Nov 21 17:22:31 2018 (r340732) +++ head/sys/sys/event.h Wed Nov 21 17:28:10 2018 (r340733) @@ -294,7 +294,6 @@ struct knote { #define KN_DETACHED 0x08 /* knote is detached */ #define KN_MARKER 0x20 /* ignore this knote */ #define KN_KQUEUE 0x40 /* this knote belongs to a kq */ -#define KN_HASKQLOCK 0x80 /* for _inevent */ #define KN_SCAN 0x100 /* flux set in kqueue_scan() */ int kn_influx; int kn_sfflags; /* saved filter flags */ From owner-svn-src-all@freebsd.org Wed Nov 21 17:32:11 2018 Return-Path: Delivered-To: svn-src-all@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 08173113F917; Wed, 21 Nov 2018 17:32:11 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.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 A2BF76CB63; Wed, 21 Nov 2018 17:32:10 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6AE0E2386B; Wed, 21 Nov 2018 17:32:10 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wALHWAea065546; Wed, 21 Nov 2018 17:32:10 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wALHWAaP065545; Wed, 21 Nov 2018 17:32:10 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201811211732.wALHWAaP065545@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 21 Nov 2018 17:32:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340734 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 340734 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A2BF76CB63 X-Spamd-Result: default: False [0.45 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.00)[0.001,0]; NEURAL_SPAM_MEDIUM(0.25)[0.253,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.20)[0.198,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Nov 2018 17:32:11 -0000 Author: markj Date: Wed Nov 21 17:32:09 2018 New Revision: 340734 URL: https://svnweb.freebsd.org/changeset/base/340734 Log: Avoid unsynchronized updates to kn_status. kn_status is protected by the kqueue's lock, but we were updating it without the kqueue lock held. For EVFILT_TIMER knotes, there is no knlist lock, so the knote activation could occur during the kn_status update and result in KN_QUEUED being lost, in which case we'd enqueue an already-enqueued knote, corrupting the queue. Fix the problem by setting or clearing KN_DISABLED before dropping the kqueue lock to call into the filter. KN_DISABLED is used only by the core kevent code, so there is no side effect from setting it earlier. Reported and tested by: Sylvain GALLIANO Reviewed by: kib MFC after: 3 days Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D18060 Modified: head/sys/kern/kern_event.c Modified: head/sys/kern/kern_event.c ============================================================================== --- head/sys/kern/kern_event.c Wed Nov 21 17:28:10 2018 (r340733) +++ head/sys/kern/kern_event.c Wed Nov 21 17:32:09 2018 (r340734) @@ -1533,6 +1533,8 @@ findkn: kn->kn_kevent.flags &= ~(EV_ADD | EV_DELETE | EV_ENABLE | EV_DISABLE | EV_FORCEONESHOT); kn->kn_status = KN_DETACHED; + if ((kev->flags & EV_DISABLE) != 0) + kn->kn_status |= KN_DISABLED; kn_enter_flux(kn); error = knote_attach(kn, kq); @@ -1568,6 +1570,11 @@ findkn: KNOTE_ACTIVATE(kn, 1); } + if ((kev->flags & EV_ENABLE) != 0) + kn->kn_status &= ~KN_DISABLED; + else if ((kev->flags & EV_DISABLE) != 0) + kn->kn_status |= KN_DISABLED; + /* * The user may change some filter values after the initial EV_ADD, * but doing so will not reset any filter which has already been @@ -1585,19 +1592,17 @@ findkn: kn->kn_sdata = kev->data; } +done_ev_add: /* * We can get here with kn->kn_knlist == NULL. This can happen when * the initial attach event decides that the event is "completed" - * already. i.e. filt_procattach is called on a zombie process. It - * will call filt_proc which will remove it from the list, and NULL + * already, e.g., filt_procattach() is called on a zombie process. It + * will call filt_proc() which will remove it from the list, and NULL * kn_knlist. + * + * KN_DISABLED will be stable while the knote is in flux, so the + * unlocked read will not race with an update. */ -done_ev_add: - if ((kev->flags & EV_ENABLE) != 0) - kn->kn_status &= ~KN_DISABLED; - else if ((kev->flags & EV_DISABLE) != 0) - kn->kn_status |= KN_DISABLED; - if ((kn->kn_status & KN_DISABLED) == 0) event = kn->kn_fop->f_event(kn, 0); else From owner-svn-src-all@freebsd.org Wed Nov 21 17:33:21 2018 Return-Path: Delivered-To: svn-src-all@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 E83CB113F99C; Wed, 21 Nov 2018 17:33:20 +0000 (UTC) (envelope-from shurd@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 8A8946CD3D; Wed, 21 Nov 2018 17:33:20 +0000 (UTC) (envelope-from shurd@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6767C2388A; Wed, 21 Nov 2018 17:33:20 +0000 (UTC) (envelope-from shurd@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wALHXKDW065666; Wed, 21 Nov 2018 17:33:20 GMT (envelope-from shurd@FreeBSD.org) Received: (from shurd@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wALHXKYi065665; Wed, 21 Nov 2018 17:33:20 GMT (envelope-from shurd@FreeBSD.org) Message-Id: <201811211733.wALHXKYi065665@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: shurd set sender to shurd@FreeBSD.org using -f From: Stephen Hurd Date: Wed, 21 Nov 2018 17:33:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r340735 - releng/12.0/sys/net X-SVN-Group: releng X-SVN-Commit-Author: shurd X-SVN-Commit-Paths: releng/12.0/sys/net X-SVN-Commit-Revision: 340735 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 8A8946CD3D X-Spamd-Result: default: False [0.43 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.20)[0.199,0]; NEURAL_HAM_LONG(-0.00)[-0.003,0]; NEURAL_SPAM_MEDIUM(0.23)[0.231,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Nov 2018 17:33:21 -0000 Author: shurd Date: Wed Nov 21 17:33:19 2018 New Revision: 340735 URL: https://svnweb.freebsd.org/changeset/base/340735 Log: MFS r340729: Prevent POLA violation with TSO/CSUM offload Ensure that any time CSUM_IP_TSO or CSUM_IP6_TSO is set that the corresponding CSUM_IP6?_TCP / CSUM_IP flags are also set. Approved by: re (gjb) Sponsored by: Limelight Networks Modified: releng/12.0/sys/net/iflib.c Directory Properties: releng/12.0/ (props changed) Modified: releng/12.0/sys/net/iflib.c ============================================================================== --- releng/12.0/sys/net/iflib.c Wed Nov 21 17:32:09 2018 (r340734) +++ releng/12.0/sys/net/iflib.c Wed Nov 21 17:33:19 2018 (r340735) @@ -2974,9 +2974,6 @@ iflib_parse_header(iflib_txq_t txq, if_pkt_info_t pi, pi->ipi_ipproto = ip->ip_p; pi->ipi_flags |= IPI_TX_IPV4; - if ((sctx->isc_flags & IFLIB_NEED_ZERO_CSUM) && (pi->ipi_csum_flags & CSUM_IP)) - ip->ip_sum = 0; - /* TCP checksum offload may require TCP header length */ if (IS_TX_OFFLOAD4(pi)) { if (__predict_true(pi->ipi_ipproto == IPPROTO_TCP)) { @@ -2993,6 +2990,10 @@ iflib_parse_header(iflib_txq_t txq, if_pkt_info_t pi, if (IS_TSO4(pi)) { if (__predict_false(ip->ip_p != IPPROTO_TCP)) return (ENXIO); + /* + * TSO always requires hardware checksum offload. + */ + pi->ipi_csum_flags |= (CSUM_IP_TCP | CSUM_IP); th->th_sum = in_pseudo(ip->ip_src.s_addr, ip->ip_dst.s_addr, htons(IPPROTO_TCP)); pi->ipi_tso_segsz = m->m_pkthdr.tso_segsz; @@ -3002,6 +3003,9 @@ iflib_parse_header(iflib_txq_t txq, if_pkt_info_t pi, } } } + if ((sctx->isc_flags & IFLIB_NEED_ZERO_CSUM) && (pi->ipi_csum_flags & CSUM_IP)) + ip->ip_sum = 0; + break; } #endif @@ -3039,9 +3043,7 @@ iflib_parse_header(iflib_txq_t txq, if_pkt_info_t pi, if (__predict_false(ip6->ip6_nxt != IPPROTO_TCP)) return (ENXIO); /* - * The corresponding flag is set by the stack in the IPv4 - * TSO case, but not in IPv6 (at least in FreeBSD 10.2). - * So, set it here because the rest of the flow requires it. + * TSO always requires hardware checksum offload. */ pi->ipi_csum_flags |= CSUM_IP6_TCP; th->th_sum = in6_cksum_pseudo(ip6, 0, IPPROTO_TCP, 0); From owner-svn-src-all@freebsd.org Wed Nov 21 17:47:41 2018 Return-Path: Delivered-To: svn-src-all@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 965C01140135; Wed, 21 Nov 2018 17:47: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 340596D69E; Wed, 21 Nov 2018 17:47:41 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 155C423A47; Wed, 21 Nov 2018 17:47:41 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wALHle1M070754; Wed, 21 Nov 2018 17:47:40 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wALHlek0070752; Wed, 21 Nov 2018 17:47:40 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201811211747.wALHlek0070752@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 21 Nov 2018 17:47:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r340736 - releng/12.0/sbin/dumpon X-SVN-Group: releng X-SVN-Commit-Author: markj X-SVN-Commit-Paths: releng/12.0/sbin/dumpon X-SVN-Commit-Revision: 340736 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 340596D69E X-Spamd-Result: default: False [0.58 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.00)[0.001,0]; NEURAL_SPAM_SHORT(0.33)[0.327,0]; NEURAL_SPAM_MEDIUM(0.25)[0.253,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Nov 2018 17:47:41 -0000 Author: markj Date: Wed Nov 21 17:47:40 2018 New Revision: 340736 URL: https://svnweb.freebsd.org/changeset/base/340736 Log: MFstable/12 r340728: Change dumpon(8)'s handling of -g. Approved by: re (gjb) Modified: releng/12.0/sbin/dumpon/dumpon.8 releng/12.0/sbin/dumpon/dumpon.c Directory Properties: releng/12.0/ (props changed) Modified: releng/12.0/sbin/dumpon/dumpon.8 ============================================================================== --- releng/12.0/sbin/dumpon/dumpon.8 Wed Nov 21 17:33:19 2018 (r340735) +++ releng/12.0/sbin/dumpon/dumpon.8 Wed Nov 21 17:47:40 2018 (r340736) @@ -28,7 +28,7 @@ .\" From: @(#)swapon.8 8.1 (Berkeley) 6/5/93 .\" $FreeBSD$ .\" -.Dd June 13, 2018 +.Dd November 17, 2018 .Dt DUMPON 8 .Os .Sh NAME @@ -46,7 +46,7 @@ .Op Fl k Ar pubkey .Op Fl Z .Op Fl z -.Op Fl g Ar gateway | Li default +.Op Fl g Ar gateway .Fl s Ar server .Fl c Ar client .Ar iface @@ -140,21 +140,22 @@ The local IP address of the .Xr netdump 4 client. .It Fl g Ar gateway -Optional. -If not specified, it is assumed that the -.Ar server -is on the same link as the -.Ar client . -.Pp -If specified, -.Ar gateway -is the address of the first-hop router between the +The first-hop router between .Ar client -and the +and .Ar server . -The special value -.Dv Dq default -indicates that the currently configured system default route should be used. +If the +.Fl g +option is not specified and the system has a default route, the default +router is used as the +.Xr netdump 4 +gateway. +If the +.Fl g +option is not specified and the system does not have a default route, +.Ar server +is assumed to be on the same link as +.Ar client . .It Fl s Ar server The IP address of the .Xr netdumpd 8 Modified: releng/12.0/sbin/dumpon/dumpon.c ============================================================================== --- releng/12.0/sbin/dumpon/dumpon.c Wed Nov 21 17:33:19 2018 (r340735) +++ releng/12.0/sbin/dumpon/dumpon.c Wed Nov 21 17:47:40 2018 (r340736) @@ -88,7 +88,7 @@ usage(void) fprintf(stderr, "usage: dumpon [-v] [-k ] [-Zz] \n" " dumpon [-v] [-k ] [-Zz]\n" - " [-g |default] -s -c \n" + " [-g ] -s -c \n" " dumpon [-v] off\n" " dumpon [-v] -l\n"); exit(EX_USAGE); @@ -109,8 +109,6 @@ find_gateway(const char *ifname) size_t sz; int error, i, ifindex, mib[7]; - ret = NULL; - /* First look up the interface index. */ if (getifaddrs(&ifap) != 0) err(EX_OSERR, "getifaddrs"); @@ -148,6 +146,7 @@ find_gateway(const char *ifname) free(buf); } + ret = NULL; for (next = buf; next < buf + sz; next += rtm->rtm_msglen) { rtm = (struct rt_msghdr *)(void *)next; if (rtm->rtm_version != RTM_VERSION) @@ -452,12 +451,16 @@ main(int argc, char *argv[]) if (inet_aton(client, &ndconf.ndc_client) == 0) errx(EX_USAGE, "invalid client address '%s'", client); - if (gateway == NULL) - gateway = server; - else if (strcmp(gateway, "default") == 0 && - (gateway = find_gateway(argv[0])) == NULL) - errx(EX_NOHOST, - "failed to look up next-hop router for %s", server); + if (gateway == NULL) { + gateway = find_gateway(argv[0]); + if (gateway == NULL) { + if (verbose) + printf( + "failed to look up gateway for %s\n", + server); + gateway = server; + } + } if (inet_aton(gateway, &ndconf.ndc_gateway) == 0) errx(EX_USAGE, "invalid gateway address '%s'", gateway); From owner-svn-src-all@freebsd.org Wed Nov 21 18:01:47 2018 Return-Path: Delivered-To: svn-src-all@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 2071411407AC; Wed, 21 Nov 2018 18:01:47 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-io1-xd42.google.com (mail-io1-xd42.google.com [IPv6:2607:f8b0:4864:20::d42]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 29E8A6E204; Wed, 21 Nov 2018 18:01:46 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by mail-io1-xd42.google.com with SMTP id l14so4563942ioj.5; Wed, 21 Nov 2018 10:01:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=PjFa47lw4/av+KRz46OGp32X+oV8TdQzseRpOqBMSfQ=; b=VmWqz+wAzVJvR5WzvXzwLN5Hys3Bifw9lyLKj33QgAREWvWd8yiFTz5uxQL0/4kfPz kfbEgtOjM9UsTWfSeJf5jwVpre21zJAB88Uil3xcvQV8jprJAjkTbYj62CN61HjEyyzJ znwH9Y0ihCUu2ucjNJK4qwk/CTknYTbAWdiUGuMOYNcyuST/2TjfyoZJnIfWtr1iwIgj ldJsb7GzcFo/m4HVh6Bra/svWtXJr+lcsr4lrQRdCh3/hIb53BAMikhiPnfQ2EtmB95p yDSRk9WN2JJ31uH+EfwwIMiUivwlw2LJ+vQgleSZVIzAAbXbyH9opZf2dNKBawgQPyuL Oklw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=PjFa47lw4/av+KRz46OGp32X+oV8TdQzseRpOqBMSfQ=; b=aKH2ryiNkpoz4P6rXgsVi9d+5yvwdx9JPzLIZWj6TnNif6q0ImSWSirseQuJDT6GjN in3vDEL1oqrdpVzVzI8ipUVK4w6H/zLZM+Ksb+8W/U8vcw5RvD/xa3efwq41btpzMy9y 8aRy2whkY49GwP+lVgiXT1XlmrCtUN7Nh6zywIw9aLH+pJvjLReACCPh+BJxC6JdITKo 5L6Z1plFEcomExIw9T3WBmMU5tjUSsvwm0ct7OfXMCrXig9kvBTVtRYz2CuGMiqTlNi6 rSxDnkBHj6Vpd8gefT1nP+J2v4T3ux/JnAtY3NruI/4diP64JIqn64+lIFHSDyFUNtA9 JxhA== X-Gm-Message-State: AA+aEWbVsUNIvK6IvNkX28f1EkxskrBqyisKW7w55ydpwxXPrUcJZ9ZX Q9WWiJ6mKP84cCaiRYa5iwY= X-Google-Smtp-Source: AFSGD/WhlBaGffyfBbLGr5m0eb/84zdOjyAdv5ofUwJInCsmVyU+6MV65FGZi2wx4ayOYEdHr9QdDA== X-Received: by 2002:a5d:9046:: with SMTP id v6mr5299339ioq.49.1542823305425; Wed, 21 Nov 2018 10:01:45 -0800 (PST) Received: from raichu (toroon0560w-lp130-07-64-229-95-98.dsl.bell.ca. [64.229.95.98]) by smtp.gmail.com with ESMTPSA id q23sm6517252ioi.66.2018.11.21.10.01.44 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 21 Nov 2018 10:01:44 -0800 (PST) Sender: Mark Johnston Date: Wed, 21 Nov 2018 13:01:42 -0500 From: Mark Johnston To: Konstantin Belousov Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r340709 - in head/sys: compat/linuxkpi/common/include/linux vm Message-ID: <20181121180142.GF67072@raichu> References: <201811202249.wAKMnJxH082469@repo.freebsd.org> <20181121003515.GE2630@raichu> <20181121004239.spk72g2pikvse4y7@smtp.freebsd.org> <20181121005148.GF2630@raichu> <20181121005832.ongabjesxlsd7cqu@smtp.freebsd.org> <20181121060716.GE2378@kib.kiev.ua> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20181121060716.GE2378@kib.kiev.ua> User-Agent: Mutt/1.10.1 (2018-07-13) X-Rspamd-Queue-Id: 29E8A6E204 X-Spamd-Result: default: False [-2.50 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_DKIM_ALLOW(-0.20)[gmail.com]; NEURAL_HAM_MEDIUM(-0.96)[-0.961,0]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36]; NEURAL_HAM_LONG(-0.93)[-0.926,0]; MIME_GOOD(-0.10)[text/plain]; RCVD_TLS_LAST(0.00)[]; DMARC_NA(0.00)[freebsd.org]; TO_DN_SOME(0.00)[]; RCVD_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; MX_GOOD(-0.01)[cached: alt3.gmail-smtp-in.l.google.com]; RCVD_IN_DNSWL_NONE(0.00)[2.4.d.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.0]; NEURAL_HAM_SHORT(-0.63)[-0.627,0]; IP_SCORE(-0.28)[ip: (2.60), ipnet: 2607:f8b0::/32(-2.34), asn: 15169(-1.56), country: US(-0.09)]; FREEMAIL_TO(0.00)[gmail.com]; FORGED_SENDER(0.30)[markj@freebsd.org,markjdb@gmail.com]; MID_RHS_NOT_FQDN(0.50)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; FROM_NEQ_ENVFROM(0.00)[markj@freebsd.org,markjdb@gmail.com] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Nov 2018 18:01:47 -0000 On Wed, Nov 21, 2018 at 08:07:16AM +0200, Konstantin Belousov wrote: > On Tue, Nov 20, 2018 at 04:58:32PM -0800, Ben Widawsky wrote: > > On 18-11-20 19:51:48, Mark Johnston wrote: > > > On Tue, Nov 20, 2018 at 04:42:39PM -0800, Ben Widawsky wrote: > > > > On 18-11-20 19:35:15, Mark Johnston wrote: > > > > > On Tue, Nov 20, 2018 at 10:49:19PM +0000, Ben Widawsky wrote: > > > > > > Author: bwidawsk > > > > > > Date: Tue Nov 20 22:49:19 2018 > > > > > > New Revision: 340709 > > > > > > URL: https://svnweb.freebsd.org/changeset/base/340709 > > > > > > > > > > > > Log: > > > > > > linuxkpi: Add some basic swap functions > > > > > > > > > > > > These are used by kms-drm to determine various heuristics relate > > > > > > memory conditions. > > > > > > > > > > > > The number of free swap pages is just a variable, and it can be > > > > > > much cheaper by either adding a new getter, or simply extern'ing > > > > > > swap_total. However, this patch opts to use the more expensive, > > > > > > existing interface - since this isn't an operation in a high per > > > > > > path. > > > > > > > > > > > > This allows us to remove some more gpl linuxkpi and do the follo > > > > > > kms-drm: > > > > > > git rm linuxkpi/gplv2/include/linux/swap.h > > > > > > > > > > > > Reviewed by: mmacy, Johannes Lundberg > > > > > > Approved by: emaste (mentor) > > > > > > Differential Revision: https://reviews.freebsd.org/D18052 > > > > > > > > > > > > Added: > > > > > > head/sys/compat/linuxkpi/common/include/linux/swap.h (contents, props changed) > > > > > > Modified: > > > > > > head/sys/vm/vm_pageout.h > > > > > > head/sys/vm/vm_swapout.c > > > > > > > > > > > > [...] > > > > > > Modified: head/sys/vm/vm_swapout.c > > > > > > ============================================================================== > > > > > > --- head/sys/vm/vm_swapout.c Tue Nov 20 22:24:18 2018 (r340708) > > > > > > +++ head/sys/vm/vm_swapout.c Tue Nov 20 22:49:19 2018 (r340709) > > > > > > @@ -961,3 +961,10 @@ swapout(struct proc *p) > > > > > > p->p_swtick = ticks; > > > > > > return (0); > > > > > > } > > > > > > + > > > > > > +/* Used to determine if the current process is itself the reaper. */ > > > > > > +bool > > > > > > +vm_curproc_is_vmproc(void) > > > > > > +{ > > > > > > + return curproc == vmproc; > > > > > > +} > > > > > > > > > > From a look at how this is used, it should probably be pageproc rather > > > > > than vmproc. There are various code paths that just check > > > > > curproc == pageproc inline. > > > > > > > > > > > > > Could I trouble you for a quick explanation of the difference between the two? > > > > > > pageproc contains the page daemon and laundry threads, which are > > > responsible for managing the LRU page queues and writing back dirty > > > pages. vmproc's main task is to swap out kernel stacks when the system > > > is under memory pressure, and swap them back in when necessary. It's a > > > somewhat legacy component of the system and isn't required. You can > > > build a kernel without it by specifying "options NO_SWAPPING" (which is > > > a somewhat misleading name), in which vm_swapout_dummy.c is compiled > > > instead of vm_swapout.c. > > > > > > > Thanks for the explanation. I indeed want the page daemon. I will put up a patch > > to do that the correct way. Thanks. > > What is the intent ? If the goal is to avoid wait for memory in > deadlock- prone contexts, then you perhaps want to return true for both > pagedaemon and vm daemon, and might be even the buf daemon threads as > well. In this case it's used to enable more aggressive shrinking of GEM objects. The function in question is invoked via a lowmem eventhandler, so the page daemon may indeed be the caller. From owner-svn-src-all@freebsd.org Wed Nov 21 18:18:58 2018 Return-Path: Delivered-To: svn-src-all@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 2C9191140DA5; Wed, 21 Nov 2018 18:18:58 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BE9E76EA4B; Wed, 21 Nov 2018 18:18:57 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9F88723F6A; Wed, 21 Nov 2018 18:18:57 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wALIIvjG086487; Wed, 21 Nov 2018 18:18:57 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wALIIvtQ086486; Wed, 21 Nov 2018 18:18:57 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201811211818.wALIIvtQ086486@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Wed, 21 Nov 2018 18:18:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340737 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head X-SVN-Commit-Author: mav X-SVN-Commit-Paths: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Commit-Revision: 340737 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: BE9E76EA4B X-Spamd-Result: default: False [0.58 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.00)[0.001,0]; NEURAL_SPAM_SHORT(0.33)[0.327,0]; NEURAL_SPAM_MEDIUM(0.25)[0.253,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Nov 2018 18:18:58 -0000 Author: mav Date: Wed Nov 21 18:18:57 2018 New Revision: 340737 URL: https://svnweb.freebsd.org/changeset/base/340737 Log: Revert r340096: 9952 Block size change during zfs receive drops spill block It was reported, and I easily reproduced it, that this change triggers panic when receiving replication stream with enabled embedded blocks, when short file compressing into one embedded block changes its block size. I am not sure that the problem is in this particuler patch, not just triggered by it, but since investigation and fix will take some time, I've decided to revert this for now. PR: 198457, 233277 Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c Wed Nov 21 17:47:40 2018 (r340736) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c Wed Nov 21 18:18:57 2018 (r340737) @@ -2143,7 +2143,6 @@ receive_object(struct receive_writer_arg *rwa, struct { dmu_object_info_t doi; dmu_tx_t *tx; - dmu_buf_t *db; uint64_t object; int err; @@ -2191,14 +2190,12 @@ receive_object(struct receive_writer_arg *rwa, struct tx = dmu_tx_create(rwa->os); dmu_tx_hold_bonus(tx, object); - dmu_tx_hold_write(tx, object, 0, 0); err = dmu_tx_assign(tx, TXG_WAIT); if (err != 0) { dmu_tx_abort(tx); return (err); } - db = NULL; if (object == DMU_NEW_OBJECT) { /* currently free, want to be allocated */ err = dmu_object_claim_dnsize(rwa->os, drro->drr_object, @@ -2206,33 +2203,15 @@ receive_object(struct receive_writer_arg *rwa, struct drro->drr_bonustype, drro->drr_bonuslen, drro->drr_dn_slots << DNODE_SHIFT, tx); } else if (drro->drr_type != doi.doi_type || - (drro->drr_blksz != doi.doi_data_block_size && - doi.doi_max_offset > doi.doi_data_block_size)) { + drro->drr_blksz != doi.doi_data_block_size || + drro->drr_bonustype != doi.doi_bonus_type || + drro->drr_bonuslen != doi.doi_bonus_size) { /* currently allocated, but with different properties */ err = dmu_object_reclaim(rwa->os, drro->drr_object, drro->drr_type, drro->drr_blksz, drro->drr_bonustype, drro->drr_bonuslen, tx); - } else { - /* - * Currently allocated, but with slightly different properties, - * that may change live, like block size or bonus buffer. - * Change those specifically to not loose the spill block, etc. - */ - if (drro->drr_bonustype != doi.doi_bonus_type || - drro->drr_bonuslen != doi.doi_bonus_size) - VERIFY0(dmu_bonus_hold(rwa->os, drro->drr_object, FTAG, - &db)); - if (drro->drr_bonustype != doi.doi_bonus_type) - VERIFY0(dmu_set_bonustype(db, drro->drr_bonustype, tx)); - if (drro->drr_bonuslen != doi.doi_bonus_size) - VERIFY0(dmu_set_bonus(db, drro->drr_bonuslen, tx)); - if (drro->drr_blksz != doi.doi_data_block_size) - err = dmu_object_set_blocksize(rwa->os, drro->drr_object, - drro->drr_blksz, 0, tx); } if (err != 0) { - if (db != NULL) - dmu_buf_rele(db, FTAG); dmu_tx_commit(tx); return (SET_ERROR(EINVAL)); } @@ -2243,9 +2222,9 @@ receive_object(struct receive_writer_arg *rwa, struct drro->drr_compress, tx); if (data != NULL) { - if (db == NULL) - VERIFY0(dmu_bonus_hold(rwa->os, drro->drr_object, FTAG, - &db)); + dmu_buf_t *db; + + VERIFY0(dmu_bonus_hold(rwa->os, drro->drr_object, FTAG, &db)); dmu_buf_will_dirty(db, tx); ASSERT3U(db->db_size, >=, drro->drr_bonuslen); @@ -2256,9 +2235,8 @@ receive_object(struct receive_writer_arg *rwa, struct dmu_ot_byteswap[byteswap].ob_func(db->db_data, drro->drr_bonuslen); } - } - if (db != NULL) dmu_buf_rele(db, FTAG); + } dmu_tx_commit(tx); return (0); From owner-svn-src-all@freebsd.org Wed Nov 21 18:19:16 2018 Return-Path: Delivered-To: svn-src-all@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 A8E851140DD3; Wed, 21 Nov 2018 18:19:16 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 420986EB79; Wed, 21 Nov 2018 18:19:16 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0A00823F6D; Wed, 21 Nov 2018 18:19:16 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wALIJF2H086573; Wed, 21 Nov 2018 18:19:15 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wALIJFGF086572; Wed, 21 Nov 2018 18:19:15 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201811211819.wALIJFGF086572@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Wed, 21 Nov 2018 18:19:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340738 - head/sys/netinet/tcp_stacks X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/sys/netinet/tcp_stacks X-SVN-Commit-Revision: 340738 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 420986EB79 X-Spamd-Result: default: False [0.58 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.00)[0.001,0]; NEURAL_SPAM_MEDIUM(0.25)[0.253,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.33)[0.327,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Nov 2018 18:19:17 -0000 Author: tuexen Date: Wed Nov 21 18:19:15 2018 New Revision: 340738 URL: https://svnweb.freebsd.org/changeset/base/340738 Log: Improve two KASSERTs in the TCP RACK stack. There are two locations where an always true comparison was made in a KASSERT. Replace this by an appropriate check and use a consistent panic message. Also use this code when checking a similar condition. PR: 229664 Reviewed by: rrs@ MFC after: 1 week Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D18021 Modified: head/sys/netinet/tcp_stacks/rack.c Modified: head/sys/netinet/tcp_stacks/rack.c ============================================================================== --- head/sys/netinet/tcp_stacks/rack.c Wed Nov 21 18:18:57 2018 (r340737) +++ head/sys/netinet/tcp_stacks/rack.c Wed Nov 21 18:19:15 2018 (r340738) @@ -7053,12 +7053,10 @@ again: tlen = rsm->r_end - rsm->r_start; if (tlen > tp->t_maxseg) tlen = tp->t_maxseg; -#ifdef INVARIANTS - if (SEQ_GT(tp->snd_una, rsm->r_start)) { - panic("tp:%p rack:%p snd_una:%u rsm:%p r_start:%u", - tp, rack, tp->snd_una, rsm, rsm->r_start); - } -#endif + KASSERT(SEQ_LEQ(tp->snd_una, rsm->r_start), + ("%s:%d: r.start:%u < SND.UNA:%u; tp:%p, rack:%p, rsm:%p", + __func__, __LINE__, + rsm->r_start, tp->snd_una, tp, rack, rsm)); sb_offset = rsm->r_start - tp->snd_una; cwin = min(tp->snd_wnd, tlen); len = cwin; @@ -7069,12 +7067,14 @@ again: len = rsm->r_end - rsm->r_start; sack_rxmit = 1; sendalot = 0; + KASSERT(SEQ_LEQ(tp->snd_una, rsm->r_start), + ("%s:%d: r.start:%u < SND.UNA:%u; tp:%p, rack:%p, rsm:%p", + __func__, __LINE__, + rsm->r_start, tp->snd_una, tp, rack, rsm)); sb_offset = rsm->r_start - tp->snd_una; if (len >= tp->t_maxseg) { len = tp->t_maxseg; } - KASSERT(sb_offset >= 0, ("%s: sack block to the left of una : %d", - __func__, sb_offset)); } else if ((rack->rc_in_persist == 0) && ((rsm = tcp_rack_output(tp, rack, cts)) != NULL)) { long tlen; @@ -7099,6 +7099,10 @@ again: } #endif tlen = rsm->r_end - rsm->r_start; + KASSERT(SEQ_LEQ(tp->snd_una, rsm->r_start), + ("%s:%d: r.start:%u < SND.UNA:%u; tp:%p, rack:%p, rsm:%p", + __func__, __LINE__, + rsm->r_start, tp->snd_una, tp, rack, rsm)); sb_offset = rsm->r_start - tp->snd_una; if (tlen > rack->r_ctl.rc_prr_sndcnt) { len = rack->r_ctl.rc_prr_sndcnt; @@ -7120,8 +7124,6 @@ again: goto just_return_nolock; } } - KASSERT(sb_offset >= 0, ("%s: sack block to the left of una : %d", - __func__, sb_offset)); if (len > 0) { sub_from_prr = 1; sack_rxmit = 1; From owner-svn-src-all@freebsd.org Wed Nov 21 18:53:14 2018 Return-Path: Delivered-To: svn-src-all@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 A8BC11141D98; Wed, 21 Nov 2018 18:53:14 +0000 (UTC) (envelope-from marius@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 38E88700DD; Wed, 21 Nov 2018 18:53:14 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 160A024608; Wed, 21 Nov 2018 18:53:14 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wALIrDav006606; Wed, 21 Nov 2018 18:53:13 GMT (envelope-from marius@FreeBSD.org) Received: (from marius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wALIrD7p006605; Wed, 21 Nov 2018 18:53:13 GMT (envelope-from marius@FreeBSD.org) Message-Id: <201811211853.wALIrD7p006605@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: marius set sender to marius@FreeBSD.org using -f From: Marius Strobl Date: Wed, 21 Nov 2018 18:53:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r340739 - stable/12/sys/dev/mmc X-SVN-Group: stable-12 X-SVN-Commit-Author: marius X-SVN-Commit-Paths: stable/12/sys/dev/mmc X-SVN-Commit-Revision: 340739 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 38E88700DD X-Spamd-Result: default: False [0.77 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.47)[0.468,0]; NEURAL_SPAM_MEDIUM(0.29)[0.287,0]; NEURAL_SPAM_LONG(0.01)[0.010,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Nov 2018 18:53:15 -0000 Author: marius Date: Wed Nov 21 18:53:13 2018 New Revision: 340739 URL: https://svnweb.freebsd.org/changeset/base/340739 Log: MFC: r340495 - Restore setting the clock for devices which support the default/legacy transfer mode only (lost with r321385). [1] - Similarly, don't try to set the power class on MMC devices that comply to version 4.0 of the system specification but are operated in default/ legacy transfer or 1-bit bus mode as no power class is specified for these cases. Trying to set a power class nevertheless resulted in an - albeit harmless - error message. PR: 231713 [1] Modified: stable/12/sys/dev/mmc/mmc.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/mmc/mmc.c ============================================================================== --- stable/12/sys/dev/mmc/mmc.c Wed Nov 21 18:19:15 2018 (r340738) +++ stable/12/sys/dev/mmc/mmc.c Wed Nov 21 18:53:13 2018 (r340739) @@ -830,9 +830,14 @@ mmc_set_power_class(struct mmc_softc *sc, struct mmc_i const uint8_t *ext_csd; uint32_t clock; uint8_t value; + enum mmc_bus_timing timing; + enum mmc_bus_width bus_width; dev = sc->dev; - if (mmcbr_get_mode(dev) != mode_mmc || ivar->csd.spec_vers < 4) + timing = mmcbr_get_timing(dev); + bus_width = ivar->bus_width; + if (mmcbr_get_mode(dev) != mode_mmc || ivar->csd.spec_vers < 4 || + timing == bus_timing_normal || bus_width == bus_width_1) return (MMC_ERR_NONE); value = 0; @@ -843,8 +848,8 @@ mmc_set_power_class(struct mmc_softc *sc, struct mmc_i if (clock <= MMC_TYPE_HS_26_MAX) value = ext_csd[EXT_CSD_PWR_CL_26_195]; else if (clock <= MMC_TYPE_HS_52_MAX) { - if (mmcbr_get_timing(dev) >= bus_timing_mmc_ddr52 && - ivar->bus_width >= bus_width_4) + if (timing >= bus_timing_mmc_ddr52 && + bus_width >= bus_width_4) value = ext_csd[EXT_CSD_PWR_CL_52_195_DDR]; else value = ext_csd[EXT_CSD_PWR_CL_52_195]; @@ -863,13 +868,13 @@ mmc_set_power_class(struct mmc_softc *sc, struct mmc_i if (clock <= MMC_TYPE_HS_26_MAX) value = ext_csd[EXT_CSD_PWR_CL_26_360]; else if (clock <= MMC_TYPE_HS_52_MAX) { - if (mmcbr_get_timing(dev) == bus_timing_mmc_ddr52 && - ivar->bus_width >= bus_width_4) + if (timing == bus_timing_mmc_ddr52 && + bus_width >= bus_width_4) value = ext_csd[EXT_CSD_PWR_CL_52_360_DDR]; else value = ext_csd[EXT_CSD_PWR_CL_52_360]; } else if (clock <= MMC_TYPE_HS200_HS400ES_MAX) { - if (ivar->bus_width == bus_width_8) + if (bus_width == bus_width_8) value = ext_csd[EXT_CSD_PWR_CL_200_360_DDR]; else value = ext_csd[EXT_CSD_PWR_CL_200_360]; @@ -881,7 +886,7 @@ mmc_set_power_class(struct mmc_softc *sc, struct mmc_i return (MMC_ERR_INVALID); } - if (ivar->bus_width == bus_width_8) + if (bus_width == bus_width_8) value = (value & EXT_CSD_POWER_CLASS_8BIT_MASK) >> EXT_CSD_POWER_CLASS_8BIT_SHIFT; else @@ -2164,7 +2169,7 @@ mmc_calculate_clock(struct mmc_softc *sc) for (i = 0; i < sc->child_count; i++) { ivar = device_get_ivars(sc->child_list[i]); if ((ivar->timings & ~(1 << bus_timing_normal)) == 0) - continue; + goto clock; rca = ivar->rca; if (mmc_select_card(sc, rca) != MMC_ERR_NONE) { @@ -2230,6 +2235,7 @@ mmc_calculate_clock(struct mmc_softc *sc) } } +clock: /* Set clock (must be done before initial tuning). */ mmcbr_set_clock(dev, max_dtr); mmcbr_update_ios(dev); From owner-svn-src-all@freebsd.org Wed Nov 21 18:53:31 2018 Return-Path: Delivered-To: svn-src-all@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 411D51141DE5; Wed, 21 Nov 2018 18:53:31 +0000 (UTC) (envelope-from marius@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 DE10F701F6; Wed, 21 Nov 2018 18:53:30 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C0AE12460D; Wed, 21 Nov 2018 18:53:30 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wALIrUHg006675; Wed, 21 Nov 2018 18:53:30 GMT (envelope-from marius@FreeBSD.org) Received: (from marius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wALIrUcB006674; Wed, 21 Nov 2018 18:53:30 GMT (envelope-from marius@FreeBSD.org) Message-Id: <201811211853.wALIrUcB006674@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: marius set sender to marius@FreeBSD.org using -f From: Marius Strobl Date: Wed, 21 Nov 2018 18:53:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r340740 - stable/11/sys/dev/mmc X-SVN-Group: stable-11 X-SVN-Commit-Author: marius X-SVN-Commit-Paths: stable/11/sys/dev/mmc X-SVN-Commit-Revision: 340740 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: DE10F701F6 X-Spamd-Result: default: False [0.77 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.01)[0.010,0]; NEURAL_SPAM_MEDIUM(0.29)[0.287,0]; NEURAL_SPAM_SHORT(0.47)[0.468,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Nov 2018 18:53:31 -0000 Author: marius Date: Wed Nov 21 18:53:30 2018 New Revision: 340740 URL: https://svnweb.freebsd.org/changeset/base/340740 Log: MFC: r340495 - Restore setting the clock for devices which support the default/legacy transfer mode only (lost with r321385). [1] - Similarly, don't try to set the power class on MMC devices that comply to version 4.0 of the system specification but are operated in default/ legacy transfer or 1-bit bus mode as no power class is specified for these cases. Trying to set a power class nevertheless resulted in an - albeit harmless - error message. PR: 231713 [1] Modified: stable/11/sys/dev/mmc/mmc.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/mmc/mmc.c ============================================================================== --- stable/11/sys/dev/mmc/mmc.c Wed Nov 21 18:53:13 2018 (r340739) +++ stable/11/sys/dev/mmc/mmc.c Wed Nov 21 18:53:30 2018 (r340740) @@ -828,9 +828,14 @@ mmc_set_power_class(struct mmc_softc *sc, struct mmc_i const uint8_t *ext_csd; uint32_t clock; uint8_t value; + enum mmc_bus_timing timing; + enum mmc_bus_width bus_width; dev = sc->dev; - if (mmcbr_get_mode(dev) != mode_mmc || ivar->csd.spec_vers < 4) + timing = mmcbr_get_timing(dev); + bus_width = ivar->bus_width; + if (mmcbr_get_mode(dev) != mode_mmc || ivar->csd.spec_vers < 4 || + timing == bus_timing_normal || bus_width == bus_width_1) return (MMC_ERR_NONE); value = 0; @@ -841,8 +846,8 @@ mmc_set_power_class(struct mmc_softc *sc, struct mmc_i if (clock <= MMC_TYPE_HS_26_MAX) value = ext_csd[EXT_CSD_PWR_CL_26_195]; else if (clock <= MMC_TYPE_HS_52_MAX) { - if (mmcbr_get_timing(dev) >= bus_timing_mmc_ddr52 && - ivar->bus_width >= bus_width_4) + if (timing >= bus_timing_mmc_ddr52 && + bus_width >= bus_width_4) value = ext_csd[EXT_CSD_PWR_CL_52_195_DDR]; else value = ext_csd[EXT_CSD_PWR_CL_52_195]; @@ -861,13 +866,13 @@ mmc_set_power_class(struct mmc_softc *sc, struct mmc_i if (clock <= MMC_TYPE_HS_26_MAX) value = ext_csd[EXT_CSD_PWR_CL_26_360]; else if (clock <= MMC_TYPE_HS_52_MAX) { - if (mmcbr_get_timing(dev) == bus_timing_mmc_ddr52 && - ivar->bus_width >= bus_width_4) + if (timing == bus_timing_mmc_ddr52 && + bus_width >= bus_width_4) value = ext_csd[EXT_CSD_PWR_CL_52_360_DDR]; else value = ext_csd[EXT_CSD_PWR_CL_52_360]; } else if (clock <= MMC_TYPE_HS200_HS400ES_MAX) { - if (ivar->bus_width == bus_width_8) + if (bus_width == bus_width_8) value = ext_csd[EXT_CSD_PWR_CL_200_360_DDR]; else value = ext_csd[EXT_CSD_PWR_CL_200_360]; @@ -879,7 +884,7 @@ mmc_set_power_class(struct mmc_softc *sc, struct mmc_i return (MMC_ERR_INVALID); } - if (ivar->bus_width == bus_width_8) + if (bus_width == bus_width_8) value = (value & EXT_CSD_POWER_CLASS_8BIT_MASK) >> EXT_CSD_POWER_CLASS_8BIT_SHIFT; else @@ -2165,7 +2170,7 @@ mmc_calculate_clock(struct mmc_softc *sc) for (i = 0; i < sc->child_count; i++) { ivar = device_get_ivars(sc->child_list[i]); if ((ivar->timings & ~(1 << bus_timing_normal)) == 0) - continue; + goto clock; rca = ivar->rca; if (mmc_select_card(sc, rca) != MMC_ERR_NONE) { @@ -2231,6 +2236,7 @@ mmc_calculate_clock(struct mmc_softc *sc) } } +clock: /* Set clock (must be done before initial tuning). */ mmcbr_set_clock(dev, max_dtr); mmcbr_update_ios(dev); From owner-svn-src-all@freebsd.org Wed Nov 21 18:54:39 2018 Return-Path: Delivered-To: svn-src-all@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 232141141EB8; Wed, 21 Nov 2018 18:54:39 +0000 (UTC) (envelope-from marius@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 BAC50703C5; Wed, 21 Nov 2018 18:54:38 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9CA7424614; Wed, 21 Nov 2018 18:54:38 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wALIscI2006774; Wed, 21 Nov 2018 18:54:38 GMT (envelope-from marius@FreeBSD.org) Received: (from marius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wALIscrs006773; Wed, 21 Nov 2018 18:54:38 GMT (envelope-from marius@FreeBSD.org) Message-Id: <201811211854.wALIscrs006773@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: marius set sender to marius@FreeBSD.org using -f From: Marius Strobl Date: Wed, 21 Nov 2018 18:54:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r340741 - stable/10/sys/dev/mmc X-SVN-Group: stable-10 X-SVN-Commit-Author: marius X-SVN-Commit-Paths: stable/10/sys/dev/mmc X-SVN-Commit-Revision: 340741 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: BAC50703C5 X-Spamd-Result: default: False [0.77 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.01)[0.010,0]; NEURAL_SPAM_SHORT(0.47)[0.468,0]; NEURAL_SPAM_MEDIUM(0.29)[0.287,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Nov 2018 18:54:39 -0000 Author: marius Date: Wed Nov 21 18:54:38 2018 New Revision: 340741 URL: https://svnweb.freebsd.org/changeset/base/340741 Log: MFC: r340495 - Restore setting the clock for devices which support the default/legacy transfer mode only (lost with r321385). [1] - Similarly, don't try to set the power class on MMC devices that comply to version 4.0 of the system specification but are operated in default/ legacy transfer or 1-bit bus mode as no power class is specified for these cases. Trying to set a power class nevertheless resulted in an - albeit harmless - error message. PR: 231713 [1] Modified: stable/10/sys/dev/mmc/mmc.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/mmc/mmc.c ============================================================================== --- stable/10/sys/dev/mmc/mmc.c Wed Nov 21 18:53:30 2018 (r340740) +++ stable/10/sys/dev/mmc/mmc.c Wed Nov 21 18:54:38 2018 (r340741) @@ -829,9 +829,14 @@ mmc_set_power_class(struct mmc_softc *sc, struct mmc_i const uint8_t *ext_csd; uint32_t clock; uint8_t value; + enum mmc_bus_timing timing; + enum mmc_bus_width bus_width; dev = sc->dev; - if (mmcbr_get_mode(dev) != mode_mmc || ivar->csd.spec_vers < 4) + timing = mmcbr_get_timing(dev); + bus_width = ivar->bus_width; + if (mmcbr_get_mode(dev) != mode_mmc || ivar->csd.spec_vers < 4 || + timing == bus_timing_normal || bus_width == bus_width_1) return (MMC_ERR_NONE); value = 0; @@ -842,8 +847,8 @@ mmc_set_power_class(struct mmc_softc *sc, struct mmc_i if (clock <= MMC_TYPE_HS_26_MAX) value = ext_csd[EXT_CSD_PWR_CL_26_195]; else if (clock <= MMC_TYPE_HS_52_MAX) { - if (mmcbr_get_timing(dev) >= bus_timing_mmc_ddr52 && - ivar->bus_width >= bus_width_4) + if (timing >= bus_timing_mmc_ddr52 && + bus_width >= bus_width_4) value = ext_csd[EXT_CSD_PWR_CL_52_195_DDR]; else value = ext_csd[EXT_CSD_PWR_CL_52_195]; @@ -862,13 +867,13 @@ mmc_set_power_class(struct mmc_softc *sc, struct mmc_i if (clock <= MMC_TYPE_HS_26_MAX) value = ext_csd[EXT_CSD_PWR_CL_26_360]; else if (clock <= MMC_TYPE_HS_52_MAX) { - if (mmcbr_get_timing(dev) == bus_timing_mmc_ddr52 && - ivar->bus_width >= bus_width_4) + if (timing == bus_timing_mmc_ddr52 && + bus_width >= bus_width_4) value = ext_csd[EXT_CSD_PWR_CL_52_360_DDR]; else value = ext_csd[EXT_CSD_PWR_CL_52_360]; } else if (clock <= MMC_TYPE_HS200_HS400ES_MAX) { - if (ivar->bus_width == bus_width_8) + if (bus_width == bus_width_8) value = ext_csd[EXT_CSD_PWR_CL_200_360_DDR]; else value = ext_csd[EXT_CSD_PWR_CL_200_360]; @@ -880,7 +885,7 @@ mmc_set_power_class(struct mmc_softc *sc, struct mmc_i return (MMC_ERR_INVALID); } - if (ivar->bus_width == bus_width_8) + if (bus_width == bus_width_8) value = (value & EXT_CSD_POWER_CLASS_8BIT_MASK) >> EXT_CSD_POWER_CLASS_8BIT_SHIFT; else @@ -2166,7 +2171,7 @@ mmc_calculate_clock(struct mmc_softc *sc) for (i = 0; i < sc->child_count; i++) { ivar = device_get_ivars(sc->child_list[i]); if ((ivar->timings & ~(1 << bus_timing_normal)) == 0) - continue; + goto clock; rca = ivar->rca; if (mmc_select_card(sc, rca) != MMC_ERR_NONE) { @@ -2232,6 +2237,7 @@ mmc_calculate_clock(struct mmc_softc *sc) } } +clock: /* Set clock (must be done before initial tuning). */ mmcbr_set_clock(dev, max_dtr); mmcbr_update_ios(dev); From owner-svn-src-all@freebsd.org Wed Nov 21 18:56:16 2018 Return-Path: Delivered-To: svn-src-all@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 C858A1141FE7; Wed, 21 Nov 2018 18:56:16 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.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 7154A705B1; Wed, 21 Nov 2018 18:56:16 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 53D0E24618; Wed, 21 Nov 2018 18:56:16 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wALIuGmT006946; Wed, 21 Nov 2018 18:56:16 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wALIuFvk006942; Wed, 21 Nov 2018 18:56:15 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201811211856.wALIuFvk006942@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Wed, 21 Nov 2018 18:56:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340742 - in head/sys: kern sys X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: in head/sys: kern sys X-SVN-Commit-Revision: 340742 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 7154A705B1 X-Spamd-Result: default: False [0.79 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.52)[0.516,0]; NEURAL_SPAM_MEDIUM(0.27)[0.274,0]; NEURAL_SPAM_LONG(0.00)[0.004,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Nov 2018 18:56:17 -0000 Author: mjg Date: Wed Nov 21 18:56:15 2018 New Revision: 340742 URL: https://svnweb.freebsd.org/changeset/base/340742 Log: proc: implement pid hash locks and an iterator forks, exits and waits are frequently stalled during poudriere -j 128 runs due to killpg and process list exports performed for each package. Both uses take the allproc lock. The latter case can be modified to iterate over the hash with finer grained locking instead. Reviewed by: kib Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D17817 Modified: head/sys/kern/kern_exit.c head/sys/kern/kern_fork.c head/sys/kern/kern_proc.c head/sys/sys/proc.h Modified: head/sys/kern/kern_exit.c ============================================================================== --- head/sys/kern/kern_exit.c Wed Nov 21 18:54:38 2018 (r340741) +++ head/sys/kern/kern_exit.c Wed Nov 21 18:56:15 2018 (r340742) @@ -435,7 +435,6 @@ exit1(struct thread *td, int rval, int signo) sx_xlock(&allproc_lock); LIST_REMOVE(p, p_list); LIST_INSERT_HEAD(&zombproc, p, p_list); - LIST_REMOVE(p, p_hash); sx_xunlock(&allproc_lock); /* @@ -876,6 +875,9 @@ proc_reap(struct thread *td, struct proc *p, int *stat sx_xlock(&allproc_lock); LIST_REMOVE(p, p_list); /* off zombproc */ sx_xunlock(&allproc_lock); + sx_xlock(PIDHASHLOCK(p->p_pid)); + LIST_REMOVE(p, p_hash); + sx_xunlock(PIDHASHLOCK(p->p_pid)); LIST_REMOVE(p, p_sibling); reaper_abandon_children(p, true); LIST_REMOVE(p, p_reapsibling); Modified: head/sys/kern/kern_fork.c ============================================================================== --- head/sys/kern/kern_fork.c Wed Nov 21 18:54:38 2018 (r340741) +++ head/sys/kern/kern_fork.c Wed Nov 21 18:56:15 2018 (r340742) @@ -406,7 +406,9 @@ do_fork(struct thread *td, struct fork_req *fr, struct AUDIT_ARG_PID(p2->p_pid); LIST_INSERT_HEAD(&allproc, p2, p_list); allproc_gen++; + sx_xlock(PIDHASHLOCK(p2->p_pid)); LIST_INSERT_HEAD(PIDHASH(p2->p_pid), p2, p_hash); + sx_xunlock(PIDHASHLOCK(p2->p_pid)); PROC_LOCK(p2); PROC_LOCK(p1); Modified: head/sys/kern/kern_proc.c ============================================================================== --- head/sys/kern/kern_proc.c Wed Nov 21 18:54:38 2018 (r340741) +++ head/sys/kern/kern_proc.c Wed Nov 21 18:56:15 2018 (r340742) @@ -118,7 +118,9 @@ static struct proc *zpfind_locked(pid_t pid); * Other process lists */ struct pidhashhead *pidhashtbl; +struct sx *pidhashtbl_lock; u_long pidhash; +u_long pidhashlock; struct pgrphashhead *pgrphashtbl; u_long pgrphash; struct proclist allproc; @@ -173,6 +175,7 @@ CTASSERT(sizeof(struct kinfo_proc32) == KINFO_PROC32_S void procinit(void) { + u_long i; sx_init(&allproc_lock, "allproc"); sx_init(&proctree_lock, "proctree"); @@ -180,6 +183,13 @@ procinit(void) LIST_INIT(&allproc); LIST_INIT(&zombproc); pidhashtbl = hashinit(maxproc / 4, M_PROC, &pidhash); + pidhashlock = (pidhash + 1) / 64; + if (pidhashlock > 0) + pidhashlock--; + pidhashtbl_lock = malloc(sizeof(*pidhashtbl_lock) * (pidhashlock + 1), + M_PROC, M_WAITOK | M_ZERO); + for (i = 0; i < pidhashlock + 1; i++) + sx_init(&pidhashtbl_lock[i], "pidhash"); pgrphashtbl = hashinit(maxproc / 4, M_PROC, &pgrphash); proc_zone = uma_zcreate("PROC", sched_sizeof_proc(), proc_ctor, proc_dtor, proc_init, proc_fini, @@ -306,7 +316,7 @@ pfind_locked(pid_t pid) LIST_FOREACH(p, PIDHASH(pid), p_hash) { if (p->p_pid == pid) { PROC_LOCK(p); - if (p->p_state == PRS_NEW) { + if (p->p_state == PRS_NEW || p->p_state == PRS_ZOMBIE) { PROC_UNLOCK(p); p = NULL; } @@ -1421,13 +1431,134 @@ sysctl_out_proc(struct proc *p, struct sysctl_req *req return (0); } +int +proc_iterate(int (*cb)(struct proc *, void *), void *cbarg) +{ + struct proc *p; + int error, i, j; + + for (i = 0; i < pidhashlock + 1; i++) { + sx_slock(&pidhashtbl_lock[i]); + for (j = i; j <= pidhash; j += pidhashlock + 1) { + LIST_FOREACH(p, &pidhashtbl[j], p_hash) { + if (p->p_state == PRS_NEW) + continue; + error = cb(p, cbarg); + PROC_LOCK_ASSERT(p, MA_NOTOWNED); + if (error != 0) { + sx_sunlock(&pidhashtbl_lock[i]); + return (error); + } + } + } + sx_sunlock(&pidhashtbl_lock[i]); + } + return (0); +} + +struct kern_proc_out_args { + struct sysctl_req *req; + int flags; + int oid_number; + int *name; +}; + static int +sysctl_kern_proc_iterate(struct proc *p, void *origarg) +{ + struct kern_proc_out_args *arg = origarg; + int *name = arg->name; + int oid_number = arg->oid_number; + int flags = arg->flags; + struct sysctl_req *req = arg->req; + int error = 0; + + PROC_LOCK(p); + + KASSERT(p->p_ucred != NULL, + ("process credential is NULL for non-NEW proc")); + /* + * Show a user only appropriate processes. + */ + if (p_cansee(curthread, p)) + goto skip; + /* + * TODO - make more efficient (see notes below). + * do by session. + */ + switch (oid_number) { + + case KERN_PROC_GID: + if (p->p_ucred->cr_gid != (gid_t)name[0]) + goto skip; + break; + + case KERN_PROC_PGRP: + /* could do this by traversing pgrp */ + if (p->p_pgrp == NULL || + p->p_pgrp->pg_id != (pid_t)name[0]) + goto skip; + break; + + case KERN_PROC_RGID: + if (p->p_ucred->cr_rgid != (gid_t)name[0]) + goto skip; + break; + + case KERN_PROC_SESSION: + if (p->p_session == NULL || + p->p_session->s_sid != (pid_t)name[0]) + goto skip; + break; + + case KERN_PROC_TTY: + if ((p->p_flag & P_CONTROLT) == 0 || + p->p_session == NULL) + goto skip; + /* XXX proctree_lock */ + SESS_LOCK(p->p_session); + if (p->p_session->s_ttyp == NULL || + tty_udev(p->p_session->s_ttyp) != + (dev_t)name[0]) { + SESS_UNLOCK(p->p_session); + goto skip; + } + SESS_UNLOCK(p->p_session); + break; + + case KERN_PROC_UID: + if (p->p_ucred->cr_uid != (uid_t)name[0]) + goto skip; + break; + + case KERN_PROC_RUID: + if (p->p_ucred->cr_ruid != (uid_t)name[0]) + goto skip; + break; + + case KERN_PROC_PROC: + break; + + default: + break; + + } + error = sysctl_out_proc(p, req, flags); + PROC_LOCK_ASSERT(p, MA_NOTOWNED); + return (error); +skip: + PROC_UNLOCK(p); + return (0); +} + +static int sysctl_kern_proc(SYSCTL_HANDLER_ARGS) { + struct kern_proc_out_args iterarg; int *name = (int *)arg1; u_int namelen = arg2; struct proc *p; - int flags, doingzomb, oid_number; + int flags, oid_number; int error = 0; oid_number = oidp->oid_number; @@ -1479,112 +1610,11 @@ sysctl_kern_proc(SYSCTL_HANDLER_ARGS) if (error != 0) return (error); } - sx_slock(&allproc_lock); - for (doingzomb=0 ; doingzomb < 2 ; doingzomb++) { - if (!doingzomb) - p = LIST_FIRST(&allproc); - else - p = LIST_FIRST(&zombproc); - for (; p != NULL; p = LIST_NEXT(p, p_list)) { - /* - * Skip embryonic processes. - */ - if (p->p_state == PRS_NEW) - continue; - PROC_LOCK(p); - KASSERT(p->p_ucred != NULL, - ("process credential is NULL for non-NEW proc")); - /* - * Show a user only appropriate processes. - */ - if (p_cansee(curthread, p)) { - PROC_UNLOCK(p); - continue; - } - /* - * TODO - make more efficient (see notes below). - * do by session. - */ - switch (oid_number) { - - case KERN_PROC_GID: - if (p->p_ucred->cr_gid != (gid_t)name[0]) { - PROC_UNLOCK(p); - continue; - } - break; - - case KERN_PROC_PGRP: - /* could do this by traversing pgrp */ - if (p->p_pgrp == NULL || - p->p_pgrp->pg_id != (pid_t)name[0]) { - PROC_UNLOCK(p); - continue; - } - break; - - case KERN_PROC_RGID: - if (p->p_ucred->cr_rgid != (gid_t)name[0]) { - PROC_UNLOCK(p); - continue; - } - break; - - case KERN_PROC_SESSION: - if (p->p_session == NULL || - p->p_session->s_sid != (pid_t)name[0]) { - PROC_UNLOCK(p); - continue; - } - break; - - case KERN_PROC_TTY: - if ((p->p_flag & P_CONTROLT) == 0 || - p->p_session == NULL) { - PROC_UNLOCK(p); - continue; - } - /* XXX proctree_lock */ - SESS_LOCK(p->p_session); - if (p->p_session->s_ttyp == NULL || - tty_udev(p->p_session->s_ttyp) != - (dev_t)name[0]) { - SESS_UNLOCK(p->p_session); - PROC_UNLOCK(p); - continue; - } - SESS_UNLOCK(p->p_session); - break; - - case KERN_PROC_UID: - if (p->p_ucred->cr_uid != (uid_t)name[0]) { - PROC_UNLOCK(p); - continue; - } - break; - - case KERN_PROC_RUID: - if (p->p_ucred->cr_ruid != (uid_t)name[0]) { - PROC_UNLOCK(p); - continue; - } - break; - - case KERN_PROC_PROC: - break; - - default: - break; - - } - - error = sysctl_out_proc(p, req, flags); - if (error) - goto out; - } - } -out: - sx_sunlock(&allproc_lock); + iterarg.flags = flags; + iterarg.oid_number = oid_number; + iterarg.req = req; + iterarg.name = name; + error = proc_iterate(sysctl_kern_proc_iterate, &iterarg); return (error); } Modified: head/sys/sys/proc.h ============================================================================== --- head/sys/sys/proc.h Wed Nov 21 18:54:38 2018 (r340741) +++ head/sys/sys/proc.h Wed Nov 21 18:56:15 2018 (r340742) @@ -942,8 +942,11 @@ extern pid_t pid_max; #define THREAD_CAN_SLEEP() ((curthread)->td_no_sleeping == 0) #define PIDHASH(pid) (&pidhashtbl[(pid) & pidhash]) +#define PIDHASHLOCK(pid) (&pidhashtbl_lock[((pid) & pidhashlock)]) extern LIST_HEAD(pidhashhead, proc) *pidhashtbl; +extern struct sx *pidhashtbl_lock; extern u_long pidhash; +extern u_long pidhashlock; #define TIDHASH(tid) (&tidhashtbl[(tid) & tidhash]) extern LIST_HEAD(tidhashhead, thread) *tidhashtbl; extern u_long tidhash; @@ -1046,6 +1049,7 @@ int proc_getargv(struct thread *td, struct proc *p, st int proc_getauxv(struct thread *td, struct proc *p, struct sbuf *sb); int proc_getenvv(struct thread *td, struct proc *p, struct sbuf *sb); void procinit(void); +int proc_iterate(int (*cb)(struct proc *, void *), void *cbarg); void proc_linkup0(struct proc *p, struct thread *td); void proc_linkup(struct proc *p, struct thread *td); struct proc *proc_realparent(struct proc *child); From owner-svn-src-all@freebsd.org Wed Nov 21 19:01:48 2018 Return-Path: Delivered-To: svn-src-all@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 5CAE5114235E; Wed, 21 Nov 2018 19:01:48 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8A13070AAE; Wed, 21 Nov 2018 19:01:47 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id wALJ1koe073354; Wed, 21 Nov 2018 11:01:46 -0800 (PST) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id wALJ1k9U073353; Wed, 21 Nov 2018 11:01:46 -0800 (PST) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201811211901.wALJ1k9U073353@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r340737 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs In-Reply-To: <201811211818.wALIIvtQ086486@repo.freebsd.org> To: Alexander Motin Date: Wed, 21 Nov 2018 11:01:46 -0800 (PST) CC: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Rspamd-Queue-Id: 8A13070AAE X-Spamd-Result: default: False [2.28 / 15.00]; ARC_NA(0.00)[]; HAS_REPLYTO(0.00)[rgrimes@freebsd.org]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_SPAM_SHORT(0.50)[0.497,0]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[dnsmgr.net]; REPLYTO_DOM_NEQ_FROM_DOM(0.00)[]; TO_DN_SOME(0.00)[]; NEURAL_SPAM_MEDIUM(0.30)[0.301,0]; AUTH_NA(1.00)[]; RCVD_COUNT_THREE(0.00)[3]; IP_SCORE(-0.02)[country: US(-0.09)]; MX_GOOD(-0.01)[cached: pdx.rh.CN85.dnsmgr.net]; NEURAL_SPAM_LONG(0.61)[0.610,0]; R_SPF_NA(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:13868, ipnet:69.59.192.0/19, country:US]; MID_RHS_MATCH_FROM(0.00)[] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Nov 2018 19:01:48 -0000 > Author: mav > Date: Wed Nov 21 18:18:57 2018 > New Revision: 340737 > URL: https://svnweb.freebsd.org/changeset/base/340737 > > Log: > Revert r340096: 9952 Block size change during zfs receive drops spill block > > It was reported, and I easily reproduced it, that this change triggers panic > when receiving replication stream with enabled embedded blocks, when short > file compressing into one embedded block changes its block size. I am not > sure that the problem is in this particuler patch, not just triggered by it, > but since investigation and fix will take some time, I've decided to revert > this for now. > > PR: 198457, 233277 Is there any impact to stable/12, and more specifically, releng/12? Thanks, Rod > Modified: > head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c > > Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c > ============================================================================== > --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c Wed Nov 21 17:47:40 2018 (r340736) > +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c Wed Nov 21 18:18:57 2018 (r340737) > @@ -2143,7 +2143,6 @@ receive_object(struct receive_writer_arg *rwa, struct > { > dmu_object_info_t doi; > dmu_tx_t *tx; > - dmu_buf_t *db; > uint64_t object; > int err; > > @@ -2191,14 +2190,12 @@ receive_object(struct receive_writer_arg *rwa, struct > > tx = dmu_tx_create(rwa->os); > dmu_tx_hold_bonus(tx, object); > - dmu_tx_hold_write(tx, object, 0, 0); > err = dmu_tx_assign(tx, TXG_WAIT); > if (err != 0) { > dmu_tx_abort(tx); > return (err); > } > > - db = NULL; > if (object == DMU_NEW_OBJECT) { > /* currently free, want to be allocated */ > err = dmu_object_claim_dnsize(rwa->os, drro->drr_object, > @@ -2206,33 +2203,15 @@ receive_object(struct receive_writer_arg *rwa, struct > drro->drr_bonustype, drro->drr_bonuslen, > drro->drr_dn_slots << DNODE_SHIFT, tx); > } else if (drro->drr_type != doi.doi_type || > - (drro->drr_blksz != doi.doi_data_block_size && > - doi.doi_max_offset > doi.doi_data_block_size)) { > + drro->drr_blksz != doi.doi_data_block_size || > + drro->drr_bonustype != doi.doi_bonus_type || > + drro->drr_bonuslen != doi.doi_bonus_size) { > /* currently allocated, but with different properties */ > err = dmu_object_reclaim(rwa->os, drro->drr_object, > drro->drr_type, drro->drr_blksz, > drro->drr_bonustype, drro->drr_bonuslen, tx); > - } else { > - /* > - * Currently allocated, but with slightly different properties, > - * that may change live, like block size or bonus buffer. > - * Change those specifically to not loose the spill block, etc. > - */ > - if (drro->drr_bonustype != doi.doi_bonus_type || > - drro->drr_bonuslen != doi.doi_bonus_size) > - VERIFY0(dmu_bonus_hold(rwa->os, drro->drr_object, FTAG, > - &db)); > - if (drro->drr_bonustype != doi.doi_bonus_type) > - VERIFY0(dmu_set_bonustype(db, drro->drr_bonustype, tx)); > - if (drro->drr_bonuslen != doi.doi_bonus_size) > - VERIFY0(dmu_set_bonus(db, drro->drr_bonuslen, tx)); > - if (drro->drr_blksz != doi.doi_data_block_size) > - err = dmu_object_set_blocksize(rwa->os, drro->drr_object, > - drro->drr_blksz, 0, tx); > } > if (err != 0) { > - if (db != NULL) > - dmu_buf_rele(db, FTAG); > dmu_tx_commit(tx); > return (SET_ERROR(EINVAL)); > } > @@ -2243,9 +2222,9 @@ receive_object(struct receive_writer_arg *rwa, struct > drro->drr_compress, tx); > > if (data != NULL) { > - if (db == NULL) > - VERIFY0(dmu_bonus_hold(rwa->os, drro->drr_object, FTAG, > - &db)); > + dmu_buf_t *db; > + > + VERIFY0(dmu_bonus_hold(rwa->os, drro->drr_object, FTAG, &db)); > dmu_buf_will_dirty(db, tx); > > ASSERT3U(db->db_size, >=, drro->drr_bonuslen); > @@ -2256,9 +2235,8 @@ receive_object(struct receive_writer_arg *rwa, struct > dmu_ot_byteswap[byteswap].ob_func(db->db_data, > drro->drr_bonuslen); > } > - } > - if (db != NULL) > dmu_buf_rele(db, FTAG); > + } > dmu_tx_commit(tx); > > return (0); > > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Wed Nov 21 19:05:25 2018 Return-Path: Delivered-To: svn-src-all@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 8707311424BE; Wed, 21 Nov 2018 19:05:25 +0000 (UTC) (envelope-from mavbsd@gmail.com) Received: from mail-yw1-xc32.google.com (mail-yw1-xc32.google.com [IPv6:2607:f8b0:4864:20::c32]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DB4C670D89; Wed, 21 Nov 2018 19:05:24 +0000 (UTC) (envelope-from mavbsd@gmail.com) Received: by mail-yw1-xc32.google.com with SMTP id d190so2667757ywd.12; Wed, 21 Nov 2018 11:05:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:to:cc:references:from:openpgp:autocrypt:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=64NlGH0Ok5DqNM9COGRGpuSwHcge1VpBQUJPzQ5TQ1U=; b=Zk0F3uS0fAN7Kknf0cqTcATNsbdKwMzeVu1snxP6Dbg3BoJwg5hQ0xlYOw9it3oDRn aCxlvYLJ/MWL2uMg9WtKkQAW7dHxN0QkklL0ocNLnAMyCkfMDfMs6Y2RIHCyRPwYP7SM dR2GRPJwH62bvtaHZv5dITKWKlIdo+BxWDpWnXJ640xvYqTfqD5gMB8zLCAMPCalfGSQ JKJblt/XHm6FU78D4TLiuH+lnvy2IehcuY56loCUDJZU5jOfnEObJv68zM2TnWFaQ309 t5yH0ngWBvipToP01na8Me07ZAb4RT6OpxBJcW3m25AS7CG8fjU0bJGWPXIgEHXb+7RZ Borg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:subject:to:cc:references:from:openpgp :autocrypt:message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=64NlGH0Ok5DqNM9COGRGpuSwHcge1VpBQUJPzQ5TQ1U=; b=H6x30gm/tmMkgP1EYX0zRUk62UoP4aj8FJ82NWyrlP+3RzKK5fbyN0ryMGQDvkjpSE vKgJ3R3XJ+bLckhzxd8eH9cYbuEqbcsXus9LOwLohYmgKG+5d+ckaEs/g9ztr72Nf+nC JSDBKAVjQ+MvLx9sjMOiOPiIlmHSfUoNsq4s9iKq7pjfkezEpTT53t/nDbuy5CwRNIG0 p2KUkTo4n8CE4y0MPCoG7+VWtfdUFmUKNE1Mtoz0/IeVmlWxFFLwtMCedUxRRT8uWZdC vMTMM2vrReKcPhc5oYuiqrxIkdH+bo2+zT9RHw85PGjuFRcU8+Sj5YgmQzbcWjK6Oq3V iCkQ== X-Gm-Message-State: AGRZ1gJ4YEE3AXg/3knHVvZxuzQZRod0o7ZDUYIWoA41ZCQOGBlm0NlJ eJxuvpxsYTRZzbui7B7reOYmL3HO5bo= X-Google-Smtp-Source: AJdET5eC58b+VXsPGypXFFcOmzoWNZ2oySMKAF3cbQnf40jY5k00nva4OBf/XI1Lv7ScAx6ieIkojQ== X-Received: by 2002:a81:29d5:: with SMTP id p204mr7776359ywp.285.1542827123657; Wed, 21 Nov 2018 11:05:23 -0800 (PST) Received: from mavoffice.ixsystems.com ([12.189.233.129]) by smtp.gmail.com with ESMTPSA id 207-v6sm12087561ywi.0.2018.11.21.11.05.23 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 21 Nov 2018 11:05:23 -0800 (PST) Sender: Alexander Motin Subject: Re: svn commit: r340737 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs To: rgrimes@freebsd.org Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201811211901.wALJ1k9U073353@pdx.rh.CN85.dnsmgr.net> From: Alexander Motin Openpgp: preference=signencrypt Autocrypt: addr=mav@FreeBSD.org; prefer-encrypt=mutual; keydata= xsBNBFOzxAwBCADkPrax0pI2W/ig0CK9nRJJwsHitAGEZ2HZiFEuti+6/4UVxj81yr4ak/4g 9bKUyC7rMEAp/ZHNhd+MFCPAAcHPvtovnfykqE/vuosCS3wlSLloix2iKVLks0CwbLHGAyne 46lTQW74Xl/33c3W1Z6d8jD9gVFT/xaVzZ0U9xdzOmsYAZaAj4ki0tuxO9F7L+ct9grRe7iP g8t9hai7BL4ee3VRwk2JXnKb7UvBiVITKYWKz1jRvZIrjPokgEcCLOSlv7x/1kjuFnj3xWZU 7HSFFT8J93epBbrSSCsYsppIk2fZH41kaaFXsMQfTPH8wkeM6qwrvOh4HiQM08R+9tThABEB AAHNIUFsZXhhbmRlciBNb3RpbiA8bWF2QEZyZWVCU0Qub3JnPsLAlwQTAQoAQQIbAwULCQgH AwUVCgkICwUWAwIBAAIeAQIXgAIZARYhBOmM88TmnMPNDledVYMYw5VbqyJ/BQJZYMKuBQkN McyiAAoJEIMYw5VbqyJ/tuUIAOG3ONOSNYqjK4eTZ1TVh9jdUBAhWk5nhDFnODN49Wj0AbYm 7aIqy8O1hnCDSZG5LttjSAo3UfXJZDKQM0BLb0gpRMBnAYqO6tdolLNqAbPGJBnGoPjsh24y 6KcbDaNnis+lD4GwPXwQM+92wZGhCUFElPV9NciZGVS65TNIgk7X+yEjjhD1MSWKKijZ1r9Z zIt4OzUTxxNOvzdlABZS88nNRdJkatOQJPmFdd1mpP6UzTNCiLUo1pIqOEtJgvVVDYq5WHY6 tciWWYdmZG/tIBexJmv2mV2OLVjXR6ZeKmntVH14H72/wRHJuYHQC+r5SVRcWWayrThsY6jZ Yr4+raTOwE0EU7PEDAEIAOZgWf2cJIu+58IzP2dkXE/urj3tr4OqrB/yHGWUf71Lz6D0Fi6Z AXgDtmcFLGPfMyWuLAvSM+xmoguk7zC4hRBYvQycmIhuqBq1jO1Wp/Z+lpoPM/1cDYLn8Flv mI/c40MhUZh345DA4jYWWaZNjQHUWVQ1fPf595vdVVMPT/abE8E5DaF6fSkRmqFTmfYRkfbt 3ytU8NdUapDcJVY7cEP2nJBVNZPnOIObR/ZIgSxjjrG5o34yXoqeup8JvwEv+/NylzzuyXEZ R1EdEIzQ/a1nh/0j4NXtzZEqKW4aTWlmSqb6wN8jh1OSOOqkYsfnE3nfxcZbxi4IRoNQYlm5 9R8AEQEAAcLAZQQYAQoADwUCU7PEDAIbDAUJBaOagAAKCRCDGMOVW6sif7FRB/4k9y/GaGqU fcJiXdQHRAKHCUvbKMFgeEDHOg33qx+POS2Ah85/PXVa2jYBldCZDmYc+zl48aEMd163a7s3 0gJaB7CYElwxlKUk6c+5gwoYIJuJJzSzW0JzSD5ch7RIRxbfxrKdsiHrUW8AeduZWzlK6VaW RmWILgLmxfLdhEVFWxbr99GSeVFZaZwn6tl/8CvBcgYoARvJvl0V5zS1akQfEISYkwL9EfUI W44EOHranL5qUXkedXBYp6fRsooGrIimfwYxaC8FbXhk3FMgMjDMRiVq4POHo1iGeYETsUrL NM6184E25gPVtX2fb3RhM8Xh6BkwCZ6ZYbQ+AcD4F/cKwsB8BBgBCgAmAhsMFiEE6YzzxOac w80OV51VgxjDlVurIn8FAllgwtgFCQ0xzMwACgkQgxjDlVurIn9OqAf9FAcKWS95wTTbraXA qg/+bQyHgjlMtGCgkmfxLsbUGeqiFgmSIuoDrF7q6sYPs6p00CXXZRuuNZt0lX7O95re8mgz gxm5iJisZpdbHMVepYlw/AxT2wCHwxGCEe64Lm+A9vjlOd+3D3/6fSLwZ9WFCE6p6lQZ1CDg 09xe+JKSgC+KDqmn0tzGKyfSCuhRAq3XkZyxL1hxBaDeP0eeKlzoy7jXodf3wVvXXc0cmpza B5McuRHK4EU6jIioHo30YqPM4AjPHGxV2X1N6/Aayungzj9EXNZtKCxs6dsTvjniWa5VkZ9F 4SOdSbxEen1DZRYpeWnd7GVmO86n+5USkKCXPg== Message-ID: <9f086b68-35b0-a34d-74b9-adf3f9af4765@FreeBSD.org> Date: Wed, 21 Nov 2018 14:05:22 -0500 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: <201811211901.wALJ1k9U073353@pdx.rh.CN85.dnsmgr.net> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: DB4C670D89 X-Spamd-Result: default: False [-3.91 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_DKIM_ALLOW(-0.20)[gmail.com]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; DMARC_NA(0.00)[FreeBSD.org]; NEURAL_HAM_LONG(-1.00)[-0.996,0]; RCVD_COUNT_THREE(0.00)[3]; IP_SCORE(-0.80)[ipnet: 2607:f8b0::/32(-2.34), asn: 15169(-1.56), country: US(-0.09)]; DKIM_TRACE(0.00)[gmail.com:+]; MX_GOOD(-0.01)[cached: alt3.gmail-smtp-in.l.google.com]; RCVD_IN_DNSWL_NONE(0.00)[2.3.c.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.0]; NEURAL_HAM_SHORT(-0.91)[-0.910,0]; FORGED_SENDER(0.30)[mav@FreeBSD.org,mavbsd@gmail.com]; RCVD_TLS_LAST(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; FROM_NEQ_ENVFROM(0.00)[mav@FreeBSD.org,mavbsd@gmail.com]; MID_RHS_MATCH_FROM(0.00)[] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Nov 2018 19:05:25 -0000 On 21.11.2018 14:01, Rodney W. Grimes wrote: >> Author: mav >> Date: Wed Nov 21 18:18:57 2018 >> New Revision: 340737 >> URL: https://svnweb.freebsd.org/changeset/base/340737 >> >> Log: >> Revert r340096: 9952 Block size change during zfs receive drops spill block >> >> It was reported, and I easily reproduced it, that this change triggers panic >> when receiving replication stream with enabled embedded blocks, when short >> file compressing into one embedded block changes its block size. I am not >> sure that the problem is in this particuler patch, not just triggered by it, >> but since investigation and fix will take some time, I've decided to revert >> this for now. >> >> PR: 198457, 233277 > > Is there any impact to stable/12, and more specifically, releng/12? No. This code was committed to head after the stable/12 branched, and I was just going to merge it when the new problem was reported. -- Alexander Motin From owner-svn-src-all@freebsd.org Wed Nov 21 19:49:23 2018 Return-Path: Delivered-To: svn-src-all@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 189B01143CAE; Wed, 21 Nov 2018 19:49:23 +0000 (UTC) (envelope-from marius@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 AF3B772CC0; Wed, 21 Nov 2018 19:49:22 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7723B24E99; Wed, 21 Nov 2018 19:49:22 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wALJnMqf033405; Wed, 21 Nov 2018 19:49:22 GMT (envelope-from marius@FreeBSD.org) Received: (from marius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wALJnMxH033404; Wed, 21 Nov 2018 19:49:22 GMT (envelope-from marius@FreeBSD.org) Message-Id: <201811211949.wALJnMxH033404@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: marius set sender to marius@FreeBSD.org using -f From: Marius Strobl Date: Wed, 21 Nov 2018 19:49:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r340743 - releng/12.0/sys/dev/mmc X-SVN-Group: releng X-SVN-Commit-Author: marius X-SVN-Commit-Paths: releng/12.0/sys/dev/mmc X-SVN-Commit-Revision: 340743 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: AF3B772CC0 X-Spamd-Result: default: False [0.77 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.00)[0.001,0]; NEURAL_SPAM_SHORT(0.51)[0.514,0]; NEURAL_SPAM_MEDIUM(0.25)[0.253,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Nov 2018 19:49:23 -0000 Author: marius Date: Wed Nov 21 19:49:21 2018 New Revision: 340743 URL: https://svnweb.freebsd.org/changeset/base/340743 Log: MFC: r340495, MF12: r340739 - Restore setting the clock for devices which support the default/legacy transfer mode only (lost with r321385). [1] - Similarly, don't try to set the power class on MMC devices that comply to version 4.0 of the system specification but are operated in default/ legacy transfer or 1-bit bus mode as no power class is specified for these cases. Trying to set a power class nevertheless resulted in an - albeit harmless - error message. PR: 231713 [1] Approved by: re (gjb) Modified: releng/12.0/sys/dev/mmc/mmc.c Directory Properties: releng/12.0/ (props changed) Modified: releng/12.0/sys/dev/mmc/mmc.c ============================================================================== --- releng/12.0/sys/dev/mmc/mmc.c Wed Nov 21 18:56:15 2018 (r340742) +++ releng/12.0/sys/dev/mmc/mmc.c Wed Nov 21 19:49:21 2018 (r340743) @@ -830,9 +830,14 @@ mmc_set_power_class(struct mmc_softc *sc, struct mmc_i const uint8_t *ext_csd; uint32_t clock; uint8_t value; + enum mmc_bus_timing timing; + enum mmc_bus_width bus_width; dev = sc->dev; - if (mmcbr_get_mode(dev) != mode_mmc || ivar->csd.spec_vers < 4) + timing = mmcbr_get_timing(dev); + bus_width = ivar->bus_width; + if (mmcbr_get_mode(dev) != mode_mmc || ivar->csd.spec_vers < 4 || + timing == bus_timing_normal || bus_width == bus_width_1) return (MMC_ERR_NONE); value = 0; @@ -843,8 +848,8 @@ mmc_set_power_class(struct mmc_softc *sc, struct mmc_i if (clock <= MMC_TYPE_HS_26_MAX) value = ext_csd[EXT_CSD_PWR_CL_26_195]; else if (clock <= MMC_TYPE_HS_52_MAX) { - if (mmcbr_get_timing(dev) >= bus_timing_mmc_ddr52 && - ivar->bus_width >= bus_width_4) + if (timing >= bus_timing_mmc_ddr52 && + bus_width >= bus_width_4) value = ext_csd[EXT_CSD_PWR_CL_52_195_DDR]; else value = ext_csd[EXT_CSD_PWR_CL_52_195]; @@ -863,13 +868,13 @@ mmc_set_power_class(struct mmc_softc *sc, struct mmc_i if (clock <= MMC_TYPE_HS_26_MAX) value = ext_csd[EXT_CSD_PWR_CL_26_360]; else if (clock <= MMC_TYPE_HS_52_MAX) { - if (mmcbr_get_timing(dev) == bus_timing_mmc_ddr52 && - ivar->bus_width >= bus_width_4) + if (timing == bus_timing_mmc_ddr52 && + bus_width >= bus_width_4) value = ext_csd[EXT_CSD_PWR_CL_52_360_DDR]; else value = ext_csd[EXT_CSD_PWR_CL_52_360]; } else if (clock <= MMC_TYPE_HS200_HS400ES_MAX) { - if (ivar->bus_width == bus_width_8) + if (bus_width == bus_width_8) value = ext_csd[EXT_CSD_PWR_CL_200_360_DDR]; else value = ext_csd[EXT_CSD_PWR_CL_200_360]; @@ -881,7 +886,7 @@ mmc_set_power_class(struct mmc_softc *sc, struct mmc_i return (MMC_ERR_INVALID); } - if (ivar->bus_width == bus_width_8) + if (bus_width == bus_width_8) value = (value & EXT_CSD_POWER_CLASS_8BIT_MASK) >> EXT_CSD_POWER_CLASS_8BIT_SHIFT; else @@ -2164,7 +2169,7 @@ mmc_calculate_clock(struct mmc_softc *sc) for (i = 0; i < sc->child_count; i++) { ivar = device_get_ivars(sc->child_list[i]); if ((ivar->timings & ~(1 << bus_timing_normal)) == 0) - continue; + goto clock; rca = ivar->rca; if (mmc_select_card(sc, rca) != MMC_ERR_NONE) { @@ -2230,6 +2235,7 @@ mmc_calculate_clock(struct mmc_softc *sc) } } +clock: /* Set clock (must be done before initial tuning). */ mmcbr_set_clock(dev, max_dtr); mmcbr_update_ios(dev); From owner-svn-src-all@freebsd.org Wed Nov 21 20:15:58 2018 Return-Path: Delivered-To: svn-src-all@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 236D211449B8; Wed, 21 Nov 2018 20:15:58 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.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 BA7EA73CEB; Wed, 21 Nov 2018 20:15:57 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9999B253BC; Wed, 21 Nov 2018 20:15:57 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wALKFvjL048406; Wed, 21 Nov 2018 20:15:57 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wALKFuns048402; Wed, 21 Nov 2018 20:15:56 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201811212015.wALKFuns048402@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Wed, 21 Nov 2018 20:15:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340744 - in head/sys: fs/nfsclient fs/pseudofs kern sys X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: in head/sys: fs/nfsclient fs/pseudofs kern sys X-SVN-Commit-Revision: 340744 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: BA7EA73CEB X-Spamd-Result: default: False [0.80 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.00)[0.004,0]; NEURAL_SPAM_SHORT(0.52)[0.525,0]; NEURAL_SPAM_MEDIUM(0.27)[0.274,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Nov 2018 20:15:58 -0000 Author: mjg Date: Wed Nov 21 20:15:56 2018 New Revision: 340744 URL: https://svnweb.freebsd.org/changeset/base/340744 Log: proc: convert pfind & friends to use pidhash locks and other cleanup pfind_locked is retired as it relied on allproc which unnecessarily restricts locking of the hash. Sponsored by: The FreeBSD Foundation Modified: head/sys/fs/nfsclient/nfs_clport.c head/sys/fs/pseudofs/pseudofs_vnops.c head/sys/kern/kern_proc.c head/sys/sys/proc.h Modified: head/sys/fs/nfsclient/nfs_clport.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clport.c Wed Nov 21 19:49:21 2018 (r340743) +++ head/sys/fs/nfsclient/nfs_clport.c Wed Nov 21 20:15:56 2018 (r340744) @@ -1157,7 +1157,7 @@ nfscl_procdoesntexist(u_int8_t *own) tl.cval[2] = *own++; tl.cval[3] = *own++; pid = tl.lval; - p = pfind_locked(pid); + p = pfind(pid); if (p == NULL) return (1); if (p->p_stats == NULL) { Modified: head/sys/fs/pseudofs/pseudofs_vnops.c ============================================================================== --- head/sys/fs/pseudofs/pseudofs_vnops.c Wed Nov 21 19:49:21 2018 (r340743) +++ head/sys/fs/pseudofs/pseudofs_vnops.c Wed Nov 21 20:15:56 2018 (r340744) @@ -107,7 +107,7 @@ pfs_visible_proc(struct thread *td, struct pfs_node *p static int pfs_visible(struct thread *td, struct pfs_node *pn, pid_t pid, - bool allproc_locked, struct proc **p) + struct proc **p) { struct proc *proc; @@ -118,7 +118,7 @@ pfs_visible(struct thread *td, struct pfs_node *pn, pi *p = NULL; if (pid == NO_PID) PFS_RETURN (1); - proc = allproc_locked ? pfind_locked(pid) : pfind(pid); + proc = pfind(pid); if (proc == NULL) PFS_RETURN (0); if (pfs_visible_proc(td, pn, proc)) { @@ -206,7 +206,7 @@ pfs_getattr(struct vop_getattr_args *va) PFS_TRACE(("%s", pn->pn_name)); pfs_assert_not_owned(pn); - if (!pfs_visible(curthread, pn, pvd->pvd_pid, false, &proc)) + if (!pfs_visible(curthread, pn, pvd->pvd_pid, &proc)) PFS_RETURN (ENOENT); vap->va_type = vn->v_type; @@ -297,7 +297,7 @@ pfs_ioctl(struct vop_ioctl_args *va) * This is necessary because process' privileges may * have changed since the open() call. */ - if (!pfs_visible(curthread, pn, pvd->pvd_pid, false, &proc)) { + if (!pfs_visible(curthread, pn, pvd->pvd_pid, &proc)) { VOP_UNLOCK(vn, 0); PFS_RETURN (EIO); } @@ -330,7 +330,7 @@ pfs_getextattr(struct vop_getextattr_args *va) * This is necessary because either process' privileges may * have changed since the open() call. */ - if (!pfs_visible(curthread, pn, pvd->pvd_pid, false, &proc)) + if (!pfs_visible(curthread, pn, pvd->pvd_pid, &proc)) PFS_RETURN (EIO); if (pn->pn_getextattr == NULL) @@ -466,7 +466,7 @@ pfs_lookup(struct vop_cachedlookup_args *va) PFS_RETURN (ENOENT); /* check that parent directory is visible... */ - if (!pfs_visible(curthread, pd, pvd->pvd_pid, false, NULL)) + if (!pfs_visible(curthread, pd, pvd->pvd_pid, NULL)) PFS_RETURN (ENOENT); /* self */ @@ -550,7 +550,7 @@ pfs_lookup(struct vop_cachedlookup_args *va) got_pnode: pfs_assert_not_owned(pd); pfs_assert_not_owned(pn); - visible = pfs_visible(curthread, pn, pid, false, NULL); + visible = pfs_visible(curthread, pn, pid, NULL); if (!visible) { error = ENOENT; goto failed; @@ -639,7 +639,7 @@ pfs_read(struct vop_read_args *va) * This is necessary because either process' privileges may * have changed since the open() call. */ - if (!pfs_visible(curthread, pn, pvd->pvd_pid, false, &proc)) + if (!pfs_visible(curthread, pn, pvd->pvd_pid, &proc)) PFS_RETURN (EIO); if (proc != NULL) { _PHOLD(proc); @@ -795,7 +795,7 @@ pfs_readdir(struct vop_readdir_args *va) pfs_lock(pd); /* check if the directory is visible to the caller */ - if (!pfs_visible(curthread, pd, pid, true, &proc)) { + if (!pfs_visible(curthread, pd, pid, &proc)) { sx_sunlock(&allproc_lock); pfs_unlock(pd); PFS_RETURN (ENOENT); @@ -1001,7 +1001,7 @@ pfs_write(struct vop_write_args *va) * This is necessary because either process' privileges may * have changed since the open() call. */ - if (!pfs_visible(curthread, pn, pvd->pvd_pid, false, &proc)) + if (!pfs_visible(curthread, pn, pvd->pvd_pid, &proc)) PFS_RETURN (EIO); if (proc != NULL) { _PHOLD(proc); Modified: head/sys/kern/kern_proc.c ============================================================================== --- head/sys/kern/kern_proc.c Wed Nov 21 19:49:21 2018 (r340743) +++ head/sys/kern/kern_proc.c Wed Nov 21 20:15:56 2018 (r340744) @@ -112,7 +112,6 @@ static void proc_dtor(void *mem, int size, void *arg); static int proc_init(void *mem, int size, int flags); static void proc_fini(void *mem, int size); static void pargs_free(struct pargs *pa); -static struct proc *zpfind_locked(pid_t pid); /* * Other process lists @@ -307,45 +306,43 @@ inferior(struct proc *p) return (1); } -struct proc * -pfind_locked(pid_t pid) +/* + * Locate a process by number. + * + * By not returning processes in the PRS_NEW state, we allow callers to avoid + * testing for that condition to avoid dereferencing p_ucred, et al. + */ +static __always_inline struct proc * +_pfind(pid_t pid, bool zombie) { struct proc *p; - sx_assert(&allproc_lock, SX_LOCKED); + p = curproc; + if (p->p_pid == pid) { + PROC_LOCK(p); + return (p); + } + sx_slock(PIDHASHLOCK(pid)); LIST_FOREACH(p, PIDHASH(pid), p_hash) { if (p->p_pid == pid) { PROC_LOCK(p); - if (p->p_state == PRS_NEW || p->p_state == PRS_ZOMBIE) { + if (p->p_state == PRS_NEW || + (zombie && p->p_state == PRS_ZOMBIE)) { PROC_UNLOCK(p); p = NULL; } break; } } + sx_sunlock(PIDHASHLOCK(pid)); return (p); } -/* - * Locate a process by number; return only "live" processes -- i.e., neither - * zombies nor newly born but incompletely initialized processes. By not - * returning processes in the PRS_NEW state, we allow callers to avoid - * testing for that condition to avoid dereferencing p_ucred, et al. - */ struct proc * pfind(pid_t pid) { - struct proc *p; - p = curproc; - if (p->p_pid == pid) { - PROC_LOCK(p); - return (p); - } - sx_slock(&allproc_lock); - p = pfind_locked(pid); - sx_sunlock(&allproc_lock); - return (p); + return (_pfind(pid, false)); } /* @@ -354,24 +351,17 @@ pfind(pid_t pid) struct proc * pfind_any(pid_t pid) { - struct proc *p; - sx_slock(&allproc_lock); - p = pfind_locked(pid); - if (p == NULL) - p = zpfind_locked(pid); - sx_sunlock(&allproc_lock); - - return (p); + return (_pfind(pid, true)); } static struct proc * -pfind_tid_locked(pid_t tid) +pfind_tid(pid_t tid) { struct proc *p; struct thread *td; - sx_assert(&allproc_lock, SX_LOCKED); + sx_slock(&allproc_lock); FOREACH_PROC_IN_SYSTEM(p) { PROC_LOCK(p); if (p->p_state == PRS_NEW) { @@ -385,6 +375,7 @@ pfind_tid_locked(pid_t tid) PROC_UNLOCK(p); } found: + sx_sunlock(&allproc_lock); return (p); } @@ -421,17 +412,15 @@ pget(pid_t pid, int flags, struct proc **pp) if (p->p_pid == pid) { PROC_LOCK(p); } else { - sx_slock(&allproc_lock); + p = NULL; if (pid <= PID_MAX) { - p = pfind_locked(pid); - if (p == NULL && (flags & PGET_NOTWEXIT) == 0) - p = zpfind_locked(pid); + if ((flags & PGET_NOTWEXIT) == 0) + p = pfind_any(pid); + else + p = pfind(pid); } else if ((flags & PGET_NOTID) == 0) { - p = pfind_tid_locked(pid); - } else { - p = NULL; + p = pfind_tid(pid); } - sx_sunlock(&allproc_lock); if (p == NULL) return (ESRCH); if ((flags & PGET_CANSEE) != 0) { @@ -1197,21 +1186,6 @@ pstats_free(struct pstats *ps) free(ps, M_SUBPROC); } -static struct proc * -zpfind_locked(pid_t pid) -{ - struct proc *p; - - sx_assert(&allproc_lock, SX_LOCKED); - LIST_FOREACH(p, &zombproc, p_list) { - if (p->p_pid == pid) { - PROC_LOCK(p); - break; - } - } - return (p); -} - /* * Locate a zombie process by number */ @@ -1221,7 +1195,12 @@ zpfind(pid_t pid) struct proc *p; sx_slock(&allproc_lock); - p = zpfind_locked(pid); + LIST_FOREACH(p, &zombproc, p_list) { + if (p->p_pid == pid) { + PROC_LOCK(p); + break; + } + } sx_sunlock(&allproc_lock); return (p); } Modified: head/sys/sys/proc.h ============================================================================== --- head/sys/sys/proc.h Wed Nov 21 19:49:21 2018 (r340743) +++ head/sys/sys/proc.h Wed Nov 21 20:15:56 2018 (r340744) @@ -981,7 +981,6 @@ extern struct uma_zone *proc_zone; struct proc *pfind(pid_t); /* Find process by id. */ struct proc *pfind_any(pid_t); /* Find (zombie) process by id. */ -struct proc *pfind_locked(pid_t pid); struct pgrp *pgfind(pid_t); /* Find process group by id. */ struct proc *zpfind(pid_t); /* Find zombie process by id. */ From owner-svn-src-all@freebsd.org Wed Nov 21 21:36:34 2018 Return-Path: Delivered-To: svn-src-all@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 6FCE3114735A; Wed, 21 Nov 2018 21:36:34 +0000 (UTC) (envelope-from oshogbo.vx@gmail.com) Received: from mail-lj1-x236.google.com (mail-lj1-x236.google.com [IPv6:2a00:1450:4864:20::236]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6103F77DC2; Wed, 21 Nov 2018 21:36:33 +0000 (UTC) (envelope-from oshogbo.vx@gmail.com) Received: by mail-lj1-x236.google.com with SMTP id e5-v6so6143019lja.4; Wed, 21 Nov 2018 13:36:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=PUlzcvY2b/Yl0PhH2juxGSjJII7zuqAuGxN+rtA98Ak=; b=AjfgXIx7dalOHWpeX7iCOr6PYM+S+mtL4HeaxEuIG/rv4mLptAeOX+VvBGGgOwlGM6 raAwQmen1apb/QFP0CuLH7ew/z2GXkG4xmomPDGlLarvAn2KuxcHC5aMSmjKTq+mKYNf nsdCox6ANuwReHbGpa3/kyGoGtOqTQavmYN739arHx/M4tP+mVwfpd6gGCTsqq0frnZF 7vgVCGp48tVNAYXLK3rcTQj8IpQmpwPeL60HvIG0LgjflWArM/Amv8V3HYMpd3fGbVtl S2RPQoE+5V19BWJvKrf1qnR07p4RgX0hXWSRl5SIoG1llO2Ej7Y3Admzo8cHbnGmGCNM NLAA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=PUlzcvY2b/Yl0PhH2juxGSjJII7zuqAuGxN+rtA98Ak=; b=WHQ1uk3ldCgIPWRsD/SgVc99iesH9vgqd08XewUUCv6I8zPHqezbYWobDs4169mOeK JQ+FrwiAbxM9oiWyXn2I0jBF/WeHFcxd9lyMvrtuToOLjGZdUfuMb4TvoHsZPJdTPPEa UYfhHIyDmrwnUf0Klw3Zsn8McFub0G3azcQ9S6knQeU9ojmIkOQ3bvPO9YQE/FmhRr+j 3SES+dt7lx/xcGxKaWT/UeqOGqMsZwvx4P9/C40UcntV54wtULL+UqunBp/3c5Mt8Tv0 8u5Z0n9OWJtOnTqywoF17LkHHYc67M2uarQI0Nq13pPaWxYhefVCLc+0vIji6BYhe/FH rn7A== X-Gm-Message-State: AA+aEWby11g/44GSFT/4vJKBK73ik7IEFS/hdbgJ/1nEOQcKOWsv8CEi VIOBO4Hrrpype/9R2Kxz+dMPvcyF X-Google-Smtp-Source: AFSGD/Wt0rHU8E8jzbYDobDjvth9uimmbapGpakNwmuExtgy9kyp6rQq7m2EMDsMicZfgB/ijAVeYQ== X-Received: by 2002:a2e:83d7:: with SMTP id s23-v6mr5613247ljh.139.1542836191526; Wed, 21 Nov 2018 13:36:31 -0800 (PST) Received: from x-wing (87-206-170-77.dynamic.chello.pl. [87.206.170.77]) by smtp.gmail.com with ESMTPSA id h21sm6939194lfk.41.2018.11.21.13.36.29 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 21 Nov 2018 13:36:30 -0800 (PST) Sender: Mariusz Zaborski Date: Wed, 21 Nov 2018 22:36:41 +0100 From: Mariusz Zaborski To: rgrimes@freebsd.org Cc: Kyle Evans , 0mp@freebsd.org, svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers Subject: Re: svn commit: r340722 - head/lib/libbe Message-ID: <20181121213641.GA54339@x-wing> References: <201811211654.wALGsAPT072769@pdx.rh.CN85.dnsmgr.net> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="tThc/1wpZn/ma/RB" Content-Disposition: inline In-Reply-To: <201811211654.wALGsAPT072769@pdx.rh.CN85.dnsmgr.net> User-Agent: Mutt/1.10.1 (2018-07-13) X-Rspamd-Queue-Id: 6103F77DC2 X-Spamd-Result: default: False [-5.44 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2a00:1450:4000::/36]; RCPT_COUNT_FIVE(0.00)[6]; RCVD_COUNT_THREE(0.00)[3]; DKIM_TRACE(0.00)[gmail.com:+]; MX_GOOD(-0.01)[cached: alt3.gmail-smtp-in.l.google.com]; NEURAL_HAM_SHORT(-0.99)[-0.989,0]; SIGNED_PGP(-2.00)[]; FORGED_SENDER(0.30)[oshogbo@freebsd.org,oshogbovx@gmail.com]; RCVD_TLS_LAST(0.00)[]; IP_SCORE(-0.65)[ipnet: 2a00:1450::/32(-1.58), asn: 15169(-1.57), country: US(-0.09)]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US]; TAGGED_FROM(0.00)[]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; R_DKIM_ALLOW(-0.20)[gmail.com]; FROM_NEQ_ENVFROM(0.00)[oshogbo@freebsd.org,oshogbovx@gmail.com]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; MIME_GOOD(-0.20)[multipart/signed,text/plain]; DMARC_NA(0.00)[freebsd.org]; RCVD_IN_DNSWL_NONE(0.00)[6.3.2.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.5.4.1.0.0.a.2.list.dnswl.org : 127.0.5.0]; MID_RHS_NOT_FQDN(0.50)[] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Nov 2018 21:36:34 -0000 --tThc/1wpZn/ma/RB Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Nov 21, 2018 at 08:54:10AM -0800, Rodney W. Grimes wrote: > > On Wed, Nov 21, 2018 at 10:19 AM Rodney W. Grimes > > wrote: > > > > > > > Author: 0mp (ports committer) > > > > Date: Wed Nov 21 11:22:44 2018 > > > > New Revision: 340722 > > > > URL: https://svnweb.freebsd.org/changeset/base/340722 > > > > > > > > Log: > > > > libbe(3): Put each error value in separate line. > > > > > > > > As requested by a TODO in the source code. > > > > > > > > Reviewed by: bcr > > > > Approved by: krion (mentor, implicit), mat (mentor, implic= it) > > > > Differential Revision: https://reviews.freebsd.org/D18063 > > > > > > Who with a src bit approved the commit to src? > > > > >=20 > > I do want to clarify- bcr approved it in the review (explicitly with > > "... hereby approved!") -- are you mainly pointing out that he failed > > to annotate this properly in the commit, or is doc bit approval for a > > commit to a manpage in src insufficient? >=20 > That is defanitly a bit of a grey area, from reading and re-reading > the commit bit page it is clear that a doc committer can commit > to src documentation, it is not clear if they can approve a commit > by someone else to the src tree, it does say > ""Approved by" from a non-mentored committer > with the appropriate bit" >=20 > It probably would be fine to have said Approved by: bcr. >=20 > I still question what a out of scope commit that is > approved by: (mentor, implicit). I am not even sure > what that means in this context. Have his mentors > said he can commit anything anyplace without them > seeing it? If so then release the mentor/mentee bit > would be more appropriate? >=20 > >=20 > > As an aside, happy to approve any changes to these manpages as the > > current bectl/libbe maintainer for anyone that wants to improve them. > > =3D) >=20 > That defanitly would of been a cleaner path. C'mon guys. Mateusz is doing a great job with documentation - THANK YOU! I would be more outraged that we still didn't appreciate him. Thanks, --=20 Mariusz Zaborski oshogbo//vx | http://oshogbo.vexillium.org FreeBSD committer | https://freebsd.org Software developer | http://wheelsystems.com If it's not broken, let's fix it till it is!!1 --tThc/1wpZn/ma/RB Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEkD1x0xkJXVVY1Gwf38KEGuLGxWQFAlv1z+QACgkQ38KEGuLG xWQu6RAAlN0swKr+z/eS9xag31ZYazLY/jOtG0Ucdea5ZQ7LsAbd2csTZXf0daJh zaMl8+hlo5jHiDYI9+2VvOuZ0tjmS8QopkJ/BTm+SWi5/ELDVnOsfGkElnwsA6I8 L0+emkpVaCfZVHlYxuhWbb1FvvVztDk31OdmN0gqArUZ5znswJqIOdOEEph6qPnv 2E9RT/mkMKJKDi55b0lwkZ8RbpFmXo5bFUXtq2EwoWaZllXvtlYoxtxHlDHITauh 5E6yhnCk4DhEYfMGCKuF3cHqc1Z8qzPT7NxRaJoXbncVrgKWdfb/ubL2nigkLKyb CLRxqF7VaCnRaAn46J2EsKsoZWjPIijcImIckz/r7s0xy9Jtc52is5TTr5MzGnwR xB9b+iwp6nabjzpiYtHgScME5WDmLH4av0jOTnARic0Mi7eFQ66KYcScgWeSnlh0 4TkGN4yN2Fl8cenMzVaa82sGci5AAxEnffIc6SWTP3U+Nw8W492TNv+txvWkjsL4 L+mUqzIjxYjLtkucR/r3/3o1j5RYcmlT3cAM+Qu75nLviMxcwEg4yQCP8fhsNjji yuMHkx2oDow0yhVDPpeLCazEXzta8LgPer3pqZcXg38LWuaYvyh2OQh8AO5YwQCF gnF9qzG76BgKOmFpj6w0HSk/GdE5Kp2B1BJNXDfwS1NEDP9mDxk= =4BEr -----END PGP SIGNATURE----- --tThc/1wpZn/ma/RB-- From owner-svn-src-all@freebsd.org Wed Nov 21 21:46:07 2018 Return-Path: Delivered-To: svn-src-all@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 2C8D61147890; Wed, 21 Nov 2018 21:46:07 +0000 (UTC) (envelope-from sobomax@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.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 C3ADF784E0; Wed, 21 Nov 2018 21:46:06 +0000 (UTC) (envelope-from sobomax@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A4D3C2629D; Wed, 21 Nov 2018 21:46:06 +0000 (UTC) (envelope-from sobomax@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wALLk6GQ097256; Wed, 21 Nov 2018 21:46:06 GMT (envelope-from sobomax@FreeBSD.org) Received: (from sobomax@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wALLk6WS097255; Wed, 21 Nov 2018 21:46:06 GMT (envelope-from sobomax@FreeBSD.org) Message-Id: <201811212146.wALLk6WS097255@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sobomax set sender to sobomax@FreeBSD.org using -f From: Maxim Sobolev Date: Wed, 21 Nov 2018 21:46:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340745 - head/contrib/elftoolchain/readelf X-SVN-Group: head X-SVN-Commit-Author: sobomax X-SVN-Commit-Paths: head/contrib/elftoolchain/readelf X-SVN-Commit-Revision: 340745 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C3ADF784E0 X-Spamd-Result: default: False [0.49 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.26)[0.264,0]; NEURAL_HAM_LONG(-0.00)[-0.003,0]; NEURAL_SPAM_MEDIUM(0.23)[0.231,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Nov 2018 21:46:07 -0000 Author: sobomax Date: Wed Nov 21 21:46:06 2018 New Revision: 340745 URL: https://svnweb.freebsd.org/changeset/base/340745 Log: Fix CU: output of the --debug-dump=decodedline, the problem there is that both file name and current directory is recorded, however file name sometimes already contains absolute path. In which case prefixing it with directory name results in an invalid pathname. Only append directory name if the file name does not start with '/'. This seems to DTRT. Approved by: emaste MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D18290 Modified: head/contrib/elftoolchain/readelf/readelf.c Modified: head/contrib/elftoolchain/readelf/readelf.c ============================================================================== --- head/contrib/elftoolchain/readelf/readelf.c Wed Nov 21 20:15:56 2018 (r340744) +++ head/contrib/elftoolchain/readelf/readelf.c Wed Nov 21 21:46:06 2018 (r340745) @@ -4720,7 +4720,7 @@ dump_dwarf_line_decoded(struct readelf *re) DW_DLV_OK) dir = NULL; printf("CU: "); - if (dir && file) + if (dir && file && file[0] != '/') printf("%s/", dir); if (file) printf("%s", file); From owner-svn-src-all@freebsd.org Wed Nov 21 21:48:03 2018 Return-Path: Delivered-To: svn-src-all@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 1CE5D1147A05; Wed, 21 Nov 2018 21:48:03 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B7DDF786B0; Wed, 21 Nov 2018 21:48:02 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 98BF8262A4; Wed, 21 Nov 2018 21:48:02 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wALLm2N7097376; Wed, 21 Nov 2018 21:48:02 GMT (envelope-from oshogbo@FreeBSD.org) Received: (from oshogbo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wALLm2PP097375; Wed, 21 Nov 2018 21:48:02 GMT (envelope-from oshogbo@FreeBSD.org) Message-Id: <201811212148.wALLm2PP097375@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: oshogbo set sender to oshogbo@FreeBSD.org using -f From: Mariusz Zaborski Date: Wed, 21 Nov 2018 21:48:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340746 - head/contrib/elftoolchain/strings X-SVN-Group: head X-SVN-Commit-Author: oshogbo X-SVN-Commit-Paths: head/contrib/elftoolchain/strings X-SVN-Commit-Revision: 340746 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B7DDF786B0 X-Spamd-Result: default: False [0.53 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.00)[0.001,0]; NEURAL_SPAM_MEDIUM(0.25)[0.253,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.28)[0.280,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Nov 2018 21:48:03 -0000 Author: oshogbo Date: Wed Nov 21 21:48:02 2018 New Revision: 340746 URL: https://svnweb.freebsd.org/changeset/base/340746 Log: strings: fix style nits Reviewed by: cem, emaste, Joseph Koshy Differential Revision: https://reviews.freebsd.org/D18036 Modified: head/contrib/elftoolchain/strings/strings.c Modified: head/contrib/elftoolchain/strings/strings.c ============================================================================== --- head/contrib/elftoolchain/strings/strings.c Wed Nov 21 21:46:06 2018 (r340745) +++ head/contrib/elftoolchain/strings/strings.c Wed Nov 21 21:48:02 2018 (r340746) @@ -24,8 +24,8 @@ * SUCH DAMAGE. */ -#include #include +#include #include #include @@ -64,7 +64,7 @@ enum encoding_style { }; #define PRINTABLE(c) \ - ((c) >= 0 && (c) <= 255 && \ + ((c) >= 0 && (c) <= 255 && \ ((c) == '\t' || isprint((c)) || \ (encoding == ENCODING_8BIT && (c) > 127))) @@ -109,8 +109,8 @@ main(int argc, char **argv) elf_errmsg(-1)); while ((ch = getopt_long(argc, argv, "1234567890ae:fhn:ot:Vv", - strings_longopts, NULL)) != -1) - switch((char)ch) { + strings_longopts, NULL)) != -1) { + switch ((char)ch) { case 'a': entire_file = 1; break; @@ -183,14 +183,15 @@ main(int argc, char **argv) usage(); /* NOTREACHED */ } + } argc -= optind; argv += optind; - if (!min_len) + if (min_len == 0) min_len = 4; - if (!*argv) + if (*argv == NULL) rc = find_strings("{standard input}", 0, 0); - else while (*argv) { + else while (*argv != NULL) { if (handle_file(*argv) != 0) rc = 1; argv++; @@ -226,10 +227,10 @@ handle_binary(const char *name, int fd) { struct stat buf; - memset(&buf, 0, sizeof(struct stat)); - (void) lseek(fd, (off_t)0, SEEK_SET); + memset(&buf, 0, sizeof(buf)); + (void)lseek(fd, 0, SEEK_SET); if (!fstat(fd, &buf)) - return (find_strings(name, (off_t)0, buf.st_size)); + return (find_strings(name, 0, buf.st_size)); return (1); } @@ -253,21 +254,21 @@ handle_elf(const char *name, int fd) if (entire_file) return (handle_binary(name, fd)); - (void) lseek(fd, (off_t)0, SEEK_SET); + (void)lseek(fd, 0, SEEK_SET); elf = elf_begin(fd, ELF_C_READ, NULL); if (elf_kind(elf) != ELF_K_ELF) { - (void) elf_end(elf); + (void)elf_end(elf); return (handle_binary(name, fd)); } if (gelf_getehdr(elf, &elfhdr) == NULL) { - (void) elf_end(elf); + (void)elf_end(elf); warnx("%s: ELF file could not be processed", name); return (1); } if (elfhdr.e_shnum == 0 && elfhdr.e_type == ET_CORE) { - (void) elf_end(elf); + (void)elf_end(elf); return (handle_binary(name, fd)); } else { scn = NULL; @@ -281,7 +282,7 @@ handle_elf(const char *name, int fd) } } } - (void) elf_end(elf); + (void)elf_end(elf); return (rc); } @@ -304,7 +305,7 @@ getcharacter(void) buf[i] = c; } - switch(encoding) { + switch (encoding) { case ENCODING_7BIT: case ENCODING_8BIT: rt = buf[0]; @@ -317,12 +318,12 @@ getcharacter(void) break; case ENCODING_32BIT_BIG: rt = ((long) buf[0] << 24) | ((long) buf[1] << 16) | - ((long) buf[2] << 8) | buf[3]; - break; + ((long) buf[2] << 8) | buf[3]; + break; case ENCODING_32BIT_LITTLE: rt = buf[0] | ((long) buf[1] << 8) | ((long) buf[2] << 16) | - ((long) buf[3] << 24); - break; + ((long) buf[3] << 24); + break; } return (rt); } @@ -341,63 +342,60 @@ find_strings(const char *name, off_t offset, off_t siz int i; if ((obuf = (char*)calloc(1, min_len + 1)) == NULL) { - (void) fprintf(stderr, "Unable to allocate memory: %s\n", - strerror(errno)); + fprintf(stderr, "Unable to allocate memory: %s\n", + strerror(errno)); return (1); } - (void) fseeko(stdin, offset, SEEK_SET); + (void)fseeko(stdin, offset, SEEK_SET); cur_off = offset; start_off = 0; - while(1) { + while (true) { if ((offset + size) && (cur_off >= offset + size)) break; start_off = cur_off; - memset(obuf, 0, min_len+1); + memset(obuf, 0, min_len + 1); for(i = 0; i < min_len; i++) { c = getcharacter(); if (c == EOF && feof(stdin)) goto _exit1; - if (PRINTABLE(c)) { - obuf[i] = c; - obuf[i+1] = 0; - cur_off += encoding_size; - } else { + if (PRINTABLE(c)) { + obuf[i] = c; + obuf[i + 1] = 0; + cur_off += encoding_size; + } else { if (encoding == ENCODING_8BIT && (uint8_t)c > 127) { - obuf[i] = c; - obuf[i+1] = 0; - cur_off += encoding_size; - continue; - } - cur_off += encoding_size; - break; - } + obuf[i] = c; + obuf[i + 1] = 0; + cur_off += encoding_size; + continue; + } + cur_off += encoding_size; + break; + } } if (i >= min_len && ((cur_off <= offset + size) || !(offset + size))) { if (show_filename) - printf ("%s: ", name); + printf("%s: ", name); if (show_loc) { - switch(radix) { + switch (radix) { case RADIX_DECIMAL: - (void) printf("%7ju ", - (uintmax_t)start_off); + printf("%7ju ", (uintmax_t)start_off); break; case RADIX_HEX: - (void) printf("%7jx ", - (uintmax_t)start_off); + printf("%7jx ", (uintmax_t)start_off); break; case RADIX_OCTAL: - (void) printf("%7jo ", - (uintmax_t)start_off); + printf("%7jo ", (uintmax_t)start_off); break; } } printf("%s", obuf); - while(1) { + while (true) { if ((offset + size) && (cur_off >= offset + size)) break; @@ -405,9 +403,9 @@ find_strings(const char *name, off_t offset, off_t siz cur_off += encoding_size; if (encoding == ENCODING_8BIT && (uint8_t)c > 127) { - putchar(c); - continue; - } + putchar(c); + continue; + } if (!PRINTABLE(c) || c == EOF) break; putchar(c); @@ -436,13 +434,15 @@ Usage: %s [options] [file...]\n\ void usage(void) { - (void) fprintf(stderr, USAGE_MESSAGE, ELFTC_GETPROGNAME()); + + fprintf(stderr, USAGE_MESSAGE, ELFTC_GETPROGNAME()); exit(EXIT_FAILURE); } void show_version(void) { - (void) printf("%s (%s)\n", ELFTC_GETPROGNAME(), elftc_version()); + + printf("%s (%s)\n", ELFTC_GETPROGNAME(), elftc_version()); exit(EXIT_SUCCESS); } From owner-svn-src-all@freebsd.org Wed Nov 21 22:01:07 2018 Return-Path: Delivered-To: svn-src-all@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 05C591147F81; Wed, 21 Nov 2018 22:01:07 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.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 A23AA79568; Wed, 21 Nov 2018 22:01:06 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 84AF32649D; Wed, 21 Nov 2018 22:01:06 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wALM16Uf003647; Wed, 21 Nov 2018 22:01:06 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wALM16QT003646; Wed, 21 Nov 2018 22:01:06 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201811212201.wALM16QT003646@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Wed, 21 Nov 2018 22:01:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340747 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 340747 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A23AA79568 X-Spamd-Result: default: False [0.49 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_MEDIUM(0.23)[0.231,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.26)[0.264,0]; NEURAL_HAM_LONG(-0.00)[-0.003,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Nov 2018 22:01:07 -0000 Author: mjg Date: Wed Nov 21 22:01:06 2018 New Revision: 340747 URL: https://svnweb.freebsd.org/changeset/base/340747 Log: uipc_shm: use unr64 for inode numbers Sponsored by: The FreeBSD Foundation Modified: head/sys/kern/uipc_shm.c Modified: head/sys/kern/uipc_shm.c ============================================================================== --- head/sys/kern/uipc_shm.c Wed Nov 21 21:48:02 2018 (r340746) +++ head/sys/kern/uipc_shm.c Wed Nov 21 22:01:06 2018 (r340747) @@ -113,7 +113,7 @@ static LIST_HEAD(, shm_mapping) *shm_dictionary; static struct sx shm_dict_lock; static struct mtx shm_timestamp_lock; static u_long shm_hash; -static struct unrhdr *shm_ino_unr; +static struct unrhdr64 shm_ino_unr; static dev_t shm_dev_ino; #define SHM_HASH(fnv) (&shm_dictionary[(fnv) & shm_hash]) @@ -531,7 +531,6 @@ struct shmfd * shm_alloc(struct ucred *ucred, mode_t mode) { struct shmfd *shmfd; - int ino; shmfd = malloc(sizeof(*shmfd), M_SHMFD, M_WAITOK | M_ZERO); shmfd->shm_size = 0; @@ -549,11 +548,7 @@ shm_alloc(struct ucred *ucred, mode_t mode) vfs_timestamp(&shmfd->shm_birthtime); shmfd->shm_atime = shmfd->shm_mtime = shmfd->shm_ctime = shmfd->shm_birthtime; - ino = alloc_unr(shm_ino_unr); - if (ino == -1) - shmfd->shm_ino = 0; - else - shmfd->shm_ino = ino; + shmfd->shm_ino = alloc_unr64(&shm_ino_unr); refcount_init(&shmfd->shm_refs, 1); mtx_init(&shmfd->shm_mtx, "shmrl", NULL, MTX_DEF); rangelock_init(&shmfd->shm_rl); @@ -584,8 +579,6 @@ shm_drop(struct shmfd *shmfd) rangelock_destroy(&shmfd->shm_rl); mtx_destroy(&shmfd->shm_mtx); vm_object_deallocate(shmfd->shm_object); - if (shmfd->shm_ino != 0) - free_unr(shm_ino_unr, shmfd->shm_ino); free(shmfd, M_SHMFD); } } @@ -624,8 +617,7 @@ shm_init(void *arg) mtx_init(&shm_timestamp_lock, "shm timestamps", NULL, MTX_DEF); sx_init(&shm_dict_lock, "shm dictionary"); shm_dictionary = hashinit(1024, M_SHMFD, &shm_hash); - shm_ino_unr = new_unrhdr(1, INT32_MAX, NULL); - KASSERT(shm_ino_unr != NULL, ("shm fake inodes not initialized")); + new_unrhdr64(&shm_ino_unr, 1); shm_dev_ino = devfs_alloc_cdp_inode(); KASSERT(shm_dev_ino > 0, ("shm dev inode not initialized")); } From owner-svn-src-all@freebsd.org Wed Nov 21 22:16:11 2018 Return-Path: Delivered-To: svn-src-all@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 915F311485C8; Wed, 21 Nov 2018 22:16:11 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 37C167A00C; Wed, 21 Nov 2018 22:16:11 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 18D04267B0; Wed, 21 Nov 2018 22:16:11 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wALMGAoU013357; Wed, 21 Nov 2018 22:16:10 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wALMGAuq013356; Wed, 21 Nov 2018 22:16:10 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201811212216.wALMGAuq013356@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Wed, 21 Nov 2018 22:16:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340748 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 340748 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 37C167A00C X-Spamd-Result: default: False [0.90 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.26)[0.264,0]; NEURAL_SPAM_MEDIUM(0.23)[0.231,0]; NEURAL_SPAM_LONG(0.40)[0.400,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Nov 2018 22:16:11 -0000 Author: mjg Date: Wed Nov 21 22:16:10 2018 New Revision: 340748 URL: https://svnweb.freebsd.org/changeset/base/340748 Log: proc: update list manipulation comment on process exit Processes stay in the hash until they get reaped. This code does not unlink the child from the parent, so remove the claim that it does. Sponsored by: The FreeBSD Foundation Modified: head/sys/kern/kern_exit.c Modified: head/sys/kern/kern_exit.c ============================================================================== --- head/sys/kern/kern_exit.c Wed Nov 21 22:01:06 2018 (r340747) +++ head/sys/kern/kern_exit.c Wed Nov 21 22:16:10 2018 (r340748) @@ -429,8 +429,7 @@ exit1(struct thread *td, int rval, int signo) sx_xlock(&proctree_lock); /* - * Remove proc from allproc queue and pidhash chain. - * Place onto zombproc. Unlink from parent's child list. + * Move proc from allproc queue to zombproc. */ sx_xlock(&allproc_lock); LIST_REMOVE(p, p_list); From owner-svn-src-all@freebsd.org Wed Nov 21 22:24:30 2018 Return-Path: Delivered-To: svn-src-all@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 E37A011488E6; Wed, 21 Nov 2018 22:24:29 +0000 (UTC) (envelope-from mpp302@gmail.com) Received: from mail-qt1-f177.google.com (mail-qt1-f177.google.com [209.85.160.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 510067A5E1; Wed, 21 Nov 2018 22:24:29 +0000 (UTC) (envelope-from mpp302@gmail.com) Received: by mail-qt1-f177.google.com with SMTP id n21so5575439qtl.6; Wed, 21 Nov 2018 14:24:29 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=vKpVHfi7WyOZMzZZC+hD9zpLkeJqGsX9AWp9YLc0kms=; b=FUUaMZEx4HogfErfIyie+V4HmO6D3KNw4p8vkLzMIgSABFFUQ3CtyLoA/bRrdVC8Io UH/UTQbeT+XPYN5iOPkPdgauz/xq1wfcsGAQvszJs/8rMtjj8+TEyXWa2EDDtMvLLtlF i1KFXhUqkO3FhFri4zLDVAV0SZS4Ao7tbrIO52xse2eryYZPNlNIrx9z30s0Wobbr4Cr lMnebj3C+BCLdYQZ439kV56fGU1XiFdlQR0f0uRC8x0RGOHeD5a20cRf6LSGTU0HFIdc j4jmcSeb9Hnfg14J3K8svWHPCWNTYn+vE6DKDUYSa4y5wJoeU195hBdO0R3yhr5VWL6M QZTw== X-Gm-Message-State: AGRZ1gLXC8NF8G8Ief7W5zLQ1yMql3PEAB6GHm+uXVPqaAUfgAIlaxkX maXhJOHly3XCFM72bL334Jtj0H1QcgBuQA== X-Google-Smtp-Source: AFSGD/WuPPIgfaqDYa1dO9KUSD9+4UdObrMgGxhEelPFliQovNqKYIQwqV1KW/0V7AIGaDiHi2MFCw== X-Received: by 2002:ac8:1d12:: with SMTP id d18mr7427987qtl.343.1542835526791; Wed, 21 Nov 2018 13:25:26 -0800 (PST) Received: from mail-qt1-f178.google.com (mail-qt1-f178.google.com. [209.85.160.178]) by smtp.gmail.com with ESMTPSA id v32sm24332683qta.37.2018.11.21.13.25.26 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 21 Nov 2018 13:25:26 -0800 (PST) Received: by mail-qt1-f178.google.com with SMTP id v11so5444921qtc.2; Wed, 21 Nov 2018 13:25:26 -0800 (PST) X-Received: by 2002:ac8:43d0:: with SMTP id w16mr7614286qtn.78.1542835526092; Wed, 21 Nov 2018 13:25:26 -0800 (PST) MIME-Version: 1.0 References: <201811211654.wALGsAPT072769@pdx.rh.CN85.dnsmgr.net> In-Reply-To: <201811211654.wALGsAPT072769@pdx.rh.CN85.dnsmgr.net> From: Mateusz Piotrowski <0mp@freebsd.org> Date: Wed, 21 Nov 2018 22:25:13 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r340722 - head/lib/libbe To: rgrimes@freebsd.org Cc: kevans@freebsd.org, svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-Rspamd-Queue-Id: 510067A5E1 X-Spamd-Result: default: False [-3.98 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; FROM_HAS_DN(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; TO_DN_NONE(0.00)[]; DMARC_NA(0.00)[freebsd.org]; RCPT_COUNT_FIVE(0.00)[5]; NEURAL_HAM_LONG(-1.00)[-0.998,0]; RCVD_COUNT_THREE(0.00)[4]; RCVD_TLS_LAST(0.00)[]; MX_GOOD(-0.01)[cached: alt3.gmail-smtp-in.l.google.com]; NEURAL_HAM_SHORT(-0.96)[-0.963,0]; RCVD_IN_DNSWL_NONE(0.00)[177.160.85.209.list.dnswl.org : 127.0.5.0]; IP_SCORE(-1.01)[ipnet: 209.85.128.0/17(-3.40), asn: 15169(-1.56), country: US(-0.09)]; FORGED_SENDER(0.30)[0mp@freebsd.org,mpp302@gmail.com]; R_DKIM_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; FROM_NEQ_ENVFROM(0.00)[0mp@freebsd.org,mpp302@gmail.com] X-Rspamd-Server: mx1.freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Nov 2018 22:24:30 -0000 Hello, On Wed, 21 Nov 2018 at 17:54, Rodney W. Grimes < freebsd@pdx.rh.cn85.dnsmgr.net> wrote: > > On Wed, Nov 21, 2018 at 10:19 AM Rodney W. Grimes > > wrote: > > > > > > > Author: 0mp (ports committer) > > > > Date: Wed Nov 21 11:22:44 2018 > > > > New Revision: 340722 > > > > URL: https://svnweb.freebsd.org/changeset/base/340722 > > > > > > > > Log: > > > > libbe(3): Put each error value in separate line. > > > > > > > > As requested by a TODO in the source code. > > > > > > > > Reviewed by: bcr > > > > Approved by: krion (mentor, implicit), mat (mentor, > implicit) > > > > Differential Revision: https://reviews.freebsd.org/D18063 > > > > > > Who with a src bit approved the commit to src? > > > > > > > I do want to clarify- bcr approved it in the review (explicitly with > > "... hereby approved!") -- are you mainly pointing out that he failed > > to annotate this properly in the commit, or is doc bit approval for a > > commit to a manpage in src insufficient? > > That is defanitly a bit of a grey area, from reading and re-reading > the commit bit page it is clear that a doc committer can commit > to src documentation, it is not clear if they can approve a commit > by someone else to the src tree, it does say > ""Approved by" from a non-mentored committer > with the appropriate bit" > > It probably would be fine to have said Approved by: bcr. > True. Perhaps as a ports committer I should even write "Approved by: bcr (doc)" to make it clear that I collected appropriate approvals before committing. I've been committing small patches to the src tree for a couple of months now and I've heard that "Reviewed by: bcr" is sufficient. I guess that now I understand that "Reviewed by" is for listing people and teams who reviewed the code and "Approved by" is for listing all the necessary approvals one has to collect in order to commit. I still question what a out of scope commit that is > approved by: (mentor, implicit). I am not even sure > what that means in this context. Have his mentors > said he can commit anything anyplace without them > seeing it? If so then release the mentor/mentee bit > would be more appropriate? > mat@ and krion@ told me that I don't have to ask them about explicit approval before committing to doc or src. If I gather all the necessary approvals from doc and src committers then I am able to commit with an implicit approval from my mentors. > > As an aside, happy to approve any changes to these manpages as the > > current bectl/libbe maintainer for anyone that wants to improve them. > > =) > I'm really sorry, this is my fault. Usually, I request people, who recently contributed to a certain part of a tree or who are listed in the MAINTAINERS file, to review my changes. This time it was only meant to be a small improvement to our documentation without any actual content changes to the manual page itself so I only notified bcr. Regards, Mateusz From owner-svn-src-all@freebsd.org Wed Nov 21 22:25:06 2018 Return-Path: Delivered-To: svn-src-all@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 864361148922; Wed, 21 Nov 2018 22:25:06 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.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 234567A70A; Wed, 21 Nov 2018 22:25:06 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 043102694B; Wed, 21 Nov 2018 22:25:06 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wALMP52a018192; Wed, 21 Nov 2018 22:25:05 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wALMP5uh018191; Wed, 21 Nov 2018 22:25:05 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201811212225.wALMP5uh018191@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Wed, 21 Nov 2018 22:25:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340749 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 340749 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 234567A70A X-Spamd-Result: default: False [1.34 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.40)[0.400,0]; NEURAL_SPAM_MEDIUM(0.49)[0.489,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.45)[0.446,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Nov 2018 22:25:06 -0000 Author: mjg Date: Wed Nov 21 22:25:05 2018 New Revision: 340749 URL: https://svnweb.freebsd.org/changeset/base/340749 Log: uipc_usrreq: fix inode number assignment The code was incrementing a global variable in an unsafe manner. Two different threads stating two different sockets could have resulted in the same inode numbers assigned to both. Creation is protected with a global lock, move the assigment there. Since inode numbers are 64-bit now drop the check for overflows. Sponsored by: The FreeBSD Foundation Modified: head/sys/kern/uipc_usrreq.c Modified: head/sys/kern/uipc_usrreq.c ============================================================================== --- head/sys/kern/uipc_usrreq.c Wed Nov 21 22:16:10 2018 (r340748) +++ head/sys/kern/uipc_usrreq.c Wed Nov 21 22:25:05 2018 (r340749) @@ -530,6 +530,7 @@ uipc_attach(struct socket *so, int proto, struct threa UNP_LINK_WLOCK(); unp->unp_gencnt = ++unp_gencnt; + unp->unp_ino = ++unp_ino; unp_count++; switch (so->so_type) { case SOCK_STREAM: @@ -1302,12 +1303,8 @@ uipc_sense(struct socket *so, struct stat *sb) KASSERT(unp != NULL, ("uipc_sense: unp == NULL")); sb->st_blksize = so->so_snd.sb_hiwat; - UNP_PCB_LOCK(unp); sb->st_dev = NODEV; - if (unp->unp_ino == 0) - unp->unp_ino = (++unp_ino == 0) ? ++unp_ino : unp_ino; sb->st_ino = unp->unp_ino; - UNP_PCB_UNLOCK(unp); return (0); } From owner-svn-src-all@freebsd.org Wed Nov 21 22:37:50 2018 Return-Path: Delivered-To: svn-src-all@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 416271148D82; Wed, 21 Nov 2018 22:37:50 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.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 D77587AEA7; Wed, 21 Nov 2018 22:37:49 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B4AA226B0B; Wed, 21 Nov 2018 22:37:49 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wALMbnZ0023623; Wed, 21 Nov 2018 22:37:49 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wALMbnLI023622; Wed, 21 Nov 2018 22:37:49 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201811212237.wALMbnLI023622@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Wed, 21 Nov 2018 22:37:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340750 - head/contrib/elftoolchain/strings X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/contrib/elftoolchain/strings X-SVN-Commit-Revision: 340750 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D77587AEA7 X-Spamd-Result: default: False [1.34 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.45)[0.446,0]; NEURAL_SPAM_MEDIUM(0.49)[0.489,0]; NEURAL_SPAM_LONG(0.40)[0.400,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Nov 2018 22:37:50 -0000 Author: mjg Date: Wed Nov 21 22:37:49 2018 New Revision: 340750 URL: https://svnweb.freebsd.org/changeset/base/340750 Log: strings: unbreak the build after r340746 Discussed with: oshogbo Sponsored by: The FreeBSD Foundation Modified: head/contrib/elftoolchain/strings/strings.c Modified: head/contrib/elftoolchain/strings/strings.c ============================================================================== --- head/contrib/elftoolchain/strings/strings.c Wed Nov 21 22:25:05 2018 (r340749) +++ head/contrib/elftoolchain/strings/strings.c Wed Nov 21 22:37:49 2018 (r340750) @@ -350,7 +350,7 @@ find_strings(const char *name, off_t offset, off_t siz (void)fseeko(stdin, offset, SEEK_SET); cur_off = offset; start_off = 0; - while (true) { + for (;;) { if ((offset + size) && (cur_off >= offset + size)) break; start_off = cur_off; @@ -395,7 +395,7 @@ find_strings(const char *name, off_t offset, off_t siz } printf("%s", obuf); - while (true) { + for (;;) { if ((offset + size) && (cur_off >= offset + size)) break; From owner-svn-src-all@freebsd.org Thu Nov 22 01:25:47 2018 Return-Path: Delivered-To: svn-src-all@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 A3F5C11075D3; Thu, 22 Nov 2018 01:25:47 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 569BA811A9; Thu, 22 Nov 2018 01:25:47 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1ECBC8E8; Thu, 22 Nov 2018 01:25:47 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAM1PlqD011141; Thu, 22 Nov 2018 01:25:47 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAM1PjMK011131; Thu, 22 Nov 2018 01:25:45 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201811220125.wAM1PjMK011131@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 22 Nov 2018 01:25:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r340751 - in stable/12: etc/mtree lib/libbe sbin/bectl sbin/bectl/tests X-SVN-Group: stable-12 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in stable/12: etc/mtree lib/libbe sbin/bectl sbin/bectl/tests X-SVN-Commit-Revision: 340751 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 569BA811A9 X-Spamd-Result: default: False [1.35 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.44)[0.445,0]; NEURAL_SPAM_MEDIUM(0.56)[0.564,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.34)[0.338,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Nov 2018 01:25:48 -0000 Author: kevans Date: Thu Nov 22 01:25:44 2018 New Revision: 340751 URL: https://svnweb.freebsd.org/changeset/base/340751 Log: MFC r340507-r340508, r340592-r340594, r340635-r340636: bectl(8) fixes r340507: libbe(3): rewrite init to support chroot usage libbe(3) currently uses zfs_be_root and locates which of its children is currently mounted at "/". This is reasonable, but not correct in the case of a chroot, for two reasons: - chroot root may be of a different zpool than zfs_be_root - chroot root will not show up as mounted at "/" Fix both of these by rewriting libbe_init to work from the rootfs down. zfs_path_to_zhandle on / will resolve to the dataset mounted at the new root, rather than the real root. From there, we can derive the BE root/pool and grab the bootfs off of the new pool. This does no harm in the average case, and opens up bectl to operating on different pools for scenarios where one may be, for instance, updating a pool that generally gets re-rooted into from a separate UFS root or zfs bootpool. While here, I've also: - Eliminated the check for /boot and / to be on the same partition. This leaves one open to a setup where /boot (and consequently, kernel/modules) are not included in the boot environment. This may very well be an intentional setup done by someone that knows what they're doing, we should not kill BE usage because of it. - Eliminated the validation bits of BEs and snapshots that enforced 'mountpoint' to be "/" -- this broke when trying to operate on an imported pool with an altroot, but we need not be this picky. Reported by: philip Reviewed by: philip, allanjude (previous version) Tested by: philip Differential Revision: https://reviews.freebsd.org/D18012 r340508: libbe(3): Rewrite be_unmount to stop mucking with getmntinfo(2) Go through the ZFS layer instead; given a BE, we can derive the dataset, zfs_open it, then zfs_unmount. ZFS takes care of the dirty details and likely gets it more correct than we did for more interesting setups. r340592: bectl(3)/libbe(3): Allow BE root to be specified Add an undocumented -r option preceding the bectl subcommand to specify a BE root to operate out of. This will remain undocumented for now, as some caveats apply: - BEs cannot be activated in the pool that doesn't contain the rootfs - bectl create cannot work out of the box without the -e option right now, since it defaults to the rootfs and cross-pool cloning doesn't work like that (IIRC) Plumb the BE root through to libbe(3) so that some things -can- be done to it, e.g. bectl -r tank/ROOT create -e default upgrade bectl -r tank/ROOT mount upgrade /mnt this aides in some upgrade setups where rootfs is not necessarily ZFS, and also makes it easier/possible to regression-test bectl when combined with a file-backed zpool. Differential Revision: https://reviews.freebsd.org/D18029 r340593: libbe(3): Properly account for altroot when creating new BEs Previously we would blindly copy the 'mountpoint' property, which includes the altroot. The altroot needs to be snipped off prior to setting it on the new BE, though, or you'll end up with a new BE and a mountpoint of /mnt with altroot=/mnt r340594: bectl(8): Add some regression tests These tests operate on a file-backed zpool that gets created in the kyua temp dir. root and ZFS support are both required for these tests. Current tests cover create, destroy, export/import, jail, list (kind of), mount, rename, and jail. List tests should later be extended to cover formatting and the different list flags, but for now only covers basic "are create/destroy actually reflected properly" r340635: libbe(3): Handle non-ZFS rootfs better If rootfs isn't ZFS, current version will emit an error claiming so and fail to initialize libbe. As a consumer, bectl -r (undocumented) can be specified to operate on a BE independently of whether on a UFS or ZFS root. Unbreak this for the UFS case by only erroring out the init if we can't determine a ZFS dataset for rootfs and no BE root was specified. Consumers of libbe should take care to ensure that rootfs is non-empty if they're trying to use it, because this could certainly be the case. Some check is needed before zfs_path_to_zhandle because it will unconditionally emit to stderr if the path isn't a ZFS filesystem, which is unhelpful for our purposes. This should also unbreak the bectl(8) tests on a UFS root, as is the case in Jenkins' -test runs. r340636: bectl(8) tests: attempt to load the ZFS module Observed in a CI test image, bectl_create test will run and be marked as skipped because the module is not loaded. The first zpool invocation will automagically load the module, but bectl_create is still skipped. Subsequent tests all pass as expected because the module is now loaded and everything is OK. Added: stable/12/sbin/bectl/tests/ - copied from r340594, head/sbin/bectl/tests/ Modified: stable/12/etc/mtree/BSD.tests.dist stable/12/lib/libbe/be.c stable/12/lib/libbe/be.h stable/12/lib/libbe/be_access.c stable/12/lib/libbe/be_impl.h stable/12/lib/libbe/be_info.c stable/12/lib/libbe/libbe.3 stable/12/sbin/bectl/Makefile stable/12/sbin/bectl/bectl.c stable/12/sbin/bectl/tests/bectl_test.sh Directory Properties: stable/12/ (props changed) Modified: stable/12/etc/mtree/BSD.tests.dist ============================================================================== --- stable/12/etc/mtree/BSD.tests.dist Wed Nov 21 22:37:49 2018 (r340750) +++ stable/12/etc/mtree/BSD.tests.dist Thu Nov 22 01:25:44 2018 (r340751) @@ -390,6 +390,8 @@ .. .. sbin + bectl + .. dhclient .. devd Modified: stable/12/lib/libbe/be.c ============================================================================== --- stable/12/lib/libbe/be.c Wed Nov 21 22:37:49 2018 (r340750) +++ stable/12/lib/libbe/be.c Thu Nov 22 01:25:44 2018 (r340751) @@ -29,11 +29,12 @@ #include __FBSDID("$FreeBSD$"); +#include +#include #include -#include +#include #include -#include #include #include #include @@ -55,23 +56,30 @@ static int be_create_child_cloned(libbe_handle_t *lbh, * zfs_be_root set by loader(8). data is expected to be a libbe_handle_t *. */ static int -be_locate_rootfs(zfs_handle_t *chkds, void *data) +be_locate_rootfs(libbe_handle_t *lbh) { - libbe_handle_t *lbh; - char *mntpoint; + struct statfs sfs; + struct extmnttab entry; + zfs_handle_t *zfs; - lbh = (libbe_handle_t *)data; - if (lbh == NULL) + /* + * Check first if root is ZFS; if not, we'll bail on rootfs capture. + * Unfortunately needed because zfs_path_to_zhandle will emit to + * stderr if / isn't actually a ZFS filesystem, which we'd like + * to avoid. + */ + if (statfs("/", &sfs) == 0) { + statfs2mnttab(&sfs, &entry); + if (strcmp(entry.mnt_fstype, MNTTYPE_ZFS) != 0) + return (1); + } else return (1); - - mntpoint = NULL; - if (zfs_is_mounted(chkds, &mntpoint) && strcmp(mntpoint, "/") == 0) { - strlcpy(lbh->rootfs, zfs_get_name(chkds), sizeof(lbh->rootfs)); - free(mntpoint); + zfs = zfs_path_to_zhandle(lbh->lzh, "/", ZFS_TYPE_FILESYSTEM); + if (zfs == NULL) return (1); - } else if(mntpoint != NULL) - free(mntpoint); + strlcpy(lbh->rootfs, zfs_get_name(zfs), sizeof(lbh->rootfs)); + zfs_close(zfs); return (0); } @@ -80,52 +88,40 @@ be_locate_rootfs(zfs_handle_t *chkds, void *data) * dataset, for example, zroot/ROOT. */ libbe_handle_t * -libbe_init(void) +libbe_init(const char *root) { - struct stat sb; - dev_t root_dev, boot_dev; libbe_handle_t *lbh; - zfs_handle_t *rootds; char *poolname, *pos; int pnamelen; lbh = NULL; poolname = pos = NULL; - rootds = NULL; - /* Verify that /boot and / are mounted on the same filesystem */ - /* TODO: use errno here?? */ - if (stat("/", &sb) != 0) - goto err; - - root_dev = sb.st_dev; - - if (stat("/boot", &sb) != 0) - goto err; - - boot_dev = sb.st_dev; - - if (root_dev != boot_dev) { - fprintf(stderr, "/ and /boot not on same device, quitting\n"); - goto err; - } - if ((lbh = calloc(1, sizeof(libbe_handle_t))) == NULL) goto err; if ((lbh->lzh = libzfs_init()) == NULL) goto err; - /* Obtain path to boot environment root */ - if ((kenv(KENV_GET, "zfs_be_root", lbh->root, - sizeof(lbh->root))) == -1) - goto err; + /* + * Grab rootfs, we'll work backwards from there if an optional BE root + * has not been passed in. + */ + if (be_locate_rootfs(lbh) != 0) { + if (root == NULL) + goto err; + *lbh->rootfs = '\0'; + } + if (root == NULL) { + /* Strip off the final slash from rootfs to get the be root */ + strlcpy(lbh->root, lbh->rootfs, sizeof(lbh->root)); + pos = strrchr(lbh->root, '/'); + if (pos == NULL) + goto err; + *pos = '\0'; + } else + strlcpy(lbh->root, root, sizeof(lbh->root)); - /* Remove leading 'zfs:' if present, otherwise use value as-is */ - if (strcmp(lbh->root, "zfs:") == 0) - strlcpy(lbh->root, strchr(lbh->root, ':') + sizeof(char), - sizeof(lbh->root)); - if ((pos = strchr(lbh->root, '/')) == NULL) goto err; @@ -144,17 +140,6 @@ libbe_init(void) sizeof(lbh->bootfs), NULL, true) != 0) goto err; - /* Obtain path to boot environment rootfs (currently booted) */ - /* XXX Get dataset mounted at / by kenv/GUID from mountroot? */ - if ((rootds = zfs_open(lbh->lzh, lbh->root, ZFS_TYPE_DATASET)) == NULL) - goto err; - - zfs_iter_filesystems(rootds, be_locate_rootfs, lbh); - zfs_close(rootds); - rootds = NULL; - if (*lbh->rootfs == '\0') - goto err; - return (lbh); err: if (lbh != NULL) { @@ -337,6 +322,7 @@ be_deep_clone_prop(int prop, void *cb) zprop_source_t src; char pval[BE_MAXPATHLEN]; char source[BE_MAXPATHLEN]; + char *val; dccb = cb; /* Skip some properties we don't want to touch */ @@ -356,7 +342,15 @@ be_deep_clone_prop(int prop, void *cb) if (src != ZPROP_SRC_LOCAL) return (ZPROP_CONT); - nvlist_add_string(dccb->props, zfs_prop_to_name(prop), (char *)pval); + /* Augment mountpoint with altroot, if needed */ + val = pval; + if (prop == ZFS_PROP_MOUNTPOINT && *dccb->altroot != '\0') { + if (pval[strlen(dccb->altroot)] == '\0') + strlcpy(pval, "/", sizeof(pval)); + else + val = pval + strlen(dccb->altroot); + } + nvlist_add_string(dccb->props, zfs_prop_to_name(prop), val); return (ZPROP_CONT); } @@ -399,6 +393,10 @@ be_deep_clone(zfs_handle_t *ds, void *data) dccb.zhp = ds; dccb.props = props; + if (zpool_get_prop(isdc->lbh->active_phandle, ZPOOL_PROP_ALTROOT, + dccb.altroot, sizeof(dccb.altroot), NULL, true) != 0 || + strcmp(dccb.altroot, "-") == 0) + *dccb.altroot = '\0'; if (zprop_iter(be_deep_clone_prop, &dccb, B_FALSE, B_FALSE, ZFS_TYPE_FILESYSTEM) == ZPROP_INVAL) return (-1); @@ -503,10 +501,6 @@ be_create_from_existing(libbe_handle_t *lbh, const cha int be_validate_snap(libbe_handle_t *lbh, const char *snap_name) { - zfs_handle_t *zfs_hdl; - char buf[BE_MAXPATHLEN]; - char *delim_pos; - int err = BE_ERR_SUCCESS; if (strlen(snap_name) >= BE_MAXPATHLEN) return (BE_ERR_PATHLEN); @@ -515,27 +509,7 @@ be_validate_snap(libbe_handle_t *lbh, const char *snap ZFS_TYPE_SNAPSHOT)) return (BE_ERR_NOENT); - strlcpy(buf, snap_name, sizeof(buf)); - - /* Find the base filesystem of the snapshot */ - if ((delim_pos = strchr(buf, '@')) == NULL) - return (BE_ERR_INVALIDNAME); - *delim_pos = '\0'; - - if ((zfs_hdl = - zfs_open(lbh->lzh, buf, ZFS_TYPE_DATASET)) == NULL) - return (BE_ERR_NOORIGIN); - - if ((err = zfs_prop_get(zfs_hdl, ZFS_PROP_MOUNTPOINT, buf, - sizeof(buf), NULL, NULL, 0, 1)) != 0) - err = BE_ERR_BADMOUNT; - - if ((err != 0) && (strncmp(buf, "/", sizeof(buf)) != 0)) - err = BE_ERR_BADMOUNT; - - zfs_close(zfs_hdl); - - return (err); + return (BE_ERR_SUCCESS); } Modified: stable/12/lib/libbe/be.h ============================================================================== --- stable/12/lib/libbe/be.h Wed Nov 21 22:37:49 2018 (r340750) +++ stable/12/lib/libbe/be.h Thu Nov 22 01:25:44 2018 (r340751) @@ -63,7 +63,7 @@ typedef enum be_error { /* Library handling functions: be.c */ -libbe_handle_t *libbe_init(void); +libbe_handle_t *libbe_init(const char *root); void libbe_close(libbe_handle_t *); /* Bootenv information functions: be_info.c */ Modified: stable/12/lib/libbe/be_access.c ============================================================================== --- stable/12/lib/libbe/be_access.c Wed Nov 21 22:37:49 2018 (r340750) +++ stable/12/lib/libbe/be_access.c Thu Nov 22 01:25:44 2018 (r340751) @@ -164,37 +164,18 @@ be_unmount(libbe_handle_t *lbh, char *bootenv, int fla { int err, mntflags; char be[BE_MAXPATHLEN]; - struct statfs *mntbuf; - int mntsize; - char *mntpath; + zfs_handle_t *root_hdl; if ((err = be_root_concat(lbh, bootenv, be)) != 0) return (set_error(lbh, err)); - if ((mntsize = getmntinfo(&mntbuf, MNT_NOWAIT)) == 0) { - if (errno == EIO) - return (set_error(lbh, BE_ERR_IO)); - return (set_error(lbh, BE_ERR_NOMOUNT)); - } + if ((root_hdl = zfs_open(lbh->lzh, be, ZFS_TYPE_FILESYSTEM)) == NULL) + return (set_error(lbh, BE_ERR_ZFSOPEN)); - mntpath = NULL; - for (int i = 0; i < mntsize; ++i) { - /* 0x000000de is the type number of zfs */ - if (mntbuf[i].f_type != 0x000000de) - continue; + mntflags = (flags & BE_MNT_FORCE) ? MS_FORCE : 0; - if (strcmp(mntbuf[i].f_mntfromname, be) == 0) { - mntpath = mntbuf[i].f_mntonname; - break; - } - } - - if (mntpath == NULL) - return (set_error(lbh, BE_ERR_NOMOUNT)); - - mntflags = (flags & BE_MNT_FORCE) ? MNT_FORCE : 0; - - if ((err = unmount(mntpath, mntflags)) != 0) { + if (zfs_unmount(root_hdl, NULL, mntflags) != 0) { + zfs_close(root_hdl); switch (errno) { case ENAMETOOLONG: return (set_error(lbh, BE_ERR_PATHLEN)); @@ -210,6 +191,7 @@ be_unmount(libbe_handle_t *lbh, char *bootenv, int fla return (set_error(lbh, BE_ERR_UNKNOWN)); } } + zfs_close(root_hdl); - return (set_error(lbh, BE_ERR_SUCCESS)); + return (BE_ERR_SUCCESS); } Modified: stable/12/lib/libbe/be_impl.h ============================================================================== --- stable/12/lib/libbe/be_impl.h Wed Nov 21 22:37:49 2018 (r340750) +++ stable/12/lib/libbe/be_impl.h Thu Nov 22 01:25:44 2018 (r340751) @@ -55,6 +55,7 @@ struct libbe_deep_clone { struct libbe_dccb { zfs_handle_t *zhp; nvlist_t *props; + char altroot[MAXPATHLEN]; }; typedef struct prop_data { Modified: stable/12/lib/libbe/be_info.c ============================================================================== --- stable/12/lib/libbe/be_info.c Wed Nov 21 22:37:49 2018 (r340750) +++ stable/12/lib/libbe/be_info.c Thu Nov 22 01:25:44 2018 (r340751) @@ -42,7 +42,10 @@ const char * be_active_name(libbe_handle_t *lbh) { - return (strrchr(lbh->rootfs, '/') + sizeof(char)); + if (*lbh->rootfs != '\0') + return (strrchr(lbh->rootfs, '/') + sizeof(char)); + else + return (lbh->rootfs); } @@ -63,7 +66,10 @@ const char * be_nextboot_name(libbe_handle_t *lbh) { - return (strrchr(lbh->bootfs, '/') + sizeof(char)); + if (*lbh->bootfs != '\0') + return (strrchr(lbh->bootfs, '/') + sizeof(char)); + else + return (lbh->bootfs); } @@ -289,30 +295,11 @@ int be_exists(libbe_handle_t *lbh, char *be) { char buf[BE_MAXPATHLEN]; - nvlist_t *dsprops; - char *mntpoint; - bool valid; be_root_concat(lbh, be, buf); if (!zfs_dataset_exists(lbh->lzh, buf, ZFS_TYPE_DATASET)) return (BE_ERR_NOENT); - /* Also check if it's mounted at / */ - if (be_prop_list_alloc(&dsprops) != 0) - return (BE_ERR_UNKNOWN); - - if (be_get_dataset_props(lbh, buf, dsprops) != 0) { - nvlist_free(dsprops); - return (BE_ERR_UNKNOWN); - } - - if (nvlist_lookup_string(dsprops, "mountpoint", &mntpoint) == 0) { - valid = (strcmp(mntpoint, "/") == 0); - nvlist_free(dsprops); - return (valid ? BE_ERR_SUCCESS : BE_ERR_BADMOUNT); - } - - nvlist_free(dsprops); - return (BE_ERR_BADMOUNT); + return (BE_ERR_SUCCESS); } Modified: stable/12/lib/libbe/libbe.3 ============================================================================== --- stable/12/lib/libbe/libbe.3 Wed Nov 21 22:37:49 2018 (r340750) +++ stable/12/lib/libbe/libbe.3 Thu Nov 22 01:25:44 2018 (r340751) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 31, 2018 +.Dd November 17, 2018 .Dt LIBBE 3 .Os .Sh NAME @@ -39,7 +39,7 @@ .Sh SYNOPSIS .In be.h .Ft "libbe_handle_t *hdl" Ns -.Fn libbe_init void +.Fn libbe_init "const char *be_root" .Pp .Ft void .Fn libbe_close "libbe_handle_t *hdl" @@ -157,13 +157,16 @@ errno otherwise as described in .Pp The .Fn libbe_init -function initializes +function takes an optional BE root and initializes .Nm , returning a .Vt "libbe_handle_t *" on success, or .Dv NULL on error. +If a BE root is supplied, +.Nm +will only operate out of that pool and BE root. An error may occur if: .Bl -column .It /boot and / are not on the same filesystem and device, @@ -184,11 +187,15 @@ invalidating the handle in the process. .Pp The .Fn be_active_name -function returns the name of the currently booted boot environment, +function returns the name of the currently booted boot environment. +This boot environment may not belong to the same BE root as the root libbe +is operating on! .Pp The .Fn be_active_path function returns the full path of the currently booted boot environment. +This boot environment may not belong to the same BE root as the root libbe +is operating on! .Pp The .Fn be_nextboot_name Modified: stable/12/sbin/bectl/Makefile ============================================================================== --- stable/12/sbin/bectl/Makefile Wed Nov 21 22:37:49 2018 (r340750) +++ stable/12/sbin/bectl/Makefile Thu Nov 22 01:25:44 2018 (r340751) @@ -1,5 +1,7 @@ # $FreeBSD$ +.include + PROG= bectl MAN= bectl.8 @@ -15,5 +17,8 @@ CFLAGS+= -I${SRCTOP}/sys/cddl/compat/opensolaris CFLAGS+= -I${SRCTOP}/sys/cddl/contrib/opensolaris/uts/common CFLAGS+= -DNEED_SOLARIS_BOOLEAN + +HAS_TESTS= yes +SUBDIR.${MK_TESTS}+= tests .include Modified: stable/12/sbin/bectl/bectl.c ============================================================================== --- stable/12/sbin/bectl/bectl.c Wed Nov 21 22:37:49 2018 (r340750) +++ stable/12/sbin/bectl/bectl.c Thu Nov 22 01:25:44 2018 (r340751) @@ -489,12 +489,25 @@ int main(int argc, char *argv[]) { const char *command; + char *root; int command_index, rc; + root = NULL; if (argc < 2) return (usage(false)); - command = argv[1]; + if (strcmp(argv[1], "-r") == 0) { + if (argc < 4) + return (usage(false)); + root = strdup(argv[2]); + command = argv[3]; + argc -= 3; + argv += 3; + } else { + command = argv[1]; + argc -= 1; + argv += 1; + } /* Handle command aliases */ if (strcmp(command, "umount") == 0) @@ -512,13 +525,12 @@ main(int argc, char *argv[]) } - if ((be = libbe_init()) == NULL) + if ((be = libbe_init(root)) == NULL) return (-1); libbe_print_on_error(be, true); - /* XXX TODO: can be simplified if offset by 2 instead of one */ - rc = command_map[command_index].fn(argc-1, argv+1); + rc = command_map[command_index].fn(argc, argv); libbe_close(be); return (rc); Modified: stable/12/sbin/bectl/tests/bectl_test.sh ============================================================================== --- head/sbin/bectl/tests/bectl_test.sh Mon Nov 19 02:30:12 2018 (r340594) +++ stable/12/sbin/bectl/tests/bectl_test.sh Thu Nov 22 01:25:44 2018 (r340751) @@ -34,7 +34,7 @@ bectl_create_setup() disk=$2 mnt=$3 - kldstat -qm zfs || atf_skip "ZFS module not loaded on the current system" + kldload -n -q zfs || atf_skip "ZFS module not loaded on the current system" atf_check mkdir -p ${mnt} atf_check truncate -s 1G ${disk} atf_check zpool create -o altroot=${mnt} ${zpool} ${disk} From owner-svn-src-all@freebsd.org Thu Nov 22 03:04:14 2018 Return-Path: Delivered-To: svn-src-all@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 CC2E61132262; Thu, 22 Nov 2018 03:04:14 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7024485924; Thu, 22 Nov 2018 03:04:14 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4DD7A1C37; Thu, 22 Nov 2018 03:04:14 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAM34ElU062889; Thu, 22 Nov 2018 03:04:14 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAM34Eq8062888; Thu, 22 Nov 2018 03:04:14 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201811220304.wAM34Eq8062888@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 22 Nov 2018 03:04:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r340752 - stable/12/tools/boot X-SVN-Group: stable-12 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: stable/12/tools/boot X-SVN-Commit-Revision: 340752 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 7024485924 X-Spamd-Result: default: False [1.24 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.39)[0.387,0]; NEURAL_SPAM_SHORT(0.36)[0.365,0]; NEURAL_SPAM_MEDIUM(0.49)[0.492,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Nov 2018 03:04:15 -0000 Author: kevans Date: Thu Nov 22 03:04:13 2018 New Revision: 340752 URL: https://svnweb.freebsd.org/changeset/base/340752 Log: MFC r339701: Update lualoader test script a little bit Use userboot.so from the test directory if possible, fall back to .OBJDIR. This avoids a problem that we've had since userboot coexistence was added, where userboot.so alone no longer exists in the .OBJDIR but is instead just a link installed later. Update lualo Modified: stable/12/tools/boot/lua-test.sh Directory Properties: stable/12/ (props changed) Modified: stable/12/tools/boot/lua-test.sh ============================================================================== --- stable/12/tools/boot/lua-test.sh Thu Nov 22 01:25:44 2018 (r340751) +++ stable/12/tools/boot/lua-test.sh Thu Nov 22 03:04:13 2018 (r340752) @@ -13,13 +13,16 @@ scriptdir=$(dirname $(realpath $0)) cd $(make -V SRCTOP)/stand obj=$(make -V .OBJDIR) t=$obj/userboot/test/test -u=$obj/userboot/userboot/userboot.so [ -n "$dir" ] || dir=/tmp/loadertest [ -d "$dir" ] || ${scriptdir}/lua-img.sh ${dir} +# We'll try userboot.so from the test directory before plucking it straight out +# of .OBJDIR. +u=$dir/boot/userboot.so +[ -f "$u" ] || u=$obj/userboot/userboot_lua/userboot_lua.so [ -f "$dir/boot/lua/loader.lua" ] || die "No boot/lua/loader.lua found" [ -f "$dir/boot/kernel/kernel" ] || die "No kernel to load" [ -x "$t" ] || die "no userboot test jig found ($t)" -[ -x "$u" ] || die "no userboot.so ($u) found" +[ -f "$u" ] || die "no userboot.so ($u) found" $t -h $dir -b $u From owner-svn-src-all@freebsd.org Thu Nov 22 04:39:09 2018 Return-Path: Delivered-To: svn-src-all@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 72A7611367ED; Thu, 22 Nov 2018 04:39:09 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 216A689972; Thu, 22 Nov 2018 04:39:09 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 023CB2BBE; Thu, 22 Nov 2018 04:39:09 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAM4d8PD008933; Thu, 22 Nov 2018 04:39:08 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAM4d7h9008922; Thu, 22 Nov 2018 04:39:07 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201811220439.wAM4d7h9008922@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 22 Nov 2018 04:39:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r340753 - in releng/12.0: etc/mtree lib/libbe sbin/bectl sbin/bectl/tests X-SVN-Group: releng X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in releng/12.0: etc/mtree lib/libbe sbin/bectl sbin/bectl/tests X-SVN-Commit-Revision: 340753 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 216A689972 X-Spamd-Result: default: False [1.41 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.46)[0.458,0]; NEURAL_SPAM_MEDIUM(0.56)[0.561,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.39)[0.393,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Nov 2018 04:39:09 -0000 Author: kevans Date: Thu Nov 22 04:39:06 2018 New Revision: 340753 URL: https://svnweb.freebsd.org/changeset/base/340753 Log: MFC r340507-r340508, r340592-r340594, r340635-r340636: bectl(8) fixes r340507: libbe(3): rewrite init to support chroot usage libbe(3) currently uses zfs_be_root and locates which of its children is currently mounted at "/". This is reasonable, but not correct in the case of a chroot, for two reasons: - chroot root may be of a different zpool than zfs_be_root - chroot root will not show up as mounted at "/" Fix both of these by rewriting libbe_init to work from the rootfs down. zfs_path_to_zhandle on / will resolve to the dataset mounted at the new root, rather than the real root. From there, we can derive the BE root/pool and grab the bootfs off of the new pool. This does no harm in the average case, and opens up bectl to operating on different pools for scenarios where one may be, for instance, updating a pool that generally gets re-rooted into from a separate UFS root or zfs bootpool. While here, I've also: - Eliminated the check for /boot and / to be on the same partition. This leaves one open to a setup where /boot (and consequently, kernel/modules) are not included in the boot environment. This may very well be an intentional setup done by someone that knows what they're doing, we should not kill BE usage because of it. - Eliminated the validation bits of BEs and snapshots that enforced 'mountpoint' to be "/" -- this broke when trying to operate on an imported pool with an altroot, but we need not be this picky. Reported by: philip Reviewed by: philip, allanjude (previous version) Tested by: philip Differential Revision: https://reviews.freebsd.org/D18012 r340508: libbe(3): Rewrite be_unmount to stop mucking with getmntinfo(2) Go through the ZFS layer instead; given a BE, we can derive the dataset, zfs_open it, then zfs_unmount. ZFS takes care of the dirty details and likely gets it more correct than we did for more interesting setups. r340592: bectl(3)/libbe(3): Allow BE root to be specified Add an undocumented -r option preceding the bectl subcommand to specify a BE root to operate out of. This will remain undocumented for now, as some caveats apply: - BEs cannot be activated in the pool that doesn't contain the rootfs - bectl create cannot work out of the box without the -e option right now, since it defaults to the rootfs and cross-pool cloning doesn't work like that (IIRC) Plumb the BE root through to libbe(3) so that some things -can- be done to it, e.g. bectl -r tank/ROOT create -e default upgrade bectl -r tank/ROOT mount upgrade /mnt this aides in some upgrade setups where rootfs is not necessarily ZFS, and also makes it easier/possible to regression-test bectl when combined with a file-backed zpool. Differential Revision: https://reviews.freebsd.org/D18029 r340593: libbe(3): Properly account for altroot when creating new BEs Previously we would blindly copy the 'mountpoint' property, which includes the altroot. The altroot needs to be snipped off prior to setting it on the new BE, though, or you'll end up with a new BE and a mountpoint of /mnt with altroot=/mnt r340594: bectl(8): Add some regression tests These tests operate on a file-backed zpool that gets created in the kyua temp dir. root and ZFS support are both required for these tests. Current tests cover create, destroy, export/import, jail, list (kind of), mount, rename, and jail. List tests should later be extended to cover formatting and the different list flags, but for now only covers basic "are create/destroy actually reflected properly" r340635: libbe(3): Handle non-ZFS rootfs better If rootfs isn't ZFS, current version will emit an error claiming so and fail to initialize libbe. As a consumer, bectl -r (undocumented) can be specified to operate on a BE independently of whether on a UFS or ZFS root. Unbreak this for the UFS case by only erroring out the init if we can't determine a ZFS dataset for rootfs and no BE root was specified. Consumers of libbe should take care to ensure that rootfs is non-empty if they're trying to use it, because this could certainly be the case. Some check is needed before zfs_path_to_zhandle because it will unconditionally emit to stderr if the path isn't a ZFS filesystem, which is unhelpful for our purposes. This should also unbreak the bectl(8) tests on a UFS root, as is the case in Jenkins' -test runs. r340636: bectl(8) tests: attempt to load the ZFS module Observed in a CI test image, bectl_create test will run and be marked as skipped because the module is not loaded. The first zpool invocation will automagically load the module, but bectl_create is still skipped. Subsequent tests all pass as expected because the module is now loaded and everything is OK. Approved by: re (gjb) Added: releng/12.0/sbin/bectl/tests/ - copied from r340751, stable/12/sbin/bectl/tests/ Modified: releng/12.0/etc/mtree/BSD.tests.dist releng/12.0/lib/libbe/be.c releng/12.0/lib/libbe/be.h releng/12.0/lib/libbe/be_access.c releng/12.0/lib/libbe/be_impl.h releng/12.0/lib/libbe/be_info.c releng/12.0/lib/libbe/libbe.3 releng/12.0/sbin/bectl/Makefile releng/12.0/sbin/bectl/bectl.c Directory Properties: releng/12.0/ (props changed) Modified: releng/12.0/etc/mtree/BSD.tests.dist ============================================================================== --- releng/12.0/etc/mtree/BSD.tests.dist Thu Nov 22 03:04:13 2018 (r340752) +++ releng/12.0/etc/mtree/BSD.tests.dist Thu Nov 22 04:39:06 2018 (r340753) @@ -390,6 +390,8 @@ .. .. sbin + bectl + .. dhclient .. devd Modified: releng/12.0/lib/libbe/be.c ============================================================================== --- releng/12.0/lib/libbe/be.c Thu Nov 22 03:04:13 2018 (r340752) +++ releng/12.0/lib/libbe/be.c Thu Nov 22 04:39:06 2018 (r340753) @@ -29,11 +29,12 @@ #include __FBSDID("$FreeBSD$"); +#include +#include #include -#include +#include #include -#include #include #include #include @@ -55,23 +56,30 @@ static int be_create_child_cloned(libbe_handle_t *lbh, * zfs_be_root set by loader(8). data is expected to be a libbe_handle_t *. */ static int -be_locate_rootfs(zfs_handle_t *chkds, void *data) +be_locate_rootfs(libbe_handle_t *lbh) { - libbe_handle_t *lbh; - char *mntpoint; + struct statfs sfs; + struct extmnttab entry; + zfs_handle_t *zfs; - lbh = (libbe_handle_t *)data; - if (lbh == NULL) + /* + * Check first if root is ZFS; if not, we'll bail on rootfs capture. + * Unfortunately needed because zfs_path_to_zhandle will emit to + * stderr if / isn't actually a ZFS filesystem, which we'd like + * to avoid. + */ + if (statfs("/", &sfs) == 0) { + statfs2mnttab(&sfs, &entry); + if (strcmp(entry.mnt_fstype, MNTTYPE_ZFS) != 0) + return (1); + } else return (1); - - mntpoint = NULL; - if (zfs_is_mounted(chkds, &mntpoint) && strcmp(mntpoint, "/") == 0) { - strlcpy(lbh->rootfs, zfs_get_name(chkds), sizeof(lbh->rootfs)); - free(mntpoint); + zfs = zfs_path_to_zhandle(lbh->lzh, "/", ZFS_TYPE_FILESYSTEM); + if (zfs == NULL) return (1); - } else if(mntpoint != NULL) - free(mntpoint); + strlcpy(lbh->rootfs, zfs_get_name(zfs), sizeof(lbh->rootfs)); + zfs_close(zfs); return (0); } @@ -80,52 +88,40 @@ be_locate_rootfs(zfs_handle_t *chkds, void *data) * dataset, for example, zroot/ROOT. */ libbe_handle_t * -libbe_init(void) +libbe_init(const char *root) { - struct stat sb; - dev_t root_dev, boot_dev; libbe_handle_t *lbh; - zfs_handle_t *rootds; char *poolname, *pos; int pnamelen; lbh = NULL; poolname = pos = NULL; - rootds = NULL; - /* Verify that /boot and / are mounted on the same filesystem */ - /* TODO: use errno here?? */ - if (stat("/", &sb) != 0) - goto err; - - root_dev = sb.st_dev; - - if (stat("/boot", &sb) != 0) - goto err; - - boot_dev = sb.st_dev; - - if (root_dev != boot_dev) { - fprintf(stderr, "/ and /boot not on same device, quitting\n"); - goto err; - } - if ((lbh = calloc(1, sizeof(libbe_handle_t))) == NULL) goto err; if ((lbh->lzh = libzfs_init()) == NULL) goto err; - /* Obtain path to boot environment root */ - if ((kenv(KENV_GET, "zfs_be_root", lbh->root, - sizeof(lbh->root))) == -1) - goto err; + /* + * Grab rootfs, we'll work backwards from there if an optional BE root + * has not been passed in. + */ + if (be_locate_rootfs(lbh) != 0) { + if (root == NULL) + goto err; + *lbh->rootfs = '\0'; + } + if (root == NULL) { + /* Strip off the final slash from rootfs to get the be root */ + strlcpy(lbh->root, lbh->rootfs, sizeof(lbh->root)); + pos = strrchr(lbh->root, '/'); + if (pos == NULL) + goto err; + *pos = '\0'; + } else + strlcpy(lbh->root, root, sizeof(lbh->root)); - /* Remove leading 'zfs:' if present, otherwise use value as-is */ - if (strcmp(lbh->root, "zfs:") == 0) - strlcpy(lbh->root, strchr(lbh->root, ':') + sizeof(char), - sizeof(lbh->root)); - if ((pos = strchr(lbh->root, '/')) == NULL) goto err; @@ -144,17 +140,6 @@ libbe_init(void) sizeof(lbh->bootfs), NULL, true) != 0) goto err; - /* Obtain path to boot environment rootfs (currently booted) */ - /* XXX Get dataset mounted at / by kenv/GUID from mountroot? */ - if ((rootds = zfs_open(lbh->lzh, lbh->root, ZFS_TYPE_DATASET)) == NULL) - goto err; - - zfs_iter_filesystems(rootds, be_locate_rootfs, lbh); - zfs_close(rootds); - rootds = NULL; - if (*lbh->rootfs == '\0') - goto err; - return (lbh); err: if (lbh != NULL) { @@ -337,6 +322,7 @@ be_deep_clone_prop(int prop, void *cb) zprop_source_t src; char pval[BE_MAXPATHLEN]; char source[BE_MAXPATHLEN]; + char *val; dccb = cb; /* Skip some properties we don't want to touch */ @@ -356,7 +342,15 @@ be_deep_clone_prop(int prop, void *cb) if (src != ZPROP_SRC_LOCAL) return (ZPROP_CONT); - nvlist_add_string(dccb->props, zfs_prop_to_name(prop), (char *)pval); + /* Augment mountpoint with altroot, if needed */ + val = pval; + if (prop == ZFS_PROP_MOUNTPOINT && *dccb->altroot != '\0') { + if (pval[strlen(dccb->altroot)] == '\0') + strlcpy(pval, "/", sizeof(pval)); + else + val = pval + strlen(dccb->altroot); + } + nvlist_add_string(dccb->props, zfs_prop_to_name(prop), val); return (ZPROP_CONT); } @@ -399,6 +393,10 @@ be_deep_clone(zfs_handle_t *ds, void *data) dccb.zhp = ds; dccb.props = props; + if (zpool_get_prop(isdc->lbh->active_phandle, ZPOOL_PROP_ALTROOT, + dccb.altroot, sizeof(dccb.altroot), NULL, true) != 0 || + strcmp(dccb.altroot, "-") == 0) + *dccb.altroot = '\0'; if (zprop_iter(be_deep_clone_prop, &dccb, B_FALSE, B_FALSE, ZFS_TYPE_FILESYSTEM) == ZPROP_INVAL) return (-1); @@ -503,10 +501,6 @@ be_create_from_existing(libbe_handle_t *lbh, const cha int be_validate_snap(libbe_handle_t *lbh, const char *snap_name) { - zfs_handle_t *zfs_hdl; - char buf[BE_MAXPATHLEN]; - char *delim_pos; - int err = BE_ERR_SUCCESS; if (strlen(snap_name) >= BE_MAXPATHLEN) return (BE_ERR_PATHLEN); @@ -515,27 +509,7 @@ be_validate_snap(libbe_handle_t *lbh, const char *snap ZFS_TYPE_SNAPSHOT)) return (BE_ERR_NOENT); - strlcpy(buf, snap_name, sizeof(buf)); - - /* Find the base filesystem of the snapshot */ - if ((delim_pos = strchr(buf, '@')) == NULL) - return (BE_ERR_INVALIDNAME); - *delim_pos = '\0'; - - if ((zfs_hdl = - zfs_open(lbh->lzh, buf, ZFS_TYPE_DATASET)) == NULL) - return (BE_ERR_NOORIGIN); - - if ((err = zfs_prop_get(zfs_hdl, ZFS_PROP_MOUNTPOINT, buf, - sizeof(buf), NULL, NULL, 0, 1)) != 0) - err = BE_ERR_BADMOUNT; - - if ((err != 0) && (strncmp(buf, "/", sizeof(buf)) != 0)) - err = BE_ERR_BADMOUNT; - - zfs_close(zfs_hdl); - - return (err); + return (BE_ERR_SUCCESS); } Modified: releng/12.0/lib/libbe/be.h ============================================================================== --- releng/12.0/lib/libbe/be.h Thu Nov 22 03:04:13 2018 (r340752) +++ releng/12.0/lib/libbe/be.h Thu Nov 22 04:39:06 2018 (r340753) @@ -63,7 +63,7 @@ typedef enum be_error { /* Library handling functions: be.c */ -libbe_handle_t *libbe_init(void); +libbe_handle_t *libbe_init(const char *root); void libbe_close(libbe_handle_t *); /* Bootenv information functions: be_info.c */ Modified: releng/12.0/lib/libbe/be_access.c ============================================================================== --- releng/12.0/lib/libbe/be_access.c Thu Nov 22 03:04:13 2018 (r340752) +++ releng/12.0/lib/libbe/be_access.c Thu Nov 22 04:39:06 2018 (r340753) @@ -164,37 +164,18 @@ be_unmount(libbe_handle_t *lbh, char *bootenv, int fla { int err, mntflags; char be[BE_MAXPATHLEN]; - struct statfs *mntbuf; - int mntsize; - char *mntpath; + zfs_handle_t *root_hdl; if ((err = be_root_concat(lbh, bootenv, be)) != 0) return (set_error(lbh, err)); - if ((mntsize = getmntinfo(&mntbuf, MNT_NOWAIT)) == 0) { - if (errno == EIO) - return (set_error(lbh, BE_ERR_IO)); - return (set_error(lbh, BE_ERR_NOMOUNT)); - } + if ((root_hdl = zfs_open(lbh->lzh, be, ZFS_TYPE_FILESYSTEM)) == NULL) + return (set_error(lbh, BE_ERR_ZFSOPEN)); - mntpath = NULL; - for (int i = 0; i < mntsize; ++i) { - /* 0x000000de is the type number of zfs */ - if (mntbuf[i].f_type != 0x000000de) - continue; + mntflags = (flags & BE_MNT_FORCE) ? MS_FORCE : 0; - if (strcmp(mntbuf[i].f_mntfromname, be) == 0) { - mntpath = mntbuf[i].f_mntonname; - break; - } - } - - if (mntpath == NULL) - return (set_error(lbh, BE_ERR_NOMOUNT)); - - mntflags = (flags & BE_MNT_FORCE) ? MNT_FORCE : 0; - - if ((err = unmount(mntpath, mntflags)) != 0) { + if (zfs_unmount(root_hdl, NULL, mntflags) != 0) { + zfs_close(root_hdl); switch (errno) { case ENAMETOOLONG: return (set_error(lbh, BE_ERR_PATHLEN)); @@ -210,6 +191,7 @@ be_unmount(libbe_handle_t *lbh, char *bootenv, int fla return (set_error(lbh, BE_ERR_UNKNOWN)); } } + zfs_close(root_hdl); - return (set_error(lbh, BE_ERR_SUCCESS)); + return (BE_ERR_SUCCESS); } Modified: releng/12.0/lib/libbe/be_impl.h ============================================================================== --- releng/12.0/lib/libbe/be_impl.h Thu Nov 22 03:04:13 2018 (r340752) +++ releng/12.0/lib/libbe/be_impl.h Thu Nov 22 04:39:06 2018 (r340753) @@ -55,6 +55,7 @@ struct libbe_deep_clone { struct libbe_dccb { zfs_handle_t *zhp; nvlist_t *props; + char altroot[MAXPATHLEN]; }; typedef struct prop_data { Modified: releng/12.0/lib/libbe/be_info.c ============================================================================== --- releng/12.0/lib/libbe/be_info.c Thu Nov 22 03:04:13 2018 (r340752) +++ releng/12.0/lib/libbe/be_info.c Thu Nov 22 04:39:06 2018 (r340753) @@ -42,7 +42,10 @@ const char * be_active_name(libbe_handle_t *lbh) { - return (strrchr(lbh->rootfs, '/') + sizeof(char)); + if (*lbh->rootfs != '\0') + return (strrchr(lbh->rootfs, '/') + sizeof(char)); + else + return (lbh->rootfs); } @@ -63,7 +66,10 @@ const char * be_nextboot_name(libbe_handle_t *lbh) { - return (strrchr(lbh->bootfs, '/') + sizeof(char)); + if (*lbh->bootfs != '\0') + return (strrchr(lbh->bootfs, '/') + sizeof(char)); + else + return (lbh->bootfs); } @@ -289,30 +295,11 @@ int be_exists(libbe_handle_t *lbh, char *be) { char buf[BE_MAXPATHLEN]; - nvlist_t *dsprops; - char *mntpoint; - bool valid; be_root_concat(lbh, be, buf); if (!zfs_dataset_exists(lbh->lzh, buf, ZFS_TYPE_DATASET)) return (BE_ERR_NOENT); - /* Also check if it's mounted at / */ - if (be_prop_list_alloc(&dsprops) != 0) - return (BE_ERR_UNKNOWN); - - if (be_get_dataset_props(lbh, buf, dsprops) != 0) { - nvlist_free(dsprops); - return (BE_ERR_UNKNOWN); - } - - if (nvlist_lookup_string(dsprops, "mountpoint", &mntpoint) == 0) { - valid = (strcmp(mntpoint, "/") == 0); - nvlist_free(dsprops); - return (valid ? BE_ERR_SUCCESS : BE_ERR_BADMOUNT); - } - - nvlist_free(dsprops); - return (BE_ERR_BADMOUNT); + return (BE_ERR_SUCCESS); } Modified: releng/12.0/lib/libbe/libbe.3 ============================================================================== --- releng/12.0/lib/libbe/libbe.3 Thu Nov 22 03:04:13 2018 (r340752) +++ releng/12.0/lib/libbe/libbe.3 Thu Nov 22 04:39:06 2018 (r340753) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 31, 2018 +.Dd November 17, 2018 .Dt LIBBE 3 .Os .Sh NAME @@ -39,7 +39,7 @@ .Sh SYNOPSIS .In be.h .Ft "libbe_handle_t *hdl" Ns -.Fn libbe_init void +.Fn libbe_init "const char *be_root" .Pp .Ft void .Fn libbe_close "libbe_handle_t *hdl" @@ -157,13 +157,16 @@ errno otherwise as described in .Pp The .Fn libbe_init -function initializes +function takes an optional BE root and initializes .Nm , returning a .Vt "libbe_handle_t *" on success, or .Dv NULL on error. +If a BE root is supplied, +.Nm +will only operate out of that pool and BE root. An error may occur if: .Bl -column .It /boot and / are not on the same filesystem and device, @@ -184,11 +187,15 @@ invalidating the handle in the process. .Pp The .Fn be_active_name -function returns the name of the currently booted boot environment, +function returns the name of the currently booted boot environment. +This boot environment may not belong to the same BE root as the root libbe +is operating on! .Pp The .Fn be_active_path function returns the full path of the currently booted boot environment. +This boot environment may not belong to the same BE root as the root libbe +is operating on! .Pp The .Fn be_nextboot_name Modified: releng/12.0/sbin/bectl/Makefile ============================================================================== --- releng/12.0/sbin/bectl/Makefile Thu Nov 22 03:04:13 2018 (r340752) +++ releng/12.0/sbin/bectl/Makefile Thu Nov 22 04:39:06 2018 (r340753) @@ -1,5 +1,7 @@ # $FreeBSD$ +.include + PROG= bectl MAN= bectl.8 @@ -15,5 +17,8 @@ CFLAGS+= -I${SRCTOP}/sys/cddl/compat/opensolaris CFLAGS+= -I${SRCTOP}/sys/cddl/contrib/opensolaris/uts/common CFLAGS+= -DNEED_SOLARIS_BOOLEAN + +HAS_TESTS= yes +SUBDIR.${MK_TESTS}+= tests .include Modified: releng/12.0/sbin/bectl/bectl.c ============================================================================== --- releng/12.0/sbin/bectl/bectl.c Thu Nov 22 03:04:13 2018 (r340752) +++ releng/12.0/sbin/bectl/bectl.c Thu Nov 22 04:39:06 2018 (r340753) @@ -489,12 +489,25 @@ int main(int argc, char *argv[]) { const char *command; + char *root; int command_index, rc; + root = NULL; if (argc < 2) return (usage(false)); - command = argv[1]; + if (strcmp(argv[1], "-r") == 0) { + if (argc < 4) + return (usage(false)); + root = strdup(argv[2]); + command = argv[3]; + argc -= 3; + argv += 3; + } else { + command = argv[1]; + argc -= 1; + argv += 1; + } /* Handle command aliases */ if (strcmp(command, "umount") == 0) @@ -512,13 +525,12 @@ main(int argc, char *argv[]) } - if ((be = libbe_init()) == NULL) + if ((be = libbe_init(root)) == NULL) return (-1); libbe_print_on_error(be, true); - /* XXX TODO: can be simplified if offset by 2 instead of one */ - rc = command_map[command_index].fn(argc-1, argv+1); + rc = command_map[command_index].fn(argc, argv); libbe_close(be); return (rc); From owner-svn-src-all@freebsd.org Thu Nov 22 03:42:35 2018 Return-Path: Delivered-To: svn-src-all@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 33A451133F9F; Thu, 22 Nov 2018 03:42:35 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C96EF87207; Thu, 22 Nov 2018 03:42:34 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from mail-lf1-f41.google.com (mail-lf1-f41.google.com [209.85.167.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) (Authenticated sender: kevans) by smtp.freebsd.org (Postfix) with ESMTPSA id 6B12B850D; Thu, 22 Nov 2018 03:42:34 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-lf1-f41.google.com with SMTP id e26so5522552lfc.2; Wed, 21 Nov 2018 19:42:34 -0800 (PST) X-Gm-Message-State: AGRZ1gJZUIZk5fbVl9cp4RAjTRun1CqjAnBZWizi5ltgSasidsFlWAgb HYy8FpGpNc8VraRvE1CF8RWYg9I4V5VvT/maj24= X-Google-Smtp-Source: AJdET5eXMtF1UJPJBmL057+xROJmqS4iM3IHmL1kfSj5pbClfeeHUQstWT17wFyfaUMnIbeIIm1QkpzSSpX45okVejk= X-Received: by 2002:a19:cd50:: with SMTP id d77mr5210288lfg.125.1542858152827; Wed, 21 Nov 2018 19:42:32 -0800 (PST) MIME-Version: 1.0 References: <201810210208.w9L28vVc080088@repo.freebsd.org> In-Reply-To: <201810210208.w9L28vVc080088@repo.freebsd.org> From: Kyle Evans Date: Wed, 21 Nov 2018 21:42:21 -0600 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r339516 - head/sys/cddl/dev/dtrace/powerpc To: Justin Hibbits Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org, Li-Wen Hsu Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: C96EF87207 X-Spamd-Result: default: False [1.35 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_SPAM_LONG(0.39)[0.389,0]; NEURAL_SPAM_MEDIUM(0.54)[0.537,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.42)[0.425,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Nov 2018 03:42:35 -0000 On Sat, Oct 20, 2018 at 9:09 PM Justin Hibbits wrote: > > Author: jhibbits > Date: Sun Oct 21 02:08:57 2018 > New Revision: 339516 > URL: https://svnweb.freebsd.org/changeset/base/339516 > > Log: > powerpc/dtrace: Use explicit bit numbers to mask out PSL_EE > > There seems to be a race in CI, such that dtrace_asm.S might be assembled > before the genassym is completed. This causes a build failure when PSL_EE > doesn't exist, and is read as 0. Get around this by explicitly specifying > the bits in the mask instead. > Hi, CI on the stable/12 branch still hits this, so I'm tempted to MFC this if you don't object. OTOH, the correct solution should be a `dependency "genassym.o"` in ^/sys/conf/files.powerpc for dtrace_asm.S, no? Thanks, Kyle Evans From owner-svn-src-all@freebsd.org Thu Nov 22 04:02:29 2018 Return-Path: Delivered-To: svn-src-all@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 ED94B1134C70; Thu, 22 Nov 2018 04:02:28 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7FE648857D; Thu, 22 Nov 2018 04:02:28 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from mail-lf1-f44.google.com (mail-lf1-f44.google.com [209.85.167.44]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) (Authenticated sender: kevans) by smtp.freebsd.org (Postfix) with ESMTPSA id 21442872C; Thu, 22 Nov 2018 04:02:28 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-lf1-f44.google.com with SMTP id e26so5544481lfc.2; Wed, 21 Nov 2018 20:02:28 -0800 (PST) X-Gm-Message-State: AGRZ1gJ5BgXF109OW0jZsPHG+B0L+C9bIpY1dE+ScC26EjZo3kgnPq8G JPnoGyAzlEaHV1o6pjbAHzfBrjFaNsFNZ/T3LUc= X-Google-Smtp-Source: AJdET5esQC6QcdLFhOd9i1faSblp+m0uVt5ZIPvOT7zFiy2+dN6ARkdHF0Bry1PYEDIW+0d/8OboJjUafY9ugfTCRDg= X-Received: by 2002:a19:cd50:: with SMTP id d77mr5235522lfg.125.1542859346691; Wed, 21 Nov 2018 20:02:26 -0800 (PST) MIME-Version: 1.0 References: <201810210208.w9L28vVc080088@repo.freebsd.org> In-Reply-To: From: Kyle Evans Date: Wed, 21 Nov 2018 22:02:15 -0600 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r339516 - head/sys/cddl/dev/dtrace/powerpc To: Justin Hibbits Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org, Li-Wen Hsu Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 7FE648857D X-Spamd-Result: default: False [1.35 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_SPAM_LONG(0.39)[0.389,0]; NEURAL_SPAM_MEDIUM(0.54)[0.537,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.42)[0.425,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Nov 2018 04:02:29 -0000 On Wed, Nov 21, 2018 at 9:42 PM Kyle Evans wrote: > > On Sat, Oct 20, 2018 at 9:09 PM Justin Hibbits wrote: > > > > Author: jhibbits > > Date: Sun Oct 21 02:08:57 2018 > > New Revision: 339516 > > URL: https://svnweb.freebsd.org/changeset/base/339516 > > > > Log: > > powerpc/dtrace: Use explicit bit numbers to mask out PSL_EE > > > > There seems to be a race in CI, such that dtrace_asm.S might be assembled > > before the genassym is completed. This causes a build failure when PSL_EE > > doesn't exist, and is read as 0. Get around this by explicitly specifying > > the bits in the mask instead. > > > > Hi, > > CI on the stable/12 branch still hits this, so I'm tempted to MFC this > if you don't object. OTOH, the correct solution should be a > `dependency "genassym.o"` in ^/sys/conf/files.powerpc for > dtrace_asm.S, no? > Sorry, that should have read "genassym.inc" -- my naive understanding of 'dependency' is that config(8) will turn it directly into a makefile dependency that will alleviate this. From owner-svn-src-all@freebsd.org Thu Nov 22 04:48:28 2018 Return-Path: Delivered-To: svn-src-all@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 CD7941136BE9; Thu, 22 Nov 2018 04:48:28 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.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 6FFB089E0D; Thu, 22 Nov 2018 04:48:28 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4A8D52D73; Thu, 22 Nov 2018 04:48:28 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAM4mSFc014131; Thu, 22 Nov 2018 04:48:28 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAM4mSZE014130; Thu, 22 Nov 2018 04:48:28 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201811220448.wAM4mSZE014130@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Thu, 22 Nov 2018 04:48:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340754 - head/libexec/rc/rc.d X-SVN-Group: head X-SVN-Commit-Author: cy X-SVN-Commit-Paths: head/libexec/rc/rc.d X-SVN-Commit-Revision: 340754 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 6FFB089E0D X-Spamd-Result: default: False [1.31 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.40)[0.400,0]; NEURAL_SPAM_MEDIUM(0.49)[0.489,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.42)[0.419,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Nov 2018 04:48:29 -0000 Author: cy Date: Thu Nov 22 04:48:27 2018 New Revision: 340754 URL: https://svnweb.freebsd.org/changeset/base/340754 Log: Allow forced start of ipmon in special cases where testing is desired (or other special cases) and when ipfilter is disabled in rc.conf but started by other means. MFC after: 1 week Modified: head/libexec/rc/rc.d/ipmon Modified: head/libexec/rc/rc.d/ipmon ============================================================================== --- head/libexec/rc/rc.d/ipmon Thu Nov 22 04:39:06 2018 (r340753) +++ head/libexec/rc/rc.d/ipmon Thu Nov 22 04:48:27 2018 (r340754) @@ -21,7 +21,7 @@ ipmon_precmd() # Continue only if ipfilter or ipnat is enabled and the # ipfilter module is loaded. # - if ! checkyesno ipfilter_enable && ! checkyesno ipnat_enable ; then + if ! checkyesno ipfilter_enable && ! checkyesno ipnat_enable && ! checkyesno rc_force ; then err 1 "${name} requires either ipfilter or ipnat enabled" fi if ! ${ipfilter_program:-/sbin/ipf} -V | grep -q 'Running: yes' >/dev/null 2>&1; then From owner-svn-src-all@freebsd.org Thu Nov 22 05:24:35 2018 Return-Path: Delivered-To: svn-src-all@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 18B63113856D; Thu, 22 Nov 2018 05:24:35 +0000 (UTC) (envelope-from chmeeedalf@gmail.com) Received: from mail-lj1-f193.google.com (mail-lj1-f193.google.com [209.85.208.193]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 463848B252; Thu, 22 Nov 2018 05:24:34 +0000 (UTC) (envelope-from chmeeedalf@gmail.com) Received: by mail-lj1-f193.google.com with SMTP id l15-v6so6830365lja.9; Wed, 21 Nov 2018 21:24:34 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=fhrpDQY17AQirD3tA9zQ9OFiIeJVgaH2w9LaeQuNDRY=; b=gLtXqCJfNvPXtYjQVemx6DNyxjIaYz35icqI7gXvfuQ8qf2BEpjQKxf+3qmh6nhqOY urvWhO6XLM5ijzX0/8ra1S4ilhxie9mSe9Q+RPYn+FwrnpyiTXwjNJedyC/5XqVdUswv SnL+uzRdfLBsdU5LAmqkmbMje8OnvLxuFSLzr2JLrvkqHEiHuBE0u++MpnLrvN1gslz0 yM5hUHsiiAPrLqIWS9uu9KJ26JQw+3Xm86M7zn/wavdxZkk5vL4M9VjOtf8y8FyIDkqk QCVHSsh1EWNLm98gNpKZgRwI3qJSiwqbgiBFyPXB2YWJgpoEmDUCQBF5OA+nxUiw1K2E Xzfg== X-Gm-Message-State: AA+aEWbktAQoFZz4LOS6n0dx/381NQ+SJHLNVe+QbY6kQC7BHdP1L1Sy Q/+gj1aKVE2cZt/I5bWb9Ed1pGDgibqncUi0vDdWOw== X-Google-Smtp-Source: AJdET5dSxA2aMTjR6+7c3pP/HzgAhxJ629UeQ5OUpSa41SkVecDFHCaitbfxBrhblCLhecNQW9u6CwwkVTeNy49o1OY= X-Received: by 2002:a2e:4c1a:: with SMTP id z26-v6mr6302139lja.136.1542863876868; Wed, 21 Nov 2018 21:17:56 -0800 (PST) MIME-Version: 1.0 References: <201810210208.w9L28vVc080088@repo.freebsd.org> In-Reply-To: From: Justin Hibbits Date: Wed, 21 Nov 2018 23:17:44 -0600 Message-ID: Subject: Re: svn commit: r339516 - head/sys/cddl/dev/dtrace/powerpc To: kevans@freebsd.org Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org, Li-Wen Hsu Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 463848B252 X-Spamd-Result: default: False [-3.93 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.99)[-0.989,0]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; RCVD_TLS_LAST(0.00)[]; DMARC_NA(0.00)[freebsd.org]; RCPT_COUNT_FIVE(0.00)[5]; NEURAL_HAM_LONG(-0.99)[-0.992,0]; IP_SCORE(-1.02)[ipnet: 209.85.128.0/17(-3.45), asn: 15169(-1.57), country: US(-0.09)]; MX_GOOD(-0.01)[cached: alt3.gmail-smtp-in.l.google.com]; NEURAL_HAM_SHORT(-0.91)[-0.913,0]; RCVD_IN_DNSWL_NONE(0.00)[193.208.85.209.list.dnswl.org : 127.0.5.0]; FORGED_SENDER(0.30)[jhibbits@freebsd.org,chmeeedalf@gmail.com]; RWL_MAILSPIKE_POSSIBLE(0.00)[193.208.85.209.rep.mailspike.net : 127.0.0.17]; R_DKIM_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; FROM_NEQ_ENVFROM(0.00)[jhibbits@freebsd.org,chmeeedalf@gmail.com]; RCVD_COUNT_TWO(0.00)[2] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Nov 2018 05:24:35 -0000 On Wed, Nov 21, 2018 at 10:02 PM Kyle Evans wrote: > > On Wed, Nov 21, 2018 at 9:42 PM Kyle Evans wrote: > > > > On Sat, Oct 20, 2018 at 9:09 PM Justin Hibbits wrote: > > > > > > Author: jhibbits > > > Date: Sun Oct 21 02:08:57 2018 > > > New Revision: 339516 > > > URL: https://svnweb.freebsd.org/changeset/base/339516 > > > > > > Log: > > > powerpc/dtrace: Use explicit bit numbers to mask out PSL_EE > > > > > > There seems to be a race in CI, such that dtrace_asm.S might be assembled > > > before the genassym is completed. This causes a build failure when PSL_EE > > > doesn't exist, and is read as 0. Get around this by explicitly specifying > > > the bits in the mask instead. > > > > > > > Hi, > > > > CI on the stable/12 branch still hits this, so I'm tempted to MFC this > > if you don't object. OTOH, the correct solution should be a > > `dependency "genassym.o"` in ^/sys/conf/files.powerpc for > > dtrace_asm.S, no? > > > > Sorry, that should have read "genassym.inc" -- my naive understanding > of 'dependency' is that config(8) will turn it directly into a > makefile dependency that will alleviate this. Hm, I'm surprised we don't have a rule for all kernel .S files, even modules, being dependent on that. Should we add one? - Justin From owner-svn-src-all@freebsd.org Thu Nov 22 07:16:36 2018 Return-Path: Delivered-To: svn-src-all@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 11F4E113D29C; Thu, 22 Nov 2018 07:16:36 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-io1-xd42.google.com (mail-io1-xd42.google.com [IPv6:2607:f8b0:4864:20::d42]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 586998F2CF; Thu, 22 Nov 2018 07:16:35 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by mail-io1-xd42.google.com with SMTP id r200so5908311iod.11; Wed, 21 Nov 2018 23:16:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=JOby5YdW3aP5kBtyUEJ40PPwMljdEKUxIyUT/tSvqkU=; b=ssGpy9/jc1T3HNppj+UO9wTjxJXxzx92aOfQd8b8qgE/JX6sCeoB5wiu9JQrEIslye aVkasC5JjjXkhm45C2iYtdY686DnKmiKtlAmb1F4PRMjxVpIQuY861fOAaFmZSWWLSbY yyVyUh/ImWzJYWfIc7C0YCgXeJznc1cNYVZkCUZuV0NrulDSPXEKxgmOf+owkzovVF5x +eIWmIPqN5TliXQEJ0F9LVDTYXq4/SrjVRv/i1nS/iB5mQN7Zl9KLeVUftPNDLVZzRtH X4nVO4US+gy1cz5NklTA5h4kpMsE9hFlm4A58kbQmAduZlqiOV/+aNTYj6ebGPwdZhVP YJOQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=JOby5YdW3aP5kBtyUEJ40PPwMljdEKUxIyUT/tSvqkU=; b=I7qv/m3CbYNaensuai9FwBKn1EaNNVVMuxgaj0PLuoqteN5z532xmjCtu3jxqPfT1v attBnCXMqGisDzToPT42dCmtavkyHhR+n8AqzOIpZjT11rrcGVlKbrIHasSBDBJoUVok BeKeciP6gR+Kk3Pu6hE/MFgmhcVnzK55lvXlXUNzIdAirUg5+ukfLcVwF1KhgK80JRsf CK3nbnnAYa5v7hfxtRwTrx143tbg2vzdWvc9Eiw7EZeis2ArcWWWFdHzf/p0lhMYhw8t UFiQIEsOGgmETvJCEnZSC1zpdpyHdFp2PJaSEHBjgthIbvxykF63EobusmpeoomEIiUt Ofgg== X-Gm-Message-State: AA+aEWaSyFVVpmXlAF7naYi663Jkqj8/pzsuVFETjHxeK9k+cEBIuWBJ OkLUJtdE0z+SlAJZ/8UvWwTt7dowsTc= X-Google-Smtp-Source: AFSGD/XPCkmiXAg/3T/YVPKkjc7KTk3LIs06xpGjxnmzxTc6fO4gUWvp/mxOfbr1Mle9RgR9hWE0jA== X-Received: by 2002:a6b:3fd7:: with SMTP id m206mr7129531ioa.210.1542870994434; Wed, 21 Nov 2018 23:16:34 -0800 (PST) Received: from raichu (toroon0560w-lp130-07-64-229-95-98.dsl.bell.ca. [64.229.95.98]) by smtp.gmail.com with ESMTPSA id e80-v6sm1567315itc.35.2018.11.21.23.16.33 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 21 Nov 2018 23:16:33 -0800 (PST) Sender: Mark Johnston Date: Thu, 22 Nov 2018 02:16:29 -0500 From: Mark Johnston To: Kyle Evans Cc: Justin Hibbits , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org, Li-Wen Hsu Subject: Re: svn commit: r339516 - head/sys/cddl/dev/dtrace/powerpc Message-ID: <20181122071629.GA96830@raichu> References: <201810210208.w9L28vVc080088@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) X-Rspamd-Queue-Id: 586998F2CF X-Spamd-Result: default: False [-2.33 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_DKIM_ALLOW(-0.20)[gmail.com]; NEURAL_HAM_MEDIUM(-0.98)[-0.981,0]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; RCVD_TLS_LAST(0.00)[]; DMARC_NA(0.00)[freebsd.org]; RCPT_COUNT_FIVE(0.00)[6]; NEURAL_HAM_LONG(-0.98)[-0.980,0]; RCVD_COUNT_THREE(0.00)[3]; IP_SCORE(-0.28)[ip: (2.56), ipnet: 2607:f8b0::/32(-2.31), asn: 15169(-1.57), country: US(-0.09)]; DKIM_TRACE(0.00)[gmail.com:+]; MX_GOOD(-0.01)[cached: alt3.gmail-smtp-in.l.google.com]; RCVD_IN_DNSWL_NONE(0.00)[2.4.d.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.0]; NEURAL_HAM_SHORT(-0.37)[-0.373,0]; FORGED_SENDER(0.30)[markj@freebsd.org,markjdb@gmail.com]; MID_RHS_NOT_FQDN(0.50)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; FROM_NEQ_ENVFROM(0.00)[markj@freebsd.org,markjdb@gmail.com] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Nov 2018 07:16:36 -0000 On Wed, Nov 21, 2018 at 10:02:15PM -0600, Kyle Evans wrote: > On Wed, Nov 21, 2018 at 9:42 PM Kyle Evans wrote: > > > > On Sat, Oct 20, 2018 at 9:09 PM Justin Hibbits wrote: > > > > > > Author: jhibbits > > > Date: Sun Oct 21 02:08:57 2018 > > > New Revision: 339516 > > > URL: https://svnweb.freebsd.org/changeset/base/339516 > > > > > > Log: > > > powerpc/dtrace: Use explicit bit numbers to mask out PSL_EE > > > > > > There seems to be a race in CI, such that dtrace_asm.S might be assembled > > > before the genassym is completed. This causes a build failure when PSL_EE > > > doesn't exist, and is read as 0. Get around this by explicitly specifying > > > the bits in the mask instead. > > > > > > > Hi, > > > > CI on the stable/12 branch still hits this, so I'm tempted to MFC this > > if you don't object. OTOH, the correct solution should be a > > `dependency "genassym.o"` in ^/sys/conf/files.powerpc for > > dtrace_asm.S, no? I believe that dtrace_asm.S will be built as part of dtrace.ko, not the kernel. dtrace/Makefile already specifies a dependency on assym.inc. Maybe this is the same issue as PR 233339? > Sorry, that should have read "genassym.inc" -- my naive understanding > of 'dependency' is that config(8) will turn it directly into a > makefile dependency that will alleviate this. > From owner-svn-src-all@freebsd.org Thu Nov 22 09:41:59 2018 Return-Path: Delivered-To: svn-src-all@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 365AD1142ABD; Thu, 22 Nov 2018 09:41:59 +0000 (UTC) (envelope-from tijl@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 BF55F6E506; Thu, 22 Nov 2018 09:41:58 +0000 (UTC) (envelope-from tijl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BA2B8627E; Thu, 22 Nov 2018 09:41:54 +0000 (UTC) (envelope-from tijl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAM9fsGs065990; Thu, 22 Nov 2018 09:41:54 GMT (envelope-from tijl@FreeBSD.org) Received: (from tijl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAM9fs72065989; Thu, 22 Nov 2018 09:41:54 GMT (envelope-from tijl@FreeBSD.org) Message-Id: <201811220941.wAM9fs72065989@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tijl set sender to tijl@FreeBSD.org using -f From: Tijl Coosemans Date: Thu, 22 Nov 2018 09:41:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r340756 - stable/11/sys/compat/linux X-SVN-Group: stable-11 X-SVN-Commit-Author: tijl X-SVN-Commit-Paths: stable/11/sys/compat/linux X-SVN-Commit-Revision: 340756 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: BF55F6E506 X-Spamd-Result: default: False [1.51 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.41)[0.407,0]; NEURAL_SPAM_MEDIUM(0.52)[0.517,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.59)[0.589,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Nov 2018 09:41:59 -0000 Author: tijl Date: Thu Nov 22 09:41:54 2018 New Revision: 340756 URL: https://svnweb.freebsd.org/changeset/base/340756 Log: MFC r340631: Do proper copyin of control message data in the Linux sendmsg syscall. Instead of calling m_append with a user address, allocate an mbuf cluster and copy data into it using copyin. For the SCM_CREDS case, instead of zeroing a stack variable and appending that to the mbuf, zero part of the mbuf cluster directly. One mbuf cluster is also the size limit used by the FreeBSD sendmsg syscall (uipc_syscalls.c:sockargs()). PR: 217901 Reviewed by: kib Modified: stable/11/sys/compat/linux/linux_socket.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/compat/linux/linux_socket.c ============================================================================== --- stable/11/sys/compat/linux/linux_socket.c Thu Nov 22 09:41:45 2018 (r340755) +++ stable/11/sys/compat/linux/linux_socket.c Thu Nov 22 09:41:54 2018 (r340756) @@ -1088,7 +1088,6 @@ linux_sendmsg_common(struct thread *td, l_int s, struc l_uint flags) { struct cmsghdr *cmsg; - struct cmsgcred cmcred; struct mbuf *control; struct msghdr msg; struct l_cmsghdr linux_cmsg; @@ -1099,6 +1098,7 @@ linux_sendmsg_common(struct thread *td, l_int s, struc struct sockaddr *sa; sa_family_t sa_family; void *data; + l_size_t len; int error; error = copyin(msghdr, &linux_msg, sizeof(linux_msg)); @@ -1129,7 +1129,6 @@ linux_sendmsg_common(struct thread *td, l_int s, struc return (error); control = NULL; - cmsg = NULL; if ((ptr_cmsg = LINUX_CMSG_FIRSTHDR(&linux_msg)) != NULL) { error = kern_getsockname(td, s, &sa, &datalen); @@ -1139,8 +1138,10 @@ linux_sendmsg_common(struct thread *td, l_int s, struc free(sa, M_SONAME); error = ENOBUFS; - cmsg = malloc(CMSG_HDRSZ, M_LINUX, M_WAITOK|M_ZERO); control = m_get(M_WAITOK, MT_CONTROL); + MCLGET(control, M_WAITOK); + data = mtod(control, void *); + datalen = 0; do { error = copyin(ptr_cmsg, &linux_cmsg, @@ -1152,10 +1153,14 @@ linux_sendmsg_common(struct thread *td, l_int s, struc if (linux_cmsg.cmsg_len < sizeof(struct l_cmsghdr)) goto bad; + if (datalen + CMSG_HDRSZ > MCLBYTES) + goto bad; + /* * Now we support only SCM_RIGHTS and SCM_CRED, * so return EINVAL in any other cmsg_type */ + cmsg = data; cmsg->cmsg_type = linux_to_bsd_cmsg_type(linux_cmsg.cmsg_type); cmsg->cmsg_level = @@ -1173,35 +1178,34 @@ linux_sendmsg_common(struct thread *td, l_int s, struc if (sa_family != AF_UNIX) continue; - data = LINUX_CMSG_DATA(ptr_cmsg); - datalen = linux_cmsg.cmsg_len - L_CMSG_HDRSZ; + if (cmsg->cmsg_type == SCM_CREDS) { + len = sizeof(struct cmsgcred); + if (datalen + CMSG_SPACE(len) > MCLBYTES) + goto bad; - switch (cmsg->cmsg_type) - { - case SCM_RIGHTS: - break; - - case SCM_CREDS: - data = &cmcred; - datalen = sizeof(cmcred); - /* * The lower levels will fill in the structure */ - bzero(data, datalen); - break; + memset(CMSG_DATA(data), 0, len); + } else { + len = linux_cmsg.cmsg_len - L_CMSG_HDRSZ; + if (datalen + CMSG_SPACE(len) < datalen || + datalen + CMSG_SPACE(len) > MCLBYTES) + goto bad; + + error = copyin(LINUX_CMSG_DATA(ptr_cmsg), + CMSG_DATA(data), len); + if (error != 0) + goto bad; } - cmsg->cmsg_len = CMSG_LEN(datalen); - - error = ENOBUFS; - if (!m_append(control, CMSG_HDRSZ, (c_caddr_t)cmsg)) - goto bad; - if (!m_append(control, datalen, (c_caddr_t)data)) - goto bad; + cmsg->cmsg_len = CMSG_LEN(len); + data = (char *)data + CMSG_SPACE(len); + datalen += CMSG_SPACE(len); } while ((ptr_cmsg = LINUX_CMSG_NXTHDR(&linux_msg, ptr_cmsg))); - if (m_length(control, NULL) == 0) { + control->m_len = datalen; + if (datalen == 0) { m_freem(control); control = NULL; } @@ -1215,8 +1219,6 @@ linux_sendmsg_common(struct thread *td, l_int s, struc bad: m_freem(control); free(iov, M_IOV); - if (cmsg) - free(cmsg, M_LINUX); return (error); } From owner-svn-src-all@freebsd.org Thu Nov 22 09:41:46 2018 Return-Path: Delivered-To: svn-src-all@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 A29D41142988; Thu, 22 Nov 2018 09:41:46 +0000 (UTC) (envelope-from tijl@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 460776E403; Thu, 22 Nov 2018 09:41:46 +0000 (UTC) (envelope-from tijl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 270AF626C; Thu, 22 Nov 2018 09:41:46 +0000 (UTC) (envelope-from tijl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAM9fk5V065920; Thu, 22 Nov 2018 09:41:46 GMT (envelope-from tijl@FreeBSD.org) Received: (from tijl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAM9fk38065919; Thu, 22 Nov 2018 09:41:46 GMT (envelope-from tijl@FreeBSD.org) Message-Id: <201811220941.wAM9fk38065919@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tijl set sender to tijl@FreeBSD.org using -f From: Tijl Coosemans Date: Thu, 22 Nov 2018 09:41:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r340755 - stable/12/sys/compat/linux X-SVN-Group: stable-12 X-SVN-Commit-Author: tijl X-SVN-Commit-Paths: stable/12/sys/compat/linux X-SVN-Commit-Revision: 340755 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 460776E403 X-Spamd-Result: default: False [1.51 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.41)[0.407,0]; NEURAL_SPAM_MEDIUM(0.52)[0.517,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.59)[0.589,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Nov 2018 09:41:46 -0000 Author: tijl Date: Thu Nov 22 09:41:45 2018 New Revision: 340755 URL: https://svnweb.freebsd.org/changeset/base/340755 Log: MFC r340631: Do proper copyin of control message data in the Linux sendmsg syscall. Instead of calling m_append with a user address, allocate an mbuf cluster and copy data into it using copyin. For the SCM_CREDS case, instead of zeroing a stack variable and appending that to the mbuf, zero part of the mbuf cluster directly. One mbuf cluster is also the size limit used by the FreeBSD sendmsg syscall (uipc_syscalls.c:sockargs()). PR: 217901 Reviewed by: kib Modified: stable/12/sys/compat/linux/linux_socket.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/compat/linux/linux_socket.c ============================================================================== --- stable/12/sys/compat/linux/linux_socket.c Thu Nov 22 04:48:27 2018 (r340754) +++ stable/12/sys/compat/linux/linux_socket.c Thu Nov 22 09:41:45 2018 (r340755) @@ -1085,7 +1085,6 @@ linux_sendmsg_common(struct thread *td, l_int s, struc l_uint flags) { struct cmsghdr *cmsg; - struct cmsgcred cmcred; struct mbuf *control; struct msghdr msg; struct l_cmsghdr linux_cmsg; @@ -1096,6 +1095,7 @@ linux_sendmsg_common(struct thread *td, l_int s, struc struct sockaddr *sa; sa_family_t sa_family; void *data; + l_size_t len; int error; error = copyin(msghdr, &linux_msg, sizeof(linux_msg)); @@ -1126,7 +1126,6 @@ linux_sendmsg_common(struct thread *td, l_int s, struc return (error); control = NULL; - cmsg = NULL; if ((ptr_cmsg = LINUX_CMSG_FIRSTHDR(&linux_msg)) != NULL) { error = kern_getsockname(td, s, &sa, &datalen); @@ -1136,8 +1135,10 @@ linux_sendmsg_common(struct thread *td, l_int s, struc free(sa, M_SONAME); error = ENOBUFS; - cmsg = malloc(CMSG_HDRSZ, M_LINUX, M_WAITOK|M_ZERO); control = m_get(M_WAITOK, MT_CONTROL); + MCLGET(control, M_WAITOK); + data = mtod(control, void *); + datalen = 0; do { error = copyin(ptr_cmsg, &linux_cmsg, @@ -1149,10 +1150,14 @@ linux_sendmsg_common(struct thread *td, l_int s, struc if (linux_cmsg.cmsg_len < sizeof(struct l_cmsghdr)) goto bad; + if (datalen + CMSG_HDRSZ > MCLBYTES) + goto bad; + /* * Now we support only SCM_RIGHTS and SCM_CRED, * so return EINVAL in any other cmsg_type */ + cmsg = data; cmsg->cmsg_type = linux_to_bsd_cmsg_type(linux_cmsg.cmsg_type); cmsg->cmsg_level = @@ -1170,35 +1175,34 @@ linux_sendmsg_common(struct thread *td, l_int s, struc if (sa_family != AF_UNIX) continue; - data = LINUX_CMSG_DATA(ptr_cmsg); - datalen = linux_cmsg.cmsg_len - L_CMSG_HDRSZ; + if (cmsg->cmsg_type == SCM_CREDS) { + len = sizeof(struct cmsgcred); + if (datalen + CMSG_SPACE(len) > MCLBYTES) + goto bad; - switch (cmsg->cmsg_type) - { - case SCM_RIGHTS: - break; - - case SCM_CREDS: - data = &cmcred; - datalen = sizeof(cmcred); - /* * The lower levels will fill in the structure */ - bzero(data, datalen); - break; + memset(CMSG_DATA(data), 0, len); + } else { + len = linux_cmsg.cmsg_len - L_CMSG_HDRSZ; + if (datalen + CMSG_SPACE(len) < datalen || + datalen + CMSG_SPACE(len) > MCLBYTES) + goto bad; + + error = copyin(LINUX_CMSG_DATA(ptr_cmsg), + CMSG_DATA(data), len); + if (error != 0) + goto bad; } - cmsg->cmsg_len = CMSG_LEN(datalen); - - error = ENOBUFS; - if (!m_append(control, CMSG_HDRSZ, (c_caddr_t)cmsg)) - goto bad; - if (!m_append(control, datalen, (c_caddr_t)data)) - goto bad; + cmsg->cmsg_len = CMSG_LEN(len); + data = (char *)data + CMSG_SPACE(len); + datalen += CMSG_SPACE(len); } while ((ptr_cmsg = LINUX_CMSG_NXTHDR(&linux_msg, ptr_cmsg))); - if (m_length(control, NULL) == 0) { + control->m_len = datalen; + if (datalen == 0) { m_freem(control); control = NULL; } @@ -1212,8 +1216,6 @@ linux_sendmsg_common(struct thread *td, l_int s, struc bad: m_freem(control); free(iov, M_IOV); - if (cmsg) - free(cmsg, M_LINUX); return (error); } From owner-svn-src-all@freebsd.org Thu Nov 22 09:47:43 2018 Return-Path: Delivered-To: svn-src-all@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 99A6F1142F1E; Thu, 22 Nov 2018 09:47:43 +0000 (UTC) (envelope-from tijl@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 402336EB73; Thu, 22 Nov 2018 09:47:43 +0000 (UTC) (envelope-from tijl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 22A9A63D0; Thu, 22 Nov 2018 09:47:43 +0000 (UTC) (envelope-from tijl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAM9lhTA067226; Thu, 22 Nov 2018 09:47:43 GMT (envelope-from tijl@FreeBSD.org) Received: (from tijl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAM9lh5R067225; Thu, 22 Nov 2018 09:47:43 GMT (envelope-from tijl@FreeBSD.org) Message-Id: <201811220947.wAM9lh5R067225@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tijl set sender to tijl@FreeBSD.org using -f From: Tijl Coosemans Date: Thu, 22 Nov 2018 09:47:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r340757 - stable/12/sys/compat/linux X-SVN-Group: stable-12 X-SVN-Commit-Author: tijl X-SVN-Commit-Paths: stable/12/sys/compat/linux X-SVN-Commit-Revision: 340757 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 402336EB73 X-Spamd-Result: default: False [1.51 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.41)[0.407,0]; NEURAL_SPAM_MEDIUM(0.52)[0.517,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.59)[0.589,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Nov 2018 09:47:43 -0000 Author: tijl Date: Thu Nov 22 09:47:42 2018 New Revision: 340757 URL: https://svnweb.freebsd.org/changeset/base/340757 Log: MFC r340674: Fix another user address dereference in linux_sendmsg syscall. This was hidden behind the LINUX_CMSG_NXTHDR macro which dereferences its second argument. Stop using the macro as well as LINUX_CMSG_FIRSTHDR. Use the size field of the kernel copy of the control message header to obtain the next control message. PR: 217901 Modified: stable/12/sys/compat/linux/linux_socket.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/compat/linux/linux_socket.c ============================================================================== --- stable/12/sys/compat/linux/linux_socket.c Thu Nov 22 09:41:54 2018 (r340756) +++ stable/12/sys/compat/linux/linux_socket.c Thu Nov 22 09:47:42 2018 (r340757) @@ -1096,6 +1096,7 @@ linux_sendmsg_common(struct thread *td, l_int s, struc sa_family_t sa_family; void *data; l_size_t len; + l_size_t clen; int error; error = copyin(msghdr, &linux_msg, sizeof(linux_msg)); @@ -1127,7 +1128,7 @@ linux_sendmsg_common(struct thread *td, l_int s, struc control = NULL; - if ((ptr_cmsg = LINUX_CMSG_FIRSTHDR(&linux_msg)) != NULL) { + if (linux_msg.msg_controllen >= sizeof(struct l_cmsghdr)) { error = kern_getsockname(td, s, &sa, &datalen); if (error != 0) goto bad; @@ -1140,6 +1141,8 @@ linux_sendmsg_common(struct thread *td, l_int s, struc data = mtod(control, void *); datalen = 0; + ptr_cmsg = PTRIN(linux_msg.msg_control); + clen = linux_msg.msg_controllen; do { error = copyin(ptr_cmsg, &linux_cmsg, sizeof(struct l_cmsghdr)); @@ -1147,7 +1150,8 @@ linux_sendmsg_common(struct thread *td, l_int s, struc goto bad; error = EINVAL; - if (linux_cmsg.cmsg_len < sizeof(struct l_cmsghdr)) + if (linux_cmsg.cmsg_len < sizeof(struct l_cmsghdr) || + linux_cmsg.cmsg_len > clen) goto bad; if (datalen + CMSG_HDRSZ > MCLBYTES) @@ -1199,7 +1203,14 @@ linux_sendmsg_common(struct thread *td, l_int s, struc cmsg->cmsg_len = CMSG_LEN(len); data = (char *)data + CMSG_SPACE(len); datalen += CMSG_SPACE(len); - } while ((ptr_cmsg = LINUX_CMSG_NXTHDR(&linux_msg, ptr_cmsg))); + + if (clen <= LINUX_CMSG_ALIGN(linux_cmsg.cmsg_len)) + break; + + clen -= LINUX_CMSG_ALIGN(linux_cmsg.cmsg_len); + ptr_cmsg = (struct l_cmsghdr *)((char *)ptr_cmsg + + LINUX_CMSG_ALIGN(linux_cmsg.cmsg_len)); + } while(clen >= sizeof(struct l_cmsghdr)); control->m_len = datalen; if (datalen == 0) { From owner-svn-src-all@freebsd.org Thu Nov 22 09:47:56 2018 Return-Path: Delivered-To: svn-src-all@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 4B7BB1142F85; Thu, 22 Nov 2018 09:47:56 +0000 (UTC) (envelope-from tijl@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 E41606EC6C; Thu, 22 Nov 2018 09:47:55 +0000 (UTC) (envelope-from tijl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1A78E63D4; Thu, 22 Nov 2018 09:47:52 +0000 (UTC) (envelope-from tijl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAM9lpnU067291; Thu, 22 Nov 2018 09:47:51 GMT (envelope-from tijl@FreeBSD.org) Received: (from tijl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAM9lpjs067290; Thu, 22 Nov 2018 09:47:51 GMT (envelope-from tijl@FreeBSD.org) Message-Id: <201811220947.wAM9lpjs067290@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tijl set sender to tijl@FreeBSD.org using -f From: Tijl Coosemans Date: Thu, 22 Nov 2018 09:47:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r340758 - stable/11/sys/compat/linux X-SVN-Group: stable-11 X-SVN-Commit-Author: tijl X-SVN-Commit-Paths: stable/11/sys/compat/linux X-SVN-Commit-Revision: 340758 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E41606EC6C X-Spamd-Result: default: False [1.51 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.41)[0.407,0]; NEURAL_SPAM_MEDIUM(0.52)[0.517,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.59)[0.589,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Nov 2018 09:47:56 -0000 Author: tijl Date: Thu Nov 22 09:47:51 2018 New Revision: 340758 URL: https://svnweb.freebsd.org/changeset/base/340758 Log: MFC r340674: Fix another user address dereference in linux_sendmsg syscall. This was hidden behind the LINUX_CMSG_NXTHDR macro which dereferences its second argument. Stop using the macro as well as LINUX_CMSG_FIRSTHDR. Use the size field of the kernel copy of the control message header to obtain the next control message. PR: 217901 Modified: stable/11/sys/compat/linux/linux_socket.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/compat/linux/linux_socket.c ============================================================================== --- stable/11/sys/compat/linux/linux_socket.c Thu Nov 22 09:47:42 2018 (r340757) +++ stable/11/sys/compat/linux/linux_socket.c Thu Nov 22 09:47:51 2018 (r340758) @@ -1099,6 +1099,7 @@ linux_sendmsg_common(struct thread *td, l_int s, struc sa_family_t sa_family; void *data; l_size_t len; + l_size_t clen; int error; error = copyin(msghdr, &linux_msg, sizeof(linux_msg)); @@ -1130,7 +1131,7 @@ linux_sendmsg_common(struct thread *td, l_int s, struc control = NULL; - if ((ptr_cmsg = LINUX_CMSG_FIRSTHDR(&linux_msg)) != NULL) { + if (linux_msg.msg_controllen >= sizeof(struct l_cmsghdr)) { error = kern_getsockname(td, s, &sa, &datalen); if (error != 0) goto bad; @@ -1143,6 +1144,8 @@ linux_sendmsg_common(struct thread *td, l_int s, struc data = mtod(control, void *); datalen = 0; + ptr_cmsg = PTRIN(linux_msg.msg_control); + clen = linux_msg.msg_controllen; do { error = copyin(ptr_cmsg, &linux_cmsg, sizeof(struct l_cmsghdr)); @@ -1150,7 +1153,8 @@ linux_sendmsg_common(struct thread *td, l_int s, struc goto bad; error = EINVAL; - if (linux_cmsg.cmsg_len < sizeof(struct l_cmsghdr)) + if (linux_cmsg.cmsg_len < sizeof(struct l_cmsghdr) || + linux_cmsg.cmsg_len > clen) goto bad; if (datalen + CMSG_HDRSZ > MCLBYTES) @@ -1202,7 +1206,14 @@ linux_sendmsg_common(struct thread *td, l_int s, struc cmsg->cmsg_len = CMSG_LEN(len); data = (char *)data + CMSG_SPACE(len); datalen += CMSG_SPACE(len); - } while ((ptr_cmsg = LINUX_CMSG_NXTHDR(&linux_msg, ptr_cmsg))); + + if (clen <= LINUX_CMSG_ALIGN(linux_cmsg.cmsg_len)) + break; + + clen -= LINUX_CMSG_ALIGN(linux_cmsg.cmsg_len); + ptr_cmsg = (struct l_cmsghdr *)((char *)ptr_cmsg + + LINUX_CMSG_ALIGN(linux_cmsg.cmsg_len)); + } while(clen >= sizeof(struct l_cmsghdr)); control->m_len = datalen; if (datalen == 0) { From owner-svn-src-all@freebsd.org Thu Nov 22 13:03:12 2018 Return-Path: Delivered-To: svn-src-all@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 13A3A114833C; Thu, 22 Nov 2018 13:03:12 +0000 (UTC) (envelope-from marius@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 AE41775A88; Thu, 22 Nov 2018 13:03:11 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8DAC710424; Thu, 22 Nov 2018 13:03:11 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAMD3BGA071747; Thu, 22 Nov 2018 13:03:11 GMT (envelope-from marius@FreeBSD.org) Received: (from marius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAMD3BPr071746; Thu, 22 Nov 2018 13:03:11 GMT (envelope-from marius@FreeBSD.org) Message-Id: <201811221303.wAMD3BPr071746@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: marius set sender to marius@FreeBSD.org using -f From: Marius Strobl Date: Thu, 22 Nov 2018 13:03:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r340759 - stable/12/sys/sparc64/sparc64 X-SVN-Group: stable-12 X-SVN-Commit-Author: marius X-SVN-Commit-Paths: stable/12/sys/sparc64/sparc64 X-SVN-Commit-Revision: 340759 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: AE41775A88 X-Spamd-Result: default: False [1.07 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.41)[0.407,0]; NEURAL_SPAM_SHORT(0.15)[0.145,0]; NEURAL_SPAM_MEDIUM(0.52)[0.517,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Nov 2018 13:03:12 -0000 Author: marius Date: Thu Nov 22 13:03:11 2018 New Revision: 340759 URL: https://svnweb.freebsd.org/changeset/base/340759 Log: MFC: r340656 Given that the idea of D15374 was to "make memmove a first class citizen", provide a _MEMMOVE extension of _MEMCPY that deals with overlap based on the previous bcopy(9) implementation and use the former for bcopy(9) and memmove(9). This addresses my D15374 review comment, avoiding extra MOVs in case of memmove(9) and trashing the stack pointer. Modified: stable/12/sys/sparc64/sparc64/support.S Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/sparc64/sparc64/support.S ============================================================================== --- stable/12/sys/sparc64/sparc64/support.S Thu Nov 22 09:47:51 2018 (r340758) +++ stable/12/sys/sparc64/sparc64/support.S Thu Nov 22 13:03:11 2018 (r340759) @@ -207,6 +207,30 @@ __FBSDID("$FreeBSD$"); 6: /* + * Extension of _MEMCPY dealing with overlap, but unaware of ASIs. + * Used for bcopy() and memmove(). + */ +#define _MEMMOVE(dst, src, len) \ + /* Check for overlap, and copy backwards if so. */ \ + sub dst, src, %g1 ; \ + cmp %g1, len ; \ + bgeu,a,pt %xcc, 2f ; \ + nop ; \ + /* Copy backwards. */ \ + add src, len, src ; \ + add dst, len, dst ; \ +1: deccc 1, len ; \ + bl,pn %xcc, 3f ; \ + dec 1, src ; \ + ldub [src], %g1 ; \ + dec 1, dst ; \ + ba %xcc, 1b ; \ + stb %g1, [dst] ; \ +2: /* Do the fast version. */ \ + _MEMCPY(dst, src, len, EMPTY, EMPTY, EMPTY, EMPTY) ; \ +3: + +/* * void ascopy(u_long asi, vm_offset_t src, vm_offset_t dst, size_t len) */ ENTRY(ascopy) @@ -265,49 +289,14 @@ ENTRY(bcmp) END(bcmp) /* - * void *memmove(void *dst, const void *src, size_t len) * void bcopy(const void *src, void *dst, size_t len) */ -ENTRY(memmove) - /* - * Swap src/dst for memmove/bcopy differences - */ - mov %o0, %o6 - mov %o1, %o0 - mov %o6, %o1 -ALTENTRY(bcopy) - /* - * Check for overlap, and copy backwards if so. - */ - sub %o1, %o0, %g1 - cmp %g1, %o2 - bgeu,a,pt %xcc, 3f +ENTRY(bcopy) + _MEMMOVE(%o1, %o0, %o2) + retl nop +END(bcopy) - /* - * Copy backwards. - */ - add %o0, %o2, %o0 - add %o1, %o2, %o1 -1: deccc 1, %o2 - bl,a,pn %xcc, 2f - nop - dec 1, %o0 - ldub [%o0], %g1 - dec 1, %o1 - ba %xcc, 1b - stb %g1, [%o1] -2: retl - mov %o6, %o0 - - /* - * Do the fast version. - */ -3: _MEMCPY(%o1, %o0, %o2, EMPTY, EMPTY, EMPTY, EMPTY) - retl - mov %o6, %o0 -END(memmove) - /* * void bzero(void *b, size_t len) */ @@ -335,6 +324,16 @@ ENTRY(memcpy) retl nop END(memcpy) + +/* + * void *memmove(void *dst, const void *src, size_t len) + */ +ENTRY(memmove) + mov %o0, %o3 + _MEMMOVE(%o3, %o1, %o2) + retl + nop +END(memmove) /* * void *memset(void *b, int c, size_t len) From owner-svn-src-all@freebsd.org Thu Nov 22 13:09:04 2018 Return-Path: Delivered-To: svn-src-all@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 AA59E114840B; Thu, 22 Nov 2018 13:09:04 +0000 (UTC) (envelope-from marius@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 4208175C5A; Thu, 22 Nov 2018 13:09:04 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2099910428; Thu, 22 Nov 2018 13:09:04 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAMD94tE072036; Thu, 22 Nov 2018 13:09:04 GMT (envelope-from marius@FreeBSD.org) Received: (from marius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAMD93iE072034; Thu, 22 Nov 2018 13:09:03 GMT (envelope-from marius@FreeBSD.org) Message-Id: <201811221309.wAMD93iE072034@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: marius set sender to marius@FreeBSD.org using -f From: Marius Strobl Date: Thu, 22 Nov 2018 13:09:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r340760 - stable/12/sys/dev/sdhci X-SVN-Group: stable-12 X-SVN-Commit-Author: marius X-SVN-Commit-Paths: stable/12/sys/dev/sdhci X-SVN-Commit-Revision: 340760 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4208175C5A X-Spamd-Result: default: False [1.07 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.41)[0.407,0]; NEURAL_SPAM_SHORT(0.15)[0.145,0]; NEURAL_SPAM_MEDIUM(0.52)[0.517,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Nov 2018 13:09:04 -0000 Author: marius Date: Thu Nov 22 13:09:03 2018 New Revision: 340760 URL: https://svnweb.freebsd.org/changeset/base/340760 Log: MFC: r340543, r340654 Add a quirk handling for AMDI0040 controllers allowing them to do HS400. Submitted by: Shreyank Amartya (original version) Modified: stable/12/sys/dev/sdhci/sdhci.c stable/12/sys/dev/sdhci/sdhci.h stable/12/sys/dev/sdhci/sdhci_acpi.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/sdhci/sdhci.c ============================================================================== --- stable/12/sys/dev/sdhci/sdhci.c Thu Nov 22 13:03:11 2018 (r340759) +++ stable/12/sys/dev/sdhci/sdhci.c Thu Nov 22 13:09:03 2018 (r340760) @@ -898,6 +898,9 @@ sdhci_init_slot(device_t dev, struct sdhci_slot *slot, if (slot->quirks & SDHCI_QUIRK_CAPS_BIT63_FOR_MMC_HS400 && caps2 & SDHCI_CAN_MMC_HS400) host_caps |= MMC_CAP_MMC_HS400; + if (slot->quirks & SDHCI_QUIRK_MMC_HS400_IF_CAN_SDR104 && + caps2 & SDHCI_CAN_SDR104) + host_caps |= MMC_CAP_MMC_HS400; /* * Disable UHS-I and eMMC modes if the set_uhs_timing method is the Modified: stable/12/sys/dev/sdhci/sdhci.h ============================================================================== --- stable/12/sys/dev/sdhci/sdhci.h Thu Nov 22 13:03:11 2018 (r340759) +++ stable/12/sys/dev/sdhci/sdhci.h Thu Nov 22 13:09:03 2018 (r340760) @@ -93,6 +93,8 @@ #define SDHCI_QUIRK_PRESET_VALUE_BROKEN (1 << 27) /* Controller does not support or the support for ACMD12 is broken. */ #define SDHCI_QUIRK_BROKEN_AUTO_STOP (1 << 28) +/* Controller supports eMMC HS400 mode if SDHCI_CAN_SDR104 is set. */ +#define SDHCI_QUIRK_MMC_HS400_IF_CAN_SDR104 (1 << 29) /* * Controller registers Modified: stable/12/sys/dev/sdhci/sdhci_acpi.c ============================================================================== --- stable/12/sys/dev/sdhci/sdhci_acpi.c Thu Nov 22 13:03:11 2018 (r340759) +++ stable/12/sys/dev/sdhci/sdhci_acpi.c Thu Nov 22 13:09:03 2018 (r340760) @@ -45,12 +45,15 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include "mmcbr_if.h" #include "sdhci_if.h" +#define SDHCI_AMD_RESET_DLL_REG 0x908 + static const struct sdhci_acpi_device { const char* hid; int uid; @@ -80,7 +83,8 @@ static const struct sdhci_acpi_device { SDHCI_QUIRK_CAPS_BIT63_FOR_MMC_HS400 | SDHCI_QUIRK_PRESET_VALUE_BROKEN }, { "AMDI0040", 0, "AMD eMMC 5.0 Controller", - SDHCI_QUIRK_32BIT_DMA_SIZE }, + SDHCI_QUIRK_32BIT_DMA_SIZE | + SDHCI_QUIRK_MMC_HS400_IF_CAN_SDR104 }, { NULL, 0, NULL, 0} }; @@ -94,12 +98,11 @@ static char *sdhci_ids[] = { }; struct sdhci_acpi_softc { - u_int quirks; /* Chip specific quirks */ - struct resource *irq_res; /* IRQ resource */ - void *intrhand; /* Interrupt handle */ - struct sdhci_slot slot; struct resource *mem_res; /* Memory resource */ + struct resource *irq_res; /* IRQ resource */ + void *intrhand; /* Interrupt handle */ + const struct sdhci_acpi_device *acpi_dev; }; static void sdhci_acpi_intr(void *arg); @@ -189,6 +192,52 @@ sdhci_acpi_write_multi_4(device_t dev, struct sdhci_sl bus_write_multi_stream_4(sc->mem_res, off, data, count); } +static void +sdhci_acpi_set_uhs_timing(device_t dev, struct sdhci_slot *slot) +{ + const struct sdhci_acpi_softc *sc; + const struct sdhci_acpi_device *acpi_dev; + const struct mmc_ios *ios; + device_t bus; + uint16_t old_timing; + enum mmc_bus_timing timing; + + bus = slot->bus; + old_timing = SDHCI_READ_2(bus, slot, SDHCI_HOST_CONTROL2); + old_timing &= SDHCI_CTRL2_UHS_MASK; + sdhci_generic_set_uhs_timing(dev, slot); + + sc = device_get_softc(dev); + acpi_dev = sc->acpi_dev; + /* + * AMDI0040 controllers require SDHCI_CTRL2_SAMPLING_CLOCK to be + * disabled when switching from HS200 to high speed and to always + * be turned on again when tuning for HS400. In the later case, + * an AMD-specific DLL reset additionally is needed. + */ + if (strcmp(acpi_dev->hid, "AMDI0040") == 0 && acpi_dev->uid == 0) { + ios = &slot->host.ios; + timing = ios->timing; + if (old_timing == SDHCI_CTRL2_UHS_SDR104 && + timing == bus_timing_hs) + SDHCI_WRITE_2(bus, slot, SDHCI_HOST_CONTROL2, + SDHCI_READ_2(bus, slot, SDHCI_HOST_CONTROL2) & + ~SDHCI_CTRL2_SAMPLING_CLOCK); + if (ios->clock > SD_SDR50_MAX && + old_timing != SDHCI_CTRL2_MMC_HS400 && + timing == bus_timing_mmc_hs400) { + SDHCI_WRITE_2(bus, slot, SDHCI_HOST_CONTROL2, + SDHCI_READ_2(bus, slot, SDHCI_HOST_CONTROL2) | + SDHCI_CTRL2_SAMPLING_CLOCK); + SDHCI_WRITE_4(bus, slot, SDHCI_AMD_RESET_DLL_REG, + 0x40003210); + DELAY(20); + SDHCI_WRITE_4(bus, slot, SDHCI_AMD_RESET_DLL_REG, + 0x40033210); + } + } +} + static const struct sdhci_acpi_device * sdhci_acpi_find_device(device_t dev) { @@ -237,13 +286,15 @@ sdhci_acpi_attach(device_t dev) { struct sdhci_acpi_softc *sc = device_get_softc(dev); int rid, err; + u_int quirks; const struct sdhci_acpi_device *acpi_dev; acpi_dev = sdhci_acpi_find_device(dev); if (acpi_dev == NULL) return (ENXIO); - sc->quirks = acpi_dev->quirks; + sc->acpi_dev = acpi_dev; + quirks = acpi_dev->quirks; /* Allocate IRQ. */ rid = 0; @@ -271,11 +322,10 @@ sdhci_acpi_attach(device_t dev) if (strcmp(acpi_dev->hid, "80860F14") == 0 && acpi_dev->uid == 1 && SDHCI_READ_4(dev, &sc->slot, SDHCI_CAPABILITIES) == 0x446cc8b2 && SDHCI_READ_4(dev, &sc->slot, SDHCI_CAPABILITIES2) == 0x00000807) - sc->quirks |= SDHCI_QUIRK_MMC_DDR52 | - SDHCI_QUIRK_DATA_TIMEOUT_1MHZ; - sc->quirks &= ~sdhci_quirk_clear; - sc->quirks |= sdhci_quirk_set; - sc->slot.quirks = sc->quirks; + quirks |= SDHCI_QUIRK_MMC_DDR52 | SDHCI_QUIRK_DATA_TIMEOUT_1MHZ; + quirks &= ~sdhci_quirk_clear; + quirks |= sdhci_quirk_set; + sc->slot.quirks = quirks; err = sdhci_init_slot(dev, &sc->slot, 0); if (err) { @@ -392,7 +442,7 @@ static device_method_t sdhci_methods[] = { DEVMETHOD(sdhci_write_2, sdhci_acpi_write_2), DEVMETHOD(sdhci_write_4, sdhci_acpi_write_4), DEVMETHOD(sdhci_write_multi_4, sdhci_acpi_write_multi_4), - DEVMETHOD(sdhci_set_uhs_timing, sdhci_generic_set_uhs_timing), + DEVMETHOD(sdhci_set_uhs_timing, sdhci_acpi_set_uhs_timing), DEVMETHOD_END }; From owner-svn-src-all@freebsd.org Thu Nov 22 13:09:44 2018 Return-Path: Delivered-To: svn-src-all@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 C61571148458; Thu, 22 Nov 2018 13:09:43 +0000 (UTC) (envelope-from tijl@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 6D85875D8A; Thu, 22 Nov 2018 13:09:43 +0000 (UTC) (envelope-from tijl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4FA0F10429; Thu, 22 Nov 2018 13:09:43 +0000 (UTC) (envelope-from tijl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAMD9hjS072123; Thu, 22 Nov 2018 13:09:43 GMT (envelope-from tijl@FreeBSD.org) Received: (from tijl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAMD9hU6072122; Thu, 22 Nov 2018 13:09:43 GMT (envelope-from tijl@FreeBSD.org) Message-Id: <201811221309.wAMD9hU6072122@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tijl set sender to tijl@FreeBSD.org using -f From: Tijl Coosemans Date: Thu, 22 Nov 2018 13:09:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r340761 - releng/12.0/sys/compat/linux X-SVN-Group: releng X-SVN-Commit-Author: tijl X-SVN-Commit-Paths: releng/12.0/sys/compat/linux X-SVN-Commit-Revision: 340761 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 6D85875D8A X-Spamd-Result: default: False [1.17 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.24)[0.241,0]; NEURAL_SPAM_MEDIUM(0.51)[0.514,0]; NEURAL_SPAM_LONG(0.42)[0.420,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Nov 2018 13:09:44 -0000 Author: tijl Date: Thu Nov 22 13:09:42 2018 New Revision: 340761 URL: https://svnweb.freebsd.org/changeset/base/340761 Log: MFS r340755: Do proper copyin of control message data in the Linux sendmsg syscall. Instead of calling m_append with a user address, allocate an mbuf cluster and copy data into it using copyin. For the SCM_CREDS case, instead of zeroing a stack variable and appending that to the mbuf, zero part of the mbuf cluster directly. One mbuf cluster is also the size limit used by the FreeBSD sendmsg syscall (uipc_syscalls.c:sockargs()). PR: 217901 Reviewed by: kib Approved by: re (marius) Modified: releng/12.0/sys/compat/linux/linux_socket.c Directory Properties: releng/12.0/ (props changed) Modified: releng/12.0/sys/compat/linux/linux_socket.c ============================================================================== --- releng/12.0/sys/compat/linux/linux_socket.c Thu Nov 22 13:09:03 2018 (r340760) +++ releng/12.0/sys/compat/linux/linux_socket.c Thu Nov 22 13:09:42 2018 (r340761) @@ -1085,7 +1085,6 @@ linux_sendmsg_common(struct thread *td, l_int s, struc l_uint flags) { struct cmsghdr *cmsg; - struct cmsgcred cmcred; struct mbuf *control; struct msghdr msg; struct l_cmsghdr linux_cmsg; @@ -1096,6 +1095,7 @@ linux_sendmsg_common(struct thread *td, l_int s, struc struct sockaddr *sa; sa_family_t sa_family; void *data; + l_size_t len; int error; error = copyin(msghdr, &linux_msg, sizeof(linux_msg)); @@ -1126,7 +1126,6 @@ linux_sendmsg_common(struct thread *td, l_int s, struc return (error); control = NULL; - cmsg = NULL; if ((ptr_cmsg = LINUX_CMSG_FIRSTHDR(&linux_msg)) != NULL) { error = kern_getsockname(td, s, &sa, &datalen); @@ -1136,8 +1135,10 @@ linux_sendmsg_common(struct thread *td, l_int s, struc free(sa, M_SONAME); error = ENOBUFS; - cmsg = malloc(CMSG_HDRSZ, M_LINUX, M_WAITOK|M_ZERO); control = m_get(M_WAITOK, MT_CONTROL); + MCLGET(control, M_WAITOK); + data = mtod(control, void *); + datalen = 0; do { error = copyin(ptr_cmsg, &linux_cmsg, @@ -1149,10 +1150,14 @@ linux_sendmsg_common(struct thread *td, l_int s, struc if (linux_cmsg.cmsg_len < sizeof(struct l_cmsghdr)) goto bad; + if (datalen + CMSG_HDRSZ > MCLBYTES) + goto bad; + /* * Now we support only SCM_RIGHTS and SCM_CRED, * so return EINVAL in any other cmsg_type */ + cmsg = data; cmsg->cmsg_type = linux_to_bsd_cmsg_type(linux_cmsg.cmsg_type); cmsg->cmsg_level = @@ -1170,35 +1175,34 @@ linux_sendmsg_common(struct thread *td, l_int s, struc if (sa_family != AF_UNIX) continue; - data = LINUX_CMSG_DATA(ptr_cmsg); - datalen = linux_cmsg.cmsg_len - L_CMSG_HDRSZ; + if (cmsg->cmsg_type == SCM_CREDS) { + len = sizeof(struct cmsgcred); + if (datalen + CMSG_SPACE(len) > MCLBYTES) + goto bad; - switch (cmsg->cmsg_type) - { - case SCM_RIGHTS: - break; - - case SCM_CREDS: - data = &cmcred; - datalen = sizeof(cmcred); - /* * The lower levels will fill in the structure */ - bzero(data, datalen); - break; + memset(CMSG_DATA(data), 0, len); + } else { + len = linux_cmsg.cmsg_len - L_CMSG_HDRSZ; + if (datalen + CMSG_SPACE(len) < datalen || + datalen + CMSG_SPACE(len) > MCLBYTES) + goto bad; + + error = copyin(LINUX_CMSG_DATA(ptr_cmsg), + CMSG_DATA(data), len); + if (error != 0) + goto bad; } - cmsg->cmsg_len = CMSG_LEN(datalen); - - error = ENOBUFS; - if (!m_append(control, CMSG_HDRSZ, (c_caddr_t)cmsg)) - goto bad; - if (!m_append(control, datalen, (c_caddr_t)data)) - goto bad; + cmsg->cmsg_len = CMSG_LEN(len); + data = (char *)data + CMSG_SPACE(len); + datalen += CMSG_SPACE(len); } while ((ptr_cmsg = LINUX_CMSG_NXTHDR(&linux_msg, ptr_cmsg))); - if (m_length(control, NULL) == 0) { + control->m_len = datalen; + if (datalen == 0) { m_freem(control); control = NULL; } @@ -1212,8 +1216,6 @@ linux_sendmsg_common(struct thread *td, l_int s, struc bad: m_freem(control); free(iov, M_IOV); - if (cmsg) - free(cmsg, M_LINUX); return (error); } From owner-svn-src-all@freebsd.org Thu Nov 22 13:12:18 2018 Return-Path: Delivered-To: svn-src-all@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 43D861148627; Thu, 22 Nov 2018 13:12:18 +0000 (UTC) (envelope-from tijl@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 DB3AE76160; Thu, 22 Nov 2018 13:12:17 +0000 (UTC) (envelope-from tijl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BD5C1105A3; Thu, 22 Nov 2018 13:12:17 +0000 (UTC) (envelope-from tijl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAMDCHkP073847; Thu, 22 Nov 2018 13:12:17 GMT (envelope-from tijl@FreeBSD.org) Received: (from tijl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAMDCH0U073846; Thu, 22 Nov 2018 13:12:17 GMT (envelope-from tijl@FreeBSD.org) Message-Id: <201811221312.wAMDCH0U073846@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tijl set sender to tijl@FreeBSD.org using -f From: Tijl Coosemans Date: Thu, 22 Nov 2018 13:12:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r340762 - releng/12.0/sys/compat/linux X-SVN-Group: releng X-SVN-Commit-Author: tijl X-SVN-Commit-Paths: releng/12.0/sys/compat/linux X-SVN-Commit-Revision: 340762 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: DB3AE76160 X-Spamd-Result: default: False [1.17 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.42)[0.420,0]; NEURAL_SPAM_MEDIUM(0.51)[0.514,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.24)[0.241,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Nov 2018 13:12:18 -0000 Author: tijl Date: Thu Nov 22 13:12:17 2018 New Revision: 340762 URL: https://svnweb.freebsd.org/changeset/base/340762 Log: MFS r340757: Fix another user address dereference in linux_sendmsg syscall. This was hidden behind the LINUX_CMSG_NXTHDR macro which dereferences its second argument. Stop using the macro as well as LINUX_CMSG_FIRSTHDR. Use the size field of the kernel copy of the control message header to obtain the next control message. PR: 217901 Approved by: re (marius) Modified: releng/12.0/sys/compat/linux/linux_socket.c Directory Properties: releng/12.0/ (props changed) Modified: releng/12.0/sys/compat/linux/linux_socket.c ============================================================================== --- releng/12.0/sys/compat/linux/linux_socket.c Thu Nov 22 13:09:42 2018 (r340761) +++ releng/12.0/sys/compat/linux/linux_socket.c Thu Nov 22 13:12:17 2018 (r340762) @@ -1096,6 +1096,7 @@ linux_sendmsg_common(struct thread *td, l_int s, struc sa_family_t sa_family; void *data; l_size_t len; + l_size_t clen; int error; error = copyin(msghdr, &linux_msg, sizeof(linux_msg)); @@ -1127,7 +1128,7 @@ linux_sendmsg_common(struct thread *td, l_int s, struc control = NULL; - if ((ptr_cmsg = LINUX_CMSG_FIRSTHDR(&linux_msg)) != NULL) { + if (linux_msg.msg_controllen >= sizeof(struct l_cmsghdr)) { error = kern_getsockname(td, s, &sa, &datalen); if (error != 0) goto bad; @@ -1140,6 +1141,8 @@ linux_sendmsg_common(struct thread *td, l_int s, struc data = mtod(control, void *); datalen = 0; + ptr_cmsg = PTRIN(linux_msg.msg_control); + clen = linux_msg.msg_controllen; do { error = copyin(ptr_cmsg, &linux_cmsg, sizeof(struct l_cmsghdr)); @@ -1147,7 +1150,8 @@ linux_sendmsg_common(struct thread *td, l_int s, struc goto bad; error = EINVAL; - if (linux_cmsg.cmsg_len < sizeof(struct l_cmsghdr)) + if (linux_cmsg.cmsg_len < sizeof(struct l_cmsghdr) || + linux_cmsg.cmsg_len > clen) goto bad; if (datalen + CMSG_HDRSZ > MCLBYTES) @@ -1199,7 +1203,14 @@ linux_sendmsg_common(struct thread *td, l_int s, struc cmsg->cmsg_len = CMSG_LEN(len); data = (char *)data + CMSG_SPACE(len); datalen += CMSG_SPACE(len); - } while ((ptr_cmsg = LINUX_CMSG_NXTHDR(&linux_msg, ptr_cmsg))); + + if (clen <= LINUX_CMSG_ALIGN(linux_cmsg.cmsg_len)) + break; + + clen -= LINUX_CMSG_ALIGN(linux_cmsg.cmsg_len); + ptr_cmsg = (struct l_cmsghdr *)((char *)ptr_cmsg + + LINUX_CMSG_ALIGN(linux_cmsg.cmsg_len)); + } while(clen >= sizeof(struct l_cmsghdr)); control->m_len = datalen; if (datalen == 0) { From owner-svn-src-all@freebsd.org Thu Nov 22 13:14:17 2018 Return-Path: Delivered-To: svn-src-all@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 CB57411486B2; Thu, 22 Nov 2018 13:14:16 +0000 (UTC) (envelope-from marius@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 6D2FE76318; Thu, 22 Nov 2018 13:14:16 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4888D105BF; Thu, 22 Nov 2018 13:14:16 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAMDEGte077130; Thu, 22 Nov 2018 13:14:16 GMT (envelope-from marius@FreeBSD.org) Received: (from marius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAMDEFom077127; Thu, 22 Nov 2018 13:14:15 GMT (envelope-from marius@FreeBSD.org) Message-Id: <201811221314.wAMDEFom077127@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: marius set sender to marius@FreeBSD.org using -f From: Marius Strobl Date: Thu, 22 Nov 2018 13:14:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r340763 - stable/11/sys/dev/sdhci X-SVN-Group: stable-11 X-SVN-Commit-Author: marius X-SVN-Commit-Paths: stable/11/sys/dev/sdhci X-SVN-Commit-Revision: 340763 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 6D2FE76318 X-Spamd-Result: default: False [1.07 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.41)[0.407,0]; NEURAL_SPAM_SHORT(0.15)[0.145,0]; NEURAL_SPAM_MEDIUM(0.52)[0.517,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Nov 2018 13:14:17 -0000 Author: marius Date: Thu Nov 22 13:14:15 2018 New Revision: 340763 URL: https://svnweb.freebsd.org/changeset/base/340763 Log: MFC: r339007, r340543, r340654 - Add ACPI identifier for AMD eMMC 5.0 controller [1] - Add a quirk handling for AMDI0040 controllers allowing them to do HS400. [2] Submitted by: Rajesh Kumar [1], Shreyank Amartya (original version) [2] Modified: stable/11/sys/dev/sdhci/sdhci.c stable/11/sys/dev/sdhci/sdhci.h stable/11/sys/dev/sdhci/sdhci_acpi.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/sdhci/sdhci.c ============================================================================== --- stable/11/sys/dev/sdhci/sdhci.c Thu Nov 22 13:12:17 2018 (r340762) +++ stable/11/sys/dev/sdhci/sdhci.c Thu Nov 22 13:14:15 2018 (r340763) @@ -809,6 +809,9 @@ sdhci_init_slot(device_t dev, struct sdhci_slot *slot, if (slot->quirks & SDHCI_QUIRK_CAPS_BIT63_FOR_MMC_HS400 && caps2 & SDHCI_CAN_MMC_HS400) host_caps |= MMC_CAP_MMC_HS400; + if (slot->quirks & SDHCI_QUIRK_MMC_HS400_IF_CAN_SDR104 && + caps2 & SDHCI_CAN_SDR104) + host_caps |= MMC_CAP_MMC_HS400; /* * Disable UHS-I and eMMC modes if the set_uhs_timing method is the Modified: stable/11/sys/dev/sdhci/sdhci.h ============================================================================== --- stable/11/sys/dev/sdhci/sdhci.h Thu Nov 22 13:12:17 2018 (r340762) +++ stable/11/sys/dev/sdhci/sdhci.h Thu Nov 22 13:14:15 2018 (r340763) @@ -89,6 +89,8 @@ #define SDHCI_QUIRK_PRESET_VALUE_BROKEN (1 << 27) /* Controller does not support or the support for ACMD12 is broken. */ #define SDHCI_QUIRK_BROKEN_AUTO_STOP (1 << 28) +/* Controller supports eMMC HS400 mode if SDHCI_CAN_SDR104 is set. */ +#define SDHCI_QUIRK_MMC_HS400_IF_CAN_SDR104 (1 << 29) /* * Controller registers Modified: stable/11/sys/dev/sdhci/sdhci_acpi.c ============================================================================== --- stable/11/sys/dev/sdhci/sdhci_acpi.c Thu Nov 22 13:12:17 2018 (r340762) +++ stable/11/sys/dev/sdhci/sdhci_acpi.c Thu Nov 22 13:14:15 2018 (r340763) @@ -45,12 +45,15 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include "mmcbr_if.h" #include "sdhci_if.h" +#define SDHCI_AMD_RESET_DLL_REG 0x908 + static const struct sdhci_acpi_device { const char* hid; int uid; @@ -79,6 +82,9 @@ static const struct sdhci_acpi_device { SDHCI_QUIRK_MMC_DDR52 | SDHCI_QUIRK_CAPS_BIT63_FOR_MMC_HS400 | SDHCI_QUIRK_PRESET_VALUE_BROKEN }, + { "AMDI0040", 0, "AMD eMMC 5.0 Controller", + SDHCI_QUIRK_32BIT_DMA_SIZE | + SDHCI_QUIRK_MMC_HS400_IF_CAN_SDR104 }, { NULL, 0, NULL, 0} }; @@ -87,16 +93,16 @@ static char *sdhci_ids[] = { "80860F16", "80865ACA", "80865ACC", + "AMDI0040", NULL }; struct sdhci_acpi_softc { - u_int quirks; /* Chip specific quirks */ - struct resource *irq_res; /* IRQ resource */ - void *intrhand; /* Interrupt handle */ - struct sdhci_slot slot; struct resource *mem_res; /* Memory resource */ + struct resource *irq_res; /* IRQ resource */ + void *intrhand; /* Interrupt handle */ + const struct sdhci_acpi_device *acpi_dev; }; static void sdhci_acpi_intr(void *arg); @@ -186,6 +192,52 @@ sdhci_acpi_write_multi_4(device_t dev, struct sdhci_sl bus_write_multi_stream_4(sc->mem_res, off, data, count); } +static void +sdhci_acpi_set_uhs_timing(device_t dev, struct sdhci_slot *slot) +{ + const struct sdhci_acpi_softc *sc; + const struct sdhci_acpi_device *acpi_dev; + const struct mmc_ios *ios; + device_t bus; + uint16_t old_timing; + enum mmc_bus_timing timing; + + bus = slot->bus; + old_timing = SDHCI_READ_2(bus, slot, SDHCI_HOST_CONTROL2); + old_timing &= SDHCI_CTRL2_UHS_MASK; + sdhci_generic_set_uhs_timing(dev, slot); + + sc = device_get_softc(dev); + acpi_dev = sc->acpi_dev; + /* + * AMDI0040 controllers require SDHCI_CTRL2_SAMPLING_CLOCK to be + * disabled when switching from HS200 to high speed and to always + * be turned on again when tuning for HS400. In the later case, + * an AMD-specific DLL reset additionally is needed. + */ + if (strcmp(acpi_dev->hid, "AMDI0040") == 0 && acpi_dev->uid == 0) { + ios = &slot->host.ios; + timing = ios->timing; + if (old_timing == SDHCI_CTRL2_UHS_SDR104 && + timing == bus_timing_hs) + SDHCI_WRITE_2(bus, slot, SDHCI_HOST_CONTROL2, + SDHCI_READ_2(bus, slot, SDHCI_HOST_CONTROL2) & + ~SDHCI_CTRL2_SAMPLING_CLOCK); + if (ios->clock > SD_SDR50_MAX && + old_timing != SDHCI_CTRL2_MMC_HS400 && + timing == bus_timing_mmc_hs400) { + SDHCI_WRITE_2(bus, slot, SDHCI_HOST_CONTROL2, + SDHCI_READ_2(bus, slot, SDHCI_HOST_CONTROL2) | + SDHCI_CTRL2_SAMPLING_CLOCK); + SDHCI_WRITE_4(bus, slot, SDHCI_AMD_RESET_DLL_REG, + 0x40003210); + DELAY(20); + SDHCI_WRITE_4(bus, slot, SDHCI_AMD_RESET_DLL_REG, + 0x40033210); + } + } +} + static const struct sdhci_acpi_device * sdhci_acpi_find_device(device_t dev) { @@ -234,13 +286,15 @@ sdhci_acpi_attach(device_t dev) { struct sdhci_acpi_softc *sc = device_get_softc(dev); int rid, err; + u_int quirks; const struct sdhci_acpi_device *acpi_dev; acpi_dev = sdhci_acpi_find_device(dev); if (acpi_dev == NULL) return (ENXIO); - sc->quirks = acpi_dev->quirks; + sc->acpi_dev = acpi_dev; + quirks = acpi_dev->quirks; /* Allocate IRQ. */ rid = 0; @@ -268,11 +322,10 @@ sdhci_acpi_attach(device_t dev) if (strcmp(acpi_dev->hid, "80860F14") == 0 && acpi_dev->uid == 1 && SDHCI_READ_4(dev, &sc->slot, SDHCI_CAPABILITIES) == 0x446cc8b2 && SDHCI_READ_4(dev, &sc->slot, SDHCI_CAPABILITIES2) == 0x00000807) - sc->quirks |= SDHCI_QUIRK_MMC_DDR52 | - SDHCI_QUIRK_DATA_TIMEOUT_1MHZ; - sc->quirks &= ~sdhci_quirk_clear; - sc->quirks |= sdhci_quirk_set; - sc->slot.quirks = sc->quirks; + quirks |= SDHCI_QUIRK_MMC_DDR52 | SDHCI_QUIRK_DATA_TIMEOUT_1MHZ; + quirks &= ~sdhci_quirk_clear; + quirks |= sdhci_quirk_set; + sc->slot.quirks = quirks; err = sdhci_init_slot(dev, &sc->slot, 0); if (err) { @@ -389,7 +442,7 @@ static device_method_t sdhci_methods[] = { DEVMETHOD(sdhci_write_2, sdhci_acpi_write_2), DEVMETHOD(sdhci_write_4, sdhci_acpi_write_4), DEVMETHOD(sdhci_write_multi_4, sdhci_acpi_write_multi_4), - DEVMETHOD(sdhci_set_uhs_timing, sdhci_generic_set_uhs_timing), + DEVMETHOD(sdhci_set_uhs_timing, sdhci_acpi_set_uhs_timing), DEVMETHOD_END }; From owner-svn-src-all@freebsd.org Thu Nov 22 13:17:29 2018 Return-Path: Delivered-To: svn-src-all@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 8CDEC114875D; Thu, 22 Nov 2018 13:17:29 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0DA80764AA; Thu, 22 Nov 2018 13:17:29 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from mail-lf1-f48.google.com (mail-lf1-f48.google.com [209.85.167.48]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) (Authenticated sender: kevans) by smtp.freebsd.org (Postfix) with ESMTPSA id 9EF10BEFF; Thu, 22 Nov 2018 13:17:28 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-lf1-f48.google.com with SMTP id f23so6496814lfc.13; Thu, 22 Nov 2018 05:17:28 -0800 (PST) X-Gm-Message-State: AGRZ1gLq34GWfYlJYwX/7Pf4Bqhypqy1toxQ0lreGRiUg4vK7eRxDHb5 VhhynQjrXXoMd9B92Aug60BYk8IeClTA5XLJtLo= X-Google-Smtp-Source: AJdET5fVBKOnFJ8oEVYZhiEOjGeTe9Lmdzc3aMQCdQxSkykVJxFtN/XF0z3P/E2a7t0G1/L4sAFS/wWSCjdUMGhHunQ= X-Received: by 2002:a19:c70a:: with SMTP id x10mr6362543lff.88.1542892647062; Thu, 22 Nov 2018 05:17:27 -0800 (PST) MIME-Version: 1.0 References: <201810210208.w9L28vVc080088@repo.freebsd.org> <20181122071629.GA96830@raichu> In-Reply-To: <20181122071629.GA96830@raichu> From: Kyle Evans Date: Thu, 22 Nov 2018 07:17:15 -0600 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r339516 - head/sys/cddl/dev/dtrace/powerpc To: Mark Johnston Cc: Justin Hibbits , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org, Li-Wen Hsu Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 0DA80764AA X-Spamd-Result: default: False [1.01 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_SPAM_SHORT(0.09)[0.091,0]; NEURAL_SPAM_MEDIUM(0.54)[0.538,0]; NEURAL_SPAM_LONG(0.38)[0.383,0]; ASN(0.00)[asn:11403, ipnet:96.47.64.0/20, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Nov 2018 13:17:29 -0000 On Thu, Nov 22, 2018 at 1:16 AM Mark Johnston wrote: > > On Wed, Nov 21, 2018 at 10:02:15PM -0600, Kyle Evans wrote: > > On Wed, Nov 21, 2018 at 9:42 PM Kyle Evans wrote: > > > > > > On Sat, Oct 20, 2018 at 9:09 PM Justin Hibbits wrote: > > > > > > > > Author: jhibbits > > > > Date: Sun Oct 21 02:08:57 2018 > > > > New Revision: 339516 > > > > URL: https://svnweb.freebsd.org/changeset/base/339516 > > > > > > > > Log: > > > > powerpc/dtrace: Use explicit bit numbers to mask out PSL_EE > > > > > > > > There seems to be a race in CI, such that dtrace_asm.S might be assembled > > > > before the genassym is completed. This causes a build failure when PSL_EE > > > > doesn't exist, and is read as 0. Get around this by explicitly specifying > > > > the bits in the mask instead. > > > > > > > > > > Hi, > > > > > > CI on the stable/12 branch still hits this, so I'm tempted to MFC this > > > if you don't object. OTOH, the correct solution should be a > > > `dependency "genassym.o"` in ^/sys/conf/files.powerpc for > > > dtrace_asm.S, no? > > I believe that dtrace_asm.S will be built as part of dtrace.ko, not the > kernel. dtrace/Makefile already specifies a dependency on assym.inc. > Maybe this is the same issue as PR 233339? > Ah, indeed, this was the module rather than kernel build of dtrace_asm.S -- sorry about that. That one is indeed not as simple of a fix. =( From owner-svn-src-all@freebsd.org Thu Nov 22 13:18:59 2018 Return-Path: Delivered-To: svn-src-all@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 9C31B11487FF; Thu, 22 Nov 2018 13:18:59 +0000 (UTC) (envelope-from marius@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 3BE9776632; Thu, 22 Nov 2018 13:18:59 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 102C6105C1; Thu, 22 Nov 2018 13:18:59 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAMDIwIk077386; Thu, 22 Nov 2018 13:18:58 GMT (envelope-from marius@FreeBSD.org) Received: (from marius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAMDIwPp077383; Thu, 22 Nov 2018 13:18:58 GMT (envelope-from marius@FreeBSD.org) Message-Id: <201811221318.wAMDIwPp077383@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: marius set sender to marius@FreeBSD.org using -f From: Marius Strobl Date: Thu, 22 Nov 2018 13:18:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r340764 - stable/10/sys/dev/sdhci X-SVN-Group: stable-10 X-SVN-Commit-Author: marius X-SVN-Commit-Paths: stable/10/sys/dev/sdhci X-SVN-Commit-Revision: 340764 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 3BE9776632 X-Spamd-Result: default: False [1.07 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.15)[0.145,0]; NEURAL_SPAM_MEDIUM(0.52)[0.517,0]; NEURAL_SPAM_LONG(0.41)[0.407,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Nov 2018 13:18:59 -0000 Author: marius Date: Thu Nov 22 13:18:58 2018 New Revision: 340764 URL: https://svnweb.freebsd.org/changeset/base/340764 Log: MFC: r339007, r340543, r340654 - Add ACPI identifier for AMD eMMC 5.0 controller [1] - Add a quirk handling for AMDI0040 controllers allowing them to do HS400. [2] Submitted by: Rajesh Kumar [1], Shreyank Amartya (original version) [2] Modified: stable/10/sys/dev/sdhci/sdhci.c stable/10/sys/dev/sdhci/sdhci.h stable/10/sys/dev/sdhci/sdhci_acpi.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/sdhci/sdhci.c ============================================================================== --- stable/10/sys/dev/sdhci/sdhci.c Thu Nov 22 13:14:15 2018 (r340763) +++ stable/10/sys/dev/sdhci/sdhci.c Thu Nov 22 13:18:58 2018 (r340764) @@ -810,6 +810,9 @@ sdhci_init_slot(device_t dev, struct sdhci_slot *slot, if (slot->quirks & SDHCI_QUIRK_CAPS_BIT63_FOR_MMC_HS400 && caps2 & SDHCI_CAN_MMC_HS400) host_caps |= MMC_CAP_MMC_HS400; + if (slot->quirks & SDHCI_QUIRK_MMC_HS400_IF_CAN_SDR104 && + caps2 & SDHCI_CAN_SDR104) + host_caps |= MMC_CAP_MMC_HS400; /* * Disable UHS-I and eMMC modes if the set_uhs_timing method is the Modified: stable/10/sys/dev/sdhci/sdhci.h ============================================================================== --- stable/10/sys/dev/sdhci/sdhci.h Thu Nov 22 13:14:15 2018 (r340763) +++ stable/10/sys/dev/sdhci/sdhci.h Thu Nov 22 13:18:58 2018 (r340764) @@ -87,6 +87,8 @@ #define SDHCI_QUIRK_CAPS_BIT63_FOR_MMC_HS400 (1 << 26) /* Controller support for SDHCI_CTRL2_PRESET_VALUE is broken. */ #define SDHCI_QUIRK_PRESET_VALUE_BROKEN (1 << 27) +/* Controller supports eMMC HS400 mode if SDHCI_CAN_SDR104 is set. */ +#define SDHCI_QUIRK_MMC_HS400_IF_CAN_SDR104 (1 << 29) /* * Controller registers Modified: stable/10/sys/dev/sdhci/sdhci_acpi.c ============================================================================== --- stable/10/sys/dev/sdhci/sdhci_acpi.c Thu Nov 22 13:14:15 2018 (r340763) +++ stable/10/sys/dev/sdhci/sdhci_acpi.c Thu Nov 22 13:18:58 2018 (r340764) @@ -45,12 +45,15 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include "mmcbr_if.h" #include "sdhci_if.h" +#define SDHCI_AMD_RESET_DLL_REG 0x908 + static const struct sdhci_acpi_device { const char* hid; int uid; @@ -79,6 +82,9 @@ static const struct sdhci_acpi_device { SDHCI_QUIRK_MMC_DDR52 | SDHCI_QUIRK_CAPS_BIT63_FOR_MMC_HS400 | SDHCI_QUIRK_PRESET_VALUE_BROKEN }, + { "AMDI0040", 0, "AMD eMMC 5.0 Controller", + SDHCI_QUIRK_32BIT_DMA_SIZE | + SDHCI_QUIRK_MMC_HS400_IF_CAN_SDR104 }, { NULL, 0, NULL, 0} }; @@ -87,16 +93,16 @@ static char *sdhci_ids[] = { "80860F16", "80865ACA", "80865ACC", + "AMDI0040", NULL }; struct sdhci_acpi_softc { - u_int quirks; /* Chip specific quirks */ - struct resource *irq_res; /* IRQ resource */ - void *intrhand; /* Interrupt handle */ - struct sdhci_slot slot; struct resource *mem_res; /* Memory resource */ + struct resource *irq_res; /* IRQ resource */ + void *intrhand; /* Interrupt handle */ + const struct sdhci_acpi_device *acpi_dev; }; static void sdhci_acpi_intr(void *arg); @@ -186,6 +192,52 @@ sdhci_acpi_write_multi_4(device_t dev, struct sdhci_sl bus_write_multi_stream_4(sc->mem_res, off, data, count); } +static void +sdhci_acpi_set_uhs_timing(device_t dev, struct sdhci_slot *slot) +{ + const struct sdhci_acpi_softc *sc; + const struct sdhci_acpi_device *acpi_dev; + const struct mmc_ios *ios; + device_t bus; + uint16_t old_timing; + enum mmc_bus_timing timing; + + bus = slot->bus; + old_timing = SDHCI_READ_2(bus, slot, SDHCI_HOST_CONTROL2); + old_timing &= SDHCI_CTRL2_UHS_MASK; + sdhci_generic_set_uhs_timing(dev, slot); + + sc = device_get_softc(dev); + acpi_dev = sc->acpi_dev; + /* + * AMDI0040 controllers require SDHCI_CTRL2_SAMPLING_CLOCK to be + * disabled when switching from HS200 to high speed and to always + * be turned on again when tuning for HS400. In the later case, + * an AMD-specific DLL reset additionally is needed. + */ + if (strcmp(acpi_dev->hid, "AMDI0040") == 0 && acpi_dev->uid == 0) { + ios = &slot->host.ios; + timing = ios->timing; + if (old_timing == SDHCI_CTRL2_UHS_SDR104 && + timing == bus_timing_hs) + SDHCI_WRITE_2(bus, slot, SDHCI_HOST_CONTROL2, + SDHCI_READ_2(bus, slot, SDHCI_HOST_CONTROL2) & + ~SDHCI_CTRL2_SAMPLING_CLOCK); + if (ios->clock > SD_SDR50_MAX && + old_timing != SDHCI_CTRL2_MMC_HS400 && + timing == bus_timing_mmc_hs400) { + SDHCI_WRITE_2(bus, slot, SDHCI_HOST_CONTROL2, + SDHCI_READ_2(bus, slot, SDHCI_HOST_CONTROL2) | + SDHCI_CTRL2_SAMPLING_CLOCK); + SDHCI_WRITE_4(bus, slot, SDHCI_AMD_RESET_DLL_REG, + 0x40003210); + DELAY(20); + SDHCI_WRITE_4(bus, slot, SDHCI_AMD_RESET_DLL_REG, + 0x40033210); + } + } +} + static const struct sdhci_acpi_device * sdhci_acpi_find_device(device_t dev) { @@ -234,13 +286,15 @@ sdhci_acpi_attach(device_t dev) { struct sdhci_acpi_softc *sc = device_get_softc(dev); int rid, err; + u_int quirks; const struct sdhci_acpi_device *acpi_dev; acpi_dev = sdhci_acpi_find_device(dev); if (acpi_dev == NULL) return (ENXIO); - sc->quirks = acpi_dev->quirks; + sc->acpi_dev = acpi_dev; + quirks = acpi_dev->quirks; /* Allocate IRQ. */ rid = 0; @@ -268,11 +322,10 @@ sdhci_acpi_attach(device_t dev) if (strcmp(acpi_dev->hid, "80860F14") == 0 && acpi_dev->uid == 1 && SDHCI_READ_4(dev, &sc->slot, SDHCI_CAPABILITIES) == 0x446cc8b2 && SDHCI_READ_4(dev, &sc->slot, SDHCI_CAPABILITIES2) == 0x00000807) - sc->quirks |= SDHCI_QUIRK_MMC_DDR52 | - SDHCI_QUIRK_DATA_TIMEOUT_1MHZ; - sc->quirks &= ~sdhci_quirk_clear; - sc->quirks |= sdhci_quirk_set; - sc->slot.quirks = sc->quirks; + quirks |= SDHCI_QUIRK_MMC_DDR52 | SDHCI_QUIRK_DATA_TIMEOUT_1MHZ; + quirks &= ~sdhci_quirk_clear; + quirks |= sdhci_quirk_set; + sc->slot.quirks = quirks; err = sdhci_init_slot(dev, &sc->slot, 0); if (err) { @@ -389,7 +442,7 @@ static device_method_t sdhci_methods[] = { DEVMETHOD(sdhci_write_2, sdhci_acpi_write_2), DEVMETHOD(sdhci_write_4, sdhci_acpi_write_4), DEVMETHOD(sdhci_write_multi_4, sdhci_acpi_write_multi_4), - DEVMETHOD(sdhci_set_uhs_timing, sdhci_generic_set_uhs_timing), + DEVMETHOD(sdhci_set_uhs_timing, sdhci_acpi_set_uhs_timing), DEVMETHOD_END }; From owner-svn-src-all@freebsd.org Thu Nov 22 14:10:47 2018 Return-Path: Delivered-To: svn-src-all@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 2E46E1149825; Thu, 22 Nov 2018 14:10:47 +0000 (UTC) (envelope-from arybchik@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 B4C8777ED3; Thu, 22 Nov 2018 14:10:46 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 95C0B10DD8; Thu, 22 Nov 2018 14:10:46 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAMEAkoH003800; Thu, 22 Nov 2018 14:10:46 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAMEAkVM003799; Thu, 22 Nov 2018 14:10:46 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811221410.wAMEAkVM003799@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Thu, 22 Nov 2018 14:10:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340765 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 340765 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B4C8777ED3 X-Spamd-Result: default: False [1.36 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.40)[0.400,0]; NEURAL_SPAM_MEDIUM(0.49)[0.489,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.47)[0.471,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Nov 2018 14:10:47 -0000 Author: arybchik Date: Thu Nov 22 14:10:46 2018 New Revision: 340765 URL: https://svnweb.freebsd.org/changeset/base/340765 Log: sfxge(4): cleanup: move into right place Due to incorrect merge the piece of code was put in incorrect place and diverge from libefx in other locations. Sponsored by: Solarflare Communications, Inc. MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D18024 Modified: head/sys/dev/sfxge/common/ef10_nic.c Modified: head/sys/dev/sfxge/common/ef10_nic.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_nic.c Thu Nov 22 13:18:58 2018 (r340764) +++ head/sys/dev/sfxge/common/ef10_nic.c Thu Nov 22 14:10:46 2018 (r340765) @@ -1092,6 +1092,18 @@ ef10_get_datapath_caps( CAP_FLAG2(flags2, INIT_EVQ_V2) ? B_TRUE : B_FALSE; /* + * Check if firmware-verified NVRAM updates must be used. + * + * The firmware trusted installer requires all NVRAM updates to use + * version 2 of MC_CMD_NVRAM_UPDATE_START (to enable verified update) + * and version 2 of MC_CMD_NVRAM_UPDATE_FINISH (to verify the updated + * partition and report the result). + */ + encp->enc_fw_verified_nvram_update_required = + CAP_FLAG2(flags2, NVRAM_UPDATE_REPORT_VERIFY_RESULT) ? + B_TRUE : B_FALSE; + + /* * Check if firmware provides packet memory and Rx datapath * counters. */ @@ -1104,18 +1116,6 @@ ef10_get_datapath_caps( */ encp->enc_mac_stats_40g_tx_size_bins = CAP_FLAG2(flags2, MAC_STATS_40G_TX_SIZE_BINS) ? B_TRUE : B_FALSE; - - /* - * Check if firmware-verified NVRAM updates must be used. - * - * The firmware trusted installer requires all NVRAM updates to use - * version 2 of MC_CMD_NVRAM_UPDATE_START (to enable verified update) - * and version 2 of MC_CMD_NVRAM_UPDATE_FINISH (to verify the updated - * partition and report the result). - */ - encp->enc_fw_verified_nvram_update_required = - CAP_FLAG2(flags2, NVRAM_UPDATE_REPORT_VERIFY_RESULT) ? - B_TRUE : B_FALSE; #undef CAP_FLAG #undef CAP_FLAG2 From owner-svn-src-all@freebsd.org Thu Nov 22 14:31:39 2018 Return-Path: Delivered-To: svn-src-all@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 EEC5F1149E8E; Thu, 22 Nov 2018 14:31:38 +0000 (UTC) (envelope-from arybchik@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 9C5AD78F35; Thu, 22 Nov 2018 14:31:38 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7D4D011270; Thu, 22 Nov 2018 14:31:38 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAMEVcse015763; Thu, 22 Nov 2018 14:31:38 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAMEVapr015749; Thu, 22 Nov 2018 14:31:36 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811221431.wAMEVapr015749@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Thu, 22 Nov 2018 14:31:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340766 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 340766 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 9C5AD78F35 X-Spamd-Result: default: False [1.55 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.48)[0.476,0]; NEURAL_SPAM_SHORT(0.49)[0.493,0]; NEURAL_SPAM_MEDIUM(0.58)[0.583,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Nov 2018 14:31:39 -0000 Author: arybchik Date: Thu Nov 22 14:31:35 2018 New Revision: 340766 URL: https://svnweb.freebsd.org/changeset/base/340766 Log: sfxge(4): support packed stream Rx mode in libefx Submitted by: Artem V. Andreev Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18022 Modified: head/sys/dev/sfxge/common/ef10_ev.c head/sys/dev/sfxge/common/ef10_impl.h head/sys/dev/sfxge/common/ef10_nic.c head/sys/dev/sfxge/common/ef10_rx.c head/sys/dev/sfxge/common/efsys.h head/sys/dev/sfxge/common/efx.h head/sys/dev/sfxge/common/efx_check.h head/sys/dev/sfxge/common/efx_impl.h head/sys/dev/sfxge/common/efx_nic.c head/sys/dev/sfxge/common/efx_regs_ef10.h head/sys/dev/sfxge/common/efx_rx.c head/sys/dev/sfxge/common/siena_nic.c Modified: head/sys/dev/sfxge/common/ef10_ev.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_ev.c Thu Nov 22 14:10:46 2018 (r340765) +++ head/sys/dev/sfxge/common/ef10_ev.c Thu Nov 22 14:31:35 2018 (r340766) @@ -762,8 +762,90 @@ ef10_ev_qstats_update( } #endif /* EFSYS_OPT_QSTATS */ +#if EFSYS_OPT_RX_PACKED_STREAM static __checkReturn boolean_t +ef10_ev_rx_packed_stream( + __in efx_evq_t *eep, + __in efx_qword_t *eqp, + __in const efx_ev_callbacks_t *eecp, + __in_opt void *arg) +{ + uint32_t label; + uint32_t pkt_count_lbits; + uint16_t flags; + boolean_t should_abort; + efx_evq_rxq_state_t *eersp; + unsigned int pkt_count; + unsigned int current_id; + boolean_t new_buffer; + + pkt_count_lbits = EFX_QWORD_FIELD(*eqp, ESF_DZ_RX_DSC_PTR_LBITS); + label = EFX_QWORD_FIELD(*eqp, ESF_DZ_RX_QLABEL); + new_buffer = EFX_QWORD_FIELD(*eqp, ESF_DZ_RX_EV_ROTATE); + + flags = 0; + + eersp = &eep->ee_rxq_state[label]; + + /* + * RX_DSC_PTR_LBITS has least significant bits of the global + * (not per-buffer) packet counter. It is guaranteed that + * maximum number of completed packets fits in lbits-mask. + * So, modulo lbits-mask arithmetic should be used to calculate + * packet counter increment. + */ + pkt_count = (pkt_count_lbits - eersp->eers_rx_stream_npackets) & + EFX_MASK32(ESF_DZ_RX_DSC_PTR_LBITS); + eersp->eers_rx_stream_npackets += pkt_count; + + if (new_buffer) { + flags |= EFX_PKT_PACKED_STREAM_NEW_BUFFER; + eersp->eers_rx_packed_stream_credits++; + eersp->eers_rx_read_ptr++; + } + current_id = eersp->eers_rx_read_ptr & eersp->eers_rx_mask; + + /* Check for errors that invalidate checksum and L3/L4 fields */ + if (EFX_QWORD_FIELD(*eqp, ESF_DZ_RX_ECC_ERR) != 0) { + /* RX frame truncated (error flag is misnamed) */ + EFX_EV_QSTAT_INCR(eep, EV_RX_FRM_TRUNC); + flags |= EFX_DISCARD; + goto deliver; + } + if (EFX_QWORD_FIELD(*eqp, ESF_DZ_RX_ECRC_ERR) != 0) { + /* Bad Ethernet frame CRC */ + EFX_EV_QSTAT_INCR(eep, EV_RX_ETH_CRC_ERR); + flags |= EFX_DISCARD; + goto deliver; + } + + if (EFX_QWORD_FIELD(*eqp, ESF_DZ_RX_PARSE_INCOMPLETE)) { + flags |= EFX_PKT_PACKED_STREAM_PARSE_INCOMPLETE; + goto deliver; + } + + if (EFX_QWORD_FIELD(*eqp, ESF_DZ_RX_IPCKSUM_ERR)) + EFX_EV_QSTAT_INCR(eep, EV_RX_IPV4_HDR_CHKSUM_ERR); + + if (EFX_QWORD_FIELD(*eqp, ESF_DZ_RX_TCPUDP_CKSUM_ERR)) + EFX_EV_QSTAT_INCR(eep, EV_RX_TCP_UDP_CHKSUM_ERR); + +deliver: + /* If we're not discarding the packet then it is ok */ + if (~flags & EFX_DISCARD) + EFX_EV_QSTAT_INCR(eep, EV_RX_OK); + + EFSYS_ASSERT(eecp->eec_rx_ps != NULL); + should_abort = eecp->eec_rx_ps(arg, label, current_id, pkt_count, + flags); + + return (should_abort); +} + +#endif /* EFSYS_OPT_RX_PACKED_STREAM */ + +static __checkReturn boolean_t ef10_ev_rx( __in efx_evq_t *eep, __in efx_qword_t *eqp, @@ -792,9 +874,20 @@ ef10_ev_rx( return (B_FALSE); /* Basic packet information */ + label = EFX_QWORD_FIELD(*eqp, ESF_DZ_RX_QLABEL); + eersp = &eep->ee_rxq_state[label]; + +#if EFSYS_OPT_RX_PACKED_STREAM + /* + * Packed stream events are very different, + * so handle them separately + */ + if (eersp->eers_rx_packed_stream) + return (ef10_ev_rx_packed_stream(eep, eqp, eecp, arg)); +#endif + size = EFX_QWORD_FIELD(*eqp, ESF_DZ_RX_BYTES); next_read_lbits = EFX_QWORD_FIELD(*eqp, ESF_DZ_RX_DSC_PTR_LBITS); - label = EFX_QWORD_FIELD(*eqp, ESF_DZ_RX_QLABEL); eth_tag_class = EFX_QWORD_FIELD(*eqp, ESF_DZ_RX_ETH_TAG_CLASS); mac_class = EFX_QWORD_FIELD(*eqp, ESF_DZ_RX_MAC_CLASS); l3_class = EFX_QWORD_FIELD(*eqp, ESF_DZ_RX_L3_CLASS); @@ -824,7 +917,6 @@ ef10_ev_rx( flags |= EFX_PKT_UNICAST; /* Increment the count of descriptors read */ - eersp = &eep->ee_rxq_state[label]; desc_count = (next_read_lbits - eersp->eers_rx_read_ptr) & EFX_MASK32(ESF_DZ_RX_DSC_PTR_LBITS); eersp->eers_rx_read_ptr += desc_count; @@ -1246,7 +1338,8 @@ ef10_ev_mcdi( ef10_ev_rxlabel_init( __in efx_evq_t *eep, __in efx_rxq_t *erp, - __in unsigned int label) + __in unsigned int label, + __in boolean_t packed_stream) { efx_evq_rxq_state_t *eersp; @@ -1255,8 +1348,41 @@ ef10_ev_rxlabel_init( EFSYS_ASSERT3U(eersp->eers_rx_mask, ==, 0); +#if EFSYS_OPT_RX_PACKED_STREAM + /* + * For packed stream modes, the very first event will + * have a new buffer flag set, so it will be incremented, + * yielding the correct pointer. That results in a simpler + * code than trying to detect start-of-the-world condition + * in the event handler. + */ + eersp->eers_rx_read_ptr = packed_stream ? ~0 : 0; +#else eersp->eers_rx_read_ptr = 0; +#endif eersp->eers_rx_mask = erp->er_mask; +#if EFSYS_OPT_RX_PACKED_STREAM + eersp->eers_rx_stream_npackets = 0; + eersp->eers_rx_packed_stream = packed_stream; + if (packed_stream) { + eersp->eers_rx_packed_stream_credits = (eep->ee_mask + 1) / + EFX_DIV_ROUND_UP(EFX_RX_PACKED_STREAM_MEM_PER_CREDIT, + EFX_RX_PACKED_STREAM_MIN_PACKET_SPACE); + EFSYS_ASSERT3U(eersp->eers_rx_packed_stream_credits, !=, 0); + /* + * A single credit is allocated to the queue when it is started. + * It is immediately spent by the first packet which has NEW + * BUFFER flag set, though, but still we shall take into + * account, as to not wrap around the maximum number of credits + * accidentally + */ + eersp->eers_rx_packed_stream_credits--; + EFSYS_ASSERT3U(eersp->eers_rx_packed_stream_credits, <=, + EFX_RX_PACKED_STREAM_MAX_CREDITS); + } +#else + EFSYS_ASSERT(!packed_stream); +#endif } void @@ -1273,6 +1399,11 @@ ef10_ev_rxlabel_fini( eersp->eers_rx_read_ptr = 0; eersp->eers_rx_mask = 0; +#if EFSYS_OPT_RX_PACKED_STREAM + eersp->eers_rx_stream_npackets = 0; + eersp->eers_rx_packed_stream = B_FALSE; + eersp->eers_rx_packed_stream_credits = 0; +#endif } #endif /* EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD */ Modified: head/sys/dev/sfxge/common/ef10_impl.h ============================================================================== --- head/sys/dev/sfxge/common/ef10_impl.h Thu Nov 22 14:10:46 2018 (r340765) +++ head/sys/dev/sfxge/common/ef10_impl.h Thu Nov 22 14:31:35 2018 (r340766) @@ -118,7 +118,8 @@ ef10_ev_qstats_update( ef10_ev_rxlabel_init( __in efx_evq_t *eep, __in efx_rxq_t *erp, - __in unsigned int label); + __in unsigned int label, + __in boolean_t packed_stream); void ef10_ev_rxlabel_fini( @@ -685,6 +686,22 @@ ef10_tx_qpush( __in unsigned int added, __in unsigned int pushed); +#if EFSYS_OPT_RX_PACKED_STREAM +extern void +ef10_rx_qpush_ps_credits( + __in efx_rxq_t *erp); + +extern __checkReturn uint8_t * +ef10_rx_qps_packet_info( + __in efx_rxq_t *erp, + __in uint8_t *buffer, + __in uint32_t buffer_length, + __in uint32_t current_offset, + __out uint16_t *lengthp, + __out uint32_t *next_offsetp, + __out uint32_t *timestamp); +#endif + extern __checkReturn efx_rc_t ef10_tx_qpace( __in efx_txq_t *etp, @@ -1131,6 +1148,35 @@ ef10_external_port_mapping( __in uint32_t port, __out uint8_t *external_portp); +#if EFSYS_OPT_RX_PACKED_STREAM + +/* Data space per credit in packed stream mode */ +#define EFX_RX_PACKED_STREAM_MEM_PER_CREDIT (1 << 16) + +/* + * Received packets are always aligned at this boundary. Also there always + * exists a gap of this size between packets. + * (see SF-112241-TC, 4.5) + */ +#define EFX_RX_PACKED_STREAM_ALIGNMENT 64 + +/* + * Size of a pseudo-header prepended to received packets + * in packed stream mode + */ +#define EFX_RX_PACKED_STREAM_RX_PREFIX_SIZE 8 + +/* Minimum space for packet in packed stream mode */ +#define EFX_RX_PACKED_STREAM_MIN_PACKET_SPACE \ + P2ROUNDUP(EFX_RX_PACKED_STREAM_RX_PREFIX_SIZE + \ + EFX_MAC_PDU_MIN + \ + EFX_RX_PACKED_STREAM_ALIGNMENT, \ + EFX_RX_PACKED_STREAM_ALIGNMENT) + +/* Maximum number of credits */ +#define EFX_RX_PACKED_STREAM_MAX_CREDITS 127 + +#endif /* EFSYS_OPT_RX_PACKED_STREAM */ #ifdef __cplusplus } Modified: head/sys/dev/sfxge/common/ef10_nic.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_nic.c Thu Nov 22 14:10:46 2018 (r340765) +++ head/sys/dev/sfxge/common/ef10_nic.c Thu Nov 22 14:31:35 2018 (r340766) @@ -1072,6 +1072,17 @@ ef10_get_datapath_caps( encp->enc_rx_disable_scatter_supported = CAP_FLAG(flags, RX_DISABLE_SCATTER) ? B_TRUE : B_FALSE; + /* Check if the firmware supports packed stream mode */ + encp->enc_rx_packed_stream_supported = + CAP_FLAG(flags, RX_PACKED_STREAM) ? B_TRUE : B_FALSE; + + /* + * Check if the firmware supports configurable buffer sizes + * for packed stream mode (otherwise buffer size is 1Mbyte) + */ + encp->enc_rx_var_packed_stream_supported = + CAP_FLAG(flags, RX_PACKED_STREAM_VAR_BUFFERS) ? B_TRUE : B_FALSE; + /* Check if the firmware supports set mac with running filters */ encp->enc_allow_set_mac_with_installed_filters = CAP_FLAG(flags, VADAPTOR_PERMIT_SET_MAC_WHEN_FILTERS_INSTALLED) ? Modified: head/sys/dev/sfxge/common/ef10_rx.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_rx.c Thu Nov 22 14:10:46 2018 (r340765) +++ head/sys/dev/sfxge/common/ef10_rx.c Thu Nov 22 14:31:35 2018 (r340766) @@ -46,41 +46,51 @@ efx_mcdi_init_rxq( __in uint32_t label, __in uint32_t instance, __in efsys_mem_t *esmp, - __in boolean_t disable_scatter) + __in boolean_t disable_scatter, + __in uint32_t ps_bufsize) { efx_mcdi_req_t req; - uint8_t payload[ - MC_CMD_INIT_RXQ_IN_LEN(EFX_RXQ_NBUFS(EFX_RXQ_MAXNDESCS))]; + uint8_t payload[MAX(MC_CMD_INIT_RXQ_EXT_IN_LEN, + MC_CMD_INIT_RXQ_EXT_OUT_LEN)]; int npages = EFX_RXQ_NBUFS(size); int i; efx_qword_t *dma_addr; uint64_t addr; efx_rc_t rc; + uint32_t dma_mode; /* If this changes, then the payload size might need to change. */ EFSYS_ASSERT3U(MC_CMD_INIT_RXQ_OUT_LEN, ==, 0); EFSYS_ASSERT3U(size, <=, EFX_RXQ_MAXNDESCS); + if (ps_bufsize > 0) + dma_mode = MC_CMD_INIT_RXQ_EXT_IN_PACKED_STREAM; + else + dma_mode = MC_CMD_INIT_RXQ_EXT_IN_SINGLE_PACKET; + (void) memset(payload, 0, sizeof (payload)); req.emr_cmd = MC_CMD_INIT_RXQ; req.emr_in_buf = payload; - req.emr_in_length = MC_CMD_INIT_RXQ_IN_LEN(npages); + req.emr_in_length = MC_CMD_INIT_RXQ_EXT_IN_LEN; req.emr_out_buf = payload; - req.emr_out_length = MC_CMD_INIT_RXQ_OUT_LEN; + req.emr_out_length = MC_CMD_INIT_RXQ_EXT_OUT_LEN; - MCDI_IN_SET_DWORD(req, INIT_RXQ_IN_SIZE, size); - MCDI_IN_SET_DWORD(req, INIT_RXQ_IN_TARGET_EVQ, target_evq); - MCDI_IN_SET_DWORD(req, INIT_RXQ_IN_LABEL, label); - MCDI_IN_SET_DWORD(req, INIT_RXQ_IN_INSTANCE, instance); - MCDI_IN_POPULATE_DWORD_6(req, INIT_RXQ_IN_FLAGS, - INIT_RXQ_IN_FLAG_BUFF_MODE, 0, - INIT_RXQ_IN_FLAG_HDR_SPLIT, 0, - INIT_RXQ_IN_FLAG_TIMESTAMP, 0, - INIT_RXQ_IN_CRC_MODE, 0, - INIT_RXQ_IN_FLAG_PREFIX, 1, - INIT_RXQ_IN_FLAG_DISABLE_SCATTER, disable_scatter); - MCDI_IN_SET_DWORD(req, INIT_RXQ_IN_OWNER_ID, 0); - MCDI_IN_SET_DWORD(req, INIT_RXQ_IN_PORT_ID, EVB_PORT_ID_ASSIGNED); + MCDI_IN_SET_DWORD(req, INIT_RXQ_EXT_IN_SIZE, size); + MCDI_IN_SET_DWORD(req, INIT_RXQ_EXT_IN_TARGET_EVQ, target_evq); + MCDI_IN_SET_DWORD(req, INIT_RXQ_EXT_IN_LABEL, label); + MCDI_IN_SET_DWORD(req, INIT_RXQ_EXT_IN_INSTANCE, instance); + MCDI_IN_POPULATE_DWORD_8(req, INIT_RXQ_EXT_IN_FLAGS, + INIT_RXQ_EXT_IN_FLAG_BUFF_MODE, 0, + INIT_RXQ_EXT_IN_FLAG_HDR_SPLIT, 0, + INIT_RXQ_EXT_IN_FLAG_TIMESTAMP, 0, + INIT_RXQ_EXT_IN_CRC_MODE, 0, + INIT_RXQ_EXT_IN_FLAG_PREFIX, 1, + INIT_RXQ_EXT_IN_FLAG_DISABLE_SCATTER, disable_scatter, + INIT_RXQ_EXT_IN_DMA_MODE, + dma_mode, + INIT_RXQ_EXT_IN_PACKED_STREAM_BUFF_SIZE, ps_bufsize); + MCDI_IN_SET_DWORD(req, INIT_RXQ_EXT_IN_OWNER_ID, 0); + MCDI_IN_SET_DWORD(req, INIT_RXQ_EXT_IN_PORT_ID, EVB_PORT_ID_ASSIGNED); dma_addr = MCDI_IN2(req, efx_qword_t, INIT_RXQ_IN_DMA_ADDR); addr = EFSYS_MEM_ADDR(esmp); @@ -707,6 +717,95 @@ ef10_rx_qpush( erp->er_index, &dword, B_FALSE); } +#if EFSYS_OPT_RX_PACKED_STREAM + + void +ef10_rx_qpush_ps_credits( + __in efx_rxq_t *erp) +{ + efx_nic_t *enp = erp->er_enp; + efx_dword_t dword; + efx_evq_rxq_state_t *rxq_state = + &erp->er_eep->ee_rxq_state[erp->er_label]; + uint32_t credits; + + EFSYS_ASSERT(rxq_state->eers_rx_packed_stream); + + if (rxq_state->eers_rx_packed_stream_credits == 0) + return; + + /* + * It is a bug if we think that FW has utilized more + * credits than it is allowed to have (maximum). However, + * make sure that we do not credit more than maximum anyway. + */ + credits = MIN(rxq_state->eers_rx_packed_stream_credits, + EFX_RX_PACKED_STREAM_MAX_CREDITS); + EFX_POPULATE_DWORD_3(dword, + ERF_DZ_RX_DESC_MAGIC_DOORBELL, 1, + ERF_DZ_RX_DESC_MAGIC_CMD, + ERE_DZ_RX_DESC_MAGIC_CMD_PS_CREDITS, + ERF_DZ_RX_DESC_MAGIC_DATA, credits); + EFX_BAR_TBL_WRITED(enp, ER_DZ_RX_DESC_UPD_REG, + erp->er_index, &dword, B_FALSE); + + rxq_state->eers_rx_packed_stream_credits = 0; +} + +/* + * In accordance with SF-112241-TC the received data has the following layout: + * - 8 byte pseudo-header which consist of: + * - 4 byte little-endian timestamp + * - 2 byte little-endian captured length in bytes + * - 2 byte little-endian original packet length in bytes + * - captured packet bytes + * - optional padding to align to 64 bytes boundary + * - 64 bytes scratch space for the host software + */ + __checkReturn uint8_t * +ef10_rx_qps_packet_info( + __in efx_rxq_t *erp, + __in uint8_t *buffer, + __in uint32_t buffer_length, + __in uint32_t current_offset, + __out uint16_t *lengthp, + __out uint32_t *next_offsetp, + __out uint32_t *timestamp) +{ + uint16_t buf_len; + uint8_t *pkt_start; + efx_qword_t *qwordp; + efx_evq_rxq_state_t *rxq_state = + &erp->er_eep->ee_rxq_state[erp->er_label]; + + EFSYS_ASSERT(rxq_state->eers_rx_packed_stream); + + buffer += current_offset; + pkt_start = buffer + EFX_RX_PACKED_STREAM_RX_PREFIX_SIZE; + + qwordp = (efx_qword_t *)buffer; + *timestamp = EFX_QWORD_FIELD(*qwordp, ES_DZ_PS_RX_PREFIX_TSTAMP); + *lengthp = EFX_QWORD_FIELD(*qwordp, ES_DZ_PS_RX_PREFIX_ORIG_LEN); + buf_len = EFX_QWORD_FIELD(*qwordp, ES_DZ_PS_RX_PREFIX_CAP_LEN); + + buf_len = P2ROUNDUP(buf_len + EFX_RX_PACKED_STREAM_RX_PREFIX_SIZE, + EFX_RX_PACKED_STREAM_ALIGNMENT); + *next_offsetp = + current_offset + buf_len + EFX_RX_PACKED_STREAM_ALIGNMENT; + + EFSYS_ASSERT3U(*next_offsetp, <=, buffer_length); + EFSYS_ASSERT3U(current_offset + *lengthp, <, *next_offsetp); + + if ((*next_offsetp ^ current_offset) & + EFX_RX_PACKED_STREAM_MEM_PER_CREDIT) + rxq_state->eers_rx_packed_stream_credits++; + + return (pkt_start); +} + + +#endif + __checkReturn efx_rc_t ef10_rx_qflush( __in efx_rxq_t *erp) @@ -749,6 +848,7 @@ ef10_rx_qcreate( efx_nic_cfg_t *encp = &(enp->en_nic_cfg); efx_rc_t rc; boolean_t disable_scatter; + unsigned int ps_buf_size; _NOTE(ARGUNUSED(id, erp)) @@ -768,6 +868,51 @@ ef10_rx_qcreate( goto fail2; } + switch (type) { + case EFX_RXQ_TYPE_DEFAULT: + case EFX_RXQ_TYPE_SCATTER: + ps_buf_size = 0; + break; +#if EFSYS_OPT_RX_PACKED_STREAM + case EFX_RXQ_TYPE_PACKED_STREAM_1M: + ps_buf_size = MC_CMD_INIT_RXQ_EXT_IN_PS_BUFF_1M; + break; + case EFX_RXQ_TYPE_PACKED_STREAM_512K: + ps_buf_size = MC_CMD_INIT_RXQ_EXT_IN_PS_BUFF_512K; + break; + case EFX_RXQ_TYPE_PACKED_STREAM_256K: + ps_buf_size = MC_CMD_INIT_RXQ_EXT_IN_PS_BUFF_256K; + break; + case EFX_RXQ_TYPE_PACKED_STREAM_128K: + ps_buf_size = MC_CMD_INIT_RXQ_EXT_IN_PS_BUFF_128K; + break; + case EFX_RXQ_TYPE_PACKED_STREAM_64K: + ps_buf_size = MC_CMD_INIT_RXQ_EXT_IN_PS_BUFF_64K; + break; +#endif /* EFSYS_OPT_RX_PACKED_STREAM */ + default: + rc = ENOTSUP; + goto fail3; + } + +#if EFSYS_OPT_RX_PACKED_STREAM + if (ps_buf_size != 0) { + /* Check if datapath firmware supports packed stream mode */ + if (encp->enc_rx_packed_stream_supported == B_FALSE) { + rc = ENOTSUP; + goto fail4; + } + /* Check if packed stream allows configurable buffer sizes */ + if ((type != EFX_RXQ_TYPE_PACKED_STREAM_1M) && + (encp->enc_rx_var_packed_stream_supported == B_FALSE)) { + rc = ENOTSUP; + goto fail5; + } + } +#else /* EFSYS_OPT_RX_PACKED_STREAM */ + EFSYS_ASSERT(ps_buf_size == 0); +#endif /* EFSYS_OPT_RX_PACKED_STREAM */ + /* Scatter can only be disabled if the firmware supports doing so */ if (type == EFX_RXQ_TYPE_SCATTER) disable_scatter = B_FALSE; @@ -775,16 +920,24 @@ ef10_rx_qcreate( disable_scatter = encp->enc_rx_disable_scatter_supported; if ((rc = efx_mcdi_init_rxq(enp, n, eep->ee_index, label, index, - esmp, disable_scatter)) != 0) - goto fail3; + esmp, disable_scatter, ps_buf_size)) != 0) + goto fail6; erp->er_eep = eep; erp->er_label = label; - ef10_ev_rxlabel_init(eep, erp, label); + ef10_ev_rxlabel_init(eep, erp, label, ps_buf_size != 0); return (0); +fail6: + EFSYS_PROBE(fail6); +#if EFSYS_OPT_RX_PACKED_STREAM +fail5: + EFSYS_PROBE(fail5); +fail4: + EFSYS_PROBE(fail4); +#endif /* EFSYS_OPT_RX_PACKED_STREAM */ fail3: EFSYS_PROBE(fail3); fail2: Modified: head/sys/dev/sfxge/common/efsys.h ============================================================================== --- head/sys/dev/sfxge/common/efsys.h Thu Nov 22 14:10:46 2018 (r340765) +++ head/sys/dev/sfxge/common/efsys.h Thu Nov 22 14:31:35 2018 (r340766) @@ -281,6 +281,8 @@ sfxge_map_mbuf_fast(bus_dma_tag_t tag, bus_dmamap_t ma #define EFSYS_OPT_ALLOW_UNCONFIGURED_NIC 0 +#define EFSYS_OPT_RX_PACKED_STREAM 0 + /* ID */ typedef struct __efsys_identifier_s efsys_identifier_t; Modified: head/sys/dev/sfxge/common/efx.h ============================================================================== --- head/sys/dev/sfxge/common/efx.h Thu Nov 22 14:10:46 2018 (r340765) +++ head/sys/dev/sfxge/common/efx.h Thu Nov 22 14:31:35 2018 (r340766) @@ -52,6 +52,9 @@ extern "C" { #define EFX_FIELD_OFFSET(_type, _field) \ ((size_t) &(((_type *)0)->_field)) +/* The macro expands divider twice */ +#define EFX_DIV_ROUND_UP(_n, _d) (((_n) + (_d) - 1) / (_d)) + /* Return codes */ typedef __success(return == 0) int efx_rc_t; @@ -1086,6 +1089,7 @@ efx_bist_stop( #define EFX_FEATURE_PIO_BUFFERS 0x00000800 #define EFX_FEATURE_FW_ASSISTED_TSO 0x00001000 #define EFX_FEATURE_FW_ASSISTED_TSO_V2 0x00002000 +#define EFX_FEATURE_PACKED_STREAM 0x00004000 typedef struct efx_nic_cfg_s { uint32_t enc_board_type; @@ -1181,6 +1185,8 @@ typedef struct efx_nic_cfg_s { boolean_t enc_allow_set_mac_with_installed_filters; boolean_t enc_enhanced_set_mac_supported; boolean_t enc_init_evq_v2_supported; + boolean_t enc_rx_packed_stream_supported; + boolean_t enc_rx_var_packed_stream_supported; boolean_t enc_pm_and_rxdp_counters; boolean_t enc_mac_stats_40g_tx_size_bins; /* External port identifier */ @@ -1622,6 +1628,16 @@ typedef __checkReturn boolean_t #define EFX_ADDR_MISMATCH 0x4000 #define EFX_DISCARD 0x8000 +/* + * The following flags are used only for packed stream + * mode. The values for the flags are reused to fit into 16 bit, + * since EFX_PKT_START and EFX_PKT_CONT are never used in + * packed stream mode + */ +#define EFX_PKT_PACKED_STREAM_NEW_BUFFER EFX_PKT_START +#define EFX_PKT_PACKED_STREAM_PARSE_INCOMPLETE EFX_PKT_CONT + + #define EFX_EV_RX_NLABELS 32 #define EFX_EV_TX_NLABELS 32 @@ -1633,7 +1649,29 @@ typedef __checkReturn boolean_t __in uint32_t size, __in uint16_t flags); +#if EFSYS_OPT_RX_PACKED_STREAM + +/* + * Packed stream mode is documented in SF-112241-TC. + * The general idea is that, instead of putting each incoming + * packet into a separate buffer which is specified in a RX + * descriptor, a large buffer is provided to the hardware and + * packets are put there in a continuous stream. + * The main advantage of such an approach is that RX queue refilling + * happens much less frequently. + */ + typedef __checkReturn boolean_t +(*efx_rx_ps_ev_t)( + __in_opt void *arg, + __in uint32_t label, + __in uint32_t id, + __in uint32_t pkt_count, + __in uint16_t flags); + +#endif + +typedef __checkReturn boolean_t (*efx_tx_ev_t)( __in_opt void *arg, __in uint32_t label, @@ -1722,6 +1760,9 @@ typedef __checkReturn boolean_t typedef struct efx_ev_callbacks_s { efx_initialized_ev_t eec_initialized; efx_rx_ev_t eec_rx; +#if EFSYS_OPT_RX_PACKED_STREAM + efx_rx_ps_ev_t eec_rx_ps; +#endif efx_tx_ev_t eec_tx; efx_exception_ev_t eec_exception; efx_rxq_flush_done_ev_t eec_rxq_flush_done; @@ -1900,6 +1941,11 @@ efx_pseudo_hdr_pkt_length_get( typedef enum efx_rxq_type_e { EFX_RXQ_TYPE_DEFAULT, EFX_RXQ_TYPE_SCATTER, + EFX_RXQ_TYPE_PACKED_STREAM_1M, + EFX_RXQ_TYPE_PACKED_STREAM_512K, + EFX_RXQ_TYPE_PACKED_STREAM_256K, + EFX_RXQ_TYPE_PACKED_STREAM_128K, + EFX_RXQ_TYPE_PACKED_STREAM_64K, EFX_RXQ_NTYPES } efx_rxq_type_t; @@ -1939,6 +1985,29 @@ efx_rx_qpush( __in efx_rxq_t *erp, __in unsigned int added, __inout unsigned int *pushedp); + +#if EFSYS_OPT_RX_PACKED_STREAM + +/* + * Fake length for RXQ descriptors in packed stream mode + * to make hardware happy + */ +#define EFX_RXQ_PACKED_STREAM_FAKE_BUF_SIZE 32 + +extern void +efx_rx_qpush_ps_credits( + __in efx_rxq_t *erp); + +extern __checkReturn uint8_t * +efx_rx_qps_packet_info( + __in efx_rxq_t *erp, + __in uint8_t *buffer, + __in uint32_t buffer_length, + __in uint32_t current_offset, + __out uint16_t *lengthp, + __out uint32_t *next_offsetp, + __out uint32_t *timestamp); +#endif extern __checkReturn efx_rc_t efx_rx_qflush( Modified: head/sys/dev/sfxge/common/efx_check.h ============================================================================== --- head/sys/dev/sfxge/common/efx_check.h Thu Nov 22 14:10:46 2018 (r340765) +++ head/sys/dev/sfxge/common/efx_check.h Thu Nov 22 14:31:35 2018 (r340766) @@ -339,5 +339,11 @@ # endif #endif /* EFSYS_OPT_ALLOW_UNCONFIGURED_NIC */ +/* Support packed stream mode */ +#if EFSYS_OPT_RX_PACKED_STREAM +# if !(EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD) +# error "PACKED_STREAM requires HUNTINGTON or MEDFORD" +# endif +#endif #endif /* _SYS_EFX_CHECK_H */ Modified: head/sys/dev/sfxge/common/efx_impl.h ============================================================================== --- head/sys/dev/sfxge/common/efx_impl.h Thu Nov 22 14:10:46 2018 (r340765) +++ head/sys/dev/sfxge/common/efx_impl.h Thu Nov 22 14:31:35 2018 (r340766) @@ -170,6 +170,12 @@ typedef struct efx_rx_ops_s { unsigned int, unsigned int, unsigned int); void (*erxo_qpush)(efx_rxq_t *, unsigned int, unsigned int *); +#if EFSYS_OPT_RX_PACKED_STREAM + void (*erxo_qpush_ps_credits)(efx_rxq_t *); + uint8_t * (*erxo_qps_packet_info)(efx_rxq_t *, uint8_t *, + uint32_t, uint32_t, + uint16_t *, uint32_t *, uint32_t *); +#endif efx_rc_t (*erxo_qflush)(efx_rxq_t *); void (*erxo_qenable)(efx_rxq_t *); efx_rc_t (*erxo_qcreate)(efx_nic_t *enp, unsigned int, @@ -694,6 +700,11 @@ typedef boolean_t (*efx_ev_handler_t)(efx_evq_t *, efx typedef struct efx_evq_rxq_state_s { unsigned int eers_rx_read_ptr; unsigned int eers_rx_mask; +#if EFSYS_OPT_RX_PACKED_STREAM + unsigned int eers_rx_stream_npackets; + boolean_t eers_rx_packed_stream; + unsigned int eers_rx_packed_stream_credits; +#endif } efx_evq_rxq_state_t; struct efx_evq_s { Modified: head/sys/dev/sfxge/common/efx_nic.c ============================================================================== --- head/sys/dev/sfxge/common/efx_nic.c Thu Nov 22 14:10:46 2018 (r340765) +++ head/sys/dev/sfxge/common/efx_nic.c Thu Nov 22 14:31:35 2018 (r340766) @@ -289,7 +289,8 @@ efx_nic_create( EFX_FEATURE_MCDI_DMA | EFX_FEATURE_PIO_BUFFERS | EFX_FEATURE_FW_ASSISTED_TSO | - EFX_FEATURE_FW_ASSISTED_TSO_V2; + EFX_FEATURE_FW_ASSISTED_TSO_V2 | + EFX_FEATURE_PACKED_STREAM; break; #endif /* EFSYS_OPT_HUNTINGTON */ @@ -308,7 +309,8 @@ efx_nic_create( EFX_FEATURE_MAC_HEADER_FILTERS | EFX_FEATURE_MCDI_DMA | EFX_FEATURE_PIO_BUFFERS | - EFX_FEATURE_FW_ASSISTED_TSO_V2; + EFX_FEATURE_FW_ASSISTED_TSO_V2 | + EFX_FEATURE_PACKED_STREAM; break; #endif /* EFSYS_OPT_MEDFORD */ Modified: head/sys/dev/sfxge/common/efx_regs_ef10.h ============================================================================== --- head/sys/dev/sfxge/common/efx_regs_ef10.h Thu Nov 22 14:10:46 2018 (r340765) +++ head/sys/dev/sfxge/common/efx_regs_ef10.h Thu Nov 22 14:31:35 2018 (r340766) @@ -169,7 +169,6 @@ extern "C" { #define ERF_DZ_RX_DESC_WPTR_LBN 0 #define ERF_DZ_RX_DESC_WPTR_WIDTH 12 - /* * TX_DESC_UPD_REG(96bit): * @@ -543,6 +542,31 @@ extern "C" { #define ERF_DD_EVQ_IND_TIMER_VAL_LBN 0 #define ERF_DD_EVQ_IND_TIMER_VAL_WIDTH 8 +/* Packed stream magic doorbell command */ +#define ERF_DZ_RX_DESC_MAGIC_DOORBELL_LBN 11 +#define ERF_DZ_RX_DESC_MAGIC_DOORBELL_WIDTH 1 + +#define ERF_DZ_RX_DESC_MAGIC_CMD_LBN 8 +#define ERF_DZ_RX_DESC_MAGIC_CMD_WIDTH 3 +#define ERE_DZ_RX_DESC_MAGIC_CMD_PS_CREDITS 0 + +#define ERF_DZ_RX_DESC_MAGIC_DATA_LBN 0 +#define ERF_DZ_RX_DESC_MAGIC_DATA_WIDTH 8 + +/* Packed stream RX packet prefix */ +#define ES_DZ_PS_RX_PREFIX_TSTAMP_LBN 0 +#define ES_DZ_PS_RX_PREFIX_TSTAMP_WIDTH 32 +#define ES_DZ_PS_RX_PREFIX_CAP_LEN_LBN 32 +#define ES_DZ_PS_RX_PREFIX_CAP_LEN_WIDTH 16 +#define ES_DZ_PS_RX_PREFIX_ORIG_LEN_LBN 48 +#define ES_DZ_PS_RX_PREFIX_ORIG_LEN_WIDTH 16 + +/* + * An extra flag for the packed stream mode, + * signalling the start of a new buffer + */ +#define ESF_DZ_RX_EV_ROTATE_LBN 53 +#define ESF_DZ_RX_EV_ROTATE_WIDTH 1 #ifdef __cplusplus } Modified: head/sys/dev/sfxge/common/efx_rx.c ============================================================================== --- head/sys/dev/sfxge/common/efx_rx.c Thu Nov 22 14:10:46 2018 (r340765) +++ head/sys/dev/sfxge/common/efx_rx.c Thu Nov 22 14:31:35 2018 (r340766) @@ -103,6 +103,22 @@ siena_rx_qpush( __in unsigned int added, __inout unsigned int *pushedp); +#if EFSYS_OPT_RX_PACKED_STREAM +static void +siena_rx_qpush_ps_credits( + __in efx_rxq_t *erp); + +static __checkReturn uint8_t * +siena_rx_qps_packet_info( + __in efx_rxq_t *erp, + __in uint8_t *buffer, + __in uint32_t buffer_length, + __in uint32_t current_offset, + __out uint16_t *lengthp, + __out uint32_t *next_offsetp, + __out uint32_t *timestamp); +#endif + static __checkReturn efx_rc_t siena_rx_qflush( __in efx_rxq_t *erp); @@ -146,6 +162,10 @@ static const efx_rx_ops_t __efx_rx_siena_ops = { siena_rx_prefix_pktlen, /* erxo_prefix_pktlen */ siena_rx_qpost, /* erxo_qpost */ siena_rx_qpush, /* erxo_qpush */ +#if EFSYS_OPT_RX_PACKED_STREAM + siena_rx_qpush_ps_credits, /* erxo_qpush_ps_credits */ + siena_rx_qps_packet_info, /* erxo_qps_packet_info */ +#endif siena_rx_qflush, /* erxo_qflush */ siena_rx_qenable, /* erxo_qenable */ siena_rx_qcreate, /* erxo_qcreate */ @@ -169,6 +189,10 @@ static const efx_rx_ops_t __efx_rx_ef10_ops = { ef10_rx_prefix_pktlen, /* erxo_prefix_pktlen */ ef10_rx_qpost, /* erxo_qpost */ ef10_rx_qpush, /* erxo_qpush */ +#if EFSYS_OPT_RX_PACKED_STREAM + ef10_rx_qpush_ps_credits, /* erxo_qpush_ps_credits */ + ef10_rx_qps_packet_info, /* erxo_qps_packet_info */ +#endif ef10_rx_qflush, /* erxo_qflush */ ef10_rx_qenable, /* erxo_qenable */ ef10_rx_qcreate, /* erxo_qcreate */ @@ -430,7 +454,41 @@ efx_rx_qpost( erxop->erxo_qpost(erp, addrp, size, n, completed, added); } +#if EFSYS_OPT_RX_PACKED_STREAM + void +efx_rx_qpush_ps_credits( + __in efx_rxq_t *erp) +{ + efx_nic_t *enp = erp->er_enp; + const efx_rx_ops_t *erxop = enp->en_erxop; + + EFSYS_ASSERT3U(erp->er_magic, ==, EFX_RXQ_MAGIC); + + erxop->erxo_qpush_ps_credits(erp); +} + + __checkReturn uint8_t * +efx_rx_qps_packet_info( + __in efx_rxq_t *erp, + __in uint8_t *buffer, + __in uint32_t buffer_length, + __in uint32_t current_offset, + __out uint16_t *lengthp, + __out uint32_t *next_offsetp, + __out uint32_t *timestamp) +{ + efx_nic_t *enp = erp->er_enp; + const efx_rx_ops_t *erxop = enp->en_erxop; + + return (erxop->erxo_qps_packet_info(erp, buffer, + buffer_length, current_offset, lengthp, + next_offsetp, timestamp)); +} + +#endif /* EFSYS_OPT_RX_PACKED_STREAM */ + + void efx_rx_qpush( __in efx_rxq_t *erp, __in unsigned int added, @@ -1075,6 +1133,32 @@ siena_rx_qpush( EFX_BAR_TBL_WRITED3(enp, FR_BZ_RX_DESC_UPD_REGP0, erp->er_index, &dword, B_FALSE); } + +#if EFSYS_OPT_RX_PACKED_STREAM +static void +siena_rx_qpush_ps_credits( + __in efx_rxq_t *erp) +{ + /* Not supported by Siena hardware */ + EFSYS_ASSERT(0); +} + +static uint8_t * +siena_rx_qps_packet_info( + __in efx_rxq_t *erp, + __in uint8_t *buffer, + __in uint32_t buffer_length, + __in uint32_t current_offset, + __out uint16_t *lengthp, + __out uint32_t *next_offsetp, + __out uint32_t *timestamp) +{ + /* Not supported by Siena hardware */ + EFSYS_ASSERT(0); + + return (NULL); +} +#endif /* EFSYS_OPT_RX_PACKED_STREAM */ static __checkReturn efx_rc_t siena_rx_qflush( Modified: head/sys/dev/sfxge/common/siena_nic.c ============================================================================== --- head/sys/dev/sfxge/common/siena_nic.c Thu Nov 22 14:10:46 2018 (r340765) +++ head/sys/dev/sfxge/common/siena_nic.c Thu Nov 22 14:31:35 2018 (r340766) @@ -167,6 +167,8 @@ siena_board_cfg( encp->enc_fw_assisted_tso_v2_enabled = B_FALSE; encp->enc_fw_assisted_tso_v2_n_contexts = 0; encp->enc_allow_set_mac_with_installed_filters = B_TRUE; + encp->enc_rx_packed_stream_supported = B_FALSE; + encp->enc_rx_var_packed_stream_supported = B_FALSE; /* Siena supports two 10G ports, and 8 lanes of PCIe Gen2 */ encp->enc_required_pcie_bandwidth_mbps = 2 * 10000; From owner-svn-src-all@freebsd.org Thu Nov 22 16:15:27 2018 Return-Path: Delivered-To: svn-src-all@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 1D849114B6F6; Thu, 22 Nov 2018 16:15:27 +0000 (UTC) (envelope-from arybchik@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 B7AF97BB42; Thu, 22 Nov 2018 16:15:26 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 95D50122EA; Thu, 22 Nov 2018 16:15:26 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAMGFQ0d069249; Thu, 22 Nov 2018 16:15:26 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAMGFPLT069239; Thu, 22 Nov 2018 16:15:25 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811221615.wAMGFPLT069239@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Thu, 22 Nov 2018 16:15:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340767 - in head/sys/dev/sfxge: . common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: in head/sys/dev/sfxge: . common X-SVN-Commit-Revision: 340767 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B7AF97BB42 X-Spamd-Result: default: False [1.10 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.42)[0.420,0]; NEURAL_SPAM_MEDIUM(0.51)[0.514,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.17)[0.169,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Nov 2018 16:15:27 -0000 Author: arybchik Date: Thu Nov 22 16:15:24 2018 New Revision: 340767 URL: https://svnweb.freebsd.org/changeset/base/340767 Log: sfxge(4): limit max TXQ size on Medford to 2048 Queues with 4096 descriptors are not supported as the top bit is used for vfifo stuffing. Submitted by: Mark Spender Reviewed by: gnn Sponsored by: Solarflare Communications, Inc. MFC after: 2 days Differential Revision: https://reviews.freebsd.org/D8948 Modified: head/sys/dev/sfxge/common/ef10_tx.c (contents, props changed) head/sys/dev/sfxge/common/efx.h head/sys/dev/sfxge/common/efx_tx.c head/sys/dev/sfxge/common/hunt_nic.c head/sys/dev/sfxge/common/medford_nic.c head/sys/dev/sfxge/common/siena_nic.c head/sys/dev/sfxge/sfxge.c Modified: head/sys/dev/sfxge/common/ef10_tx.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_tx.c Thu Nov 22 14:31:35 2018 (r340766) +++ head/sys/dev/sfxge/common/ef10_tx.c Thu Nov 22 16:15:24 2018 (r340767) @@ -67,7 +67,7 @@ efx_mcdi_init_txq( efx_rc_t rc; EFSYS_ASSERT(EFX_TXQ_MAX_BUFS >= - EFX_TXQ_NBUFS(EFX_TXQ_MAXNDESCS(&enp->en_nic_cfg))); + EFX_TXQ_NBUFS(enp->en_nic_cfg.enc_txq_max_ndescs)); npages = EFX_TXQ_NBUFS(size); if (npages > MC_CMD_INIT_TXQ_IN_DMA_ADDR_MAXNUM) { Modified: head/sys/dev/sfxge/common/efx.h ============================================================================== --- head/sys/dev/sfxge/common/efx.h Thu Nov 22 14:31:35 2018 (r340766) +++ head/sys/dev/sfxge/common/efx.h Thu Nov 22 16:15:24 2018 (r340767) @@ -1111,6 +1111,7 @@ typedef struct efx_nic_cfg_s { uint32_t enc_evq_limit; uint32_t enc_txq_limit; uint32_t enc_rxq_limit; + uint32_t enc_txq_max_ndescs; uint32_t enc_buftbl_limit; uint32_t enc_piobuf_limit; uint32_t enc_piobuf_size; @@ -2045,12 +2046,6 @@ efx_tx_init( extern void efx_tx_fini( __in efx_nic_t *enp); - -#define EFX_BUG35388_WORKAROUND(_encp) \ - (((_encp) == NULL) ? 1 : ((_encp)->enc_bug35388_workaround != 0)) - -#define EFX_TXQ_MAXNDESCS(_encp) \ - ((EFX_BUG35388_WORKAROUND(_encp)) ? 2048 : 4096) #define EFX_TXQ_MINNDESCS 512 Modified: head/sys/dev/sfxge/common/efx_tx.c ============================================================================== --- head/sys/dev/sfxge/common/efx_tx.c Thu Nov 22 14:31:35 2018 (r340766) +++ head/sys/dev/sfxge/common/efx_tx.c Thu Nov 22 16:15:24 2018 (r340767) @@ -913,7 +913,7 @@ siena_tx_qcreate( (1 << FRF_AZ_TX_DESCQ_LABEL_WIDTH)); EFSYS_ASSERT3U(label, <, EFX_EV_TX_NLABELS); - EFSYS_ASSERT(ISP2(EFX_TXQ_MAXNDESCS(encp))); + EFSYS_ASSERT(ISP2(encp->enc_txq_max_ndescs)); EFX_STATIC_ASSERT(ISP2(EFX_TXQ_MINNDESCS)); if (!ISP2(n) || (n < EFX_TXQ_MINNDESCS) || (n > EFX_EVQ_MAXNEVS)) { @@ -925,7 +925,7 @@ siena_tx_qcreate( goto fail2; } for (size = 0; - (1 << size) <= (EFX_TXQ_MAXNDESCS(encp) / EFX_TXQ_MINNDESCS); + (1 << size) <= (int)(encp->enc_txq_max_ndescs / EFX_TXQ_MINNDESCS); size++) if ((1 << size) == (int)(n / EFX_TXQ_MINNDESCS)) break; Modified: head/sys/dev/sfxge/common/hunt_nic.c ============================================================================== --- head/sys/dev/sfxge/common/hunt_nic.c Thu Nov 22 14:31:35 2018 (r340766) +++ head/sys/dev/sfxge/common/hunt_nic.c Thu Nov 22 16:15:24 2018 (r340767) @@ -318,6 +318,12 @@ hunt_board_cfg( encp->enc_rxq_limit = EFX_RXQ_LIMIT_TARGET; encp->enc_txq_limit = EFX_TXQ_LIMIT_TARGET; + /* + * The workaround for bug35388 uses the top bit of transmit queue + * descriptor writes, preventing the use of 4096 descriptor TXQs. + */ + encp->enc_txq_max_ndescs = encp->enc_bug35388_workaround ? 2048 : 4096; + encp->enc_buftbl_limit = 0xFFFFFFFF; encp->enc_piobuf_limit = HUNT_PIOBUF_NBUFS; Modified: head/sys/dev/sfxge/common/medford_nic.c ============================================================================== --- head/sys/dev/sfxge/common/medford_nic.c Thu Nov 22 14:31:35 2018 (r340766) +++ head/sys/dev/sfxge/common/medford_nic.c Thu Nov 22 16:15:24 2018 (r340767) @@ -315,6 +315,13 @@ medford_board_cfg( encp->enc_rxq_limit = EFX_RXQ_LIMIT_TARGET; encp->enc_txq_limit = EFX_TXQ_LIMIT_TARGET; + /* + * The maximum supported transmit queue size is 2048. TXQs with 4096 + * descriptors are not supported as the top bit is used for vfifo + * stuffing. + */ + encp->enc_txq_max_ndescs = 2048; + encp->enc_buftbl_limit = 0xFFFFFFFF; encp->enc_piobuf_limit = MEDFORD_PIOBUF_NBUFS; Modified: head/sys/dev/sfxge/common/siena_nic.c ============================================================================== --- head/sys/dev/sfxge/common/siena_nic.c Thu Nov 22 14:31:35 2018 (r340766) +++ head/sys/dev/sfxge/common/siena_nic.c Thu Nov 22 16:15:24 2018 (r340767) @@ -158,6 +158,8 @@ siena_board_cfg( encp->enc_rxq_limit = MIN(EFX_RXQ_LIMIT_TARGET, nrxq); encp->enc_txq_limit = MIN(EFX_TXQ_LIMIT_TARGET, ntxq); + encp->enc_txq_max_ndescs = 4096; + encp->enc_buftbl_limit = SIENA_SRAM_ROWS - (encp->enc_txq_limit * EFX_TXQ_DC_NDESCS(EFX_TXQ_DC_SIZE)) - (encp->enc_rxq_limit * EFX_RXQ_DC_NDESCS(EFX_RXQ_DC_SIZE)); Modified: head/sys/dev/sfxge/sfxge.c ============================================================================== --- head/sys/dev/sfxge/sfxge.c Thu Nov 22 14:31:35 2018 (r340766) +++ head/sys/dev/sfxge/sfxge.c Thu Nov 22 16:15:24 2018 (r340767) @@ -764,10 +764,10 @@ sfxge_create(struct sfxge_softc *sc) if (!ISP2(sfxge_tx_ring_entries) || (sfxge_tx_ring_entries < EFX_TXQ_MINNDESCS) || - (sfxge_tx_ring_entries > EFX_TXQ_MAXNDESCS(efx_nic_cfg_get(enp)))) { + (sfxge_tx_ring_entries > efx_nic_cfg_get(enp)->enc_txq_max_ndescs)) { log(LOG_ERR, "%s=%d must be power of 2 from %u to %u", SFXGE_PARAM_TX_RING, sfxge_tx_ring_entries, - EFX_TXQ_MINNDESCS, EFX_TXQ_MAXNDESCS(efx_nic_cfg_get(enp))); + EFX_TXQ_MINNDESCS, efx_nic_cfg_get(enp)->enc_txq_max_ndescs); error = EINVAL; goto fail_tx_ring_entries; } From owner-svn-src-all@freebsd.org Thu Nov 22 16:27:31 2018 Return-Path: Delivered-To: svn-src-all@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 C2894114BB00; Thu, 22 Nov 2018 16:27:31 +0000 (UTC) (envelope-from marius@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 665C17C281; Thu, 22 Nov 2018 16:27:31 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3FC4712483; Thu, 22 Nov 2018 16:27:31 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAMGRVZS074339; Thu, 22 Nov 2018 16:27:31 GMT (envelope-from marius@FreeBSD.org) Received: (from marius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAMGRV3G074338; Thu, 22 Nov 2018 16:27:31 GMT (envelope-from marius@FreeBSD.org) Message-Id: <201811221627.wAMGRV3G074338@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: marius set sender to marius@FreeBSD.org using -f From: Marius Strobl Date: Thu, 22 Nov 2018 16:27:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r340768 - releng/12.0/sys/sparc64/sparc64 X-SVN-Group: releng X-SVN-Commit-Author: marius X-SVN-Commit-Paths: releng/12.0/sys/sparc64/sparc64 X-SVN-Commit-Revision: 340768 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 665C17C281 X-Spamd-Result: default: False [1.10 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.17)[0.169,0]; NEURAL_SPAM_MEDIUM(0.51)[0.514,0]; NEURAL_SPAM_LONG(0.42)[0.420,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Nov 2018 16:27:32 -0000 Author: marius Date: Thu Nov 22 16:27:30 2018 New Revision: 340768 URL: https://svnweb.freebsd.org/changeset/base/340768 Log: MFC: r340656, MF12: r340759 Given that the idea of D15374 was to "make memmove a first class citizen", provide a _MEMMOVE extension of _MEMCPY that deals with overlap based on the previous bcopy(9) implementation and use the former for bcopy(9) and memmove(9). This addresses my D15374 review comment, avoiding extra MOVs in case of memmove(9) and trashing the stack pointer. Approved by: re (kib) Modified: releng/12.0/sys/sparc64/sparc64/support.S Directory Properties: releng/12.0/ (props changed) Modified: releng/12.0/sys/sparc64/sparc64/support.S ============================================================================== --- releng/12.0/sys/sparc64/sparc64/support.S Thu Nov 22 16:15:24 2018 (r340767) +++ releng/12.0/sys/sparc64/sparc64/support.S Thu Nov 22 16:27:30 2018 (r340768) @@ -207,6 +207,30 @@ __FBSDID("$FreeBSD$"); 6: /* + * Extension of _MEMCPY dealing with overlap, but unaware of ASIs. + * Used for bcopy() and memmove(). + */ +#define _MEMMOVE(dst, src, len) \ + /* Check for overlap, and copy backwards if so. */ \ + sub dst, src, %g1 ; \ + cmp %g1, len ; \ + bgeu,a,pt %xcc, 2f ; \ + nop ; \ + /* Copy backwards. */ \ + add src, len, src ; \ + add dst, len, dst ; \ +1: deccc 1, len ; \ + bl,pn %xcc, 3f ; \ + dec 1, src ; \ + ldub [src], %g1 ; \ + dec 1, dst ; \ + ba %xcc, 1b ; \ + stb %g1, [dst] ; \ +2: /* Do the fast version. */ \ + _MEMCPY(dst, src, len, EMPTY, EMPTY, EMPTY, EMPTY) ; \ +3: + +/* * void ascopy(u_long asi, vm_offset_t src, vm_offset_t dst, size_t len) */ ENTRY(ascopy) @@ -265,49 +289,14 @@ ENTRY(bcmp) END(bcmp) /* - * void *memmove(void *dst, const void *src, size_t len) * void bcopy(const void *src, void *dst, size_t len) */ -ENTRY(memmove) - /* - * Swap src/dst for memmove/bcopy differences - */ - mov %o0, %o6 - mov %o1, %o0 - mov %o6, %o1 -ALTENTRY(bcopy) - /* - * Check for overlap, and copy backwards if so. - */ - sub %o1, %o0, %g1 - cmp %g1, %o2 - bgeu,a,pt %xcc, 3f +ENTRY(bcopy) + _MEMMOVE(%o1, %o0, %o2) + retl nop +END(bcopy) - /* - * Copy backwards. - */ - add %o0, %o2, %o0 - add %o1, %o2, %o1 -1: deccc 1, %o2 - bl,a,pn %xcc, 2f - nop - dec 1, %o0 - ldub [%o0], %g1 - dec 1, %o1 - ba %xcc, 1b - stb %g1, [%o1] -2: retl - mov %o6, %o0 - - /* - * Do the fast version. - */ -3: _MEMCPY(%o1, %o0, %o2, EMPTY, EMPTY, EMPTY, EMPTY) - retl - mov %o6, %o0 -END(memmove) - /* * void bzero(void *b, size_t len) */ @@ -335,6 +324,16 @@ ENTRY(memcpy) retl nop END(memcpy) + +/* + * void *memmove(void *dst, const void *src, size_t len) + */ +ENTRY(memmove) + mov %o0, %o3 + _MEMMOVE(%o3, %o1, %o2) + retl + nop +END(memmove) /* * void *memset(void *b, int c, size_t len) From owner-svn-src-all@freebsd.org Thu Nov 22 16:52:31 2018 Return-Path: Delivered-To: svn-src-all@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 C3B4C114C127; Thu, 22 Nov 2018 16:52:31 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6B09A7CE93; Thu, 22 Nov 2018 16:52:31 +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 4C15F12939; Thu, 22 Nov 2018 16:52:31 +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 wAMGqVSH089429; Thu, 22 Nov 2018 16:52:31 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAMGqVtc089428; Thu, 22 Nov 2018 16:52:31 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201811221652.wAMGqVtc089428@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 22 Nov 2018 16:52:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r340769 - stable/12/usr.bin/ldd X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/12/usr.bin/ldd X-SVN-Commit-Revision: 340769 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 6B09A7CE93 X-Spamd-Result: default: False [1.00 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.39)[0.387,0]; NEURAL_SPAM_MEDIUM(0.49)[0.492,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.12)[0.118,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Nov 2018 16:52:31 -0000 Author: markj Date: Thu Nov 22 16:52:30 2018 New Revision: 340769 URL: https://svnweb.freebsd.org/changeset/base/340769 Log: MFC r339653: Add an IMPLEMENTATION NOTES section to ldd.1. PR: 231926 Modified: stable/12/usr.bin/ldd/ldd.1 Directory Properties: stable/12/ (props changed) Modified: stable/12/usr.bin/ldd/ldd.1 ============================================================================== --- stable/12/usr.bin/ldd/ldd.1 Thu Nov 22 16:27:30 2018 (r340768) +++ stable/12/usr.bin/ldd/ldd.1 Thu Nov 22 16:52:30 2018 (r340769) @@ -1,6 +1,6 @@ .\" $FreeBSD$ .\" -.Dd May 15, 2008 +.Dd October 23, 2018 .Dt LDD 1 .Os .Sh NAME @@ -57,6 +57,14 @@ option displays a verbose listing of the dynamic linki encoded in the executable. See the source code and include files for the definitive meaning of all the fields. +.Sh IMPLEMENTATION NOTES +.Nm +lists the dependencies of an executable by setting +.Xr rtld 1 +environment variables and running the executable in a child process. +If the executable is corrupt or invalid, +.Nm +may therefore fail without providing any diagnostic error messages. .Sh EXAMPLES The following is an example of a shell pipeline which uses the .Fl f @@ -67,6 +75,7 @@ which link against libc.so.6: .Sh SEE ALSO .Xr ld 1 , .Xr nm 1 , +.Xr readelf 1 , .Xr rtld 1 .Sh HISTORY A From owner-svn-src-all@freebsd.org Thu Nov 22 16:53:31 2018 Return-Path: Delivered-To: svn-src-all@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 B4EA9114C18B; Thu, 22 Nov 2018 16:53:31 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5D2FC7CFEC; Thu, 22 Nov 2018 16:53:31 +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 3AB0912946; Thu, 22 Nov 2018 16:53:31 +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 wAMGrVNt089556; Thu, 22 Nov 2018 16:53:31 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAMGrUrd089555; Thu, 22 Nov 2018 16:53:30 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201811221653.wAMGrUrd089555@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 22 Nov 2018 16:53:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r340770 - stable/12/sys/fs/fuse X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/12/sys/fs/fuse X-SVN-Commit-Revision: 340770 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 5D2FC7CFEC X-Spamd-Result: default: False [1.00 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.39)[0.387,0]; NEURAL_SPAM_MEDIUM(0.49)[0.492,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.12)[0.118,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Nov 2018 16:53:31 -0000 Author: markj Date: Thu Nov 22 16:53:30 2018 New Revision: 340770 URL: https://svnweb.freebsd.org/changeset/base/340770 Log: MFC r340639: Remove comments made obsolete by the ino64 work. Modified: stable/12/sys/fs/fuse/fuse_internal.c stable/12/sys/fs/fuse/fuse_internal.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/fs/fuse/fuse_internal.c ============================================================================== --- stable/12/sys/fs/fuse/fuse_internal.c Thu Nov 22 16:52:30 2018 (r340769) +++ stable/12/sys/fs/fuse/fuse_internal.c Thu Nov 22 16:53:30 2018 (r340770) @@ -350,7 +350,7 @@ fuse_internal_readdir_processdata(struct uio *uio, fiov_adjust(cookediov, bytesavail); de = (struct dirent *)cookediov->base; - de->d_fileno = fudge->ino; /* XXX: truncation */ + de->d_fileno = fudge->ino; de->d_reclen = bytesavail; de->d_type = fudge->type; de->d_namlen = fudge->namelen; Modified: stable/12/sys/fs/fuse/fuse_internal.h ============================================================================== --- stable/12/sys/fs/fuse/fuse_internal.h Thu Nov 22 16:52:30 2018 (r340769) +++ stable/12/sys/fs/fuse/fuse_internal.h Thu Nov 22 16:53:30 2018 (r340770) @@ -212,7 +212,7 @@ fuse_internal_attr_fat2vat(struct mount *mp, vattr_null(vap); vap->va_fsid = mp->mnt_stat.f_fsid.val[0]; - vap->va_fileid = fat->ino; /* XXX cast from 64 bits to 32 */ + vap->va_fileid = fat->ino; vap->va_mode = fat->mode & ~S_IFMT; vap->va_nlink = fat->nlink; vap->va_uid = fat->uid; From owner-svn-src-all@freebsd.org Thu Nov 22 16:55:10 2018 Return-Path: Delivered-To: svn-src-all@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 B0206114C290; Thu, 22 Nov 2018 16:55:10 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 56DD27D1E4; Thu, 22 Nov 2018 16:55:10 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1DBC212948; Thu, 22 Nov 2018 16:55:10 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAMGtA4Q089697; Thu, 22 Nov 2018 16:55:10 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAMGt9p5089696; Thu, 22 Nov 2018 16:55:09 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201811221655.wAMGt9p5089696@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 22 Nov 2018 16:55:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340771 - head/sys/dev/proto X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/sys/dev/proto X-SVN-Commit-Revision: 340771 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 56DD27D1E4 X-Spamd-Result: default: False [1.04 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.15)[0.153,0]; NEURAL_SPAM_MEDIUM(0.49)[0.489,0]; NEURAL_SPAM_LONG(0.40)[0.400,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Nov 2018 16:55:11 -0000 Author: emaste Date: Thu Nov 22 16:55:09 2018 New Revision: 340771 URL: https://svnweb.freebsd.org/changeset/base/340771 Log: proto: change device permissions to 0600 C Turt reports that the driver is not thread safe and may have exploitable races. Note that the proto device is intended for prototyping and development, and is not for use on production systems. From the man page: SECURITY CONSIDERATIONS Because programs have direct access to the hardware, the proto driver is inherently insecure. It is not advisable to use this driver on a production machine. The proto device is not included in any of FreeBSD's kernel config files (although the module is built). The issues in the proto device still need to be fixed, and the device is inherently (and intentionally) insecure, but it might as well be limited to root only. admbugs: 782 Reported by: C Turt MFC after: 3 days Sponsored by: The FreeBSD Foundation Modified: head/sys/dev/proto/proto_core.c Modified: head/sys/dev/proto/proto_core.c ============================================================================== --- head/sys/dev/proto/proto_core.c Thu Nov 22 16:53:30 2018 (r340770) +++ head/sys/dev/proto/proto_core.c Thu Nov 22 16:55:09 2018 (r340771) @@ -196,7 +196,7 @@ proto_attach(device_t dev) case SYS_RES_MEMORY: case SYS_RES_IOPORT: r->r_size = rman_get_size(r->r_d.res); - r->r_u.cdev = make_dev(&proto_devsw, res, 0, 0, 0666, + r->r_u.cdev = make_dev(&proto_devsw, res, 0, 0, 0600, "proto/%s/%02x.%s", device_get_desc(dev), r->r_rid, (r->r_type == SYS_RES_IOPORT) ? "io" : "mem"); r->r_u.cdev->si_drv1 = sc; @@ -204,7 +204,7 @@ proto_attach(device_t dev) break; case PROTO_RES_PCICFG: r->r_size = 4096; - r->r_u.cdev = make_dev(&proto_devsw, res, 0, 0, 0666, + r->r_u.cdev = make_dev(&proto_devsw, res, 0, 0, 0600, "proto/%s/pcicfg", device_get_desc(dev)); r->r_u.cdev->si_drv1 = sc; r->r_u.cdev->si_drv2 = r; @@ -212,7 +212,7 @@ proto_attach(device_t dev) case PROTO_RES_BUSDMA: r->r_d.busdma = proto_busdma_attach(sc); r->r_size = 0; /* no read(2) nor write(2) */ - r->r_u.cdev = make_dev(&proto_devsw, res, 0, 0, 0666, + r->r_u.cdev = make_dev(&proto_devsw, res, 0, 0, 0600, "proto/%s/busdma", device_get_desc(dev)); r->r_u.cdev->si_drv1 = sc; r->r_u.cdev->si_drv2 = r; From owner-svn-src-all@freebsd.org Thu Nov 22 17:28:21 2018 Return-Path: Delivered-To: svn-src-all@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 CFD95114CD82; Thu, 22 Nov 2018 17:28:20 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: from mail-qt1-x844.google.com (mail-qt1-x844.google.com [IPv6:2607:f8b0:4864:20::844]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 44B177E1B0; Thu, 22 Nov 2018 17:28:20 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: by mail-qt1-x844.google.com with SMTP id p17so8125958qtl.5; Thu, 22 Nov 2018 09:28:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=T1K7xBYwwSWIfP8YrBX5MEiwIxTicRn7HRQUi4a/PMk=; b=rycF3iIHGKytC+QL6k84lxEMaZm+vuwmYNBdELj7RGjjPS0ixYCXjcr3IqeTtXAaWf PXUoOzUbOduvP76EuGDdzRwjHf8m5RBf3DfysYZfKorGpHeyCf8XRac5GO8OwbbDwDjL Kz+Mdq+ARvD1bBc7rj+N2b0lPdUlrqA2hHCdA62o3xm/otsA+/1KiVx2jtN6orDz/W06 3nHRZPrJOHRV9uWrD5ryZfikG803UD0Dy4dvaZeopvsmpdY6JYlVNv1BxSxddU2nNKmB Mx6lZ9VWfy21kGy/Wbt9PQTmxKKBJfRtW4ue8IMkkv3ZESlmX/TYnC2rpG4wVXrWh2Tw moLg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=T1K7xBYwwSWIfP8YrBX5MEiwIxTicRn7HRQUi4a/PMk=; b=FJrQONlTohv3GZUbaDpPJ/mXOQYVnNEJoL7hXxEzpIl3r/cG/4xc4YpxYhbIX0NzSJ IzYY1Z2s6XRg3GKciBI8tlF/T6MG5aoUFOXSW3DlsKEjJ1iRjfZJQfCVKggafVESetD4 P7FxXj3O5jtpqfoRGfdAnM6jI8qAYXvWCoQwF8cxCunFBAeougLTtcl3yBT8ONYSpEkz YNlqtS6+4KK+RINMF05cNyGFscbINLhkZaoi3cLEHQyoarfcjKLDsjQoz+OcMlEVE2aU QGus6OHhh7DyOlqB8eMGPXyLxCYeGQFfb1j6gOApaTNYee1Uy6VPLj5UOQkPL0ac0/b2 KSqg== X-Gm-Message-State: AGRZ1gK7a7HVnbO0PF+oFfLEdQEihuUMDR88NWSQbbrlOg8MT6rVGNJN mjIdSrYaCy8XOrijS0v2XDG48QpJ+aJ6Wfg0mjs= X-Google-Smtp-Source: AFSGD/Wayi1GmD/67T/mLLPOel2fFN5qMZondQkLQ5J12GwLAhFloutbN8DnFt27NgNPDx0gfRHP2qyjPG6Xdhn6EIk= X-Received: by 2002:ac8:5053:: with SMTP id h19mr10683861qtm.280.1542907699918; Thu, 22 Nov 2018 09:28:19 -0800 (PST) MIME-Version: 1.0 Received: by 2002:ac8:784:0:0:0:0:0 with HTTP; Thu, 22 Nov 2018 09:28:19 -0800 (PST) In-Reply-To: References: <201811201458.wAKEwftP033152@repo.freebsd.org> <20181120150756.GD2378@kib.kiev.ua> From: Mateusz Guzik Date: Thu, 22 Nov 2018 18:28:19 +0100 Message-ID: Subject: Re: svn commit: r340676 - in head/sys: kern sys To: Warner Losh Cc: Konstantin Belousov , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 44B177E1B0 X-Spamd-Result: default: False [-2.64 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.59)[-0.587,0]; R_DKIM_ALLOW(-0.20)[gmail.com]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36]; FREEMAIL_FROM(0.00)[gmail.com]; MIME_GOOD(-0.10)[text/plain]; IP_SCORE(0.21)[ip: (4.77), ipnet: 2607:f8b0::/32(-2.10), asn: 15169(-1.51), country: US(-0.09)]; NEURAL_HAM_LONG(-0.66)[-0.656,0]; RCPT_COUNT_FIVE(0.00)[5]; RCVD_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; MX_GOOD(-0.01)[cached: alt3.gmail-smtp-in.l.google.com]; DKIM_TRACE(0.00)[gmail.com:+]; RCVD_IN_DNSWL_NONE(0.00)[4.4.8.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.0]; NEURAL_HAM_SHORT(-0.59)[-0.593,0]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; FROM_EQ_ENVFROM(0.00)[]; RCVD_TLS_LAST(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; FREEMAIL_CC(0.00)[gmail.com] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Nov 2018 17:28:21 -0000 On 11/20/18, Warner Losh wrote: > On Tue, Nov 20, 2018 at 8:28 AM Mateusz Guzik wrote: > >> On 11/20/18, Konstantin Belousov wrote: >> >> +#if defined(__mips__) || defined(__powerpc__) >> > Please note what I asked about this #ifdefs in the review. mips >> > and powerpc machine/atomic.h should define some symbol like >> > __ATOMIC_NO_64_OPS and this case should be handled in less >> > arch-explicit >> > manner. >> > >> >> Right, should have mentioned that in the commit message. >> >> Anyhow, mips has some degree of 64 bit ops even for 32 bits so >> this becomes more iffy. In particular it does have atomic_add_64. >> I don't have a good way to test mips atomics and since non-atomic >> version for powerpc was needed anyway I decided not to try to >> add one. >> > > I thought the 64-bit stuff was not present in true 32-bit mips at all. You > need the lld/scd instructions to do 64-bit atomics which are only available > in a 64-bit environment (eg n32 or n64 execution). They throw a fatal > machine error if you execute them in o32 land. > > And I think the proper ifdef for this is defined(mips) && > !defined(__mips_n64) && !defined(__mips_n32) or something horrible like > that to not pessimize 64-bit executions. > And powerpc will require something of similar sort (as reported by Mark MIllard). It gets quite ugly indeed. I don't have strong opinion how to express the ifdefs, I think this is least bad if sticking to a mi header: diff --git a/sys/sys/systm.h b/sys/sys/systm.h index a1b98c5660c..fab94ee7979 100644 --- a/sys/sys/systm.h +++ b/sys/sys/systm.h @@ -523,7 +523,11 @@ int alloc_unr_specific(struct unrhdr *uh, u_int item); int alloc_unrl(struct unrhdr *uh); void free_unr(struct unrhdr *uh, u_int item); -#if defined(__mips__) || defined(__powerpc__) +#if defined(mips) && !defined(__mips_n64) && !defined(__mips_n32) +#define UNR64_LOCKED +#endif + +#if defined(__powerpc__) && !defined(__powerpc64__) #define UNR64_LOCKED #endif -- Mateusz Guzik From owner-svn-src-all@freebsd.org Thu Nov 22 17:42:27 2018 Return-Path: Delivered-To: svn-src-all@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 0267411022FD for ; Thu, 22 Nov 2018 17:42:27 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-it1-x131.google.com (mail-it1-x131.google.com [IPv6:2607:f8b0:4864:20::131]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 33C4E7EAA2 for ; Thu, 22 Nov 2018 17:42:26 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-it1-x131.google.com with SMTP id v11so14860037itj.0 for ; Thu, 22 Nov 2018 09:42:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=F9TdPOedxco+Cf6ygcxyxsJI+rHiqW8tRV6IC/Xvo9Y=; b=1KLPK3a7+nyrCGyN93vL1jkj3CTAqPnRhX3HplnaPLG6RRH9K9fO9BuxsALuBCWFg5 TQoXfsmXg9FRfRrg8jLmKvNjLnbL9kDDBYSc7K5nv8OXa6tWDp0Z9BBx2CCtIYy73DR5 ozjcunTx6TnB39MBDn6ZptrAZm7X3jZYrXd4Q96quw7rjXNqz42qNRtM2GPYZpR1HTFG 4eCAx+c0AUiCPUB6QOXAmELF44ertLaJ6F/6/uIBmOxZ0W8Zl9JEjoCWFtZjjUwsT/6t buVNrtyNNFEmfON+EiZ4Ky8NWAquwGo6ISulUnThHLmW92ycLc98oEojbQ8XB6IV2knP yaOQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=F9TdPOedxco+Cf6ygcxyxsJI+rHiqW8tRV6IC/Xvo9Y=; b=TVpr2hM3HnmDChbo3TjKv6PF+zsuJuDwcIbkhJx1Guakk8hygZUiWFjbjBpMiUg+QT CsEI1wQC8wiwCxkGubQsq0mi7TOonFrjvDaAiTti9P/rYjAO4gJokU4HLhLpKAi5JdLh EE17kRfP52TbNglMwkdWxdkk/S1LIvfZ1ggw14S2vwWeJOI6L3zBNNLVS7DN7aSNjYWb AIIGVIAdwq0Yzw9bR1wyUv21bKeO1uSsH2GwlFjOw5p9gJ7woovd719cn2TTID1IGqL3 ZAKIw+ZbNNFHlWqGG4AtMDcWQr81tAb38U2E9DFhSYl/RiZsemQCahGGucBKO7u+JIpl ihAw== X-Gm-Message-State: AGRZ1gIMOd8K3wRINhBYphHxHliN0j8y1ZbzxJdrJmT7lwHFkBePeSY2 3dO8VXTqv2L7G/+z0Kuhqernh6OBUtC8c+x1UODFiw== X-Google-Smtp-Source: AJdET5dBIGUb3Y3BF50eEIw2FaIWv4RtnY1hUDoKTb0KECr/Eip4iIWlFNhCN19ahvRWcNuKGQsnjdr9ZcMylU+GA3g= X-Received: by 2002:a24:3796:: with SMTP id r144-v6mr10151975itr.79.1542908545237; Thu, 22 Nov 2018 09:42:25 -0800 (PST) MIME-Version: 1.0 References: <201811201458.wAKEwftP033152@repo.freebsd.org> <20181120150756.GD2378@kib.kiev.ua> In-Reply-To: From: Warner Losh Date: Thu, 22 Nov 2018 10:42:14 -0700 Message-ID: Subject: Re: svn commit: r340676 - in head/sys: kern sys To: Mateusz Guzik Cc: Konstantin Belousov , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org X-Rspamd-Queue-Id: 33C4E7EAA2 X-Spamd-Result: default: False [-4.97 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; R_DKIM_ALLOW(-0.20)[bsdimp-com.20150623.gappssmtp.com]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[svn-src-all@freebsd.org]; DMARC_NA(0.00)[bsdimp.com]; RCPT_COUNT_FIVE(0.00)[5]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[bsdimp-com.20150623.gappssmtp.com:+]; MX_GOOD(-0.01)[cached: ALT1.aspmx.l.google.com]; RCVD_IN_DNSWL_NONE(0.00)[1.3.1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.0]; NEURAL_HAM_SHORT(-0.98)[-0.981,0]; R_SPF_NA(0.00)[]; FORGED_SENDER(0.30)[imp@bsdimp.com,wlosh@bsdimp.com]; FREEMAIL_TO(0.00)[gmail.com]; RCVD_TLS_LAST(0.00)[]; IP_SCORE(-1.98)[ip: (-6.19), ipnet: 2607:f8b0::/32(-2.10), asn: 15169(-1.51), country: US(-0.09)]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; FROM_NEQ_ENVFROM(0.00)[imp@bsdimp.com,wlosh@bsdimp.com]; FREEMAIL_CC(0.00)[gmail.com] X-Rspamd-Server: mx1.freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Nov 2018 17:42:27 -0000 On Thu, Nov 22, 2018 at 10:28 AM Mateusz Guzik wrote: > On 11/20/18, Warner Losh wrote: > > On Tue, Nov 20, 2018 at 8:28 AM Mateusz Guzik wrote: > > > >> On 11/20/18, Konstantin Belousov wrote: > >> >> +#if defined(__mips__) || defined(__powerpc__) > >> > Please note what I asked about this #ifdefs in the review. mips > >> > and powerpc machine/atomic.h should define some symbol like > >> > __ATOMIC_NO_64_OPS and this case should be handled in less > >> > arch-explicit > >> > manner. > >> > > >> > >> Right, should have mentioned that in the commit message. > >> > >> Anyhow, mips has some degree of 64 bit ops even for 32 bits so > >> this becomes more iffy. In particular it does have atomic_add_64. > >> I don't have a good way to test mips atomics and since non-atomic > >> version for powerpc was needed anyway I decided not to try to > >> add one. > >> > > > > I thought the 64-bit stuff was not present in true 32-bit mips at all. > You > > need the lld/scd instructions to do 64-bit atomics which are only > available > > in a 64-bit environment (eg n32 or n64 execution). They throw a fatal > > machine error if you execute them in o32 land. > > > > And I think the proper ifdef for this is defined(mips) && > > !defined(__mips_n64) && !defined(__mips_n32) or something horrible like > > that to not pessimize 64-bit executions. > > > > And powerpc will require something of similar sort (as reported by Mark > MIllard). It gets quite ugly indeed. > > I don't have strong opinion how to express the ifdefs, I think this is > least > bad if sticking to a mi header: > > diff --git a/sys/sys/systm.h b/sys/sys/systm.h > index a1b98c5660c..fab94ee7979 100644 > --- a/sys/sys/systm.h > +++ b/sys/sys/systm.h > @@ -523,7 +523,11 @@ int alloc_unr_specific(struct unrhdr *uh, u_int item); > int alloc_unrl(struct unrhdr *uh); > void free_unr(struct unrhdr *uh, u_int item); > > -#if defined(__mips__) || defined(__powerpc__) > +#if defined(mips) && !defined(__mips_n64) && !defined(__mips_n32) > +#define UNR64_LOCKED > +#endif > + > +#if defined(__powerpc__) && !defined(__powerpc64__) > #define UNR64_LOCKED > #endif > We should move the defining of this to machine/atomic.h as suggested elsewhere. Once it's more than one phrase long, it makes no sense to pollute the MI header with MD stuff like this. Warner From owner-svn-src-all@freebsd.org Thu Nov 22 17:51:20 2018 Return-Path: Delivered-To: svn-src-all@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 500B411024C6; Thu, 22 Nov 2018 17:51:20 +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 E79E97F2BA; Thu, 22 Nov 2018 17:51: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 C8B1B13178; Thu, 22 Nov 2018 17:51: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 wAMHpJBm017720; Thu, 22 Nov 2018 17:51:19 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAMHpJ7K017719; Thu, 22 Nov 2018 17:51:19 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201811221751.wAMHpJ7K017719@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 22 Nov 2018 17:51:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340772 - head/sys/amd64/ia32 X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/amd64/ia32 X-SVN-Commit-Revision: 340772 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E79E97F2BA X-Spamd-Result: default: False [1.12 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.40)[0.400,0]; NEURAL_SPAM_MEDIUM(0.49)[0.489,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.23)[0.235,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Nov 2018 17:51:20 -0000 Author: markj Date: Thu Nov 22 17:51:19 2018 New Revision: 340772 URL: https://svnweb.freebsd.org/changeset/base/340772 Log: Clear unused bytes in ia32_osendsig(). Mirror the fix for the native i386 implementation from r218327. This code is compiled only when the non-default COMPAT_43 option is configured. Reported by: Ilja Van Sprundel Reviewed by: kib MFC after: 3 days Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D18298 Modified: head/sys/amd64/ia32/ia32_signal.c Modified: head/sys/amd64/ia32/ia32_signal.c ============================================================================== --- head/sys/amd64/ia32/ia32_signal.c Thu Nov 22 16:55:09 2018 (r340771) +++ head/sys/amd64/ia32/ia32_signal.c Thu Nov 22 17:51:19 2018 (r340772) @@ -364,12 +364,14 @@ ia32_osendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t /* Build the argument list for the signal handler. */ sf.sf_signum = sig; sf.sf_scp = (register_t)&fp->sf_siginfo.si_sc; + bzero(&sf.sf_siginfo, sizeof(sf.sf_siginfo)); if (SIGISMEMBER(psp->ps_siginfo, sig)) { /* Signal handler installed with SA_SIGINFO. */ sf.sf_arg2 = (register_t)&fp->sf_siginfo; sf.sf_siginfo.si_signo = sig; sf.sf_siginfo.si_code = ksi->ksi_code; sf.sf_ah = (uintptr_t)catcher; + sf.sf_addr = 0; } else { /* Old FreeBSD-style arguments. */ sf.sf_arg2 = ksi->ksi_code; From owner-svn-src-all@freebsd.org Thu Nov 22 18:59:07 2018 Return-Path: Delivered-To: svn-src-all@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 9B1711103EA7; Thu, 22 Nov 2018 18:59:07 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3FBF881301; Thu, 22 Nov 2018 18:59:07 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 17F2F13C6D; Thu, 22 Nov 2018 18:59:07 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAMIx6I9052352; Thu, 22 Nov 2018 18:59:06 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAMIx5E3052345; Thu, 22 Nov 2018 18:59:05 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201811221859.wAMIx5E3052345@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 22 Nov 2018 18:59:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r340773 - in releng/12.0: . rescue/rescue share/mk tools/build/options X-SVN-Group: releng X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: in releng/12.0: . rescue/rescue share/mk tools/build/options X-SVN-Commit-Revision: 340773 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 3FBF881301 X-Spamd-Result: default: False [1.09 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.42)[0.420,0]; NEURAL_SPAM_SHORT(0.16)[0.158,0]; NEURAL_SPAM_MEDIUM(0.51)[0.514,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Nov 2018 18:59:07 -0000 Author: emaste Date: Thu Nov 22 18:59:05 2018 New Revision: 340773 URL: https://svnweb.freebsd.org/changeset/base/340773 Log: MF12 r340697: Introduce src.conf knob to build userland with retpoline MFC r339511: Introduce src.conf knob to build userland with retpoline WITH_RETPOLINE enables -mretpoline vulnerability mitigation in userland for CVE-2017-5715. MFC r340099: libcompat: disable retpoline when building build tools These are built with the host toolchain which may not support retpoline. While here, move the MK_ overrides to a separate line and sort them alphabetically to support future changes. MFC r340650: Avoid retpolineplt with static linking Statically linked binaries linked with -zretpolineplt crash at startup as lld produces a broken PLT. MFC r340652: rescue: set NO_SHARED in Makefile The rescue binary is built statically via the Makefile generated by crunchgen, but that does not trigger other shared/static logic in bsd.prog.mk - in particular PR: 233336 Reported by: Peter Malcom (r339511), Charlie Li (r340652) Approved by: re (kib) Sponsored by: The FreeBSD Foundation Added: releng/12.0/tools/build/options/WITH_RETPOLINE - copied unchanged from r340697, stable/12/tools/build/options/WITH_RETPOLINE Modified: releng/12.0/Makefile.inc1 releng/12.0/Makefile.libcompat releng/12.0/rescue/rescue/Makefile releng/12.0/share/mk/bsd.lib.mk releng/12.0/share/mk/bsd.opts.mk releng/12.0/share/mk/bsd.prog.mk Directory Properties: releng/12.0/ (props changed) Modified: releng/12.0/Makefile.inc1 ============================================================================== --- releng/12.0/Makefile.inc1 Thu Nov 22 17:51:19 2018 (r340772) +++ releng/12.0/Makefile.inc1 Thu Nov 22 18:59:05 2018 (r340773) @@ -659,7 +659,7 @@ BSARGS= DESTDIR= \ -DNO_PIC MK_PROFILE=no -DNO_SHARED \ -DNO_CPU_CFLAGS MK_WARNS=no MK_CTF=no \ MK_CLANG_EXTRAS=no MK_CLANG_FULL=no \ - MK_LLDB=no MK_TESTS=no \ + MK_LLDB=no MK_RETPOLINE=no MK_TESTS=no \ MK_INCLUDES=yes BMAKE= \ @@ -680,7 +680,7 @@ TMAKE= \ -DNO_LINT \ -DNO_CPU_CFLAGS MK_WARNS=no MK_CTF=no \ MK_CLANG_EXTRAS=no MK_CLANG_FULL=no \ - MK_LLDB=no MK_TESTS=no + MK_LLDB=no MK_RETPOLINE=no MK_TESTS=no # cross-tools stage # TOOLS_PREFIX set in BMAKE @@ -703,7 +703,7 @@ KTMAKE= \ SSP_CFLAGS= \ MK_HTML=no -DNO_LINT MK_MAN=no \ -DNO_PIC MK_PROFILE=no -DNO_SHARED \ - -DNO_CPU_CFLAGS MK_WARNS=no MK_CTF=no + -DNO_CPU_CFLAGS MK_RETPOLINE=no MK_WARNS=no MK_CTF=no # world stage WMAKEENV= ${CROSSENV} \ @@ -2390,6 +2390,7 @@ NXBMAKEARGS+= \ MK_OFED=no \ MK_OPENSSH=no \ MK_PROFILE=no \ + MK_RETPOLINE=no \ MK_SENDMAIL=no \ MK_SVNLITE=no \ MK_TESTS=no \ Modified: releng/12.0/Makefile.libcompat ============================================================================== --- releng/12.0/Makefile.libcompat Thu Nov 22 17:51:19 2018 (r340772) +++ releng/12.0/Makefile.libcompat Thu Nov 22 18:59:05 2018 (r340773) @@ -200,7 +200,8 @@ build${libcompat}: .PHONY OBJTOP=${LIBCOMPAT_OBJTOP} \ OBJROOT='$${OBJTOP}/' \ MAKEOBJDIRPREFIX= \ - DIRPRFX=${_dir}/ -DNO_LINT -DNO_CPU_CFLAGS MK_WARNS=no MK_CTF=no \ + DIRPRFX=${_dir}/ -DNO_LINT -DNO_CPU_CFLAGS \ + MK_CTF=no MK_RETPOLINE=no MK_WARNS=no \ ${_t} .endfor .endfor Modified: releng/12.0/rescue/rescue/Makefile ============================================================================== --- releng/12.0/rescue/rescue/Makefile Thu Nov 22 17:51:19 2018 (r340772) +++ releng/12.0/rescue/rescue/Makefile Thu Nov 22 18:59:05 2018 (r340773) @@ -6,6 +6,7 @@ PACKAGE=rescue MAN= MK_SSP= no +NO_SHARED= yes PROG= rescue BINDIR?=/rescue Modified: releng/12.0/share/mk/bsd.lib.mk ============================================================================== --- releng/12.0/share/mk/bsd.lib.mk Thu Nov 22 17:51:19 2018 (r340772) +++ releng/12.0/share/mk/bsd.lib.mk Thu Nov 22 18:59:05 2018 (r340773) @@ -69,6 +69,12 @@ TAGS+= package=${PACKAGE:Uruntime} TAG_ARGS= -T ${TAGS:[*]:S/ /,/g} .endif +.if ${MK_RETPOLINE} != "no" +CFLAGS+= -mretpoline +CXXFLAGS+= -mretpoline +LDFLAGS+= -Wl,-zretpolineplt +.endif + .if ${MK_DEBUG_FILES} != "no" && empty(DEBUG_FLAGS:M-g) && \ empty(DEBUG_FLAGS:M-gdwarf*) CFLAGS+= ${DEBUG_FILES_CFLAGS} Modified: releng/12.0/share/mk/bsd.opts.mk ============================================================================== --- releng/12.0/share/mk/bsd.opts.mk Thu Nov 22 17:51:19 2018 (r340772) +++ releng/12.0/share/mk/bsd.opts.mk Thu Nov 22 18:59:05 2018 (r340773) @@ -72,6 +72,7 @@ __DEFAULT_NO_OPTIONS = \ CCACHE_BUILD \ CTF \ INSTALL_AS_USER \ + RETPOLINE \ STALE_STAGED __DEFAULT_DEPENDENT_OPTIONS = \ Modified: releng/12.0/share/mk/bsd.prog.mk ============================================================================== --- releng/12.0/share/mk/bsd.prog.mk Thu Nov 22 17:51:19 2018 (r340772) +++ releng/12.0/share/mk/bsd.prog.mk Thu Nov 22 18:59:05 2018 (r340773) @@ -34,6 +34,15 @@ PROG= ${PROG_CXX} MK_DEBUG_FILES= no .endif +.if ${MK_RETPOLINE} != "no" +CFLAGS+= -mretpoline +CXXFLAGS+= -mretpoline +# retpolineplt is broken with static linking (PR 233336) +.if !defined(NO_SHARED) || ${NO_SHARED} == "no" || ${NO_SHARED} == "NO" +LDFLAGS+= -Wl,-zretpolineplt +.endif +.endif + .if defined(CRUNCH_CFLAGS) CFLAGS+=${CRUNCH_CFLAGS} .else Copied: releng/12.0/tools/build/options/WITH_RETPOLINE (from r340697, stable/12/tools/build/options/WITH_RETPOLINE) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ releng/12.0/tools/build/options/WITH_RETPOLINE Thu Nov 22 18:59:05 2018 (r340773, copy of r340697, stable/12/tools/build/options/WITH_RETPOLINE) @@ -0,0 +1,3 @@ +.\" $FreeBSD$ +Set to build the base system with the retpoline speculative execution +vulnerability mitigation for CVE-2017-5715. From owner-svn-src-all@freebsd.org Thu Nov 22 19:49:54 2018 Return-Path: Delivered-To: svn-src-all@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 0E67811052D4; Thu, 22 Nov 2018 19:49:54 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A8B8D83589; Thu, 22 Nov 2018 19:49:53 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 89A2A14486; Thu, 22 Nov 2018 19:49:53 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAMJnrh3078977; Thu, 22 Nov 2018 19:49:53 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAMJnrm0078975; Thu, 22 Nov 2018 19:49:53 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201811221949.wAMJnrm0078975@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Thu, 22 Nov 2018 19:49:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340774 - in head/sys/netinet: . tcp_stacks X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: in head/sys/netinet: . tcp_stacks X-SVN-Commit-Revision: 340774 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A8B8D83589 X-Spamd-Result: default: False [1.32 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.42)[0.420,0]; NEURAL_SPAM_MEDIUM(0.74)[0.738,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.16)[0.158,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Nov 2018 19:49:54 -0000 Author: tuexen Date: Thu Nov 22 19:49:52 2018 New Revision: 340774 URL: https://svnweb.freebsd.org/changeset/base/340774 Log: Ensure that TCP RST-segments announce consistently a receiver window of zero. This was already done when sending them via tcp_respond(). Reviewed by: rrs@ MFC after: 1 week Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D17949 Modified: head/sys/netinet/tcp_output.c head/sys/netinet/tcp_stacks/rack.c Modified: head/sys/netinet/tcp_output.c ============================================================================== --- head/sys/netinet/tcp_output.c Thu Nov 22 18:59:05 2018 (r340773) +++ head/sys/netinet/tcp_output.c Thu Nov 22 19:49:52 2018 (r340774) @@ -1172,14 +1172,18 @@ send: /* * Calculate receive window. Don't shrink window, * but avoid silly window syndrome. + * If a RST segment is sent, advertise a window of zero. */ - if (recwin < (so->so_rcv.sb_hiwat / 4) && - recwin < tp->t_maxseg) + if (flags & TH_RST) { recwin = 0; - if (SEQ_GT(tp->rcv_adv, tp->rcv_nxt) && - recwin < (tp->rcv_adv - tp->rcv_nxt)) - recwin = (tp->rcv_adv - tp->rcv_nxt); - + } else { + if (recwin < (so->so_rcv.sb_hiwat / 4) && + recwin < tp->t_maxseg) + recwin = 0; + if (SEQ_GT(tp->rcv_adv, tp->rcv_nxt) && + recwin < (tp->rcv_adv - tp->rcv_nxt)) + recwin = (tp->rcv_adv - tp->rcv_nxt); + } /* * According to RFC1323 the window field in a SYN (i.e., a * or ) segment itself is never scaled. The Modified: head/sys/netinet/tcp_stacks/rack.c ============================================================================== --- head/sys/netinet/tcp_stacks/rack.c Thu Nov 22 18:59:05 2018 (r340773) +++ head/sys/netinet/tcp_stacks/rack.c Thu Nov 22 19:49:52 2018 (r340774) @@ -8189,15 +8189,20 @@ send: /* * Calculate receive window. Don't shrink window, but avoid silly * window syndrome. + * If a RST segment is sent, advertise a window of zero. */ - if (recwin < (long)(so->so_rcv.sb_hiwat / 4) && - recwin < (long)tp->t_maxseg) + if (flags & TH_RST) { recwin = 0; - if (SEQ_GT(tp->rcv_adv, tp->rcv_nxt) && - recwin < (long)(tp->rcv_adv - tp->rcv_nxt)) - recwin = (long)(tp->rcv_adv - tp->rcv_nxt); - if (recwin > (long)TCP_MAXWIN << tp->rcv_scale) - recwin = (long)TCP_MAXWIN << tp->rcv_scale; + } else { + if (recwin < (long)(so->so_rcv.sb_hiwat / 4) && + recwin < (long)tp->t_maxseg) + recwin = 0; + if (SEQ_GT(tp->rcv_adv, tp->rcv_nxt) && + recwin < (long)(tp->rcv_adv - tp->rcv_nxt)) + recwin = (long)(tp->rcv_adv - tp->rcv_nxt); + if (recwin > (long)TCP_MAXWIN << tp->rcv_scale) + recwin = (long)TCP_MAXWIN << tp->rcv_scale; + } /* * According to RFC1323 the window field in a SYN (i.e., a or From owner-svn-src-all@freebsd.org Thu Nov 22 19:56:51 2018 Return-Path: Delivered-To: svn-src-all@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 33D2711056B0; Thu, 22 Nov 2018 19:56:51 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CC9C383BA9; Thu, 22 Nov 2018 19:56:50 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AD9551464A; Thu, 22 Nov 2018 19:56:50 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAMJuoHg083752; Thu, 22 Nov 2018 19:56:50 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAMJuoE8083751; Thu, 22 Nov 2018 19:56:50 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201811221956.wAMJuoE8083751@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Thu, 22 Nov 2018 19:56:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r340775 - stable/12/sys/netpfil/pf X-SVN-Group: stable-12 X-SVN-Commit-Author: kp X-SVN-Commit-Paths: stable/12/sys/netpfil/pf X-SVN-Commit-Revision: 340775 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: CC9C383BA9 X-Spamd-Result: default: False [1.06 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.03)[-0.027,0]; NEURAL_SPAM_LONG(0.39)[0.387,0]; NEURAL_SPAM_MEDIUM(0.70)[0.699,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Nov 2018 19:56:51 -0000 Author: kp Date: Thu Nov 22 19:56:50 2018 New Revision: 340775 URL: https://svnweb.freebsd.org/changeset/base/340775 Log: MFC r340265: pf: Prevent tables referenced by rules in anchors from getting disabled. PR: 183198 Obtained from: OpenBSD Modified: stable/12/sys/netpfil/pf/pf_table.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/netpfil/pf/pf_table.c ============================================================================== --- stable/12/sys/netpfil/pf/pf_table.c Thu Nov 22 19:49:52 2018 (r340774) +++ stable/12/sys/netpfil/pf/pf_table.c Thu Nov 22 19:56:50 2018 (r340775) @@ -1754,6 +1754,7 @@ pfr_setflags_ktable(struct pfr_ktable *kt, int newf) PF_RULES_WASSERT(); if (!(newf & PFR_TFLAG_REFERENCED) && + !(newf & PFR_TFLAG_REFDANCHOR) && !(newf & PFR_TFLAG_PERSIST)) newf &= ~PFR_TFLAG_ACTIVE; if (!(newf & PFR_TFLAG_ACTIVE)) From owner-svn-src-all@freebsd.org Thu Nov 22 19:56:52 2018 Return-Path: Delivered-To: svn-src-all@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 B92DA11056BD; Thu, 22 Nov 2018 19:56:52 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5FD9083BAF; Thu, 22 Nov 2018 19:56:52 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 421861464C; Thu, 22 Nov 2018 19:56:52 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAMJuqG4083817; Thu, 22 Nov 2018 19:56:52 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAMJuqmB083816; Thu, 22 Nov 2018 19:56:52 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201811221956.wAMJuqmB083816@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Thu, 22 Nov 2018 19:56:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r340776 - stable/11/sys/netpfil/pf X-SVN-Group: stable-11 X-SVN-Commit-Author: kp X-SVN-Commit-Paths: stable/11/sys/netpfil/pf X-SVN-Commit-Revision: 340776 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 5FD9083BAF X-Spamd-Result: default: False [1.06 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.03)[-0.027,0]; NEURAL_SPAM_LONG(0.39)[0.387,0]; NEURAL_SPAM_MEDIUM(0.70)[0.699,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Nov 2018 19:56:52 -0000 Author: kp Date: Thu Nov 22 19:56:51 2018 New Revision: 340776 URL: https://svnweb.freebsd.org/changeset/base/340776 Log: MFC r340265: pf: Prevent tables referenced by rules in anchors from getting disabled. PR: 183198 Obtained from: OpenBSD Modified: stable/11/sys/netpfil/pf/pf_table.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/netpfil/pf/pf_table.c ============================================================================== --- stable/11/sys/netpfil/pf/pf_table.c Thu Nov 22 19:56:50 2018 (r340775) +++ stable/11/sys/netpfil/pf/pf_table.c Thu Nov 22 19:56:51 2018 (r340776) @@ -1747,6 +1747,7 @@ pfr_setflags_ktable(struct pfr_ktable *kt, int newf) PF_RULES_WASSERT(); if (!(newf & PFR_TFLAG_REFERENCED) && + !(newf & PFR_TFLAG_REFDANCHOR) && !(newf & PFR_TFLAG_PERSIST)) newf &= ~PFR_TFLAG_ACTIVE; if (!(newf & PFR_TFLAG_ACTIVE)) From owner-svn-src-all@freebsd.org Thu Nov 22 19:56:53 2018 Return-Path: Delivered-To: svn-src-all@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 B8C9F11056E0; Thu, 22 Nov 2018 19:56:53 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5E2F183BB7; Thu, 22 Nov 2018 19:56:53 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 40D041464E; Thu, 22 Nov 2018 19:56:53 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAMJurQJ083877; Thu, 22 Nov 2018 19:56:53 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAMJurMK083876; Thu, 22 Nov 2018 19:56:53 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201811221956.wAMJurMK083876@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Thu, 22 Nov 2018 19:56:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340777 - head/sys/netinet/tcp_stacks X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/sys/netinet/tcp_stacks X-SVN-Commit-Revision: 340777 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 5E2F183BB7 X-Spamd-Result: default: False [1.18 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.40)[0.400,0]; NEURAL_SPAM_MEDIUM(0.72)[0.721,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.06)[0.059,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Nov 2018 19:56:53 -0000 Author: tuexen Date: Thu Nov 22 19:56:52 2018 New Revision: 340777 URL: https://svnweb.freebsd.org/changeset/base/340777 Log: Ensure that the default RTT stack can make an RTT measurement if the TCP connection was initiated using the RACK stack, but the peer does not support the TCP RACK extension. This ensures that the TCP behaviour on the wire is the same if the TCP connection is initated using the RACK stack or the default stack. Reviewed by: rrs@ MFC after: 1 week Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D18032 Modified: head/sys/netinet/tcp_stacks/rack.c Modified: head/sys/netinet/tcp_stacks/rack.c ============================================================================== --- head/sys/netinet/tcp_stacks/rack.c Thu Nov 22 19:56:51 2018 (r340776) +++ head/sys/netinet/tcp_stacks/rack.c Thu Nov 22 19:56:52 2018 (r340777) @@ -8493,9 +8493,7 @@ out: pass, rsm); if ((tp->t_flags & TF_FORCEDATA) == 0 || (rack->rc_in_persist == 0)) { -#ifdef NETFLIX_STATS tcp_seq startseq = tp->snd_nxt; -#endif /* * Advance snd_nxt over sequence space of this segment. @@ -8527,6 +8525,17 @@ out: tp->t_acktime = ticks; } tp->snd_max = tp->snd_nxt; + /* + * Time this transmission if not a retransmission and + * not currently timing anything. + * This is only relevant in case of switching back to + * the base stack. + */ + if (tp->t_rtttime == 0) { + tp->t_rtttime = ticks; + tp->t_rtseq = startseq; + TCPSTAT_INC(tcps_segstimed); + } #ifdef NETFLIX_STATS if (!(tp->t_flags & TF_GPUTINPROG) && len) { tp->t_flags |= TF_GPUTINPROG; From owner-svn-src-all@freebsd.org Thu Nov 22 19:59:03 2018 Return-Path: Delivered-To: svn-src-all@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 4B7E61105954; Thu, 22 Nov 2018 19:59:03 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E81F8840CD; Thu, 22 Nov 2018 19:59:02 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C9C5714666; Thu, 22 Nov 2018 19:59:02 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAMJx2AK084034; Thu, 22 Nov 2018 19:59:02 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAMJx2YX084033; Thu, 22 Nov 2018 19:59:02 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201811221959.wAMJx2YX084033@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Thu, 22 Nov 2018 19:59:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r340778 - stable/12/sbin/pfctl X-SVN-Group: stable-12 X-SVN-Commit-Author: kp X-SVN-Commit-Paths: stable/12/sbin/pfctl X-SVN-Commit-Revision: 340778 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E81F8840CD X-Spamd-Result: default: False [1.06 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.03)[-0.027,0]; NEURAL_SPAM_LONG(0.39)[0.387,0]; NEURAL_SPAM_MEDIUM(0.70)[0.699,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Nov 2018 19:59:03 -0000 Author: kp Date: Thu Nov 22 19:59:02 2018 New Revision: 340778 URL: https://svnweb.freebsd.org/changeset/base/340778 Log: MFC r340264: pfctl: Populate ifname in ifa_lookup() pfctl_adjust_skip_ifaces() relies on this name. Modified: stable/12/sbin/pfctl/pfctl_parser.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sbin/pfctl/pfctl_parser.c ============================================================================== --- stable/12/sbin/pfctl/pfctl_parser.c Thu Nov 22 19:56:52 2018 (r340777) +++ stable/12/sbin/pfctl/pfctl_parser.c Thu Nov 22 19:59:02 2018 (r340778) @@ -1400,6 +1400,7 @@ ifa_lookup(const char *ifa_name, int flags) set_ipmask(n, 128); } n->ifindex = p->ifindex; + n->ifname = strdup(p->ifname); n->next = NULL; n->tail = n; From owner-svn-src-all@freebsd.org Thu Nov 22 19:59:05 2018 Return-Path: Delivered-To: svn-src-all@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 0C098110597A; Thu, 22 Nov 2018 19:59:05 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A462D840D2; Thu, 22 Nov 2018 19:59:04 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 857E814667; Thu, 22 Nov 2018 19:59:04 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAMJx4RY084083; Thu, 22 Nov 2018 19:59:04 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAMJx4QP084082; Thu, 22 Nov 2018 19:59:04 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201811221959.wAMJx4QP084082@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Thu, 22 Nov 2018 19:59:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r340779 - stable/11/sbin/pfctl X-SVN-Group: stable-11 X-SVN-Commit-Author: kp X-SVN-Commit-Paths: stable/11/sbin/pfctl X-SVN-Commit-Revision: 340779 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A462D840D2 X-Spamd-Result: default: False [1.06 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.03)[-0.027,0]; NEURAL_SPAM_LONG(0.39)[0.387,0]; NEURAL_SPAM_MEDIUM(0.70)[0.699,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Nov 2018 19:59:05 -0000 Author: kp Date: Thu Nov 22 19:59:04 2018 New Revision: 340779 URL: https://svnweb.freebsd.org/changeset/base/340779 Log: MFC r340264: pfctl: Populate ifname in ifa_lookup() pfctl_adjust_skip_ifaces() relies on this name. Modified: stable/11/sbin/pfctl/pfctl_parser.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sbin/pfctl/pfctl_parser.c ============================================================================== --- stable/11/sbin/pfctl/pfctl_parser.c Thu Nov 22 19:59:02 2018 (r340778) +++ stable/11/sbin/pfctl/pfctl_parser.c Thu Nov 22 19:59:04 2018 (r340779) @@ -1404,6 +1404,7 @@ ifa_lookup(const char *ifa_name, int flags) set_ipmask(n, 128); } n->ifindex = p->ifindex; + n->ifname = strdup(p->ifname); n->next = NULL; n->tail = n; From owner-svn-src-all@freebsd.org Thu Nov 22 20:00:57 2018 Return-Path: Delivered-To: svn-src-all@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 A09C11105C09; Thu, 22 Nov 2018 20:00:57 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3443084647; Thu, 22 Nov 2018 20:00:57 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 16DE714783; Thu, 22 Nov 2018 20:00:57 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAMK0uIa085192; Thu, 22 Nov 2018 20:00:56 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAMK0urW085183; Thu, 22 Nov 2018 20:00:56 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201811222000.wAMK0urW085183@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Thu, 22 Nov 2018 20:00:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r340780 - stable/12/tests/sys/netpfil/pf X-SVN-Group: stable-12 X-SVN-Commit-Author: kp X-SVN-Commit-Paths: stable/12/tests/sys/netpfil/pf X-SVN-Commit-Revision: 340780 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 3443084647 X-Spamd-Result: default: False [1.06 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.03)[-0.027,0]; NEURAL_SPAM_LONG(0.39)[0.387,0]; NEURAL_SPAM_MEDIUM(0.70)[0.699,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Nov 2018 20:00:57 -0000 Author: kp Date: Thu Nov 22 20:00:56 2018 New Revision: 340780 URL: https://svnweb.freebsd.org/changeset/base/340780 Log: MFC r340266: pf tests: Test PR 183198 Create a table which is only used inside an anchor, ensure that the table exists. PR: 183198 Added: stable/12/tests/sys/netpfil/pf/anchor.sh - copied unchanged from r340266, head/tests/sys/netpfil/pf/anchor.sh Modified: stable/12/tests/sys/netpfil/pf/Makefile Directory Properties: stable/12/ (props changed) Modified: stable/12/tests/sys/netpfil/pf/Makefile ============================================================================== --- stable/12/tests/sys/netpfil/pf/Makefile Thu Nov 22 19:59:04 2018 (r340779) +++ stable/12/tests/sys/netpfil/pf/Makefile Thu Nov 22 20:00:56 2018 (r340780) @@ -5,7 +5,8 @@ PACKAGE= tests TESTSDIR= ${TESTSBASE}/sys/netpfil/pf TESTS_SUBDIRS+= ioctl -ATF_TESTS_SH+= pass_block \ +ATF_TESTS_SH+= anchor \ + pass_block \ forward \ fragmentation \ set_tos \ Copied: stable/12/tests/sys/netpfil/pf/anchor.sh (from r340266, head/tests/sys/netpfil/pf/anchor.sh) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/12/tests/sys/netpfil/pf/anchor.sh Thu Nov 22 20:00:56 2018 (r340780, copy of r340266, head/tests/sys/netpfil/pf/anchor.sh) @@ -0,0 +1,40 @@ +# $FreeBSD$ + +. $(atf_get_srcdir)/utils.subr + +atf_test_case "pr183198" "cleanup" +pr183198_head() +{ + atf_set descr 'Test tables referenced by rules in anchors' + atf_set require.user root +} + +pr183198_body() +{ + pft_init + + epair=$(pft_mkepair) + pft_mkjail alcatraz ${epair}b + jexec alcatraz pfctl -e + + # Forward with pf enabled + pft_set_rules alcatraz \ + "table { 10.0.0.1, 10.0.0.2, 10.0.0.3 }" \ + "block in" \ + "anchor \"epair\" on ${epair}b { \n\ + pass in from \n\ + }" + + atf_check -s exit:0 -o ignore jexec alcatraz pfctl -sr -a '*' + atf_check -s exit:0 -o ignore jexec alcatraz pfctl -t test -T show +} + +pr183198_cleanup() +{ + pft_cleanup +} + +atf_init_test_cases() +{ + atf_add_test_case "pr183198" +} From owner-svn-src-all@freebsd.org Thu Nov 22 20:02:40 2018 Return-Path: Delivered-To: svn-src-all@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 5E6F11105EAD; Thu, 22 Nov 2018 20:02:40 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 004F984936; Thu, 22 Nov 2018 20:02:40 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CD995147FA; Thu, 22 Nov 2018 20:02:39 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAMK2dK3088968; Thu, 22 Nov 2018 20:02:39 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAMK2dlM088967; Thu, 22 Nov 2018 20:02:39 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201811222002.wAMK2dlM088967@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Thu, 22 Nov 2018 20:02:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340781 - head/sys/netinet/tcp_stacks X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/sys/netinet/tcp_stacks X-SVN-Commit-Revision: 340781 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 004F984936 X-Spamd-Result: default: False [1.18 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.40)[0.400,0]; NEURAL_SPAM_SHORT(0.06)[0.059,0]; NEURAL_SPAM_MEDIUM(0.72)[0.721,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Nov 2018 20:02:40 -0000 Author: tuexen Date: Thu Nov 22 20:02:39 2018 New Revision: 340781 URL: https://svnweb.freebsd.org/changeset/base/340781 Log: Ensure that the TCP RACK stack honours the setting of the net.inet.tcp.drop_synfin sysctl-variable. Reviewed by: rrs@ MFC after: 1 week Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D18033 Modified: head/sys/netinet/tcp_stacks/rack.c Modified: head/sys/netinet/tcp_stacks/rack.c ============================================================================== --- head/sys/netinet/tcp_stacks/rack.c Thu Nov 22 20:00:56 2018 (r340780) +++ head/sys/netinet/tcp_stacks/rack.c Thu Nov 22 20:02:39 2018 (r340781) @@ -6528,6 +6528,10 @@ rack_hpts_do_segment(struct mbuf *m, struct tcphdr *th TCP_LOG_EVENT(tp, th, &so->so_rcv, &so->so_snd, TCP_LOG_IN, 0, tlen, &log, true); } + if ((thflags & TH_SYN) && (thflags & TH_FIN) && V_drop_synfin) { + way_out = 4; + goto done_with_input; + } /* * Segment received on connection. Reset idle time and keep-alive * timer. XXX: This should be done after segment validation to From owner-svn-src-all@freebsd.org Thu Nov 22 20:05:58 2018 Return-Path: Delivered-To: svn-src-all@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 2D03B1106075; Thu, 22 Nov 2018 20:05:58 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A9CBC84B66; Thu, 22 Nov 2018 20:05:57 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8508E14826; Thu, 22 Nov 2018 20:05:57 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAMK5vTI089165; Thu, 22 Nov 2018 20:05:57 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAMK5vGu089164; Thu, 22 Nov 2018 20:05:57 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201811222005.wAMK5vGu089164@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Thu, 22 Nov 2018 20:05:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340782 - head/sys/netinet/tcp_stacks X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/sys/netinet/tcp_stacks X-SVN-Commit-Revision: 340782 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A9CBC84B66 X-Spamd-Result: default: False [1.18 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.40)[0.400,0]; NEURAL_SPAM_MEDIUM(0.72)[0.721,0]; NEURAL_SPAM_SHORT(0.06)[0.059,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Nov 2018 20:05:58 -0000 Author: tuexen Date: Thu Nov 22 20:05:57 2018 New Revision: 340782 URL: https://svnweb.freebsd.org/changeset/base/340782 Log: A TCP stack is required to check SEG.ACK first, when processing a segment in the SYN-SENT state as stated in Section 3.9 of RFC 793, page 66. Ensure this is also done by the TCP RACK stack. Reviewed by: rrs@ MFC after: 1 week Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D18034 Modified: head/sys/netinet/tcp_stacks/rack.c Modified: head/sys/netinet/tcp_stacks/rack.c ============================================================================== --- head/sys/netinet/tcp_stacks/rack.c Thu Nov 22 20:02:39 2018 (r340781) +++ head/sys/netinet/tcp_stacks/rack.c Thu Nov 22 20:05:57 2018 (r340782) @@ -6533,6 +6533,15 @@ rack_hpts_do_segment(struct mbuf *m, struct tcphdr *th goto done_with_input; } /* + * If a segment with the ACK-bit set arrives in the SYN-SENT state + * check SEQ.ACK first as described on page 66 of RFC 793, section 3.9. + */ + if ((tp->t_state == TCPS_SYN_SENT) && (thflags & TH_ACK) && + (SEQ_LEQ(th->th_ack, tp->iss) || SEQ_GT(th->th_ack, tp->snd_max))) { + rack_do_dropwithreset(m, tp, th, BANDLIM_RST_OPENPORT, tlen); + return; + } + /* * Segment received on connection. Reset idle time and keep-alive * timer. XXX: This should be done after segment validation to * ignore broken/spoofed segs. From owner-svn-src-all@freebsd.org Thu Nov 22 20:49:44 2018 Return-Path: Delivered-To: svn-src-all@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 31CDC11074ED; Thu, 22 Nov 2018 20:49:44 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.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 CDC8486D5A; Thu, 22 Nov 2018 20:49:43 +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 AEEBC14F17; Thu, 22 Nov 2018 20:49:43 +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 wAMKnh7M014586; Thu, 22 Nov 2018 20:49:43 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAMKnf99014576; Thu, 22 Nov 2018 20:49:41 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201811222049.wAMKnf99014576@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 22 Nov 2018 20:49:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340783 - in head/sys: kern netinet netinet6 ofed/drivers/infiniband/ulp/sdp X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in head/sys: kern netinet netinet6 ofed/drivers/infiniband/ulp/sdp X-SVN-Commit-Revision: 340783 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: CDC8486D5A X-Spamd-Result: default: False [1.21 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.06)[0.056,0]; NEURAL_SPAM_MEDIUM(0.74)[0.738,0]; NEURAL_SPAM_LONG(0.42)[0.420,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Nov 2018 20:49:44 -0000 Author: markj Date: Thu Nov 22 20:49:41 2018 New Revision: 340783 URL: https://svnweb.freebsd.org/changeset/base/340783 Log: Plug some networking sysctl leaks. Various network protocol sysctl handlers were not zero-filling their output buffers and thus would export uninitialized stack memory to userland. Fix a number of such handlers. Reported by: Thomas Barabosch, Fraunhofer FKIE Reviewed by: tuexen MFC after: 3 days Security: kernel memory disclosure Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D18301 Modified: head/sys/kern/uipc_socket.c head/sys/kern/uipc_usrreq.c head/sys/netinet/in_pcb.c head/sys/netinet/ip_divert.c head/sys/netinet/raw_ip.c head/sys/netinet/sctp_sysctl.c head/sys/netinet/tcp_subr.c head/sys/netinet/udp_usrreq.c head/sys/netinet6/ip6_mroute.c head/sys/ofed/drivers/infiniband/ulp/sdp/sdp_main.c Modified: head/sys/kern/uipc_socket.c ============================================================================== --- head/sys/kern/uipc_socket.c Thu Nov 22 20:05:57 2018 (r340782) +++ head/sys/kern/uipc_socket.c Thu Nov 22 20:49:41 2018 (r340783) @@ -4007,6 +4007,7 @@ void sotoxsocket(struct socket *so, struct xsocket *xso) { + bzero(xso, sizeof(*xso)); xso->xso_len = sizeof *xso; xso->xso_so = (uintptr_t)so; xso->so_type = so->so_type; @@ -4025,8 +4026,6 @@ sotoxsocket(struct socket *so, struct xsocket *xso) xso->so_incqlen = so->sol_incqlen; xso->so_qlimit = so->sol_qlimit; xso->so_oobmark = 0; - bzero(&xso->so_snd, sizeof(xso->so_snd)); - bzero(&xso->so_rcv, sizeof(xso->so_rcv)); } else { xso->so_state |= so->so_qstate; xso->so_qlen = xso->so_incqlen = xso->so_qlimit = 0; Modified: head/sys/kern/uipc_usrreq.c ============================================================================== --- head/sys/kern/uipc_usrreq.c Thu Nov 22 20:05:57 2018 (r340782) +++ head/sys/kern/uipc_usrreq.c Thu Nov 22 20:49:41 2018 (r340783) @@ -1809,7 +1809,7 @@ unp_pcblist(SYSCTL_HANDLER_ARGS) /* * OK, now we're committed to doing something. */ - xug = malloc(sizeof(*xug), M_TEMP, M_WAITOK); + xug = malloc(sizeof(*xug), M_TEMP, M_WAITOK | M_ZERO); UNP_LINK_RLOCK(); gencnt = unp_gencnt; n = unp_count; Modified: head/sys/netinet/in_pcb.c ============================================================================== --- head/sys/netinet/in_pcb.c Thu Nov 22 20:05:57 2018 (r340782) +++ head/sys/netinet/in_pcb.c Thu Nov 22 20:49:41 2018 (r340783) @@ -2883,11 +2883,10 @@ void in_pcbtoxinpcb(const struct inpcb *inp, struct xinpcb *xi) { + bzero(xi, sizeof(*xi)); xi->xi_len = sizeof(struct xinpcb); if (inp->inp_socket) sotoxsocket(inp->inp_socket, &xi->xi_socket); - else - bzero(&xi->xi_socket, sizeof(struct xsocket)); bcopy(&inp->inp_inc, &xi->inp_inc, sizeof(struct in_conninfo)); xi->inp_gencnt = inp->inp_gencnt; xi->inp_ppcb = (uintptr_t)inp->inp_ppcb; Modified: head/sys/netinet/ip_divert.c ============================================================================== --- head/sys/netinet/ip_divert.c Thu Nov 22 20:05:57 2018 (r340782) +++ head/sys/netinet/ip_divert.c Thu Nov 22 20:49:41 2018 (r340783) @@ -664,6 +664,7 @@ div_pcblist(SYSCTL_HANDLER_ARGS) if (error != 0) return (error); + bzero(&xig, sizeof(xig)); xig.xig_len = sizeof xig; xig.xig_count = n; xig.xig_gen = gencnt; Modified: head/sys/netinet/raw_ip.c ============================================================================== --- head/sys/netinet/raw_ip.c Thu Nov 22 20:05:57 2018 (r340782) +++ head/sys/netinet/raw_ip.c Thu Nov 22 20:49:41 2018 (r340783) @@ -1060,6 +1060,7 @@ rip_pcblist(SYSCTL_HANDLER_ARGS) n = V_ripcbinfo.ipi_count; INP_INFO_WUNLOCK(&V_ripcbinfo); + bzero(&xig, sizeof(xig)); xig.xig_len = sizeof xig; xig.xig_count = n; xig.xig_gen = gencnt; Modified: head/sys/netinet/sctp_sysctl.c ============================================================================== --- head/sys/netinet/sctp_sysctl.c Thu Nov 22 20:05:57 2018 (r340782) +++ head/sys/netinet/sctp_sysctl.c Thu Nov 22 20:49:41 2018 (r340783) @@ -395,6 +395,9 @@ sctp_sysctl_handle_assoclist(SYSCTL_HANDLER_ARGS) SCTP_LTRACE_ERR_RET(NULL, NULL, NULL, SCTP_FROM_SCTP_SYSCTL, EPERM); return (EPERM); } + memset(&xinpcb, 0, sizeof(xinpcb)); + memset(&xstcb, 0, sizeof(xstcb)); + memset(&xraddr, 0, sizeof(xraddr)); LIST_FOREACH(inp, &SCTP_BASE_INFO(listhead), sctp_list) { SCTP_INP_RLOCK(inp); if (inp->sctp_flags & SCTP_PCB_FLAGS_SOCKET_ALLGONE) { Modified: head/sys/netinet/tcp_subr.c ============================================================================== --- head/sys/netinet/tcp_subr.c Thu Nov 22 20:05:57 2018 (r340782) +++ head/sys/netinet/tcp_subr.c Thu Nov 22 20:49:41 2018 (r340783) @@ -556,6 +556,7 @@ sysctl_net_inet_list_func_info(SYSCTL_HANDLER_ARGS) cnt++; #endif if (req->oldptr != NULL) { + bzero(&tfi, sizeof(tfi)); tfi.tfi_refcnt = f->tf_fb->tfb_refcnt; tfi.tfi_id = f->tf_fb->tfb_id; (void)strncpy(tfi.tfi_alias, f->tf_name, @@ -2154,6 +2155,7 @@ tcp_pcblist(SYSCTL_HANDLER_ARGS) if (error != 0) return (error); + bzero(&xig, sizeof(xig)); xig.xig_len = sizeof xig; xig.xig_count = n + m; xig.xig_gen = gencnt; @@ -3215,8 +3217,8 @@ tcp_inptoxtp(const struct inpcb *inp, struct xtcpcb *x struct tcpcb *tp = intotcpcb(inp); sbintime_t now; + bzero(xt, sizeof(*xt)); if (inp->inp_flags & INP_TIMEWAIT) { - bzero(xt, sizeof(struct xtcpcb)); xt->t_state = TCPS_TIME_WAIT; } else { xt->t_state = tp->t_state; @@ -3244,7 +3246,6 @@ tcp_inptoxtp(const struct inpcb *inp, struct xtcpcb *x bcopy(tp->t_fb->tfb_tcp_block_name, xt->xt_stack, TCP_FUNCTION_NAME_LEN_MAX); - bzero(xt->xt_logid, TCP_LOG_ID_LEN); #ifdef TCP_BLACKBOX (void)tcp_log_get_id(tp, xt->xt_logid); #endif Modified: head/sys/netinet/udp_usrreq.c ============================================================================== --- head/sys/netinet/udp_usrreq.c Thu Nov 22 20:05:57 2018 (r340782) +++ head/sys/netinet/udp_usrreq.c Thu Nov 22 20:49:41 2018 (r340783) @@ -887,6 +887,7 @@ udp_pcblist(SYSCTL_HANDLER_ARGS) if (error != 0) return (error); + bzero(&xig, sizeof(xig)); xig.xig_len = sizeof xig; xig.xig_count = n; xig.xig_gen = gencnt; Modified: head/sys/netinet6/ip6_mroute.c ============================================================================== --- head/sys/netinet6/ip6_mroute.c Thu Nov 22 20:05:57 2018 (r340782) +++ head/sys/netinet6/ip6_mroute.c Thu Nov 22 20:49:41 2018 (r340783) @@ -203,7 +203,8 @@ sysctl_mif6table(SYSCTL_HANDLER_ARGS) struct mif6_sctl *out; int error; - out = malloc(sizeof(struct mif6_sctl) * MAXMIFS, M_TEMP, M_WAITOK); + out = malloc(sizeof(struct mif6_sctl) * MAXMIFS, M_TEMP, + M_WAITOK | M_ZERO); for (int i = 0; i < MAXMIFS; i++) { out[i].m6_flags = mif6table[i].m6_flags; out[i].m6_rate_limit = mif6table[i].m6_rate_limit; Modified: head/sys/ofed/drivers/infiniband/ulp/sdp/sdp_main.c ============================================================================== --- head/sys/ofed/drivers/infiniband/ulp/sdp/sdp_main.c Thu Nov 22 20:05:57 2018 (r340782) +++ head/sys/ofed/drivers/infiniband/ulp/sdp/sdp_main.c Thu Nov 22 20:49:41 2018 (r340783) @@ -1810,6 +1810,7 @@ sdp_pcblist(SYSCTL_HANDLER_ARGS) if (error != 0) return (error); + bzero(&xig, sizeof(xig)); xig.xig_len = sizeof xig; xig.xig_count = n; xig.xig_gen = 0; From owner-svn-src-all@freebsd.org Thu Nov 22 21:08:39 2018 Return-Path: Delivered-To: svn-src-all@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 5FB581107E9E; Thu, 22 Nov 2018 21:08:39 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EC74769BD1; Thu, 22 Nov 2018 21:08:38 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B14771526C; Thu, 22 Nov 2018 21:08:38 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAML8cSS024703; Thu, 22 Nov 2018 21:08:38 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAML8cnG024699; Thu, 22 Nov 2018 21:08:38 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201811222108.wAML8cnG024699@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Thu, 22 Nov 2018 21:08:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340784 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 340784 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: EC74769BD1 X-Spamd-Result: default: False [1.49 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.33)[0.332,0]; NEURAL_SPAM_MEDIUM(0.74)[0.738,0]; NEURAL_SPAM_LONG(0.42)[0.420,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Nov 2018 21:08:39 -0000 Author: mjg Date: Thu Nov 22 21:08:37 2018 New Revision: 340784 URL: https://svnweb.freebsd.org/changeset/base/340784 Log: fork: fix use-after-free with vfork The pointer to the child is stored without any reference held. Then it is blindly used to wait until P_PPWAIT is cleared. However, if the child is autoreaped it could have exited and get freed before the parent started waiting. Use the existing hold mechanism to mitigate the problem. Most common case of doing exec remains unchanged. The corner case of doing exit performs wake up before waiting for holds to clear. Reviewed by: kib Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D18295 Modified: head/sys/kern/kern_exit.c head/sys/kern/kern_fork.c head/sys/kern/subr_syscall.c Modified: head/sys/kern/kern_exit.c ============================================================================== --- head/sys/kern/kern_exit.c Thu Nov 22 20:49:41 2018 (r340783) +++ head/sys/kern/kern_exit.c Thu Nov 22 21:08:37 2018 (r340784) @@ -285,6 +285,15 @@ exit1(struct thread *td, int rval, int signo) wakeup(&p->p_stype); /* + * If P_PPWAIT is set our parent holds us with p_lock and may + * be waiting on p_pwait. + */ + if (p->p_flag & P_PPWAIT) { + p->p_flag &= ~P_PPWAIT; + cv_broadcast(&p->p_pwait); + } + + /* * Wait for any processes that have a hold on our vmspace to * release their reference. */ @@ -329,13 +338,9 @@ exit1(struct thread *td, int rval, int signo) */ EVENTHANDLER_DIRECT_INVOKE(process_exit, p); - /* - * If parent is waiting for us to exit or exec, - * P_PPWAIT is set; we will wakeup the parent below. - */ PROC_LOCK(p); stopprofclock(p); - p->p_flag &= ~(P_TRACED | P_PPWAIT | P_PPTRACE); + p->p_flag &= ~(P_TRACED | P_PPTRACE); p->p_ptevents = 0; /* @@ -636,7 +641,6 @@ exit1(struct thread *td, int rval, int signo) * proc lock. */ wakeup(p->p_pptr); - cv_broadcast(&p->p_pwait); sched_exit(p->p_pptr, td); PROC_SLOCK(p); p->p_state = PRS_ZOMBIE; Modified: head/sys/kern/kern_fork.c ============================================================================== --- head/sys/kern/kern_fork.c Thu Nov 22 20:49:41 2018 (r340783) +++ head/sys/kern/kern_fork.c Thu Nov 22 21:08:37 2018 (r340784) @@ -725,6 +725,7 @@ do_fork(struct thread *td, struct fork_req *fr, struct */ _PHOLD(p2); if (fr->fr_flags & RFPPWAIT) { + _PHOLD(p2); td->td_pflags |= TDP_RFPPWAIT; td->td_rfppwait_p = p2; td->td_dbgflags |= TDB_VFORK; Modified: head/sys/kern/subr_syscall.c ============================================================================== --- head/sys/kern/subr_syscall.c Thu Nov 22 20:49:41 2018 (r340783) +++ head/sys/kern/subr_syscall.c Thu Nov 22 21:08:37 2018 (r340784) @@ -257,6 +257,7 @@ again: } cv_timedwait(&p2->p_pwait, &p2->p_mtx, hz); } + _PRELE(p2); PROC_UNLOCK(p2); if (td->td_dbgflags & TDB_VFORK) { From owner-svn-src-all@freebsd.org Thu Nov 22 21:29:37 2018 Return-Path: Delivered-To: svn-src-all@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 4BEE51108579; Thu, 22 Nov 2018 21:29:37 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.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 E2E816A58D; Thu, 22 Nov 2018 21:29:36 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BE90B155A6; Thu, 22 Nov 2018 21:29:36 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAMLTa0t035032; Thu, 22 Nov 2018 21:29:36 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAMLTap8035031; Thu, 22 Nov 2018 21:29:36 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201811222129.wAMLTap8035031@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Thu, 22 Nov 2018 21:29:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340785 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 340785 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E2E816A58D X-Spamd-Result: default: False [1.45 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.40)[0.400,0]; NEURAL_SPAM_MEDIUM(0.72)[0.721,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.33)[0.330,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Nov 2018 21:29:37 -0000 Author: mjg Date: Thu Nov 22 21:29:36 2018 New Revision: 340785 URL: https://svnweb.freebsd.org/changeset/base/340785 Log: fork: remove avoidable proc lock/unlock pair We don't have to access the process after making it runnable, so there is no need to hold it either. Sponsored by: The FreeBSD Foundation Modified: head/sys/kern/kern_fork.c head/sys/kern/kern_racct.c Modified: head/sys/kern/kern_fork.c ============================================================================== --- head/sys/kern/kern_fork.c Thu Nov 22 21:08:37 2018 (r340784) +++ head/sys/kern/kern_fork.c Thu Nov 22 21:29:36 2018 (r340785) @@ -719,11 +719,6 @@ do_fork(struct thread *td, struct fork_req *fr, struct if ((fr->fr_flags & RFMEM) == 0 && dtrace_fasttrap_fork) dtrace_fasttrap_fork(p1, p2); #endif - /* - * Hold the process so that it cannot exit after we make it runnable, - * but before we wait for the debugger. - */ - _PHOLD(p2); if (fr->fr_flags & RFPPWAIT) { _PHOLD(p2); td->td_pflags |= TDP_RFPPWAIT; @@ -783,8 +778,12 @@ do_fork(struct thread *td, struct fork_req *fr, struct PROC_UNLOCK(p2); sx_xunlock(&proctree_lock); } - + + racct_proc_fork_done(p2); + if ((fr->fr_flags & RFSTOPPED) == 0) { + if (fr->fr_pidp != NULL) + *fr->fr_pidp = p2->p_pid; /* * If RFSTOPPED not requested, make child runnable and * add to run queue. @@ -793,16 +792,9 @@ do_fork(struct thread *td, struct fork_req *fr, struct TD_SET_CAN_RUN(td2); sched_add(td2, SRQ_BORING); thread_unlock(td2); - if (fr->fr_pidp != NULL) - *fr->fr_pidp = p2->p_pid; } else { *fr->fr_procp = p2; } - - PROC_LOCK(p2); - _PRELE(p2); - racct_proc_fork_done(p2); - PROC_UNLOCK(p2); } int Modified: head/sys/kern/kern_racct.c ============================================================================== --- head/sys/kern/kern_racct.c Thu Nov 22 21:08:37 2018 (r340784) +++ head/sys/kern/kern_racct.c Thu Nov 22 21:29:36 2018 (r340785) @@ -967,13 +967,13 @@ racct_proc_fork_done(struct proc *child) if (!racct_enable) return; - PROC_LOCK_ASSERT(child, MA_OWNED); - #ifdef RCTL + PROC_LOCK(child); RACCT_LOCK(); rctl_enforce(child, RACCT_NPROC, 0); rctl_enforce(child, RACCT_NTHR, 0); RACCT_UNLOCK(); + PROC_UNLOCK(child); #endif } From owner-svn-src-all@freebsd.org Thu Nov 22 21:38:25 2018 Return-Path: Delivered-To: svn-src-all@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 314DA11087CF; Thu, 22 Nov 2018 21:38:25 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C47D86A991; Thu, 22 Nov 2018 21:38:24 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 99AEB15736; Thu, 22 Nov 2018 21:38:24 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAMLcOVB039890; Thu, 22 Nov 2018 21:38:24 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAMLcOtw039889; Thu, 22 Nov 2018 21:38:24 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201811222138.wAMLcOtw039889@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Thu, 22 Nov 2018 21:38:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340786 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 340786 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C47D86A991 X-Spamd-Result: default: False [1.45 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.40)[0.400,0]; NEURAL_SPAM_SHORT(0.33)[0.330,0]; NEURAL_SPAM_MEDIUM(0.72)[0.721,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Nov 2018 21:38:25 -0000 Author: mjg Date: Thu Nov 22 21:38:24 2018 New Revision: 340786 URL: https://svnweb.freebsd.org/changeset/base/340786 Log: Annotate TDP_RFPPWAIT as unlikely. The flag is only set on vfork, but is tested for *all* syscalls. On amd64 this shortens common-case (not vfork) code. Modified: head/sys/kern/subr_syscall.c Modified: head/sys/kern/subr_syscall.c ============================================================================== --- head/sys/kern/subr_syscall.c Thu Nov 22 21:29:36 2018 (r340785) +++ head/sys/kern/subr_syscall.c Thu Nov 22 21:38:24 2018 (r340786) @@ -230,7 +230,7 @@ syscallret(struct thread *td, int error) PROC_UNLOCK(p); } - if (td->td_pflags & TDP_RFPPWAIT) { + if (__predict_false(td->td_pflags & TDP_RFPPWAIT)) { /* * Preserve synchronization semantics of vfork. If * waiting for child to exec or exit, fork set From owner-svn-src-all@freebsd.org Fri Nov 23 00:17:48 2018 Return-Path: Delivered-To: svn-src-all@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 3CE9E1135149; Fri, 23 Nov 2018 00:17:48 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.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 D667A6EBDD; Fri, 23 Nov 2018 00:17:47 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B04EC170F9; Fri, 23 Nov 2018 00:17:47 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAN0HlwH021906; Fri, 23 Nov 2018 00:17:47 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAN0HlAe021905; Fri, 23 Nov 2018 00:17:47 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201811230017.wAN0HlAe021905@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Fri, 23 Nov 2018 00:17:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340787 - head/sys/fs/nfsclient X-SVN-Group: head X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: head/sys/fs/nfsclient X-SVN-Commit-Revision: 340787 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D667A6EBDD X-Spamd-Result: default: False [1.61 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.45)[0.452,0]; NEURAL_SPAM_MEDIUM(0.74)[0.738,0]; NEURAL_SPAM_LONG(0.42)[0.420,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Nov 2018 00:17:48 -0000 Author: rmacklem Date: Fri Nov 23 00:17:47 2018 New Revision: 340787 URL: https://svnweb.freebsd.org/changeset/base/340787 Log: Make sure the NFS readdir client fills in all "struct dirent" data. The NFS client code (nfsrpc_readdir() and nfsrpc_readdirplus()) wasn't filling in parts of the readdir reply, such as d_pad[01] and the bytes at the end of d_name within d_reclen. As such, data left in a buffer cache block could be leaked to userland in the readdir reply. This patch makes sure all of the data is filled in. Reported by: Thomas Barabosch, Fraunhofer FKIE Reviewed by: kib, markj MFC after: 2 weeks Modified: head/sys/fs/nfsclient/nfs_clrpcops.c Modified: head/sys/fs/nfsclient/nfs_clrpcops.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clrpcops.c Thu Nov 22 21:38:24 2018 (r340786) +++ head/sys/fs/nfsclient/nfs_clrpcops.c Fri Nov 23 00:17:47 2018 (r340787) @@ -2959,6 +2959,7 @@ nfsrpc_readdir(vnode_t vp, struct uio *uiop, nfsuint64 return (error); nd->nd_mrep = NULL; dp = (struct dirent *)uio_iov_base(uiop); + dp->d_pad0 = dp->d_pad1 = 0; dp->d_off = 0; dp->d_type = DT_DIR; dp->d_fileno = dotfileid; @@ -2978,6 +2979,7 @@ nfsrpc_readdir(vnode_t vp, struct uio *uiop, nfsuint64 uio_iov_base_add(uiop, dp->d_reclen); uio_iov_len_add(uiop, -(dp->d_reclen)); dp = (struct dirent *)uio_iov_base(uiop); + dp->d_pad0 = dp->d_pad1 = 0; dp->d_off = 0; dp->d_type = DT_DIR; dp->d_fileno = dotdotfileid; @@ -3091,6 +3093,7 @@ nfsrpc_readdir(vnode_t vp, struct uio *uiop, nfsuint64 tlen += 8; /* To ensure null termination. */ left = DIRBLKSIZ - blksiz; if (_GENERIC_DIRLEN(len) + NFSX_HYPER > left) { + NFSBZERO(uio_iov_base(uiop), left); dp->d_reclen += left; uio_iov_base_add(uiop, left); uio_iov_len_add(uiop, -(left)); @@ -3103,6 +3106,7 @@ nfsrpc_readdir(vnode_t vp, struct uio *uiop, nfsuint64 bigenough = 0; if (bigenough) { dp = (struct dirent *)uio_iov_base(uiop); + dp->d_pad0 = dp->d_pad1 = 0; dp->d_off = 0; dp->d_namlen = len; dp->d_reclen = _GENERIC_DIRLEN(len) + @@ -3120,7 +3124,7 @@ nfsrpc_readdir(vnode_t vp, struct uio *uiop, nfsuint64 goto nfsmout; cp = uio_iov_base(uiop); tlen -= len; - *cp = '\0'; /* null terminate */ + NFSBZERO(cp, tlen); cp += tlen; /* points to cookie storage */ tl2 = (u_int32_t *)cp; uio_iov_base_add(uiop, (tlen + NFSX_HYPER)); @@ -3208,6 +3212,7 @@ nfsrpc_readdir(vnode_t vp, struct uio *uiop, nfsuint64 */ if (blksiz > 0) { left = DIRBLKSIZ - blksiz; + NFSBZERO(uio_iov_base(uiop), left); dp->d_reclen += left; uio_iov_base_add(uiop, left); uio_iov_len_add(uiop, -(left)); @@ -3235,10 +3240,8 @@ nfsrpc_readdir(vnode_t vp, struct uio *uiop, nfsuint64 */ while (uio_uio_resid(uiop) > 0 && uio_uio_resid(uiop) != tresid) { dp = (struct dirent *)uio_iov_base(uiop); + NFSBZERO(dp, DIRBLKSIZ); dp->d_type = DT_UNKNOWN; - dp->d_fileno = 0; - dp->d_namlen = 0; - dp->d_name[0] = '\0'; tl = (u_int32_t *)&dp->d_name[4]; *tl++ = cookie.lval[0]; *tl = cookie.lval[1]; @@ -3393,6 +3396,7 @@ nfsrpc_readdirplus(vnode_t vp, struct uio *uiop, nfsui return (error); nd->nd_mrep = NULL; dp = (struct dirent *)uio_iov_base(uiop); + dp->d_pad0 = dp->d_pad1 = 0; dp->d_off = 0; dp->d_type = DT_DIR; dp->d_fileno = dotfileid; @@ -3412,6 +3416,7 @@ nfsrpc_readdirplus(vnode_t vp, struct uio *uiop, nfsui uio_iov_base_add(uiop, dp->d_reclen); uio_iov_len_add(uiop, -(dp->d_reclen)); dp = (struct dirent *)uio_iov_base(uiop); + dp->d_pad0 = dp->d_pad1 = 0; dp->d_off = 0; dp->d_type = DT_DIR; dp->d_fileno = dotdotfileid; @@ -3506,6 +3511,7 @@ nfsrpc_readdirplus(vnode_t vp, struct uio *uiop, nfsui tlen += 8; /* To ensure null termination. */ left = DIRBLKSIZ - blksiz; if (_GENERIC_DIRLEN(len) + NFSX_HYPER > left) { + NFSBZERO(uio_iov_base(uiop), left); dp->d_reclen += left; uio_iov_base_add(uiop, left); uio_iov_len_add(uiop, -(left)); @@ -3518,6 +3524,7 @@ nfsrpc_readdirplus(vnode_t vp, struct uio *uiop, nfsui bigenough = 0; if (bigenough) { dp = (struct dirent *)uio_iov_base(uiop); + dp->d_pad0 = dp->d_pad1 = 0; dp->d_off = 0; dp->d_namlen = len; dp->d_reclen = _GENERIC_DIRLEN(len) + @@ -3538,7 +3545,7 @@ nfsrpc_readdirplus(vnode_t vp, struct uio *uiop, nfsui goto nfsmout; cp = uio_iov_base(uiop); tlen -= len; - *cp = '\0'; + NFSBZERO(cp, tlen); cp += tlen; /* points to cookie storage */ tl2 = (u_int32_t *)cp; if (len == 2 && cnp->cn_nameptr[0] == '.' && @@ -3708,6 +3715,7 @@ nfsrpc_readdirplus(vnode_t vp, struct uio *uiop, nfsui */ if (blksiz > 0) { left = DIRBLKSIZ - blksiz; + NFSBZERO(uio_iov_base(uiop), left); dp->d_reclen += left; uio_iov_base_add(uiop, left); uio_iov_len_add(uiop, -(left)); @@ -3735,10 +3743,8 @@ nfsrpc_readdirplus(vnode_t vp, struct uio *uiop, nfsui */ while (uio_uio_resid(uiop) > 0 && uio_uio_resid(uiop) != tresid) { dp = (struct dirent *)uio_iov_base(uiop); + NFSBZERO(dp, DIRBLKSIZ); dp->d_type = DT_UNKNOWN; - dp->d_fileno = 0; - dp->d_namlen = 0; - dp->d_name[0] = '\0'; tl = (u_int32_t *)&dp->d_name[4]; *tl++ = cookie.lval[0]; *tl = cookie.lval[1]; From owner-svn-src-all@freebsd.org Fri Nov 23 00:56:43 2018 Return-Path: Delivered-To: svn-src-all@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 2E1001135C9E; Fri, 23 Nov 2018 00:56:43 +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 AFD6D6F96A; Fri, 23 Nov 2018 00:56:42 +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 8A9791775B; Fri, 23 Nov 2018 00:56:42 +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 wAN0ugJ0042083; Fri, 23 Nov 2018 00:56:42 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAN0ugd2042082; Fri, 23 Nov 2018 00:56:42 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201811230056.wAN0ugd2042082@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Fri, 23 Nov 2018 00:56:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r340788 - stable/12/sys/kern X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/12/sys/kern X-SVN-Commit-Revision: 340788 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: AFD6D6F96A X-Spamd-Result: default: False [1.51 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.39)[0.387,0]; NEURAL_SPAM_SHORT(0.42)[0.424,0]; NEURAL_SPAM_MEDIUM(0.70)[0.699,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Nov 2018 00:56:43 -0000 Author: markj Date: Fri Nov 23 00:56:42 2018 New Revision: 340788 URL: https://svnweb.freebsd.org/changeset/base/340788 Log: MFC r340699: Clear pad bytes in the struct exported by kern.ntp_pll.gettime. Modified: stable/12/sys/kern/kern_ntptime.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/kern/kern_ntptime.c ============================================================================== --- stable/12/sys/kern/kern_ntptime.c Fri Nov 23 00:17:47 2018 (r340787) +++ stable/12/sys/kern/kern_ntptime.c Fri Nov 23 00:56:42 2018 (r340788) @@ -300,6 +300,8 @@ ntp_sysctl(SYSCTL_HANDLER_ARGS) { struct ntptimeval ntv; /* temporary structure */ + memset(&ntv, 0, sizeof(ntv)); + NTP_LOCK(); ntp_gettime1(&ntv); NTP_UNLOCK(); From owner-svn-src-all@freebsd.org Fri Nov 23 00:59:43 2018 Return-Path: Delivered-To: svn-src-all@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 1DD6A1135D96; Fri, 23 Nov 2018 00:59:43 +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 B4AB46FAC6; Fri, 23 Nov 2018 00:59:42 +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 900091775D; Fri, 23 Nov 2018 00:59:42 +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 wAN0xg35042273; Fri, 23 Nov 2018 00:59:42 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAN0xg5P042272; Fri, 23 Nov 2018 00:59:42 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201811230059.wAN0xg5P042272@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Fri, 23 Nov 2018 00:59:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r340789 - stable/11/sys/kern X-SVN-Group: stable-11 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/11/sys/kern X-SVN-Commit-Revision: 340789 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B4AB46FAC6 X-Spamd-Result: default: False [1.51 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.39)[0.387,0]; NEURAL_SPAM_SHORT(0.42)[0.424,0]; NEURAL_SPAM_MEDIUM(0.70)[0.699,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Nov 2018 00:59:43 -0000 Author: markj Date: Fri Nov 23 00:59:42 2018 New Revision: 340789 URL: https://svnweb.freebsd.org/changeset/base/340789 Log: MFC r340699: Clear pad bytes in the struct exported by kern.ntp_pll.gettime. Modified: stable/11/sys/kern/kern_ntptime.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/kern/kern_ntptime.c ============================================================================== --- stable/11/sys/kern/kern_ntptime.c Fri Nov 23 00:56:42 2018 (r340788) +++ stable/11/sys/kern/kern_ntptime.c Fri Nov 23 00:59:42 2018 (r340789) @@ -300,6 +300,8 @@ ntp_sysctl(SYSCTL_HANDLER_ARGS) { struct ntptimeval ntv; /* temporary structure */ + memset(&ntv, 0, sizeof(ntv)); + NTP_LOCK(); ntp_gettime1(&ntv); NTP_UNLOCK(); From owner-svn-src-all@freebsd.org Fri Nov 23 01:05:44 2018 Return-Path: Delivered-To: svn-src-all@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 D713C1136041; Fri, 23 Nov 2018 01:05:43 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7DA5D6FF89; Fri, 23 Nov 2018 01:05:43 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 573EC178EF; Fri, 23 Nov 2018 01:05:43 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAN15hnq047140; Fri, 23 Nov 2018 01:05:43 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAN15hcG047139; Fri, 23 Nov 2018 01:05:43 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201811230105.wAN15hcG047139@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 23 Nov 2018 01:05:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r340790 - stable/12/usr.sbin/kldxref X-SVN-Group: stable-12 X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: stable/12/usr.sbin/kldxref X-SVN-Commit-Revision: 340790 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 7DA5D6FF89 X-Spamd-Result: default: False [1.56 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.41)[0.407,0]; NEURAL_SPAM_MEDIUM(0.72)[0.717,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.44)[0.440,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Nov 2018 01:05:44 -0000 Author: emaste Date: Fri Nov 23 01:05:42 2018 New Revision: 340790 URL: https://svnweb.freebsd.org/changeset/base/340790 Log: MFC r340285: kldxref: use appropriate Elf_Off type for offsets Submitted by: Mitchell Horne Sponsored by: The FreeBSD Foundation Modified: stable/12/usr.sbin/kldxref/ef.c Directory Properties: stable/12/ (props changed) Modified: stable/12/usr.sbin/kldxref/ef.c ============================================================================== --- stable/12/usr.sbin/kldxref/ef.c Fri Nov 23 00:59:42 2018 (r340789) +++ stable/12/usr.sbin/kldxref/ef.c Fri Nov 23 01:05:42 2018 (r340790) @@ -80,7 +80,7 @@ struct ef_file { }; static void ef_print_phdr(Elf_Phdr *); -static u_long ef_get_offset(elf_file_t, Elf_Off); +static Elf_Off ef_get_offset(elf_file_t, Elf_Off); static int ef_parse_dynamic(elf_file_t); static int ef_get_type(elf_file_t ef); @@ -126,16 +126,17 @@ ef_print_phdr(Elf_Phdr *phdr) { if ((phdr->p_flags & PF_W) == 0) { - printf("text=0x%lx ", (long)phdr->p_filesz); + printf("text=0x%jx ", (uintmax_t)phdr->p_filesz); } else { - printf("data=0x%lx", (long)phdr->p_filesz); + printf("data=0x%jx", (uintmax_t)phdr->p_filesz); if (phdr->p_filesz < phdr->p_memsz) - printf("+0x%lx", (long)(phdr->p_memsz - phdr->p_filesz)); + printf("+0x%jx", + (uintmax_t)(phdr->p_memsz - phdr->p_filesz)); printf(" "); } } -static u_long +static Elf_Off ef_get_offset(elf_file_t ef, Elf_Off off) { Elf_Phdr *ph; @@ -292,8 +293,8 @@ ef_parse_dynamic(elf_file_t ef) error = ef_read(ef, ef_get_offset(ef, dp->d_un.d_ptr), sizeof(hashhdr), hashhdr); if (error != 0) { - warnx("can't read hash header (%lx)", - ef_get_offset(ef, dp->d_un.d_ptr)); + warnx("can't read hash header (%jx)", + (uintmax_t)ef_get_offset(ef, dp->d_un.d_ptr)); return (error); } ef->ef_nbuckets = hashhdr[0]; @@ -365,8 +366,8 @@ ef_parse_dynamic(elf_file_t ef) ef->ef_nchains * sizeof(Elf_Sym), (void **)&ef->ef_symtab) != 0) { if (ef->ef_verbose) - warnx("%s: can't load .dynsym section (0x%lx)", - ef->ef_name, (long)ef->ef_symoff); + warnx("%s: can't load .dynsym section (0x%jx)", + ef->ef_name, (uintmax_t)ef->ef_symoff); return (EIO); } if (ef_read_entry(ef, ef_get_offset(ef, ef->ef_stroff), ef->ef_strsz, @@ -461,13 +462,13 @@ ef_read_entry(elf_file_t ef, Elf_Off offset, size_t le static int ef_seg_read(elf_file_t ef, Elf_Off offset, size_t len, void *dest) { - u_long ofs; + Elf_Off ofs; ofs = ef_get_offset(ef, offset); if (ofs == 0) { if (ef->ef_verbose) - warnx("ef_seg_read(%s): zero offset (%lx:%ld)", - ef->ef_name, (long)offset, ofs); + warnx("ef_seg_read(%s): zero offset (%jx:%ju)", + ef->ef_name, (uintmax_t)offset, (uintmax_t)ofs); return (EFAULT); } return (ef_read(ef, ofs, len, dest)); @@ -476,7 +477,7 @@ ef_seg_read(elf_file_t ef, Elf_Off offset, size_t len, static int ef_seg_read_rel(elf_file_t ef, Elf_Off offset, size_t len, void *dest) { - u_long ofs; + Elf_Off ofs; const Elf_Rela *a; const Elf_Rel *r; int error; @@ -484,8 +485,8 @@ ef_seg_read_rel(elf_file_t ef, Elf_Off offset, size_t ofs = ef_get_offset(ef, offset); if (ofs == 0) { if (ef->ef_verbose) - warnx("ef_seg_read_rel(%s): zero offset (%lx:%ld)", - ef->ef_name, (long)offset, ofs); + warnx("ef_seg_read_rel(%s): zero offset (%jx:%ju)", + ef->ef_name, (uintmax_t)offset, (uintmax_t)ofs); return (EFAULT); } if ((error = ef_read(ef, ofs, len, dest)) != 0) @@ -509,14 +510,14 @@ ef_seg_read_rel(elf_file_t ef, Elf_Off offset, size_t static int ef_seg_read_string(elf_file_t ef, Elf_Off offset, size_t len, char *dest) { - u_long ofs; + Elf_Off ofs; ssize_t r; ofs = ef_get_offset(ef, offset); if (ofs == 0 || ofs == (Elf_Off)-1) { if (ef->ef_verbose) - warnx("ef_seg_read_string(%s): bad offset (%lx:%ld)", - ef->ef_name, (long)offset, ofs); + warnx("ef_seg_read_string(%s): bad offset (%jx:%ju)", + ef->ef_name, (uintmax_t)offset, (uintmax_t)ofs); return (EFAULT); } From owner-svn-src-all@freebsd.org Fri Nov 23 01:07:13 2018 Return-Path: Delivered-To: svn-src-all@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 8CECA11360B2; Fri, 23 Nov 2018 01:07:13 +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 2BE03700CA; Fri, 23 Nov 2018 01:07:13 +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 0B659178F0; Fri, 23 Nov 2018 01:07:13 +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 wAN17C5V047260; Fri, 23 Nov 2018 01:07:12 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAN17CHu047259; Fri, 23 Nov 2018 01:07:12 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201811230107.wAN17CHu047259@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Fri, 23 Nov 2018 01:07:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r340791 - releng/12.0/sys/kern X-SVN-Group: releng X-SVN-Commit-Author: markj X-SVN-Commit-Paths: releng/12.0/sys/kern X-SVN-Commit-Revision: 340791 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 2BE03700CA X-Spamd-Result: default: False [1.56 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.44)[0.436,0]; NEURAL_SPAM_MEDIUM(0.72)[0.721,0]; NEURAL_SPAM_LONG(0.40)[0.400,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Nov 2018 01:07:13 -0000 Author: markj Date: Fri Nov 23 01:07:12 2018 New Revision: 340791 URL: https://svnweb.freebsd.org/changeset/base/340791 Log: MFstable/12 r340788: Clear pad bytes in the struct exported by kern.ntp_pll.gettime. Approved by: re (gjb) Modified: releng/12.0/sys/kern/kern_ntptime.c Directory Properties: releng/12.0/ (props changed) Modified: releng/12.0/sys/kern/kern_ntptime.c ============================================================================== --- releng/12.0/sys/kern/kern_ntptime.c Fri Nov 23 01:05:42 2018 (r340790) +++ releng/12.0/sys/kern/kern_ntptime.c Fri Nov 23 01:07:12 2018 (r340791) @@ -300,6 +300,8 @@ ntp_sysctl(SYSCTL_HANDLER_ARGS) { struct ntptimeval ntv; /* temporary structure */ + memset(&ntv, 0, sizeof(ntv)); + NTP_LOCK(); ntp_gettime1(&ntv); NTP_UNLOCK(); From owner-svn-src-all@freebsd.org Fri Nov 23 03:42:06 2018 Return-Path: Delivered-To: svn-src-all@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 03A4B1139603; Fri, 23 Nov 2018 03:42:06 +0000 (UTC) (envelope-from ygy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.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 99D4874026; Fri, 23 Nov 2018 03:42:05 +0000 (UTC) (envelope-from ygy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7C2B319352; Fri, 23 Nov 2018 03:42:05 +0000 (UTC) (envelope-from ygy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAN3g57p028717; Fri, 23 Nov 2018 03:42:05 GMT (envelope-from ygy@FreeBSD.org) Received: (from ygy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAN3g5vs028716; Fri, 23 Nov 2018 03:42:05 GMT (envelope-from ygy@FreeBSD.org) Message-Id: <201811230342.wAN3g5vs028716@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ygy set sender to ygy@FreeBSD.org using -f From: Guangyuan Yang Date: Fri, 23 Nov 2018 03:42:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340792 - head/sbin/ipfw X-SVN-Group: head X-SVN-Commit-Author: ygy X-SVN-Commit-Paths: head/sbin/ipfw X-SVN-Commit-Revision: 340792 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 99D4874026 X-Spamd-Result: default: False [1.71 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.40)[0.400,0]; NEURAL_SPAM_MEDIUM(0.72)[0.721,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.59)[0.587,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Nov 2018 03:42:06 -0000 Author: ygy (doc committer) Date: Fri Nov 23 03:42:05 2018 New Revision: 340792 URL: https://svnweb.freebsd.org/changeset/base/340792 Log: Fix a minor typo in ipfw(8) manual page. PR: 230747 Submitted by: f.toscan@hotmail.it MFC after: 1 week Modified: head/sbin/ipfw/ipfw.8 Modified: head/sbin/ipfw/ipfw.8 ============================================================================== --- head/sbin/ipfw/ipfw.8 Fri Nov 23 01:07:12 2018 (r340791) +++ head/sbin/ipfw/ipfw.8 Fri Nov 23 03:42:05 2018 (r340792) @@ -4567,7 +4567,7 @@ The ipfw core (ipfw2) has been completely redesigned a reimplemented by Luigi Rizzo in summer 2002. Further actions and -options have been added by various developer over the years. +options have been added by various developers over the years. .Pp .An -nosplit In-kernel NAT support written by From owner-svn-src-all@freebsd.org Fri Nov 23 04:38:52 2018 Return-Path: Delivered-To: svn-src-all@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 056F6113A929; Fri, 23 Nov 2018 04:38:52 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 99BFC758B8; Fri, 23 Nov 2018 04:38:51 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 629F919B9E; Fri, 23 Nov 2018 04:38:51 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAN4cpaX055420; Fri, 23 Nov 2018 04:38:51 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAN4coTa055417; Fri, 23 Nov 2018 04:38:50 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201811230438.wAN4coTa055417@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Fri, 23 Nov 2018 04:38:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340793 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 340793 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 99BFC758B8 X-Spamd-Result: default: False [1.67 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.42)[0.420,0]; NEURAL_SPAM_SHORT(0.52)[0.517,0]; NEURAL_SPAM_MEDIUM(0.74)[0.738,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Nov 2018 04:38:52 -0000 Author: mjg Date: Fri Nov 23 04:38:50 2018 New Revision: 340793 URL: https://svnweb.freebsd.org/changeset/base/340793 Log: Revert "fork: fix use-after-free with vfork" This unreliably breaks libc handling of vfork where forking succeded, but execve did not. vfork code in libc performs waitpid with WNOHANG in case of failed exec. With the fix exit codepath was waking up the parent before the child fully transitioned to a zombie. Woken up parent would waitpid, which could find a not-yet-zombie child and fail to reap it due to the WNOHANG flag. While removing the flag fixes the problem, it is not an option due to older releases which would still suffer from the kernel change. Revert the fix until a solution can be worked out. Note that while use-after-free which gets back due to the revert is a real bug, it's side-effects are limited due to the fact that struct proc memory is never released by UMA. Modified: head/sys/kern/kern_exit.c head/sys/kern/kern_fork.c head/sys/kern/subr_syscall.c Modified: head/sys/kern/kern_exit.c ============================================================================== --- head/sys/kern/kern_exit.c Fri Nov 23 03:42:05 2018 (r340792) +++ head/sys/kern/kern_exit.c Fri Nov 23 04:38:50 2018 (r340793) @@ -285,15 +285,6 @@ exit1(struct thread *td, int rval, int signo) wakeup(&p->p_stype); /* - * If P_PPWAIT is set our parent holds us with p_lock and may - * be waiting on p_pwait. - */ - if (p->p_flag & P_PPWAIT) { - p->p_flag &= ~P_PPWAIT; - cv_broadcast(&p->p_pwait); - } - - /* * Wait for any processes that have a hold on our vmspace to * release their reference. */ @@ -338,9 +329,13 @@ exit1(struct thread *td, int rval, int signo) */ EVENTHANDLER_DIRECT_INVOKE(process_exit, p); + /* + * If parent is waiting for us to exit or exec, + * P_PPWAIT is set; we will wakeup the parent below. + */ PROC_LOCK(p); stopprofclock(p); - p->p_flag &= ~(P_TRACED | P_PPTRACE); + p->p_flag &= ~(P_TRACED | P_PPWAIT | P_PPTRACE); p->p_ptevents = 0; /* @@ -641,6 +636,7 @@ exit1(struct thread *td, int rval, int signo) * proc lock. */ wakeup(p->p_pptr); + cv_broadcast(&p->p_pwait); sched_exit(p->p_pptr, td); PROC_SLOCK(p); p->p_state = PRS_ZOMBIE; Modified: head/sys/kern/kern_fork.c ============================================================================== --- head/sys/kern/kern_fork.c Fri Nov 23 03:42:05 2018 (r340792) +++ head/sys/kern/kern_fork.c Fri Nov 23 04:38:50 2018 (r340793) @@ -720,7 +720,6 @@ do_fork(struct thread *td, struct fork_req *fr, struct dtrace_fasttrap_fork(p1, p2); #endif if (fr->fr_flags & RFPPWAIT) { - _PHOLD(p2); td->td_pflags |= TDP_RFPPWAIT; td->td_rfppwait_p = p2; td->td_dbgflags |= TDB_VFORK; Modified: head/sys/kern/subr_syscall.c ============================================================================== --- head/sys/kern/subr_syscall.c Fri Nov 23 03:42:05 2018 (r340792) +++ head/sys/kern/subr_syscall.c Fri Nov 23 04:38:50 2018 (r340793) @@ -257,7 +257,6 @@ again: } cv_timedwait(&p2->p_pwait, &p2->p_mtx, hz); } - _PRELE(p2); PROC_UNLOCK(p2); if (td->td_dbgflags & TDB_VFORK) { From owner-svn-src-all@freebsd.org Fri Nov 23 07:26:38 2018 Return-Path: Delivered-To: svn-src-all@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 B89C2113DAF9; Fri, 23 Nov 2018 07:26:38 +0000 (UTC) (envelope-from arybchik@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 56DB17A14B; Fri, 23 Nov 2018 07:26:38 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2E4271B6EC; Fri, 23 Nov 2018 07:26:38 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAN7Qbax044139; Fri, 23 Nov 2018 07:26:38 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAN7Qbmr044136; Fri, 23 Nov 2018 07:26:37 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811230726.wAN7Qbmr044136@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 23 Nov 2018 07:26:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340794 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 340794 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 56DB17A14B X-Spamd-Result: default: False [1.49 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.42)[0.420,0]; NEURAL_SPAM_SHORT(0.33)[0.334,0]; NEURAL_SPAM_MEDIUM(0.74)[0.738,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Nov 2018 07:26:39 -0000 Author: arybchik Date: Fri Nov 23 07:26:37 2018 New Revision: 340794 URL: https://svnweb.freebsd.org/changeset/base/340794 Log: sfxge(4): add MCDI agnostic wrapper for MAC stats clear If a libefx-based driver needs some way to clear port statistics, then an MCDI agnostic method is required. Submitted by: Ivan Malov Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18064 Modified: head/sys/dev/sfxge/common/efx.h head/sys/dev/sfxge/common/efx_impl.h head/sys/dev/sfxge/common/efx_mac.c Modified: head/sys/dev/sfxge/common/efx.h ============================================================================== --- head/sys/dev/sfxge/common/efx.h Fri Nov 23 04:38:50 2018 (r340793) +++ head/sys/dev/sfxge/common/efx.h Fri Nov 23 07:26:37 2018 (r340794) @@ -566,6 +566,10 @@ efx_mac_stats_get_mask( #define EFX_MAC_STATS_SIZE 0x400 +extern __checkReturn efx_rc_t +efx_mac_stats_clear( + __in efx_nic_t *enp); + /* * Upload mac statistics supported by the hardware into the given buffer. * Modified: head/sys/dev/sfxge/common/efx_impl.h ============================================================================== --- head/sys/dev/sfxge/common/efx_impl.h Fri Nov 23 04:38:50 2018 (r340793) +++ head/sys/dev/sfxge/common/efx_impl.h Fri Nov 23 07:26:37 2018 (r340794) @@ -202,6 +202,7 @@ typedef struct efx_mac_ops_s { #endif /* EFSYS_OPT_LOOPBACK */ #if EFSYS_OPT_MAC_STATS efx_rc_t (*emo_stats_get_mask)(efx_nic_t *, uint32_t *, size_t); + efx_rc_t (*emo_stats_clear)(efx_nic_t *); efx_rc_t (*emo_stats_upload)(efx_nic_t *, efsys_mem_t *); efx_rc_t (*emo_stats_periodic)(efx_nic_t *, efsys_mem_t *, uint16_t, boolean_t); Modified: head/sys/dev/sfxge/common/efx_mac.c ============================================================================== --- head/sys/dev/sfxge/common/efx_mac.c Fri Nov 23 04:38:50 2018 (r340793) +++ head/sys/dev/sfxge/common/efx_mac.c Fri Nov 23 07:26:37 2018 (r340794) @@ -60,6 +60,7 @@ static const efx_mac_ops_t __efx_siena_mac_ops = { #endif /* EFSYS_OPT_LOOPBACK */ #if EFSYS_OPT_MAC_STATS siena_mac_stats_get_mask, /* emo_stats_get_mask */ + efx_mcdi_mac_stats_clear, /* emo_stats_clear */ efx_mcdi_mac_stats_upload, /* emo_stats_upload */ efx_mcdi_mac_stats_periodic, /* emo_stats_periodic */ siena_mac_stats_update /* emo_stats_update */ @@ -84,6 +85,7 @@ static const efx_mac_ops_t __efx_ef10_mac_ops = { #endif /* EFSYS_OPT_LOOPBACK */ #if EFSYS_OPT_MAC_STATS ef10_mac_stats_get_mask, /* emo_stats_get_mask */ + efx_mcdi_mac_stats_clear, /* emo_stats_clear */ efx_mcdi_mac_stats_upload, /* emo_stats_upload */ efx_mcdi_mac_stats_periodic, /* emo_stats_periodic */ ef10_mac_stats_update /* emo_stats_update */ @@ -708,6 +710,29 @@ efx_mac_stats_get_mask( (void) memset(maskp, 0, mask_size); if ((rc = emop->emo_stats_get_mask(enp, maskp, mask_size)) != 0) + goto fail1; + + return (0); + +fail1: + EFSYS_PROBE1(fail1, efx_rc_t, rc); + + return (rc); +} + + __checkReturn efx_rc_t +efx_mac_stats_clear( + __in efx_nic_t *enp) +{ + efx_port_t *epp = &(enp->en_port); + const efx_mac_ops_t *emop = epp->ep_emop; + efx_rc_t rc; + + EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC); + EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_PORT); + EFSYS_ASSERT(emop != NULL); + + if ((rc = emop->emo_stats_clear(enp)) != 0) goto fail1; return (0); From owner-svn-src-all@freebsd.org Fri Nov 23 07:39:01 2018 Return-Path: Delivered-To: svn-src-all@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 035C9113DE01; Fri, 23 Nov 2018 07:39:01 +0000 (UTC) (envelope-from arybchik@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 9CF8E7A5FC; Fri, 23 Nov 2018 07:39:00 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 76D001B87F; Fri, 23 Nov 2018 07:39:00 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAN7d0hx049120; Fri, 23 Nov 2018 07:39:00 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAN7cxk1049111; Fri, 23 Nov 2018 07:38:59 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811230738.wAN7cxk1049111@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 23 Nov 2018 07:38:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340795 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 340795 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 9CF8E7A5FC X-Spamd-Result: default: False [1.49 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.33)[0.334,0]; NEURAL_SPAM_MEDIUM(0.74)[0.738,0]; NEURAL_SPAM_LONG(0.42)[0.420,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Nov 2018 07:39:01 -0000 Author: arybchik Date: Fri Nov 23 07:38:59 2018 New Revision: 340795 URL: https://svnweb.freebsd.org/changeset/base/340795 Log: sfxge(4): add advanced function to extract FW version Some libefx-based drivers might need this functionality to indicate DPCPU FW IDs as part of FW version info to assist experienced users. Submitted by: Ivan Malov Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18065 Modified: head/sys/dev/sfxge/common/ef10_nic.c head/sys/dev/sfxge/common/efx.h head/sys/dev/sfxge/common/efx_mcdi.c head/sys/dev/sfxge/common/efx_mcdi.h head/sys/dev/sfxge/common/efx_nic.c Modified: head/sys/dev/sfxge/common/ef10_nic.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_nic.c Fri Nov 23 07:26:37 2018 (r340794) +++ head/sys/dev/sfxge/common/ef10_nic.c Fri Nov 23 07:38:59 2018 (r340795) @@ -494,59 +494,6 @@ fail1: } static __checkReturn efx_rc_t -efx_mcdi_get_capabilities( - __in efx_nic_t *enp, - __out uint32_t *flagsp, - __out uint32_t *flags2p, - __out uint32_t *tso2ncp) -{ - efx_mcdi_req_t req; - uint8_t payload[MAX(MC_CMD_GET_CAPABILITIES_IN_LEN, - MC_CMD_GET_CAPABILITIES_V2_OUT_LEN)]; - efx_rc_t rc; - - (void) memset(payload, 0, sizeof (payload)); - req.emr_cmd = MC_CMD_GET_CAPABILITIES; - req.emr_in_buf = payload; - req.emr_in_length = MC_CMD_GET_CAPABILITIES_IN_LEN; - req.emr_out_buf = payload; - req.emr_out_length = MC_CMD_GET_CAPABILITIES_V2_OUT_LEN; - - efx_mcdi_execute(enp, &req); - - if (req.emr_rc != 0) { - rc = req.emr_rc; - goto fail1; - } - - if (req.emr_out_length_used < MC_CMD_GET_CAPABILITIES_OUT_LEN) { - rc = EMSGSIZE; - goto fail2; - } - - *flagsp = MCDI_OUT_DWORD(req, GET_CAPABILITIES_OUT_FLAGS1); - - if (req.emr_out_length_used < MC_CMD_GET_CAPABILITIES_V2_OUT_LEN) { - *flags2p = 0; - *tso2ncp = 0; - } else { - *flags2p = MCDI_OUT_DWORD(req, GET_CAPABILITIES_V2_OUT_FLAGS2); - *tso2ncp = MCDI_OUT_WORD(req, - GET_CAPABILITIES_V2_OUT_TX_TSO_V2_N_CONTEXTS); - } - - return (0); - -fail2: - EFSYS_PROBE(fail2); -fail1: - EFSYS_PROBE1(fail1, efx_rc_t, rc); - - return (rc); -} - - -static __checkReturn efx_rc_t efx_mcdi_alloc_vis( __in efx_nic_t *enp, __in uint32_t min_vi_count, @@ -1015,8 +962,8 @@ ef10_get_datapath_caps( uint32_t tso2nc; efx_rc_t rc; - if ((rc = efx_mcdi_get_capabilities(enp, &flags, &flags2, - &tso2nc)) != 0) + if ((rc = efx_mcdi_get_capabilities(enp, &flags, NULL, NULL, + &flags2, &tso2nc)) != 0) goto fail1; if ((rc = ef10_mcdi_get_pf_count(enp, &encp->enc_hw_pf_count)) != 0) Modified: head/sys/dev/sfxge/common/efx.h ============================================================================== --- head/sys/dev/sfxge/common/efx.h Fri Nov 23 07:26:37 2018 (r340794) +++ head/sys/dev/sfxge/common/efx.h Fri Nov 23 07:38:59 2018 (r340795) @@ -1218,6 +1218,24 @@ extern const efx_nic_cfg_t * efx_nic_cfg_get( __in efx_nic_t *enp); +typedef struct efx_nic_fw_info_s { + /* Basic FW version information */ + uint16_t enfi_mc_fw_version[4]; + /* + * If datapath capabilities can be detected, + * additional FW information is to be shown + */ + boolean_t enfi_dpcpu_fw_ids_valid; + /* Rx and Tx datapath CPU FW IDs */ + uint16_t enfi_rx_dpcpu_fw_id; + uint16_t enfi_tx_dpcpu_fw_id; +} efx_nic_fw_info_t; + +extern __checkReturn efx_rc_t +efx_nic_get_fw_version( + __in efx_nic_t *enp, + __out efx_nic_fw_info_t *enfip); + /* Driver resource limits (minimum required/maximum usable). */ typedef struct efx_drv_limits_s { uint32_t edl_min_evq_count; Modified: head/sys/dev/sfxge/common/efx_mcdi.c ============================================================================== --- head/sys/dev/sfxge/common/efx_mcdi.c Fri Nov 23 07:26:37 2018 (r340794) +++ head/sys/dev/sfxge/common/efx_mcdi.c Fri Nov 23 07:38:59 2018 (r340795) @@ -1029,6 +1029,79 @@ fail1: return (rc); } + __checkReturn efx_rc_t +efx_mcdi_get_capabilities( + __in efx_nic_t *enp, + __out_opt uint32_t *flagsp, + __out_opt uint16_t *rx_dpcpu_fw_idp, + __out_opt uint16_t *tx_dpcpu_fw_idp, + __out_opt uint32_t *flags2p, + __out_opt uint32_t *tso2ncp) +{ + efx_mcdi_req_t req; + uint8_t payload[MAX(MC_CMD_GET_CAPABILITIES_IN_LEN, + MC_CMD_GET_CAPABILITIES_V2_OUT_LEN)]; + boolean_t v2_capable; + efx_rc_t rc; + + (void) memset(payload, 0, sizeof (payload)); + req.emr_cmd = MC_CMD_GET_CAPABILITIES; + req.emr_in_buf = payload; + req.emr_in_length = MC_CMD_GET_CAPABILITIES_IN_LEN; + req.emr_out_buf = payload; + req.emr_out_length = MC_CMD_GET_CAPABILITIES_V2_OUT_LEN; + + efx_mcdi_execute_quiet(enp, &req); + + if (req.emr_rc != 0) { + rc = req.emr_rc; + goto fail1; + } + + if (req.emr_out_length_used < MC_CMD_GET_CAPABILITIES_OUT_LEN) { + rc = EMSGSIZE; + goto fail2; + } + + if (flagsp != NULL) + *flagsp = MCDI_OUT_DWORD(req, GET_CAPABILITIES_OUT_FLAGS1); + + if (rx_dpcpu_fw_idp != NULL) + *rx_dpcpu_fw_idp = MCDI_OUT_WORD(req, + GET_CAPABILITIES_OUT_RX_DPCPU_FW_ID); + + if (tx_dpcpu_fw_idp != NULL) + *tx_dpcpu_fw_idp = MCDI_OUT_WORD(req, + GET_CAPABILITIES_OUT_TX_DPCPU_FW_ID); + + if (req.emr_out_length_used < MC_CMD_GET_CAPABILITIES_V2_OUT_LEN) + v2_capable = B_FALSE; + else + v2_capable = B_TRUE; + + if (flags2p != NULL) { + *flags2p = (v2_capable) ? + MCDI_OUT_DWORD(req, GET_CAPABILITIES_V2_OUT_FLAGS2) : + 0; + } + + if (tso2ncp != NULL) { + *tso2ncp = (v2_capable) ? + MCDI_OUT_WORD(req, + GET_CAPABILITIES_V2_OUT_TX_TSO_V2_N_CONTEXTS) : + 0; + } + + return (0); + +fail2: + EFSYS_PROBE(fail2); +fail1: + EFSYS_PROBE1(fail1, efx_rc_t, rc); + + return (rc); +} + static __checkReturn efx_rc_t efx_mcdi_do_reboot( __in efx_nic_t *enp, Modified: head/sys/dev/sfxge/common/efx_mcdi.h ============================================================================== --- head/sys/dev/sfxge/common/efx_mcdi.h Fri Nov 23 07:26:37 2018 (r340794) +++ head/sys/dev/sfxge/common/efx_mcdi.h Fri Nov 23 07:38:59 2018 (r340795) @@ -139,6 +139,15 @@ efx_mcdi_version( __out_opt uint32_t *buildp, __out_opt efx_mcdi_boot_t *statusp); +extern __checkReturn efx_rc_t +efx_mcdi_get_capabilities( + __in efx_nic_t *enp, + __out_opt uint32_t *flagsp, + __out_opt uint16_t *rx_dpcpu_fw_idp, + __out_opt uint16_t *tx_dpcpu_fw_idp, + __out_opt uint32_t *flags2p, + __out_opt uint32_t *tso2ncp); + extern __checkReturn efx_rc_t efx_mcdi_read_assertion( __in efx_nic_t *enp); Modified: head/sys/dev/sfxge/common/efx_nic.c ============================================================================== --- head/sys/dev/sfxge/common/efx_nic.c Fri Nov 23 07:26:37 2018 (r340794) +++ head/sys/dev/sfxge/common/efx_nic.c Fri Nov 23 07:38:59 2018 (r340795) @@ -621,6 +621,54 @@ efx_nic_cfg_get( return (&(enp->en_nic_cfg)); } + __checkReturn efx_rc_t +efx_nic_get_fw_version( + __in efx_nic_t *enp, + __out efx_nic_fw_info_t *enfip) +{ + uint16_t mc_fw_version[4]; + efx_rc_t rc; + + if (enfip == NULL) { + rc = EINVAL; + goto fail1; + } + + EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_MCDI); + EFSYS_ASSERT3U(enp->en_features, &, EFX_FEATURE_MCDI); + + rc = efx_mcdi_version(enp, mc_fw_version, NULL, NULL); + if (rc != 0) + goto fail2; + + rc = efx_mcdi_get_capabilities(enp, NULL, + &enfip->enfi_rx_dpcpu_fw_id, + &enfip->enfi_tx_dpcpu_fw_id, + NULL, NULL); + if (rc == 0) { + enfip->enfi_dpcpu_fw_ids_valid = B_TRUE; + } else if (rc == ENOTSUP) { + enfip->enfi_dpcpu_fw_ids_valid = B_FALSE; + enfip->enfi_rx_dpcpu_fw_id = 0; + enfip->enfi_tx_dpcpu_fw_id = 0; + } else { + goto fail3; + } + + memcpy(enfip->enfi_mc_fw_version, mc_fw_version, sizeof(mc_fw_version)); + + return (0); + +fail3: + EFSYS_PROBE(fail3); +fail2: + EFSYS_PROBE(fail2); +fail1: + EFSYS_PROBE1(fail1, efx_rc_t, rc); + + return (rc); +} + #if EFSYS_OPT_DIAG __checkReturn efx_rc_t From owner-svn-src-all@freebsd.org Fri Nov 23 07:43:45 2018 Return-Path: Delivered-To: svn-src-all@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 77174113DFDB; Fri, 23 Nov 2018 07:43:45 +0000 (UTC) (envelope-from arybchik@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 0FDDD7AA45; Fri, 23 Nov 2018 07:43:45 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E500F1BA11; Fri, 23 Nov 2018 07:43:44 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAN7hiff054090; Fri, 23 Nov 2018 07:43:44 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAN7hijk054089; Fri, 23 Nov 2018 07:43:44 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811230743.wAN7hijk054089@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 23 Nov 2018 07:43:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340796 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 340796 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 0FDDD7AA45 X-Spamd-Result: default: False [1.45 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.33)[0.329,0]; NEURAL_SPAM_MEDIUM(0.72)[0.721,0]; NEURAL_SPAM_LONG(0.40)[0.400,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Nov 2018 07:43:45 -0000 Author: arybchik Date: Fri Nov 23 07:43:44 2018 New Revision: 340796 URL: https://svnweb.freebsd.org/changeset/base/340796 Log: sfxge(4): fix failure path in EF10 Tx queue PIO enable Submitted by: Andy Moreton Sponsored by: Solarflare Communications, Inc. MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D18066 Modified: head/sys/dev/sfxge/common/ef10_tx.c Modified: head/sys/dev/sfxge/common/ef10_tx.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_tx.c Fri Nov 23 07:38:59 2018 (r340795) +++ head/sys/dev/sfxge/common/ef10_tx.c Fri Nov 23 07:43:44 2018 (r340796) @@ -285,9 +285,9 @@ ef10_tx_qpio_enable( fail3: EFSYS_PROBE(fail3); ef10_nic_pio_free(enp, etp->et_pio_bufnum, etp->et_pio_blknum); - etp->et_pio_size = 0; fail2: EFSYS_PROBE(fail2); + etp->et_pio_size = 0; fail1: EFSYS_PROBE1(fail1, efx_rc_t, rc); From owner-svn-src-all@freebsd.org Fri Nov 23 07:50:24 2018 Return-Path: Delivered-To: svn-src-all@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 F1199113E137; Fri, 23 Nov 2018 07:50:23 +0000 (UTC) (envelope-from arybchik@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 926197ACD9; Fri, 23 Nov 2018 07:50:23 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6DC481BA1A; Fri, 23 Nov 2018 07:50:23 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAN7oNfe054448; Fri, 23 Nov 2018 07:50:23 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAN7oNdC054447; Fri, 23 Nov 2018 07:50:23 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811230750.wAN7oNdC054447@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 23 Nov 2018 07:50:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340797 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 340797 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 926197ACD9 X-Spamd-Result: default: False [1.45 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.33)[0.329,0]; NEURAL_SPAM_MEDIUM(0.72)[0.721,0]; NEURAL_SPAM_LONG(0.40)[0.400,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Nov 2018 07:50:24 -0000 Author: arybchik Date: Fri Nov 23 07:50:22 2018 New Revision: 340797 URL: https://svnweb.freebsd.org/changeset/base/340797 Log: sfxge(4): fix potential buffer overflow in Tx queue init Improve error checking to avoid a caller overflowing the MCDI request buffer if the requested TXQ size was excessively large. Submitted by: Andy Moreton Sponsored by: Solarflare Communications, Inc. MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D18067 Modified: head/sys/dev/sfxge/common/ef10_tx.c Modified: head/sys/dev/sfxge/common/ef10_tx.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_tx.c Fri Nov 23 07:43:44 2018 (r340796) +++ head/sys/dev/sfxge/common/ef10_tx.c Fri Nov 23 07:50:22 2018 (r340797) @@ -70,7 +70,7 @@ efx_mcdi_init_txq( EFX_TXQ_NBUFS(enp->en_nic_cfg.enc_txq_max_ndescs)); npages = EFX_TXQ_NBUFS(size); - if (npages > MC_CMD_INIT_TXQ_IN_DMA_ADDR_MAXNUM) { + if (MC_CMD_INIT_TXQ_IN_LEN(npages) > sizeof (payload)) { rc = EINVAL; goto fail1; } From owner-svn-src-all@freebsd.org Fri Nov 23 07:50:36 2018 Return-Path: Delivered-To: svn-src-all@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 D446C113E166; Fri, 23 Nov 2018 07:50:36 +0000 (UTC) (envelope-from arybchik@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 6229C7ADD7; Fri, 23 Nov 2018 07:50:36 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D23931BA1C; Fri, 23 Nov 2018 07:50:34 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAN7oYVT054506; Fri, 23 Nov 2018 07:50:34 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAN7oYsT054505; Fri, 23 Nov 2018 07:50:34 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811230750.wAN7oYsT054505@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 23 Nov 2018 07:50:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340798 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 340798 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 6229C7ADD7 X-Spamd-Result: default: False [1.45 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.40)[0.400,0]; NEURAL_SPAM_MEDIUM(0.72)[0.721,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.33)[0.329,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Nov 2018 07:50:37 -0000 Author: arybchik Date: Fri Nov 23 07:50:34 2018 New Revision: 340798 URL: https://svnweb.freebsd.org/changeset/base/340798 Log: sfxge(4): fix out of bounds read in VIs allocation Submitted by: Andy Moreton Sponsored by: Solarflare Communications, Inc. MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D18068 Modified: head/sys/dev/sfxge/common/ef10_nic.c Modified: head/sys/dev/sfxge/common/ef10_nic.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_nic.c Fri Nov 23 07:50:22 2018 (r340797) +++ head/sys/dev/sfxge/common/ef10_nic.c Fri Nov 23 07:50:34 2018 (r340798) @@ -504,7 +504,7 @@ efx_mcdi_alloc_vis( { efx_mcdi_req_t req; uint8_t payload[MAX(MC_CMD_ALLOC_VIS_IN_LEN, - MC_CMD_ALLOC_VIS_OUT_LEN)]; + MC_CMD_ALLOC_VIS_EXT_OUT_LEN)]; efx_rc_t rc; if (vi_countp == NULL) { @@ -517,7 +517,7 @@ efx_mcdi_alloc_vis( req.emr_in_buf = payload; req.emr_in_length = MC_CMD_ALLOC_VIS_IN_LEN; req.emr_out_buf = payload; - req.emr_out_length = MC_CMD_ALLOC_VIS_OUT_LEN; + req.emr_out_length = MC_CMD_ALLOC_VIS_EXT_OUT_LEN; MCDI_IN_SET_DWORD(req, ALLOC_VIS_IN_MIN_VI_COUNT, min_vi_count); MCDI_IN_SET_DWORD(req, ALLOC_VIS_IN_MAX_VI_COUNT, max_vi_count); From owner-svn-src-all@freebsd.org Fri Nov 23 07:50:51 2018 Return-Path: Delivered-To: svn-src-all@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 497F0113E1A0; Fri, 23 Nov 2018 07:50:51 +0000 (UTC) (envelope-from arybchik@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 E24A67AF20; Fri, 23 Nov 2018 07:50:50 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D5F411BA38; Fri, 23 Nov 2018 07:50:45 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAN7ojtT054564; Fri, 23 Nov 2018 07:50:45 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAN7ojbQ054562; Fri, 23 Nov 2018 07:50:45 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811230750.wAN7ojbQ054562@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 23 Nov 2018 07:50:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340799 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 340799 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E24A67AF20 X-Spamd-Result: default: False [1.45 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.40)[0.400,0]; NEURAL_SPAM_MEDIUM(0.72)[0.721,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.33)[0.329,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Nov 2018 07:50:51 -0000 Author: arybchik Date: Fri Nov 23 07:50:45 2018 New Revision: 340799 URL: https://svnweb.freebsd.org/changeset/base/340799 Log: sfxge(4): fix error code usage MCDI results returned in req.emr_rc have already been translated from MC_CMD_ERR_* to errno names, so using an MC_CMD_ERR_* value is incorrect. Submitted by: Andy Moreton Sponsored by: Solarflare Communications, Inc. MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D18069 Modified: head/sys/dev/sfxge/common/ef10_rx.c head/sys/dev/sfxge/common/ef10_tx.c Modified: head/sys/dev/sfxge/common/ef10_rx.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_rx.c Fri Nov 23 07:50:34 2018 (r340798) +++ head/sys/dev/sfxge/common/ef10_rx.c Fri Nov 23 07:50:45 2018 (r340799) @@ -140,7 +140,7 @@ efx_mcdi_fini_rxq( efx_mcdi_execute_quiet(enp, &req); - if ((req.emr_rc != 0) && (req.emr_rc != MC_CMD_ERR_EALREADY)) { + if ((req.emr_rc != 0) && (req.emr_rc != EALREADY)) { rc = req.emr_rc; goto fail1; } Modified: head/sys/dev/sfxge/common/ef10_tx.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_tx.c Fri Nov 23 07:50:34 2018 (r340798) +++ head/sys/dev/sfxge/common/ef10_tx.c Fri Nov 23 07:50:45 2018 (r340799) @@ -151,7 +151,7 @@ efx_mcdi_fini_txq( efx_mcdi_execute_quiet(enp, &req); - if ((req.emr_rc != 0) && (req.emr_rc != MC_CMD_ERR_EALREADY)) { + if ((req.emr_rc != 0) && (req.emr_rc != EALREADY)) { rc = req.emr_rc; goto fail1; } From owner-svn-src-all@freebsd.org Fri Nov 23 07:51:00 2018 Return-Path: Delivered-To: svn-src-all@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 3D6EF113E1D1; Fri, 23 Nov 2018 07:51:00 +0000 (UTC) (envelope-from arybchik@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 C73277AFF0; Fri, 23 Nov 2018 07:50:59 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 496031BA47; Fri, 23 Nov 2018 07:50:57 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAN7ovef054623; Fri, 23 Nov 2018 07:50:57 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAN7ouc7054620; Fri, 23 Nov 2018 07:50:56 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811230750.wAN7ouc7054620@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 23 Nov 2018 07:50:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340800 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 340800 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C73277AFF0 X-Spamd-Result: default: False [1.49 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.42)[0.420,0]; NEURAL_SPAM_MEDIUM(0.74)[0.738,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.33)[0.334,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Nov 2018 07:51:00 -0000 Author: arybchik Date: Fri Nov 23 07:50:56 2018 New Revision: 340800 URL: https://svnweb.freebsd.org/changeset/base/340800 Log: sfxge(4): let caller know that queue is already flushed Tx/Rx queue may be already flushed due to Tx/Rx error on the queue or MC reboot. Caller needs to know that the queue is already flushed to avoid waiting for flush done event. Submitted by: Andy Moreton Sponsored by: Solarflare Communications, Inc. MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D18070 Modified: head/sys/dev/sfxge/common/ef10_ev.c head/sys/dev/sfxge/common/ef10_rx.c head/sys/dev/sfxge/common/ef10_tx.c Modified: head/sys/dev/sfxge/common/ef10_ev.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_ev.c Fri Nov 23 07:50:45 2018 (r340799) +++ head/sys/dev/sfxge/common/ef10_ev.c Fri Nov 23 07:50:56 2018 (r340800) @@ -434,7 +434,12 @@ efx_mcdi_fini_evq( return (0); fail1: - EFSYS_PROBE1(fail1, efx_rc_t, rc); + /* + * EALREADY is not an error, but indicates that the MC has rebooted and + * that the EVQ has already been destroyed. + */ + if (rc != EALREADY) + EFSYS_PROBE1(fail1, efx_rc_t, rc); return (rc); } Modified: head/sys/dev/sfxge/common/ef10_rx.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_rx.c Fri Nov 23 07:50:45 2018 (r340799) +++ head/sys/dev/sfxge/common/ef10_rx.c Fri Nov 23 07:50:56 2018 (r340800) @@ -140,7 +140,7 @@ efx_mcdi_fini_rxq( efx_mcdi_execute_quiet(enp, &req); - if ((req.emr_rc != 0) && (req.emr_rc != EALREADY)) { + if (req.emr_rc != 0) { rc = req.emr_rc; goto fail1; } @@ -148,7 +148,12 @@ efx_mcdi_fini_rxq( return (0); fail1: - EFSYS_PROBE1(fail1, efx_rc_t, rc); + /* + * EALREADY is not an error, but indicates that the MC has rebooted and + * that the RXQ has already been destroyed. + */ + if (rc != EALREADY) + EFSYS_PROBE1(fail1, efx_rc_t, rc); return (rc); } @@ -819,7 +824,14 @@ ef10_rx_qflush( return (0); fail1: - EFSYS_PROBE1(fail1, efx_rc_t, rc); + /* + * EALREADY is not an error, but indicates that the MC has rebooted and + * that the RXQ has already been destroyed. Callers need to know that + * the RXQ flush has completed to avoid waiting until timeout for a + * flush done event that will not be delivered. + */ + if (rc != EALREADY) + EFSYS_PROBE1(fail1, efx_rc_t, rc); return (rc); } Modified: head/sys/dev/sfxge/common/ef10_tx.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_tx.c Fri Nov 23 07:50:45 2018 (r340799) +++ head/sys/dev/sfxge/common/ef10_tx.c Fri Nov 23 07:50:56 2018 (r340800) @@ -151,7 +151,7 @@ efx_mcdi_fini_txq( efx_mcdi_execute_quiet(enp, &req); - if ((req.emr_rc != 0) && (req.emr_rc != EALREADY)) { + if (req.emr_rc != 0) { rc = req.emr_rc; goto fail1; } @@ -159,7 +159,12 @@ efx_mcdi_fini_txq( return (0); fail1: - EFSYS_PROBE1(fail1, efx_rc_t, rc); + /* + * EALREADY is not an error, but indicates that the MC has rebooted and + * that the TXQ has already been destroyed. + */ + if (rc != EALREADY) + EFSYS_PROBE1(fail1, efx_rc_t, rc); return (rc); } @@ -690,7 +695,14 @@ ef10_tx_qpace( return (0); fail1: - EFSYS_PROBE1(fail1, efx_rc_t, rc); + /* + * EALREADY is not an error, but indicates that the MC has rebooted and + * that the TXQ has already been destroyed. Callers need to know that + * the TXQ flush has completed to avoid waiting until timeout for a + * flush done event that will not be delivered. + */ + if (rc != EALREADY) + EFSYS_PROBE1(fail1, efx_rc_t, rc); return (rc); } From owner-svn-src-all@freebsd.org Fri Nov 23 09:02:59 2018 Return-Path: Delivered-To: svn-src-all@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 759A2113FBEF; Fri, 23 Nov 2018 09:02:59 +0000 (UTC) (envelope-from arybchik@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 1A24F7D0F5; Fri, 23 Nov 2018 09:02:59 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E5D171C6FF; Fri, 23 Nov 2018 09:02:58 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAN92weq094620; Fri, 23 Nov 2018 09:02:58 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAN92wTV094618; Fri, 23 Nov 2018 09:02:58 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811230902.wAN92wTV094618@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 23 Nov 2018 09:02:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340801 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 340801 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 1A24F7D0F5 X-Spamd-Result: default: False [1.52 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.40)[0.400,0]; NEURAL_SPAM_MEDIUM(0.72)[0.721,0]; NEURAL_SPAM_SHORT(0.40)[0.395,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Nov 2018 09:02:59 -0000 Author: arybchik Date: Fri Nov 23 09:02:58 2018 New Revision: 340801 URL: https://svnweb.freebsd.org/changeset/base/340801 Log: sfxge(4): provide information about supported tunnels VXLAN/NVGRE (and Geneve) support is available on SFN8xxx with full-feature firmware variant running. Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18071 Modified: head/sys/dev/sfxge/common/ef10_nic.c head/sys/dev/sfxge/common/efx.h Modified: head/sys/dev/sfxge/common/ef10_nic.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_nic.c Fri Nov 23 07:50:56 2018 (r340800) +++ head/sys/dev/sfxge/common/ef10_nic.c Fri Nov 23 09:02:58 2018 (r340801) @@ -1075,6 +1075,16 @@ ef10_get_datapath_caps( encp->enc_mac_stats_40g_tx_size_bins = CAP_FLAG2(flags2, MAC_STATS_40G_TX_SIZE_BINS) ? B_TRUE : B_FALSE; + /* + * Check if firmware supports VXLAN and NVGRE tunnels. + * The capability indicates Geneve protocol support as well. + */ + if (CAP_FLAG(flags, VXLAN_NVGRE)) + encp->enc_tunnel_encapsulations_supported = + (1u << EFX_TUNNEL_PROTOCOL_VXLAN) | + (1u << EFX_TUNNEL_PROTOCOL_GENEVE) | + (1u << EFX_TUNNEL_PROTOCOL_NVGRE); + #undef CAP_FLAG #undef CAP_FLAG2 Modified: head/sys/dev/sfxge/common/efx.h ============================================================================== --- head/sys/dev/sfxge/common/efx.h Fri Nov 23 07:50:56 2018 (r340800) +++ head/sys/dev/sfxge/common/efx.h Fri Nov 23 09:02:58 2018 (r340801) @@ -1095,6 +1095,14 @@ efx_bist_stop( #define EFX_FEATURE_FW_ASSISTED_TSO_V2 0x00002000 #define EFX_FEATURE_PACKED_STREAM 0x00004000 +typedef enum efx_tunnel_protocol_e { + EFX_TUNNEL_PROTOCOL_NONE = 0, + EFX_TUNNEL_PROTOCOL_VXLAN, + EFX_TUNNEL_PROTOCOL_GENEVE, + EFX_TUNNEL_PROTOCOL_NVGRE, + EFX_TUNNEL_NPROTOS +} efx_tunnel_protocol_t; + typedef struct efx_nic_cfg_s { uint32_t enc_board_type; uint32_t enc_phy_type; @@ -1194,6 +1202,7 @@ typedef struct efx_nic_cfg_s { boolean_t enc_rx_var_packed_stream_supported; boolean_t enc_pm_and_rxdp_counters; boolean_t enc_mac_stats_40g_tx_size_bins; + uint32_t enc_tunnel_encapsulations_supported; /* External port identifier */ uint8_t enc_external_port; uint32_t enc_mcdi_max_payload_length; From owner-svn-src-all@freebsd.org Fri Nov 23 09:03:12 2018 Return-Path: Delivered-To: svn-src-all@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 214E7113FC13; Fri, 23 Nov 2018 09:03:12 +0000 (UTC) (envelope-from arybchik@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 B74DD7D1E3; Fri, 23 Nov 2018 09:03:11 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 59AA21C700; Fri, 23 Nov 2018 09:03:10 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAN93Ax3094681; Fri, 23 Nov 2018 09:03:10 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAN93AtI094680; Fri, 23 Nov 2018 09:03:10 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811230903.wAN93AtI094680@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 23 Nov 2018 09:03:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340802 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 340802 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B74DD7D1E3 X-Spamd-Result: default: False [1.59 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.44)[0.439,0]; NEURAL_SPAM_MEDIUM(0.75)[0.754,0]; NEURAL_SPAM_SHORT(0.40)[0.397,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Nov 2018 09:03:12 -0000 Author: arybchik Date: Fri Nov 23 09:03:09 2018 New Revision: 340802 URL: https://svnweb.freebsd.org/changeset/base/340802 Log: sfxge(4): use proper MCDI command for encap filters MC_CMD_FILTER_OP_IN_EXT is needed to set filters for encapsulated packets. Submitted by: Mark Spender Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18072 Modified: head/sys/dev/sfxge/common/ef10_filter.c Modified: head/sys/dev/sfxge/common/ef10_filter.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_filter.c Fri Nov 23 09:02:58 2018 (r340801) +++ head/sys/dev/sfxge/common/ef10_filter.c Fri Nov 23 09:03:09 2018 (r340802) @@ -126,29 +126,29 @@ ef10_filter_init( #define MATCH_MASK(match) (EFX_MASK32(match) << EFX_LOW_BIT(match)) EFX_STATIC_ASSERT(EFX_FILTER_MATCH_REM_HOST == - MATCH_MASK(MC_CMD_FILTER_OP_IN_MATCH_SRC_IP)); + MATCH_MASK(MC_CMD_FILTER_OP_EXT_IN_MATCH_SRC_IP)); EFX_STATIC_ASSERT(EFX_FILTER_MATCH_LOC_HOST == - MATCH_MASK(MC_CMD_FILTER_OP_IN_MATCH_DST_IP)); + MATCH_MASK(MC_CMD_FILTER_OP_EXT_IN_MATCH_DST_IP)); EFX_STATIC_ASSERT(EFX_FILTER_MATCH_REM_MAC == - MATCH_MASK(MC_CMD_FILTER_OP_IN_MATCH_SRC_MAC)); + MATCH_MASK(MC_CMD_FILTER_OP_EXT_IN_MATCH_SRC_MAC)); EFX_STATIC_ASSERT(EFX_FILTER_MATCH_REM_PORT == - MATCH_MASK(MC_CMD_FILTER_OP_IN_MATCH_SRC_PORT)); + MATCH_MASK(MC_CMD_FILTER_OP_EXT_IN_MATCH_SRC_PORT)); EFX_STATIC_ASSERT(EFX_FILTER_MATCH_LOC_MAC == - MATCH_MASK(MC_CMD_FILTER_OP_IN_MATCH_DST_MAC)); + MATCH_MASK(MC_CMD_FILTER_OP_EXT_IN_MATCH_DST_MAC)); EFX_STATIC_ASSERT(EFX_FILTER_MATCH_LOC_PORT == - MATCH_MASK(MC_CMD_FILTER_OP_IN_MATCH_DST_PORT)); + MATCH_MASK(MC_CMD_FILTER_OP_EXT_IN_MATCH_DST_PORT)); EFX_STATIC_ASSERT(EFX_FILTER_MATCH_ETHER_TYPE == - MATCH_MASK(MC_CMD_FILTER_OP_IN_MATCH_ETHER_TYPE)); + MATCH_MASK(MC_CMD_FILTER_OP_EXT_IN_MATCH_ETHER_TYPE)); EFX_STATIC_ASSERT(EFX_FILTER_MATCH_INNER_VID == - MATCH_MASK(MC_CMD_FILTER_OP_IN_MATCH_INNER_VLAN)); + MATCH_MASK(MC_CMD_FILTER_OP_EXT_IN_MATCH_INNER_VLAN)); EFX_STATIC_ASSERT(EFX_FILTER_MATCH_OUTER_VID == - MATCH_MASK(MC_CMD_FILTER_OP_IN_MATCH_OUTER_VLAN)); + MATCH_MASK(MC_CMD_FILTER_OP_EXT_IN_MATCH_OUTER_VLAN)); EFX_STATIC_ASSERT(EFX_FILTER_MATCH_IP_PROTO == - MATCH_MASK(MC_CMD_FILTER_OP_IN_MATCH_IP_PROTO)); + MATCH_MASK(MC_CMD_FILTER_OP_EXT_IN_MATCH_IP_PROTO)); EFX_STATIC_ASSERT(EFX_FILTER_MATCH_UNKNOWN_MCAST_DST == - MATCH_MASK(MC_CMD_FILTER_OP_IN_MATCH_UNKNOWN_MCAST_DST)); + MATCH_MASK(MC_CMD_FILTER_OP_EXT_IN_MATCH_UNKNOWN_MCAST_DST)); EFX_STATIC_ASSERT((uint32_t)EFX_FILTER_MATCH_UNKNOWN_UCAST_DST == - MATCH_MASK(MC_CMD_FILTER_OP_IN_MATCH_UNKNOWN_UCAST_DST)); + MATCH_MASK(MC_CMD_FILTER_OP_EXT_IN_MATCH_UNKNOWN_UCAST_DST)); #undef MATCH_MASK EFSYS_KMEM_ALLOC(enp->en_esip, sizeof (ef10_filter_table_t), eftp); @@ -189,27 +189,27 @@ efx_mcdi_filter_op_add( __inout ef10_filter_handle_t *handle) { efx_mcdi_req_t req; - uint8_t payload[MAX(MC_CMD_FILTER_OP_IN_LEN, - MC_CMD_FILTER_OP_OUT_LEN)]; + uint8_t payload[MAX(MC_CMD_FILTER_OP_EXT_IN_LEN, + MC_CMD_FILTER_OP_EXT_OUT_LEN)]; efx_rc_t rc; memset(payload, 0, sizeof (payload)); req.emr_cmd = MC_CMD_FILTER_OP; req.emr_in_buf = payload; - req.emr_in_length = MC_CMD_FILTER_OP_IN_LEN; + req.emr_in_length = MC_CMD_FILTER_OP_EXT_IN_LEN; req.emr_out_buf = payload; - req.emr_out_length = MC_CMD_FILTER_OP_OUT_LEN; + req.emr_out_length = MC_CMD_FILTER_OP_EXT_OUT_LEN; switch (filter_op) { case MC_CMD_FILTER_OP_IN_OP_REPLACE: - MCDI_IN_SET_DWORD(req, FILTER_OP_IN_HANDLE_LO, + MCDI_IN_SET_DWORD(req, FILTER_OP_EXT_IN_HANDLE_LO, handle->efh_lo); - MCDI_IN_SET_DWORD(req, FILTER_OP_IN_HANDLE_HI, + MCDI_IN_SET_DWORD(req, FILTER_OP_EXT_IN_HANDLE_HI, handle->efh_hi); /* Fall through */ case MC_CMD_FILTER_OP_IN_OP_INSERT: case MC_CMD_FILTER_OP_IN_OP_SUBSCRIBE: - MCDI_IN_SET_DWORD(req, FILTER_OP_IN_OP, filter_op); + MCDI_IN_SET_DWORD(req, FILTER_OP_EXT_IN_OP, filter_op); break; default: EFSYS_ASSERT(0); @@ -217,63 +217,63 @@ efx_mcdi_filter_op_add( goto fail1; } - MCDI_IN_SET_DWORD(req, FILTER_OP_IN_PORT_ID, + MCDI_IN_SET_DWORD(req, FILTER_OP_EXT_IN_PORT_ID, EVB_PORT_ID_ASSIGNED); - MCDI_IN_SET_DWORD(req, FILTER_OP_IN_MATCH_FIELDS, + MCDI_IN_SET_DWORD(req, FILTER_OP_EXT_IN_MATCH_FIELDS, spec->efs_match_flags); - MCDI_IN_SET_DWORD(req, FILTER_OP_IN_RX_DEST, - MC_CMD_FILTER_OP_IN_RX_DEST_HOST); - MCDI_IN_SET_DWORD(req, FILTER_OP_IN_RX_QUEUE, + MCDI_IN_SET_DWORD(req, FILTER_OP_EXT_IN_RX_DEST, + MC_CMD_FILTER_OP_EXT_IN_RX_DEST_HOST); + MCDI_IN_SET_DWORD(req, FILTER_OP_EXT_IN_RX_QUEUE, spec->efs_dmaq_id); if (spec->efs_flags & EFX_FILTER_FLAG_RX_RSS) { - MCDI_IN_SET_DWORD(req, FILTER_OP_IN_RX_CONTEXT, + MCDI_IN_SET_DWORD(req, FILTER_OP_EXT_IN_RX_CONTEXT, spec->efs_rss_context); } - MCDI_IN_SET_DWORD(req, FILTER_OP_IN_RX_MODE, + MCDI_IN_SET_DWORD(req, FILTER_OP_EXT_IN_RX_MODE, spec->efs_flags & EFX_FILTER_FLAG_RX_RSS ? - MC_CMD_FILTER_OP_IN_RX_MODE_RSS : - MC_CMD_FILTER_OP_IN_RX_MODE_SIMPLE); - MCDI_IN_SET_DWORD(req, FILTER_OP_IN_TX_DEST, - MC_CMD_FILTER_OP_IN_TX_DEST_DEFAULT); + MC_CMD_FILTER_OP_EXT_IN_RX_MODE_RSS : + MC_CMD_FILTER_OP_EXT_IN_RX_MODE_SIMPLE); + MCDI_IN_SET_DWORD(req, FILTER_OP_EXT_IN_TX_DEST, + MC_CMD_FILTER_OP_EXT_IN_TX_DEST_DEFAULT); if (filter_op != MC_CMD_FILTER_OP_IN_OP_REPLACE) { /* * NOTE: Unlike most MCDI requests, the filter fields * are presented in network (big endian) byte order. */ - memcpy(MCDI_IN2(req, uint8_t, FILTER_OP_IN_SRC_MAC), + memcpy(MCDI_IN2(req, uint8_t, FILTER_OP_EXT_IN_SRC_MAC), spec->efs_rem_mac, EFX_MAC_ADDR_LEN); - memcpy(MCDI_IN2(req, uint8_t, FILTER_OP_IN_DST_MAC), + memcpy(MCDI_IN2(req, uint8_t, FILTER_OP_EXT_IN_DST_MAC), spec->efs_loc_mac, EFX_MAC_ADDR_LEN); - MCDI_IN_SET_WORD(req, FILTER_OP_IN_SRC_PORT, + MCDI_IN_SET_WORD(req, FILTER_OP_EXT_IN_SRC_PORT, __CPU_TO_BE_16(spec->efs_rem_port)); - MCDI_IN_SET_WORD(req, FILTER_OP_IN_DST_PORT, + MCDI_IN_SET_WORD(req, FILTER_OP_EXT_IN_DST_PORT, __CPU_TO_BE_16(spec->efs_loc_port)); - MCDI_IN_SET_WORD(req, FILTER_OP_IN_ETHER_TYPE, + MCDI_IN_SET_WORD(req, FILTER_OP_EXT_IN_ETHER_TYPE, __CPU_TO_BE_16(spec->efs_ether_type)); - MCDI_IN_SET_WORD(req, FILTER_OP_IN_INNER_VLAN, + MCDI_IN_SET_WORD(req, FILTER_OP_EXT_IN_INNER_VLAN, __CPU_TO_BE_16(spec->efs_inner_vid)); - MCDI_IN_SET_WORD(req, FILTER_OP_IN_OUTER_VLAN, + MCDI_IN_SET_WORD(req, FILTER_OP_EXT_IN_OUTER_VLAN, __CPU_TO_BE_16(spec->efs_outer_vid)); /* IP protocol (in low byte, high byte is zero) */ - MCDI_IN_SET_BYTE(req, FILTER_OP_IN_IP_PROTO, + MCDI_IN_SET_BYTE(req, FILTER_OP_EXT_IN_IP_PROTO, spec->efs_ip_proto); EFX_STATIC_ASSERT(sizeof (spec->efs_rem_host) == - MC_CMD_FILTER_OP_IN_SRC_IP_LEN); + MC_CMD_FILTER_OP_EXT_IN_SRC_IP_LEN); EFX_STATIC_ASSERT(sizeof (spec->efs_loc_host) == - MC_CMD_FILTER_OP_IN_DST_IP_LEN); + MC_CMD_FILTER_OP_EXT_IN_DST_IP_LEN); - memcpy(MCDI_IN2(req, uint8_t, FILTER_OP_IN_SRC_IP), + memcpy(MCDI_IN2(req, uint8_t, FILTER_OP_EXT_IN_SRC_IP), &spec->efs_rem_host.eo_byte[0], - MC_CMD_FILTER_OP_IN_SRC_IP_LEN); - memcpy(MCDI_IN2(req, uint8_t, FILTER_OP_IN_DST_IP), + MC_CMD_FILTER_OP_EXT_IN_SRC_IP_LEN); + memcpy(MCDI_IN2(req, uint8_t, FILTER_OP_EXT_IN_DST_IP), &spec->efs_loc_host.eo_byte[0], - MC_CMD_FILTER_OP_IN_DST_IP_LEN); + MC_CMD_FILTER_OP_EXT_IN_DST_IP_LEN); } efx_mcdi_execute(enp, &req); @@ -283,13 +283,13 @@ efx_mcdi_filter_op_add( goto fail2; } - if (req.emr_out_length_used < MC_CMD_FILTER_OP_OUT_LEN) { + if (req.emr_out_length_used < MC_CMD_FILTER_OP_EXT_OUT_LEN) { rc = EMSGSIZE; goto fail3; } - handle->efh_lo = MCDI_OUT_DWORD(req, FILTER_OP_OUT_HANDLE_LO); - handle->efh_hi = MCDI_OUT_DWORD(req, FILTER_OP_OUT_HANDLE_HI); + handle->efh_lo = MCDI_OUT_DWORD(req, FILTER_OP_EXT_OUT_HANDLE_LO); + handle->efh_hi = MCDI_OUT_DWORD(req, FILTER_OP_EXT_OUT_HANDLE_HI); return (0); @@ -311,24 +311,24 @@ efx_mcdi_filter_op_delete( __inout ef10_filter_handle_t *handle) { efx_mcdi_req_t req; - uint8_t payload[MAX(MC_CMD_FILTER_OP_IN_LEN, - MC_CMD_FILTER_OP_OUT_LEN)]; + uint8_t payload[MAX(MC_CMD_FILTER_OP_EXT_IN_LEN, + MC_CMD_FILTER_OP_EXT_OUT_LEN)]; efx_rc_t rc; memset(payload, 0, sizeof (payload)); req.emr_cmd = MC_CMD_FILTER_OP; req.emr_in_buf = payload; - req.emr_in_length = MC_CMD_FILTER_OP_IN_LEN; + req.emr_in_length = MC_CMD_FILTER_OP_EXT_IN_LEN; req.emr_out_buf = payload; - req.emr_out_length = MC_CMD_FILTER_OP_OUT_LEN; + req.emr_out_length = MC_CMD_FILTER_OP_EXT_OUT_LEN; switch (filter_op) { case MC_CMD_FILTER_OP_IN_OP_REMOVE: - MCDI_IN_SET_DWORD(req, FILTER_OP_IN_OP, + MCDI_IN_SET_DWORD(req, FILTER_OP_EXT_IN_OP, MC_CMD_FILTER_OP_IN_OP_REMOVE); break; case MC_CMD_FILTER_OP_IN_OP_UNSUBSCRIBE: - MCDI_IN_SET_DWORD(req, FILTER_OP_IN_OP, + MCDI_IN_SET_DWORD(req, FILTER_OP_EXT_IN_OP, MC_CMD_FILTER_OP_IN_OP_UNSUBSCRIBE); break; default: @@ -337,8 +337,8 @@ efx_mcdi_filter_op_delete( goto fail1; } - MCDI_IN_SET_DWORD(req, FILTER_OP_IN_HANDLE_LO, handle->efh_lo); - MCDI_IN_SET_DWORD(req, FILTER_OP_IN_HANDLE_HI, handle->efh_hi); + MCDI_IN_SET_DWORD(req, FILTER_OP_EXT_IN_HANDLE_LO, handle->efh_lo); + MCDI_IN_SET_DWORD(req, FILTER_OP_EXT_IN_HANDLE_HI, handle->efh_hi); efx_mcdi_execute_quiet(enp, &req); @@ -347,7 +347,7 @@ efx_mcdi_filter_op_delete( goto fail2; } - if (req.emr_out_length_used < MC_CMD_FILTER_OP_OUT_LEN) { + if (req.emr_out_length_used < MC_CMD_FILTER_OP_EXT_OUT_LEN) { rc = EMSGSIZE; goto fail3; } From owner-svn-src-all@freebsd.org Fri Nov 23 09:03:26 2018 Return-Path: Delivered-To: svn-src-all@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 D2EC2113FC36; Fri, 23 Nov 2018 09:03:25 +0000 (UTC) (envelope-from arybchik@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 78ACC7D2E4; Fri, 23 Nov 2018 09:03:25 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B89631C705; Fri, 23 Nov 2018 09:03:21 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAN93Lrj094740; Fri, 23 Nov 2018 09:03:21 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAN93LxX094738; Fri, 23 Nov 2018 09:03:21 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811230903.wAN93LxX094738@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 23 Nov 2018 09:03:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340803 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 340803 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 78ACC7D2E4 X-Spamd-Result: default: False [1.59 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.44)[0.439,0]; NEURAL_SPAM_MEDIUM(0.75)[0.754,0]; NEURAL_SPAM_SHORT(0.40)[0.397,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Nov 2018 09:03:26 -0000 Author: arybchik Date: Fri Nov 23 09:03:20 2018 New Revision: 340803 URL: https://svnweb.freebsd.org/changeset/base/340803 Log: sfxge(4): support filters for encapsulated packets This supports filters which match all unicast or multicast inner frames in VXLAN, GENEVE, or NVGRE packets. (Additional fields to match on can be added easily.) Submitted by: Mark Spender Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18073 Modified: head/sys/dev/sfxge/common/ef10_filter.c head/sys/dev/sfxge/common/efx.h head/sys/dev/sfxge/common/efx_filter.c Modified: head/sys/dev/sfxge/common/ef10_filter.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_filter.c Fri Nov 23 09:03:09 2018 (r340802) +++ head/sys/dev/sfxge/common/ef10_filter.c Fri Nov 23 09:03:20 2018 (r340803) @@ -145,6 +145,10 @@ ef10_filter_init( MATCH_MASK(MC_CMD_FILTER_OP_EXT_IN_MATCH_OUTER_VLAN)); EFX_STATIC_ASSERT(EFX_FILTER_MATCH_IP_PROTO == MATCH_MASK(MC_CMD_FILTER_OP_EXT_IN_MATCH_IP_PROTO)); + EFX_STATIC_ASSERT(EFX_FILTER_MATCH_IFRM_UNKNOWN_MCAST_DST == + MATCH_MASK(MC_CMD_FILTER_OP_EXT_IN_MATCH_IFRM_UNKNOWN_MCAST_DST)); + EFX_STATIC_ASSERT(EFX_FILTER_MATCH_IFRM_UNKNOWN_UCAST_DST == + MATCH_MASK(MC_CMD_FILTER_OP_EXT_IN_MATCH_IFRM_UNKNOWN_UCAST_DST)); EFX_STATIC_ASSERT(EFX_FILTER_MATCH_UNKNOWN_MCAST_DST == MATCH_MASK(MC_CMD_FILTER_OP_EXT_IN_MATCH_UNKNOWN_MCAST_DST)); EFX_STATIC_ASSERT((uint32_t)EFX_FILTER_MATCH_UNKNOWN_UCAST_DST == @@ -274,18 +278,47 @@ efx_mcdi_filter_op_add( memcpy(MCDI_IN2(req, uint8_t, FILTER_OP_EXT_IN_DST_IP), &spec->efs_loc_host.eo_byte[0], MC_CMD_FILTER_OP_EXT_IN_DST_IP_LEN); + + /* + * On Medford, filters for encapsulated packets match based on + * the ether type and IP protocol in the outer frame. In + * addition we need to fill in the VNI or VSID type field. + */ + switch (spec->efs_encap_type) { + case EFX_TUNNEL_PROTOCOL_NONE: + break; + case EFX_TUNNEL_PROTOCOL_VXLAN: + case EFX_TUNNEL_PROTOCOL_GENEVE: + MCDI_IN_POPULATE_DWORD_1(req, + FILTER_OP_EXT_IN_VNI_OR_VSID, + FILTER_OP_EXT_IN_VNI_TYPE, + spec->efs_encap_type == EFX_TUNNEL_PROTOCOL_VXLAN ? + MC_CMD_FILTER_OP_EXT_IN_VNI_TYPE_VXLAN : + MC_CMD_FILTER_OP_EXT_IN_VNI_TYPE_GENEVE); + break; + case EFX_TUNNEL_PROTOCOL_NVGRE: + MCDI_IN_POPULATE_DWORD_1(req, + FILTER_OP_EXT_IN_VNI_OR_VSID, + FILTER_OP_EXT_IN_VSID_TYPE, + MC_CMD_FILTER_OP_EXT_IN_VSID_TYPE_NVGRE); + break; + default: + EFSYS_ASSERT(0); + rc = EINVAL; + goto fail2; + } } efx_mcdi_execute(enp, &req); if (req.emr_rc != 0) { rc = req.emr_rc; - goto fail2; + goto fail3; } if (req.emr_out_length_used < MC_CMD_FILTER_OP_EXT_OUT_LEN) { rc = EMSGSIZE; - goto fail3; + goto fail4; } handle->efh_lo = MCDI_OUT_DWORD(req, FILTER_OP_EXT_OUT_HANDLE_LO); @@ -293,6 +326,8 @@ efx_mcdi_filter_op_add( return (0); +fail4: + EFSYS_PROBE(fail4); fail3: EFSYS_PROBE(fail3); fail2: @@ -392,6 +427,8 @@ ef10_filter_equal( if (left->efs_ether_type != right->efs_ether_type) return (B_FALSE); if (left->efs_ip_proto != right->efs_ip_proto) + return (B_FALSE); + if (left->efs_encap_type != right->efs_encap_type) return (B_FALSE); return (B_TRUE); Modified: head/sys/dev/sfxge/common/efx.h ============================================================================== --- head/sys/dev/sfxge/common/efx.h Fri Nov 23 09:03:09 2018 (r340802) +++ head/sys/dev/sfxge/common/efx.h Fri Nov 23 09:03:20 2018 (r340803) @@ -2230,6 +2230,7 @@ efx_tx_qdestroy( #define EFX_IPPROTO_TCP 6 #define EFX_IPPROTO_UDP 17 +#define EFX_IPPROTO_GRE 47 /* Use RSS to spread across multiple queues */ #define EFX_FILTER_FLAG_RX_RSS 0x01 @@ -2248,6 +2249,10 @@ efx_tx_qdestroy( typedef unsigned int efx_filter_flags_t; +/* + * Flags which specify the fields to match on. The values are the same as in the + * MC_CMD_FILTER_OP/MC_CMD_FILTER_OP_EXT commands. + */ typedef enum efx_filter_match_flags_e { EFX_FILTER_MATCH_REM_HOST = 0x0001, /* Match by remote IP host * address */ @@ -2262,6 +2267,10 @@ typedef enum efx_filter_match_flags_e { EFX_FILTER_MATCH_OUTER_VID = 0x0100, /* Match by outer VLAN ID */ EFX_FILTER_MATCH_IP_PROTO = 0x0200, /* Match by IP transport * protocol */ + /* For encapsulated packets, match all multicast inner frames */ + EFX_FILTER_MATCH_IFRM_UNKNOWN_MCAST_DST = 0x01000000, + /* For encapsulated packets, match all unicast inner frames */ + EFX_FILTER_MATCH_IFRM_UNKNOWN_UCAST_DST = 0x02000000, /* Match otherwise-unmatched multicast and broadcast packets */ EFX_FILTER_MATCH_UNKNOWN_MCAST_DST = 0x40000000, /* Match otherwise-unmatched unicast packets */ @@ -2287,21 +2296,22 @@ typedef enum efx_filter_priority_s { */ typedef struct efx_filter_spec_s { - uint32_t efs_match_flags; - uint32_t efs_priority:2; - uint32_t efs_flags:6; - uint32_t efs_dmaq_id:12; - uint32_t efs_rss_context; - uint16_t efs_outer_vid; - uint16_t efs_inner_vid; - uint8_t efs_loc_mac[EFX_MAC_ADDR_LEN]; - uint8_t efs_rem_mac[EFX_MAC_ADDR_LEN]; - uint16_t efs_ether_type; - uint8_t efs_ip_proto; - uint16_t efs_loc_port; - uint16_t efs_rem_port; - efx_oword_t efs_rem_host; - efx_oword_t efs_loc_host; + uint32_t efs_match_flags; + uint32_t efs_priority:2; + uint32_t efs_flags:6; + uint32_t efs_dmaq_id:12; + uint32_t efs_rss_context; + uint16_t efs_outer_vid; + uint16_t efs_inner_vid; + uint8_t efs_loc_mac[EFX_MAC_ADDR_LEN]; + uint8_t efs_rem_mac[EFX_MAC_ADDR_LEN]; + uint16_t efs_ether_type; + uint8_t efs_ip_proto; + efx_tunnel_protocol_t efs_encap_type; + uint16_t efs_loc_port; + uint16_t efs_rem_port; + efx_oword_t efs_rem_host; + efx_oword_t efs_loc_host; } efx_filter_spec_t; @@ -2373,6 +2383,11 @@ efx_filter_spec_set_eth_local( __in uint16_t vid, __in const uint8_t *addr); +extern void +efx_filter_spec_set_ether_type( + __inout efx_filter_spec_t *spec, + __in uint16_t ether_type); + extern __checkReturn efx_rc_t efx_filter_spec_set_uc_def( __inout efx_filter_spec_t *spec); @@ -2380,6 +2395,19 @@ efx_filter_spec_set_uc_def( extern __checkReturn efx_rc_t efx_filter_spec_set_mc_def( __inout efx_filter_spec_t *spec); + +typedef enum efx_filter_inner_frame_match_e { + EFX_FILTER_INNER_FRAME_MATCH_OTHER = 0, + EFX_FILTER_INNER_FRAME_MATCH_UNKNOWN_MCAST_DST, + EFX_FILTER_INNER_FRAME_MATCH_UNKNOWN_UCAST_DST +} efx_filter_inner_frame_match_t; + +extern __checkReturn efx_rc_t +efx_filter_spec_set_encap_type( + __inout efx_filter_spec_t *spec, + __in efx_tunnel_protocol_t encap_type, + __in efx_filter_inner_frame_match_t inner_frame_match); + #endif /* EFSYS_OPT_FILTER */ Modified: head/sys/dev/sfxge/common/efx_filter.c ============================================================================== --- head/sys/dev/sfxge/common/efx_filter.c Fri Nov 23 09:03:09 2018 (r340802) +++ head/sys/dev/sfxge/common/efx_filter.c Fri Nov 23 09:03:20 2018 (r340803) @@ -401,6 +401,17 @@ efx_filter_spec_set_eth_local( return (0); } + void +efx_filter_spec_set_ether_type( + __inout efx_filter_spec_t *spec, + __in uint16_t ether_type) +{ + EFSYS_ASSERT3P(spec, !=, NULL); + + spec->efs_ether_type = ether_type; + spec->efs_match_flags |= EFX_FILTER_MATCH_ETHER_TYPE; +} + /* * Specify matching otherwise-unmatched unicast in a filter specification */ @@ -425,6 +436,63 @@ efx_filter_spec_set_mc_def( spec->efs_match_flags |= EFX_FILTER_MATCH_UNKNOWN_MCAST_DST; return (0); +} + + +__checkReturn efx_rc_t +efx_filter_spec_set_encap_type( + __inout efx_filter_spec_t *spec, + __in efx_tunnel_protocol_t encap_type, + __in efx_filter_inner_frame_match_t inner_frame_match) +{ + uint32_t match_flags = 0; + uint8_t ip_proto; + efx_rc_t rc; + + EFSYS_ASSERT3P(spec, !=, NULL); + + switch (encap_type) { + case EFX_TUNNEL_PROTOCOL_VXLAN: + case EFX_TUNNEL_PROTOCOL_GENEVE: + ip_proto = EFX_IPPROTO_UDP; + break; + case EFX_TUNNEL_PROTOCOL_NVGRE: + ip_proto = EFX_IPPROTO_GRE; + break; + default: + EFSYS_ASSERT(0); + rc = EINVAL; + goto fail1; + } + + switch (inner_frame_match) { + case EFX_FILTER_INNER_FRAME_MATCH_UNKNOWN_MCAST_DST: + match_flags |= EFX_FILTER_MATCH_IFRM_UNKNOWN_MCAST_DST; + break; + case EFX_FILTER_INNER_FRAME_MATCH_UNKNOWN_UCAST_DST: + match_flags |= EFX_FILTER_MATCH_IFRM_UNKNOWN_UCAST_DST; + break; + case EFX_FILTER_INNER_FRAME_MATCH_OTHER: + /* This is for when specific inner frames are to be matched. */ + break; + default: + EFSYS_ASSERT(0); + rc = EINVAL; + goto fail2; + } + + spec->efs_encap_type = encap_type; + spec->efs_ip_proto = ip_proto; + spec->efs_match_flags |= (match_flags | EFX_FILTER_MATCH_IP_PROTO); + + return (0); + +fail2: + EFSYS_PROBE(fail2); +fail1: + EFSYS_PROBE1(fail1, efx_rc_t, rc); + + return (rc); } From owner-svn-src-all@freebsd.org Fri Nov 23 09:03:37 2018 Return-Path: Delivered-To: svn-src-all@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 92DD0113FC7A; Fri, 23 Nov 2018 09:03:37 +0000 (UTC) (envelope-from arybchik@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 52D267D3FD; Fri, 23 Nov 2018 09:03:37 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DF1CC1C70A; Fri, 23 Nov 2018 09:03:32 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAN93W8N094802; Fri, 23 Nov 2018 09:03:32 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAN93WNw094801; Fri, 23 Nov 2018 09:03:32 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811230903.wAN93WNw094801@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 23 Nov 2018 09:03:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340804 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 340804 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 52D267D3FD X-Spamd-Result: default: False [1.55 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.42)[0.420,0]; NEURAL_SPAM_MEDIUM(0.74)[0.738,0]; NEURAL_SPAM_SHORT(0.40)[0.396,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Nov 2018 09:03:37 -0000 Author: arybchik Date: Fri Nov 23 09:03:32 2018 New Revision: 340804 URL: https://svnweb.freebsd.org/changeset/base/340804 Log: sfxge(4): insert filters for encapsulated packets On Medford, with full-featured firmware running, encapsulated packets may not be delivered unless filters are inserted for them, as ordinary filters are not applied to encapsulated packets. So filters for encapsulated packets need to be inserted for each class of encapsulated packet. For simplicity, catch-all filters are always inserted. These may match more packets than the OS has asked for, but trying to insert more precise filters increases complexity for little gain. Submitted by: Mark Spender Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18074 Modified: head/sys/dev/sfxge/common/ef10_filter.c head/sys/dev/sfxge/common/ef10_impl.h Modified: head/sys/dev/sfxge/common/ef10_filter.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_filter.c Fri Nov 23 09:03:20 2018 (r340803) +++ head/sys/dev/sfxge/common/ef10_filter.c Fri Nov 23 09:03:32 2018 (r340804) @@ -1234,6 +1234,108 @@ fail1: return (rc); } +typedef struct ef10_filter_encap_entry_s { + uint16_t ether_type; + efx_tunnel_protocol_t encap_type; + uint32_t inner_frame_match; +} ef10_filter_encap_entry_t; + +#define EF10_ENCAP_FILTER_ENTRY(ipv, encap_type, inner_frame_match) \ + { EFX_ETHER_TYPE_##ipv, EFX_TUNNEL_PROTOCOL_##encap_type, \ + EFX_FILTER_INNER_FRAME_MATCH_UNKNOWN_##inner_frame_match } + +static ef10_filter_encap_entry_t ef10_filter_encap_list[] = { + EF10_ENCAP_FILTER_ENTRY(IPV4, VXLAN, UCAST_DST), + EF10_ENCAP_FILTER_ENTRY(IPV4, VXLAN, MCAST_DST), + EF10_ENCAP_FILTER_ENTRY(IPV6, VXLAN, UCAST_DST), + EF10_ENCAP_FILTER_ENTRY(IPV6, VXLAN, MCAST_DST), + + EF10_ENCAP_FILTER_ENTRY(IPV4, GENEVE, UCAST_DST), + EF10_ENCAP_FILTER_ENTRY(IPV4, GENEVE, MCAST_DST), + EF10_ENCAP_FILTER_ENTRY(IPV6, GENEVE, UCAST_DST), + EF10_ENCAP_FILTER_ENTRY(IPV6, GENEVE, MCAST_DST), + + EF10_ENCAP_FILTER_ENTRY(IPV4, NVGRE, UCAST_DST), + EF10_ENCAP_FILTER_ENTRY(IPV4, NVGRE, MCAST_DST), + EF10_ENCAP_FILTER_ENTRY(IPV6, NVGRE, UCAST_DST), + EF10_ENCAP_FILTER_ENTRY(IPV6, NVGRE, MCAST_DST), +}; + +#undef EF10_ENCAP_FILTER_ENTRY + +static __checkReturn efx_rc_t +ef10_filter_insert_encap_filters( + __in efx_nic_t *enp, + __in boolean_t mulcst, + __in efx_filter_flags_t filter_flags) +{ + ef10_filter_table_t *table = enp->en_filter.ef_ef10_filter_table; + uint32_t i; + efx_rc_t rc; + + EFX_STATIC_ASSERT(EFX_ARRAY_SIZE(ef10_filter_encap_list) <= + EFX_ARRAY_SIZE(table->eft_encap_filter_indexes)); + + /* + * On Medford, full-featured firmware can identify packets as being + * tunnel encapsulated, even if no encapsulated packet offloads are in + * use. When packets are identified as such, ordinary filters are not + * applied, only ones specific to encapsulated packets. Hence we need to + * insert filters for encapsulated packets in order to receive them. + * + * Separate filters need to be inserted for each ether type, + * encapsulation type, and inner frame type (unicast or multicast). To + * keep things simple and reduce the number of filters needed, catch-all + * filters for all combinations of types are inserted, even if + * all_unicst or all_mulcst have not been set. (These catch-all filters + * may well, however, fail to insert on unprivileged functions.) + */ + table->eft_encap_filter_count = 0; + for (i = 0; i < EFX_ARRAY_SIZE(ef10_filter_encap_list); i++) { + efx_filter_spec_t spec; + ef10_filter_encap_entry_t *encap_filter = + &ef10_filter_encap_list[i]; + + /* + * Skip multicast filters if we've not been asked for + * any multicast traffic. + */ + if ((mulcst == B_FALSE) && + (encap_filter->inner_frame_match == + EFX_FILTER_INNER_FRAME_MATCH_UNKNOWN_MCAST_DST)) + continue; + + efx_filter_spec_init_rx(&spec, EFX_FILTER_PRI_AUTO, + filter_flags, + table->eft_default_rxq); + efx_filter_spec_set_ether_type(&spec, encap_filter->ether_type); + rc = efx_filter_spec_set_encap_type(&spec, + encap_filter->encap_type, + encap_filter->inner_frame_match); + if (rc != 0) + goto fail1; + + rc = ef10_filter_add_internal(enp, &spec, B_TRUE, + &table->eft_encap_filter_indexes[ + table->eft_encap_filter_count]); + if (rc != 0) { + if (rc != EACCES) + goto fail2; + } else { + table->eft_encap_filter_count++; + } + } + + return (0); + +fail2: + EFSYS_PROBE(fail2); +fail1: + EFSYS_PROBE1(fail1, efx_rc_t, rc); + + return (rc); +} + static void ef10_filter_remove_old( __in efx_nic_t *enp) @@ -1329,6 +1431,12 @@ ef10_filter_reconfigure( } table->eft_mulcst_filter_count = 0; + for (i = 0; i < table->eft_encap_filter_count; i++) { + (void) ef10_filter_delete_internal(enp, + table->eft_encap_filter_indexes[i]); + } + table->eft_encap_filter_count = 0; + return (0); } @@ -1346,6 +1454,10 @@ ef10_filter_reconfigure( ef10_filter_set_entry_auto_old(table, table->eft_mulcst_filter_indexes[i]); } + for (i = 0; i < table->eft_encap_filter_count; i++) { + ef10_filter_set_entry_auto_old(table, + table->eft_encap_filter_indexes[i]); + } /* * Insert or renew unicast filters. @@ -1461,6 +1573,13 @@ ef10_filter_reconfigure( goto fail4; } } + } + + if (encp->enc_tunnel_encapsulations_supported != 0) { + /* Try to insert filters for encapsulated packets. */ + (void) ef10_filter_insert_encap_filters(enp, + mulcst || all_mulcst || brdcst, + filter_flags); } /* Remove old filters which were not renewed */ Modified: head/sys/dev/sfxge/common/ef10_impl.h ============================================================================== --- head/sys/dev/sfxge/common/ef10_impl.h Fri Nov 23 09:03:20 2018 (r340803) +++ head/sys/dev/sfxge/common/ef10_impl.h Fri Nov 23 09:03:32 2018 (r340804) @@ -1007,6 +1007,13 @@ typedef struct ef10_filter_entry_s { /* Allow for the broadcast address to be added to the multicast list */ #define EFX_EF10_FILTER_MULTICAST_FILTERS_MAX (EFX_MAC_MULTICAST_LIST_MAX + 1) +/* + * For encapsulated packets, there is one filter each for each combination of + * IPv4 or IPv6 outer frame, VXLAN, GENEVE or NVGRE packet type, and unicast or + * multicast inner frames. + */ +#define EFX_EF10_FILTER_ENCAP_FILTERS_MAX 12 + typedef struct ef10_filter_table_s { ef10_filter_entry_t eft_entry[EFX_EF10_FILTER_TBL_ROWS]; efx_rxq_t *eft_default_rxq; @@ -1018,6 +1025,9 @@ typedef struct ef10_filter_table_s { EFX_EF10_FILTER_MULTICAST_FILTERS_MAX]; uint32_t eft_mulcst_filter_count; boolean_t eft_using_all_mulcst; + uint32_t eft_encap_filter_indexes[ + EFX_EF10_FILTER_ENCAP_FILTERS_MAX]; + uint32_t eft_encap_filter_count; } ef10_filter_table_t; __checkReturn efx_rc_t From owner-svn-src-all@freebsd.org Fri Nov 23 09:14:47 2018 Return-Path: Delivered-To: svn-src-all@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 34D9D1140123; Fri, 23 Nov 2018 09:14:47 +0000 (UTC) (envelope-from arybchik@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 BB4767DB36; Fri, 23 Nov 2018 09:14:46 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9CF5F1C8A4; Fri, 23 Nov 2018 09:14:46 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAN9Ekn2099976; Fri, 23 Nov 2018 09:14:46 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAN9EkFV099973; Fri, 23 Nov 2018 09:14:46 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811230914.wAN9EkFV099973@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 23 Nov 2018 09:14:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340805 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 340805 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: BB4767DB36 X-Spamd-Result: default: False [1.52 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.40)[0.400,0]; NEURAL_SPAM_SHORT(0.40)[0.395,0]; NEURAL_SPAM_MEDIUM(0.72)[0.721,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Nov 2018 09:14:47 -0000 Author: arybchik Date: Fri Nov 23 09:14:45 2018 New Revision: 340805 URL: https://svnweb.freebsd.org/changeset/base/340805 Log: sfxge(4): define a handle to denote default RSS context Make the existing filter-specific define more general. This is the same as MC_CMD_RSS_CONTEXT_ALLOC_OUT_RSS_CONTEXT_ID_INVALID. Submitted by: Mark Spender Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18075 Modified: head/sys/dev/sfxge/common/efx.h head/sys/dev/sfxge/common/efx_filter.c Modified: head/sys/dev/sfxge/common/efx.h ============================================================================== --- head/sys/dev/sfxge/common/efx.h Fri Nov 23 09:03:32 2018 (r340804) +++ head/sys/dev/sfxge/common/efx.h Fri Nov 23 09:14:45 2018 (r340805) @@ -1889,6 +1889,9 @@ efx_rx_scatter_enable( __in unsigned int buf_size); #endif /* EFSYS_OPT_RX_SCATTER */ +/* Handle to represent use of the default RSS context. */ +#define EFX_RSS_CONTEXT_DEFAULT 0xffffffff + #if EFSYS_OPT_RX_SCALE typedef enum efx_rx_hash_alg_e { @@ -2316,7 +2319,6 @@ typedef struct efx_filter_spec_s { /* Default values for use in filter specifications */ -#define EFX_FILTER_SPEC_RSS_CONTEXT_DEFAULT 0xffffffff #define EFX_FILTER_SPEC_RX_DMAQ_ID_DROP 0xfff #define EFX_FILTER_SPEC_VID_UNSPEC 0xffff Modified: head/sys/dev/sfxge/common/efx_filter.c ============================================================================== --- head/sys/dev/sfxge/common/efx_filter.c Fri Nov 23 09:03:32 2018 (r340804) +++ head/sys/dev/sfxge/common/efx_filter.c Fri Nov 23 09:14:45 2018 (r340805) @@ -307,7 +307,7 @@ efx_filter_spec_init_rx( memset(spec, 0, sizeof (*spec)); spec->efs_priority = priority; spec->efs_flags = EFX_FILTER_FLAG_RX | flags; - spec->efs_rss_context = EFX_FILTER_SPEC_RSS_CONTEXT_DEFAULT; + spec->efs_rss_context = EFX_RSS_CONTEXT_DEFAULT; spec->efs_dmaq_id = (uint16_t)erp->er_index; } From owner-svn-src-all@freebsd.org Fri Nov 23 09:15:00 2018 Return-Path: Delivered-To: svn-src-all@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 9A344114015F; Fri, 23 Nov 2018 09:15:00 +0000 (UTC) (envelope-from arybchik@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 2BB977DC36; Fri, 23 Nov 2018 09:15:00 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1F53D1C8A5; Fri, 23 Nov 2018 09:14:58 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAN9Ew9T000134; Fri, 23 Nov 2018 09:14:58 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAN9Ew5p000133; Fri, 23 Nov 2018 09:14:58 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811230914.wAN9Ew5p000133@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 23 Nov 2018 09:14:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340806 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 340806 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 2BB977DC36 X-Spamd-Result: default: False [1.52 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.40)[0.400,0]; NEURAL_SPAM_MEDIUM(0.72)[0.721,0]; NEURAL_SPAM_SHORT(0.40)[0.395,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Nov 2018 09:15:00 -0000 Author: arybchik Date: Fri Nov 23 09:14:57 2018 New Revision: 340806 URL: https://svnweb.freebsd.org/changeset/base/340806 Log: sfxge(4): fix default RSS context check on Siena Default RSS context check is carried out during filter insertion on Siena and it needs to be fixed Submitted by: Mark Spender Sponsored by: Solarflare Communications, Inc. MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D18076 Modified: head/sys/dev/sfxge/common/efx_filter.c Modified: head/sys/dev/sfxge/common/efx_filter.c ============================================================================== --- head/sys/dev/sfxge/common/efx_filter.c Fri Nov 23 09:14:45 2018 (r340805) +++ head/sys/dev/sfxge/common/efx_filter.c Fri Nov 23 09:14:57 2018 (r340806) @@ -527,9 +527,9 @@ siena_filter_spec_from_gen_spec( else EFSYS_ASSERT3U(gen_spec->efs_flags, &, EFX_FILTER_FLAG_RX); - /* Falconsiena only has one RSS context */ + /* Siena only has one RSS context */ if ((gen_spec->efs_flags & EFX_FILTER_FLAG_RX_RSS) && - gen_spec->efs_rss_context != 0) { + gen_spec->efs_rss_context != EFX_RSS_CONTEXT_DEFAULT) { rc = EINVAL; goto fail1; } From owner-svn-src-all@freebsd.org Fri Nov 23 09:15:15 2018 Return-Path: Delivered-To: svn-src-all@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 0B9DD11401B3; Fri, 23 Nov 2018 09:15:15 +0000 (UTC) (envelope-from arybchik@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 A26AC7DD78; Fri, 23 Nov 2018 09:15:14 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F272C1C8AA; Fri, 23 Nov 2018 09:15:09 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAN9F94B000206; Fri, 23 Nov 2018 09:15:09 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAN9F9QS000202; Fri, 23 Nov 2018 09:15:09 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811230915.wAN9F9QS000202@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 23 Nov 2018 09:15:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340807 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 340807 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A26AC7DD78 X-Spamd-Result: default: False [1.55 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.42)[0.420,0]; NEURAL_SPAM_SHORT(0.40)[0.396,0]; NEURAL_SPAM_MEDIUM(0.74)[0.738,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Nov 2018 09:15:15 -0000 Author: arybchik Date: Fri Nov 23 09:15:08 2018 New Revision: 340807 URL: https://svnweb.freebsd.org/changeset/base/340807 Log: sfxge(4): add the max number of RSS exclusive contexts The patch adds enc_rx_scale_max_exclusive_contexts member to nic_cfg_t structure and sets the corresponding values for Siena, Huntington and Medford Submitted by: Mark Spender Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18077 Modified: head/sys/dev/sfxge/common/efx.h head/sys/dev/sfxge/common/hunt_nic.c head/sys/dev/sfxge/common/medford_nic.c head/sys/dev/sfxge/common/siena_nic.c Modified: head/sys/dev/sfxge/common/efx.h ============================================================================== --- head/sys/dev/sfxge/common/efx.h Fri Nov 23 09:14:57 2018 (r340806) +++ head/sys/dev/sfxge/common/efx.h Fri Nov 23 09:15:08 2018 (r340807) @@ -1134,6 +1134,7 @@ typedef struct efx_nic_cfg_s { uint32_t enc_rx_prefix_size; uint32_t enc_rx_buf_align_start; uint32_t enc_rx_buf_align_end; + uint32_t enc_rx_scale_max_exclusive_contexts; #if EFSYS_OPT_LOOPBACK efx_qword_t enc_loopback_types[EFX_LINK_NMODES]; #endif /* EFSYS_OPT_LOOPBACK */ Modified: head/sys/dev/sfxge/common/hunt_nic.c ============================================================================== --- head/sys/dev/sfxge/common/hunt_nic.c Fri Nov 23 09:14:57 2018 (r340806) +++ head/sys/dev/sfxge/common/hunt_nic.c Fri Nov 23 09:15:08 2018 (r340807) @@ -304,6 +304,13 @@ hunt_board_cfg( /* Alignment for WPTR updates */ encp->enc_rx_push_align = EF10_RX_WPTR_ALIGN; + /* + * Maximum number of exclusive RSS contexts which can be allocated. The + * hardware supports 64, but 6 are reserved for shared contexts. They + * are a global resource so not all may be available. + */ + encp->enc_rx_scale_max_exclusive_contexts = 58; + encp->enc_tx_dma_desc_size_max = EFX_MASK32(ESF_DZ_RX_KER_BYTE_CNT); /* No boundary crossing limits */ encp->enc_tx_dma_desc_boundary = 0; Modified: head/sys/dev/sfxge/common/medford_nic.c ============================================================================== --- head/sys/dev/sfxge/common/medford_nic.c Fri Nov 23 09:14:57 2018 (r340806) +++ head/sys/dev/sfxge/common/medford_nic.c Fri Nov 23 09:15:08 2018 (r340807) @@ -301,6 +301,13 @@ medford_board_cfg( /* Alignment for WPTR updates */ encp->enc_rx_push_align = EF10_RX_WPTR_ALIGN; + /* + * Maximum number of exclusive RSS contexts which can be allocated. The + * hardware supports 64, but 6 are reserved for shared contexts. They + * are a global resource so not all may be available. + */ + encp->enc_rx_scale_max_exclusive_contexts = 58; + encp->enc_tx_dma_desc_size_max = EFX_MASK32(ESF_DZ_RX_KER_BYTE_CNT); /* No boundary crossing limits */ encp->enc_tx_dma_desc_boundary = 0; Modified: head/sys/dev/sfxge/common/siena_nic.c ============================================================================== --- head/sys/dev/sfxge/common/siena_nic.c Fri Nov 23 09:14:57 2018 (r340806) +++ head/sys/dev/sfxge/common/siena_nic.c Fri Nov 23 09:15:08 2018 (r340807) @@ -140,6 +140,9 @@ siena_board_cfg( /* Alignment for WPTR updates */ encp->enc_rx_push_align = 1; + /* There is one RSS context per function */ + encp->enc_rx_scale_max_exclusive_contexts = 1; + encp->enc_tx_dma_desc_size_max = EFX_MASK32(FSF_AZ_TX_KER_BYTE_COUNT); /* Fragments must not span 4k boundaries. */ encp->enc_tx_dma_desc_boundary = 4096; From owner-svn-src-all@freebsd.org Fri Nov 23 09:15:23 2018 Return-Path: Delivered-To: svn-src-all@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 44E6B1140235; Fri, 23 Nov 2018 09:15:23 +0000 (UTC) (envelope-from arybchik@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 DE60F7DE3F; Fri, 23 Nov 2018 09:15:22 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 89B171C8AF; Fri, 23 Nov 2018 09:15:21 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAN9FLc3000270; Fri, 23 Nov 2018 09:15:21 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAN9FKtX000265; Fri, 23 Nov 2018 09:15:20 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811230915.wAN9FKtX000265@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 23 Nov 2018 09:15:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340808 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 340808 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: DE60F7DE3F X-Spamd-Result: default: False [1.55 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.42)[0.420,0]; NEURAL_SPAM_MEDIUM(0.74)[0.738,0]; NEURAL_SPAM_SHORT(0.40)[0.396,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Nov 2018 09:15:23 -0000 Author: arybchik Date: Fri Nov 23 09:15:20 2018 New Revision: 340808 URL: https://svnweb.freebsd.org/changeset/base/340808 Log: sfxge(4): rename API to check Rx scale and hash support Rename efx_rx_scale_support_get() to efx_rx_scale_default_support_get(), and efx_rx_hash_support_get() to efx_rx_hash_default_support_get(). All these really report is whether an exclusive RSS context was successfully acquired at efx_rx_init(). efx_rx_scale_support_get() sounds like it reports whether the device supports RSS, and whether exclusive or shared contexts are supported, but it doesn't do that. Renaming it to efx_rx_scale_default_support_get() helps to reflect that it reports what RSS support the client gets without trying to allocate RSS contexts itself. Also rename efx_rx_scale_support_t to efx_rx_scale_context_type_t, to make the enum more suitable for specifying the type of an RSS context to be allocated. Submitted by: Mark Spender Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18078 Modified: head/sys/dev/sfxge/common/ef10_rx.c head/sys/dev/sfxge/common/efx.h head/sys/dev/sfxge/common/efx_impl.h head/sys/dev/sfxge/common/efx_rx.c Modified: head/sys/dev/sfxge/common/ef10_rx.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_rx.c Fri Nov 23 09:15:08 2018 (r340807) +++ head/sys/dev/sfxge/common/ef10_rx.c Fri Nov 23 09:15:20 2018 (r340808) @@ -162,7 +162,7 @@ fail1: static __checkReturn efx_rc_t efx_mcdi_rss_context_alloc( __in efx_nic_t *enp, - __in efx_rx_scale_support_t scale_support, + __in efx_rx_scale_context_type_t type, __in uint32_t num_queues, __out uint32_t *rss_contextp) { @@ -178,7 +178,7 @@ efx_mcdi_rss_context_alloc( goto fail1; } - switch (scale_support) { + switch (type) { case EFX_RX_SCALE_EXCLUSIVE: context_type = MC_CMD_RSS_CONTEXT_ALLOC_IN_TYPE_EXCLUSIVE; break; @@ -464,7 +464,7 @@ ef10_rx_init( * Allocated an exclusive RSS context, which allows both the * indirection table and key to be modified. */ - enp->en_rss_support = EFX_RX_SCALE_EXCLUSIVE; + enp->en_rss_context_type = EFX_RX_SCALE_EXCLUSIVE; enp->en_hash_support = EFX_RX_HASH_AVAILABLE; } else { /* @@ -472,7 +472,7 @@ ef10_rx_init( * operation without support for RSS. The pseudo-header in * received packets will not contain a Toeplitz hash value. */ - enp->en_rss_support = EFX_RX_SCALE_UNAVAILABLE; + enp->en_rss_context_type = EFX_RX_SCALE_UNAVAILABLE; enp->en_hash_support = EFX_RX_HASH_UNAVAILABLE; } @@ -510,7 +510,7 @@ ef10_rx_scale_mode_set( goto fail1; } - if (enp->en_rss_support == EFX_RX_SCALE_UNAVAILABLE) { + if (enp->en_rss_context_type == EFX_RX_SCALE_UNAVAILABLE) { rc = ENOTSUP; goto fail2; } @@ -541,7 +541,7 @@ ef10_rx_scale_key_set( { efx_rc_t rc; - if (enp->en_rss_support == EFX_RX_SCALE_UNAVAILABLE) { + if (enp->en_rss_context_type == EFX_RX_SCALE_UNAVAILABLE) { rc = ENOTSUP; goto fail1; } @@ -570,7 +570,7 @@ ef10_rx_scale_tbl_set( { efx_rc_t rc; - if (enp->en_rss_support == EFX_RX_SCALE_UNAVAILABLE) { + if (enp->en_rss_context_type == EFX_RX_SCALE_UNAVAILABLE) { rc = ENOTSUP; goto fail1; } @@ -981,11 +981,10 @@ ef10_rx_fini( __in efx_nic_t *enp) { #if EFSYS_OPT_RX_SCALE - if (enp->en_rss_support != EFX_RX_SCALE_UNAVAILABLE) { + if (enp->en_rss_context_type != EFX_RX_SCALE_UNAVAILABLE) (void) efx_mcdi_rss_context_free(enp, enp->en_rss_context); - } enp->en_rss_context = 0; - enp->en_rss_support = EFX_RX_SCALE_UNAVAILABLE; + enp->en_rss_context_type = EFX_RX_SCALE_UNAVAILABLE; #else _NOTE(ARGUNUSED(enp)) #endif /* EFSYS_OPT_RX_SCALE */ Modified: head/sys/dev/sfxge/common/efx.h ============================================================================== --- head/sys/dev/sfxge/common/efx.h Fri Nov 23 09:15:08 2018 (r340807) +++ head/sys/dev/sfxge/common/efx.h Fri Nov 23 09:15:20 2018 (r340808) @@ -1916,22 +1916,22 @@ typedef enum efx_rx_hash_support_e { #define EFX_MAXRSS 64 /* RX indirection entry range */ #define EFX_MAXRSS_LEGACY 16 /* See bug16611 and bug17213 */ -typedef enum efx_rx_scale_support_e { - EFX_RX_SCALE_UNAVAILABLE = 0, /* Not supported */ +typedef enum efx_rx_scale_context_type_e { + EFX_RX_SCALE_UNAVAILABLE = 0, /* No RX scale context */ EFX_RX_SCALE_EXCLUSIVE, /* Writable key/indirection table */ EFX_RX_SCALE_SHARED /* Read-only key/indirection table */ -} efx_rx_scale_support_t; +} efx_rx_scale_context_type_t; extern __checkReturn efx_rc_t -efx_rx_hash_support_get( +efx_rx_hash_default_support_get( __in efx_nic_t *enp, __out efx_rx_hash_support_t *supportp); extern __checkReturn efx_rc_t -efx_rx_scale_support_get( +efx_rx_scale_default_support_get( __in efx_nic_t *enp, - __out efx_rx_scale_support_t *supportp); + __out efx_rx_scale_context_type_t *typep); extern __checkReturn efx_rc_t efx_rx_scale_mode_set( Modified: head/sys/dev/sfxge/common/efx_impl.h ============================================================================== --- head/sys/dev/sfxge/common/efx_impl.h Fri Nov 23 09:15:08 2018 (r340807) +++ head/sys/dev/sfxge/common/efx_impl.h Fri Nov 23 09:15:20 2018 (r340808) @@ -644,9 +644,9 @@ struct efx_nic_s { const efx_vpd_ops_t *en_evpdop; #endif /* EFSYS_OPT_VPD */ #if EFSYS_OPT_RX_SCALE - efx_rx_hash_support_t en_hash_support; - efx_rx_scale_support_t en_rss_support; - uint32_t en_rss_context; + efx_rx_hash_support_t en_hash_support; + efx_rx_scale_context_type_t en_rss_context_type; + uint32_t en_rss_context; #endif /* EFSYS_OPT_RX_SCALE */ uint32_t en_vport_id; #if EFSYS_OPT_LICENSING Modified: head/sys/dev/sfxge/common/efx_rx.c ============================================================================== --- head/sys/dev/sfxge/common/efx_rx.c Fri Nov 23 09:15:08 2018 (r340807) +++ head/sys/dev/sfxge/common/efx_rx.c Fri Nov 23 09:15:20 2018 (r340808) @@ -309,7 +309,7 @@ fail1: #if EFSYS_OPT_RX_SCALE __checkReturn efx_rc_t -efx_rx_hash_support_get( +efx_rx_hash_default_support_get( __in efx_nic_t *enp, __out efx_rx_hash_support_t *supportp) { @@ -323,7 +323,10 @@ efx_rx_hash_support_get( goto fail1; } - /* Report if resources are available to insert RX hash value */ + /* + * Report the hashing support the client gets by default if it + * does not allocate an RSS context itself. + */ *supportp = enp->en_hash_support; return (0); @@ -335,22 +338,25 @@ fail1: } __checkReturn efx_rc_t -efx_rx_scale_support_get( +efx_rx_scale_default_support_get( __in efx_nic_t *enp, - __out efx_rx_scale_support_t *supportp) + __out efx_rx_scale_context_type_t *typep) { efx_rc_t rc; EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC); EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_RX); - if (supportp == NULL) { + if (typep == NULL) { rc = EINVAL; goto fail1; } - /* Report if resources are available to support RSS */ - *supportp = enp->en_rss_support; + /* + * Report the RSS support the client gets by default if it + * does not allocate an RSS context itself. + */ + *typep = enp->en_rss_context_type; return (0); @@ -659,7 +665,7 @@ siena_rx_init( #if EFSYS_OPT_RX_SCALE /* The RSS key and indirection table are writable. */ - enp->en_rss_support = EFX_RX_SCALE_EXCLUSIVE; + enp->en_rss_context_type = EFX_RX_SCALE_EXCLUSIVE; /* Hardware can insert RX hash with/without RSS */ enp->en_hash_support = EFX_RX_HASH_AVAILABLE; From owner-svn-src-all@freebsd.org Fri Nov 23 09:15:34 2018 Return-Path: Delivered-To: svn-src-all@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 EBB0711402DE; Fri, 23 Nov 2018 09:15:33 +0000 (UTC) (envelope-from arybchik@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 B1D2D7DF40; Fri, 23 Nov 2018 09:15:33 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 86B511C8B4; Fri, 23 Nov 2018 09:15:33 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAN9FXnA000335; Fri, 23 Nov 2018 09:15:33 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAN9FWPG000330; Fri, 23 Nov 2018 09:15:32 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811230915.wAN9FWPG000330@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 23 Nov 2018 09:15:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340809 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 340809 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B1D2D7DF40 X-Spamd-Result: default: False [1.55 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.42)[0.420,0]; NEURAL_SPAM_MEDIUM(0.74)[0.738,0]; NEURAL_SPAM_SHORT(0.40)[0.396,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Nov 2018 09:15:34 -0000 Author: arybchik Date: Fri Nov 23 09:15:32 2018 New Revision: 340809 URL: https://svnweb.freebsd.org/changeset/base/340809 Log: sfxge(4): add API to allocate and free RSS contexts Submitted by: Mark Spender Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18079 Modified: head/sys/dev/sfxge/common/ef10_impl.h head/sys/dev/sfxge/common/ef10_rx.c head/sys/dev/sfxge/common/efx.h head/sys/dev/sfxge/common/efx_impl.h head/sys/dev/sfxge/common/efx_rx.c Modified: head/sys/dev/sfxge/common/ef10_impl.h ============================================================================== --- head/sys/dev/sfxge/common/ef10_impl.h Fri Nov 23 09:15:20 2018 (r340808) +++ head/sys/dev/sfxge/common/ef10_impl.h Fri Nov 23 09:15:32 2018 (r340809) @@ -900,6 +900,18 @@ ef10_rx_scatter_enable( #if EFSYS_OPT_RX_SCALE extern __checkReturn efx_rc_t +ef10_rx_scale_context_alloc( + __in efx_nic_t *enp, + __in efx_rx_scale_context_type_t type, + __in uint32_t num_queues, + __out uint32_t *rss_contextp); + +extern __checkReturn efx_rc_t +ef10_rx_scale_context_free( + __in efx_nic_t *enp, + __in uint32_t rss_context); + +extern __checkReturn efx_rc_t ef10_rx_scale_mode_set( __in efx_nic_t *enp, __in efx_rx_hash_alg_t alg, Modified: head/sys/dev/sfxge/common/ef10_rx.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_rx.c Fri Nov 23 09:15:20 2018 (r340808) +++ head/sys/dev/sfxge/common/ef10_rx.c Fri Nov 23 09:15:32 2018 (r340809) @@ -494,6 +494,48 @@ ef10_rx_scatter_enable( #if EFSYS_OPT_RX_SCALE __checkReturn efx_rc_t +ef10_rx_scale_context_alloc( + __in efx_nic_t *enp, + __in efx_rx_scale_context_type_t type, + __in uint32_t num_queues, + __out uint32_t *rss_contextp) +{ + efx_rc_t rc; + + rc = efx_mcdi_rss_context_alloc(enp, type, num_queues, rss_contextp); + if (rc != 0) + goto fail1; + + return (0); + +fail1: + EFSYS_PROBE1(fail1, efx_rc_t, rc); + return (rc); +} +#endif /* EFSYS_OPT_RX_SCALE */ + +#if EFSYS_OPT_RX_SCALE + __checkReturn efx_rc_t +ef10_rx_scale_context_free( + __in efx_nic_t *enp, + __in uint32_t rss_context) +{ + efx_rc_t rc; + + rc = efx_mcdi_rss_context_free(enp, rss_context); + if (rc != 0) + goto fail1; + + return (0); + +fail1: + EFSYS_PROBE1(fail1, efx_rc_t, rc); + return (rc); +} +#endif /* EFSYS_OPT_RX_SCALE */ + +#if EFSYS_OPT_RX_SCALE + __checkReturn efx_rc_t ef10_rx_scale_mode_set( __in efx_nic_t *enp, __in efx_rx_hash_alg_t alg, Modified: head/sys/dev/sfxge/common/efx.h ============================================================================== --- head/sys/dev/sfxge/common/efx.h Fri Nov 23 09:15:20 2018 (r340808) +++ head/sys/dev/sfxge/common/efx.h Fri Nov 23 09:15:32 2018 (r340809) @@ -1934,6 +1934,18 @@ efx_rx_scale_default_support_get( __out efx_rx_scale_context_type_t *typep); extern __checkReturn efx_rc_t +efx_rx_scale_context_alloc( + __in efx_nic_t *enp, + __in efx_rx_scale_context_type_t type, + __in uint32_t num_queues, + __out uint32_t *rss_contextp); + +extern __checkReturn efx_rc_t +efx_rx_scale_context_free( + __in efx_nic_t *enp, + __in uint32_t rss_context); + +extern __checkReturn efx_rc_t efx_rx_scale_mode_set( __in efx_nic_t *enp, __in efx_rx_hash_alg_t alg, Modified: head/sys/dev/sfxge/common/efx_impl.h ============================================================================== --- head/sys/dev/sfxge/common/efx_impl.h Fri Nov 23 09:15:20 2018 (r340808) +++ head/sys/dev/sfxge/common/efx_impl.h Fri Nov 23 09:15:32 2018 (r340809) @@ -156,6 +156,10 @@ typedef struct efx_rx_ops_s { efx_rc_t (*erxo_scatter_enable)(efx_nic_t *, unsigned int); #endif #if EFSYS_OPT_RX_SCALE + efx_rc_t (*erxo_scale_context_alloc)(efx_nic_t *, + efx_rx_scale_context_type_t, + uint32_t, uint32_t *); + efx_rc_t (*erxo_scale_context_free)(efx_nic_t *, uint32_t); efx_rc_t (*erxo_scale_mode_set)(efx_nic_t *, efx_rx_hash_alg_t, efx_rx_hash_type_t, boolean_t); efx_rc_t (*erxo_scale_key_set)(efx_nic_t *, uint8_t *, size_t); Modified: head/sys/dev/sfxge/common/efx_rx.c ============================================================================== --- head/sys/dev/sfxge/common/efx_rx.c Fri Nov 23 09:15:20 2018 (r340808) +++ head/sys/dev/sfxge/common/efx_rx.c Fri Nov 23 09:15:32 2018 (r340809) @@ -154,6 +154,8 @@ static const efx_rx_ops_t __efx_rx_siena_ops = { siena_rx_scatter_enable, /* erxo_scatter_enable */ #endif #if EFSYS_OPT_RX_SCALE + NULL, /* erxo_scale_context_alloc */ + NULL, /* erxo_scale_context_free */ siena_rx_scale_mode_set, /* erxo_scale_mode_set */ siena_rx_scale_key_set, /* erxo_scale_key_set */ siena_rx_scale_tbl_set, /* erxo_scale_tbl_set */ @@ -181,6 +183,8 @@ static const efx_rx_ops_t __efx_rx_ef10_ops = { ef10_rx_scatter_enable, /* erxo_scatter_enable */ #endif #if EFSYS_OPT_RX_SCALE + ef10_rx_scale_context_alloc, /* erxo_scale_context_alloc */ + ef10_rx_scale_context_free, /* erxo_scale_context_free */ ef10_rx_scale_mode_set, /* erxo_scale_mode_set */ ef10_rx_scale_key_set, /* erxo_scale_key_set */ ef10_rx_scale_tbl_set, /* erxo_scale_tbl_set */ @@ -365,7 +369,71 @@ fail1: return (rc); } +#endif /* EFSYS_OPT_RX_SCALE */ +#if EFSYS_OPT_RX_SCALE + __checkReturn efx_rc_t +efx_rx_scale_context_alloc( + __in efx_nic_t *enp, + __in efx_rx_scale_context_type_t type, + __in uint32_t num_queues, + __out uint32_t *rss_contextp) +{ + const efx_rx_ops_t *erxop = enp->en_erxop; + efx_rc_t rc; + + EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC); + EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_RX); + + if (erxop->erxo_scale_context_alloc == NULL) { + rc = ENOTSUP; + goto fail1; + } + if ((rc = erxop->erxo_scale_context_alloc(enp, type, + num_queues, rss_contextp)) != 0) { + goto fail2; + } + + return (0); + +fail2: + EFSYS_PROBE(fail2); +fail1: + EFSYS_PROBE1(fail1, efx_rc_t, rc); + return (rc); +} +#endif /* EFSYS_OPT_RX_SCALE */ + +#if EFSYS_OPT_RX_SCALE + __checkReturn efx_rc_t +efx_rx_scale_context_free( + __in efx_nic_t *enp, + __in uint32_t rss_context) +{ + const efx_rx_ops_t *erxop = enp->en_erxop; + efx_rc_t rc; + + EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC); + EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_RX); + + if (erxop->erxo_scale_context_free == NULL) { + rc = ENOTSUP; + goto fail1; + } + if ((rc = erxop->erxo_scale_context_free(enp, rss_context)) != 0) + goto fail2; + + return (0); + +fail2: + EFSYS_PROBE(fail2); +fail1: + EFSYS_PROBE1(fail1, efx_rc_t, rc); + return (rc); +} +#endif /* EFSYS_OPT_RX_SCALE */ + +#if EFSYS_OPT_RX_SCALE __checkReturn efx_rc_t efx_rx_scale_mode_set( __in efx_nic_t *enp, From owner-svn-src-all@freebsd.org Fri Nov 23 09:15:47 2018 Return-Path: Delivered-To: svn-src-all@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 25CA7114039E; Fri, 23 Nov 2018 09:15:47 +0000 (UTC) (envelope-from arybchik@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 DF0037E083; Fri, 23 Nov 2018 09:15:45 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C1A541C8B9; Fri, 23 Nov 2018 09:15:45 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAN9FjBu000397; Fri, 23 Nov 2018 09:15:45 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAN9FiRw000392; Fri, 23 Nov 2018 09:15:44 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811230915.wAN9FiRw000392@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 23 Nov 2018 09:15:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340810 - in head/sys/dev/sfxge: . common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: in head/sys/dev/sfxge: . common X-SVN-Commit-Revision: 340810 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: DF0037E083 X-Spamd-Result: default: False [1.59 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.40)[0.397,0]; NEURAL_SPAM_MEDIUM(0.75)[0.754,0]; NEURAL_SPAM_LONG(0.44)[0.439,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Nov 2018 09:15:47 -0000 Author: arybchik Date: Fri Nov 23 09:15:44 2018 New Revision: 340810 URL: https://svnweb.freebsd.org/changeset/base/340810 Log: sfxge(4): update RSS API to take RSS context parameter Update efx_rx_scale_mode_set(), efx_rx_scale_key_set() and efx_rx_scale_tbl_set(). Submitted by: Mark Spender Submitted by: Ivan Malov Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18080 Modified: head/sys/dev/sfxge/common/ef10_impl.h head/sys/dev/sfxge/common/ef10_rx.c head/sys/dev/sfxge/common/efx.h head/sys/dev/sfxge/common/efx_impl.h head/sys/dev/sfxge/common/efx_rx.c head/sys/dev/sfxge/sfxge_rx.c Modified: head/sys/dev/sfxge/common/ef10_impl.h ============================================================================== --- head/sys/dev/sfxge/common/ef10_impl.h Fri Nov 23 09:15:32 2018 (r340809) +++ head/sys/dev/sfxge/common/ef10_impl.h Fri Nov 23 09:15:44 2018 (r340810) @@ -914,6 +914,7 @@ ef10_rx_scale_context_free( extern __checkReturn efx_rc_t ef10_rx_scale_mode_set( __in efx_nic_t *enp, + __in uint32_t rss_context, __in efx_rx_hash_alg_t alg, __in efx_rx_hash_type_t type, __in boolean_t insert); @@ -921,12 +922,14 @@ ef10_rx_scale_mode_set( extern __checkReturn efx_rc_t ef10_rx_scale_key_set( __in efx_nic_t *enp, + __in uint32_t rss_context, __in_ecount(n) uint8_t *key, __in size_t n); extern __checkReturn efx_rc_t ef10_rx_scale_tbl_set( __in efx_nic_t *enp, + __in uint32_t rss_context, __in_ecount(n) unsigned int *table, __in size_t n); Modified: head/sys/dev/sfxge/common/ef10_rx.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_rx.c Fri Nov 23 09:15:32 2018 (r340809) +++ head/sys/dev/sfxge/common/ef10_rx.c Fri Nov 23 09:15:44 2018 (r340810) @@ -538,6 +538,7 @@ fail1: __checkReturn efx_rc_t ef10_rx_scale_mode_set( __in efx_nic_t *enp, + __in uint32_t rss_context, __in efx_rx_hash_alg_t alg, __in efx_rx_hash_type_t type, __in boolean_t insert) @@ -552,13 +553,16 @@ ef10_rx_scale_mode_set( goto fail1; } - if (enp->en_rss_context_type == EFX_RX_SCALE_UNAVAILABLE) { - rc = ENOTSUP; - goto fail2; + if (rss_context == EFX_RSS_CONTEXT_DEFAULT) { + if (enp->en_rss_context_type == EFX_RX_SCALE_UNAVAILABLE) { + rc = ENOTSUP; + goto fail2; + } + rss_context = enp->en_rss_context; } if ((rc = efx_mcdi_rss_context_set_flags(enp, - enp->en_rss_context, type)) != 0) + rss_context, type)) != 0) goto fail3; return (0); @@ -578,18 +582,21 @@ fail1: __checkReturn efx_rc_t ef10_rx_scale_key_set( __in efx_nic_t *enp, + __in uint32_t rss_context, __in_ecount(n) uint8_t *key, __in size_t n) { efx_rc_t rc; - if (enp->en_rss_context_type == EFX_RX_SCALE_UNAVAILABLE) { - rc = ENOTSUP; - goto fail1; + if (rss_context == EFX_RSS_CONTEXT_DEFAULT) { + if (enp->en_rss_context_type == EFX_RX_SCALE_UNAVAILABLE) { + rc = ENOTSUP; + goto fail1; + } + rss_context = enp->en_rss_context; } - if ((rc = efx_mcdi_rss_context_set_key(enp, - enp->en_rss_context, key, n)) != 0) + if ((rc = efx_mcdi_rss_context_set_key(enp, rss_context, key, n)) != 0) goto fail2; return (0); @@ -607,18 +614,23 @@ fail1: __checkReturn efx_rc_t ef10_rx_scale_tbl_set( __in efx_nic_t *enp, + __in uint32_t rss_context, __in_ecount(n) unsigned int *table, __in size_t n) { efx_rc_t rc; - if (enp->en_rss_context_type == EFX_RX_SCALE_UNAVAILABLE) { - rc = ENOTSUP; - goto fail1; + + if (rss_context == EFX_RSS_CONTEXT_DEFAULT) { + if (enp->en_rss_context_type == EFX_RX_SCALE_UNAVAILABLE) { + rc = ENOTSUP; + goto fail1; + } + rss_context = enp->en_rss_context; } if ((rc = efx_mcdi_rss_context_set_table(enp, - enp->en_rss_context, table, n)) != 0) + rss_context, table, n)) != 0) goto fail2; return (0); Modified: head/sys/dev/sfxge/common/efx.h ============================================================================== --- head/sys/dev/sfxge/common/efx.h Fri Nov 23 09:15:32 2018 (r340809) +++ head/sys/dev/sfxge/common/efx.h Fri Nov 23 09:15:44 2018 (r340810) @@ -1948,6 +1948,7 @@ efx_rx_scale_context_free( extern __checkReturn efx_rc_t efx_rx_scale_mode_set( __in efx_nic_t *enp, + __in uint32_t rss_context, __in efx_rx_hash_alg_t alg, __in efx_rx_hash_type_t type, __in boolean_t insert); @@ -1955,12 +1956,14 @@ efx_rx_scale_mode_set( extern __checkReturn efx_rc_t efx_rx_scale_tbl_set( __in efx_nic_t *enp, + __in uint32_t rss_context, __in_ecount(n) unsigned int *table, __in size_t n); extern __checkReturn efx_rc_t efx_rx_scale_key_set( __in efx_nic_t *enp, + __in uint32_t rss_context, __in_ecount(n) uint8_t *key, __in size_t n); Modified: head/sys/dev/sfxge/common/efx_impl.h ============================================================================== --- head/sys/dev/sfxge/common/efx_impl.h Fri Nov 23 09:15:32 2018 (r340809) +++ head/sys/dev/sfxge/common/efx_impl.h Fri Nov 23 09:15:44 2018 (r340810) @@ -160,11 +160,13 @@ typedef struct efx_rx_ops_s { efx_rx_scale_context_type_t, uint32_t, uint32_t *); efx_rc_t (*erxo_scale_context_free)(efx_nic_t *, uint32_t); - efx_rc_t (*erxo_scale_mode_set)(efx_nic_t *, efx_rx_hash_alg_t, + efx_rc_t (*erxo_scale_mode_set)(efx_nic_t *, uint32_t, + efx_rx_hash_alg_t, efx_rx_hash_type_t, boolean_t); - efx_rc_t (*erxo_scale_key_set)(efx_nic_t *, uint8_t *, size_t); - efx_rc_t (*erxo_scale_tbl_set)(efx_nic_t *, unsigned int *, - size_t); + efx_rc_t (*erxo_scale_key_set)(efx_nic_t *, uint32_t, + uint8_t *, size_t); + efx_rc_t (*erxo_scale_tbl_set)(efx_nic_t *, uint32_t, + unsigned int *, size_t); uint32_t (*erxo_prefix_hash)(efx_nic_t *, efx_rx_hash_alg_t, uint8_t *); #endif /* EFSYS_OPT_RX_SCALE */ Modified: head/sys/dev/sfxge/common/efx_rx.c ============================================================================== --- head/sys/dev/sfxge/common/efx_rx.c Fri Nov 23 09:15:32 2018 (r340809) +++ head/sys/dev/sfxge/common/efx_rx.c Fri Nov 23 09:15:44 2018 (r340810) @@ -58,6 +58,7 @@ siena_rx_scatter_enable( static __checkReturn efx_rc_t siena_rx_scale_mode_set( __in efx_nic_t *enp, + __in uint32_t rss_context, __in efx_rx_hash_alg_t alg, __in efx_rx_hash_type_t type, __in boolean_t insert); @@ -65,12 +66,14 @@ siena_rx_scale_mode_set( static __checkReturn efx_rc_t siena_rx_scale_key_set( __in efx_nic_t *enp, + __in uint32_t rss_context, __in_ecount(n) uint8_t *key, __in size_t n); static __checkReturn efx_rc_t siena_rx_scale_tbl_set( __in efx_nic_t *enp, + __in uint32_t rss_context, __in_ecount(n) unsigned int *table, __in size_t n); @@ -437,6 +440,7 @@ fail1: __checkReturn efx_rc_t efx_rx_scale_mode_set( __in efx_nic_t *enp, + __in uint32_t rss_context, __in efx_rx_hash_alg_t alg, __in efx_rx_hash_type_t type, __in boolean_t insert) @@ -448,7 +452,7 @@ efx_rx_scale_mode_set( EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_RX); if (erxop->erxo_scale_mode_set != NULL) { - if ((rc = erxop->erxo_scale_mode_set(enp, alg, + if ((rc = erxop->erxo_scale_mode_set(enp, rss_context, alg, type, insert)) != 0) goto fail1; } @@ -465,6 +469,7 @@ fail1: __checkReturn efx_rc_t efx_rx_scale_key_set( __in efx_nic_t *enp, + __in uint32_t rss_context, __in_ecount(n) uint8_t *key, __in size_t n) { @@ -474,7 +479,7 @@ efx_rx_scale_key_set( EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC); EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_RX); - if ((rc = erxop->erxo_scale_key_set(enp, key, n)) != 0) + if ((rc = erxop->erxo_scale_key_set(enp, rss_context, key, n)) != 0) goto fail1; return (0); @@ -490,6 +495,7 @@ fail1: __checkReturn efx_rc_t efx_rx_scale_tbl_set( __in efx_nic_t *enp, + __in uint32_t rss_context, __in_ecount(n) unsigned int *table, __in size_t n) { @@ -499,7 +505,7 @@ efx_rx_scale_tbl_set( EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC); EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_RX); - if ((rc = erxop->erxo_scale_tbl_set(enp, table, n)) != 0) + if ((rc = erxop->erxo_scale_tbl_set(enp, rss_context, table, n)) != 0) goto fail1; return (0); @@ -852,12 +858,18 @@ fail1: static __checkReturn efx_rc_t siena_rx_scale_mode_set( __in efx_nic_t *enp, + __in uint32_t rss_context, __in efx_rx_hash_alg_t alg, __in efx_rx_hash_type_t type, __in boolean_t insert) { efx_rc_t rc; + if (rss_context != EFX_RSS_CONTEXT_DEFAULT) { + rc = EINVAL; + goto fail1; + } + switch (alg) { case EFX_RX_HASHALG_LFSR: EFX_RX_LFSR_HASH(enp, insert); @@ -873,17 +885,19 @@ siena_rx_scale_mode_set( type & EFX_RX_HASH_TCPIPV6, rc); if (rc != 0) - goto fail1; + goto fail2; break; default: rc = EINVAL; - goto fail2; + goto fail3; } return (0); +fail3: + EFSYS_PROBE(fail3); fail2: EFSYS_PROBE(fail2); fail1: @@ -899,6 +913,7 @@ fail1: static __checkReturn efx_rc_t siena_rx_scale_key_set( __in efx_nic_t *enp, + __in uint32_t rss_context, __in_ecount(n) uint8_t *key, __in size_t n) { @@ -907,6 +922,11 @@ siena_rx_scale_key_set( unsigned int offset; efx_rc_t rc; + if (rss_context != EFX_RSS_CONTEXT_DEFAULT) { + rc = EINVAL; + goto fail1; + } + byte = 0; /* Write Toeplitz IPv4 hash key */ @@ -927,7 +947,7 @@ siena_rx_scale_key_set( --offset) { if (oword.eo_u8[offset - 1] != key[byte++]) { rc = EFAULT; - goto fail1; + goto fail2; } } @@ -976,7 +996,7 @@ siena_rx_scale_key_set( --offset) { if (oword.eo_u8[offset - 1] != key[byte++]) { rc = EFAULT; - goto fail2; + goto fail3; } } @@ -988,7 +1008,7 @@ siena_rx_scale_key_set( --offset) { if (oword.eo_u8[offset - 1] != key[byte++]) { rc = EFAULT; - goto fail3; + goto fail4; } } @@ -1000,13 +1020,15 @@ siena_rx_scale_key_set( --offset) { if (oword.eo_u8[offset - 1] != key[byte++]) { rc = EFAULT; - goto fail4; + goto fail5; } } done: return (0); +fail5: + EFSYS_PROBE(fail5); fail4: EFSYS_PROBE(fail4); fail3: @@ -1024,6 +1046,7 @@ fail1: static __checkReturn efx_rc_t siena_rx_scale_tbl_set( __in efx_nic_t *enp, + __in uint32_t rss_context, __in_ecount(n) unsigned int *table, __in size_t n) { @@ -1034,11 +1057,16 @@ siena_rx_scale_tbl_set( EFX_STATIC_ASSERT(EFX_RSS_TBL_SIZE == FR_BZ_RX_INDIRECTION_TBL_ROWS); EFX_STATIC_ASSERT(EFX_MAXRSS == (1 << FRF_BZ_IT_QUEUE_WIDTH)); - if (n > FR_BZ_RX_INDIRECTION_TBL_ROWS) { + if (rss_context != EFX_RSS_CONTEXT_DEFAULT) { rc = EINVAL; goto fail1; } + if (n > FR_BZ_RX_INDIRECTION_TBL_ROWS) { + rc = EINVAL; + goto fail2; + } + for (index = 0; index < FR_BZ_RX_INDIRECTION_TBL_ROWS; index++) { uint32_t byte; @@ -1067,12 +1095,14 @@ siena_rx_scale_tbl_set( /* Verify the entry */ if (EFX_OWORD_FIELD(oword, FRF_BZ_IT_QUEUE) != byte) { rc = EFAULT; - goto fail2; + goto fail3; } } return (0); +fail3: + EFSYS_PROBE(fail3); fail2: EFSYS_PROBE(fail2); fail1: Modified: head/sys/dev/sfxge/sfxge_rx.c ============================================================================== --- head/sys/dev/sfxge/sfxge_rx.c Fri Nov 23 09:15:32 2018 (r340809) +++ head/sys/dev/sfxge/sfxge_rx.c Fri Nov 23 09:15:44 2018 (r340810) @@ -1138,17 +1138,20 @@ sfxge_rx_start(struct sfxge_softc *sc) #else sc->rx_indir_table[index] = index % sc->rxq_count; #endif - if ((rc = efx_rx_scale_tbl_set(sc->enp, sc->rx_indir_table, + if ((rc = efx_rx_scale_tbl_set(sc->enp, EFX_RSS_CONTEXT_DEFAULT, + sc->rx_indir_table, nitems(sc->rx_indir_table))) != 0) goto fail; - (void)efx_rx_scale_mode_set(sc->enp, EFX_RX_HASHALG_TOEPLITZ, + (void)efx_rx_scale_mode_set(sc->enp, EFX_RSS_CONTEXT_DEFAULT, + EFX_RX_HASHALG_TOEPLITZ, EFX_RX_HASH_IPV4 | EFX_RX_HASH_TCPIPV4 | EFX_RX_HASH_IPV6 | EFX_RX_HASH_TCPIPV6, B_TRUE); #ifdef RSS rss_getkey(toep_key); #endif - if ((rc = efx_rx_scale_key_set(sc->enp, toep_key, + if ((rc = efx_rx_scale_key_set(sc->enp, EFX_RSS_CONTEXT_DEFAULT, + toep_key, sizeof(toep_key))) != 0) goto fail; From owner-svn-src-all@freebsd.org Fri Nov 23 09:15:59 2018 Return-Path: Delivered-To: svn-src-all@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 14476114043B; Fri, 23 Nov 2018 09:15:59 +0000 (UTC) (envelope-from arybchik@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 8A1087E1CD; Fri, 23 Nov 2018 09:15:58 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5239D1C8C2; Fri, 23 Nov 2018 09:15:57 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAN9Fv7Y000456; Fri, 23 Nov 2018 09:15:57 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAN9FuGC000453; Fri, 23 Nov 2018 09:15:56 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811230915.wAN9FuGC000453@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 23 Nov 2018 09:15:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340811 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 340811 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 8A1087E1CD X-Spamd-Result: default: False [1.55 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.42)[0.420,0]; NEURAL_SPAM_MEDIUM(0.74)[0.738,0]; NEURAL_SPAM_SHORT(0.40)[0.396,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Nov 2018 09:15:59 -0000 Author: arybchik Date: Fri Nov 23 09:15:56 2018 New Revision: 340811 URL: https://svnweb.freebsd.org/changeset/base/340811 Log: sfxge(4): add API to set an RSS context for a filter Submitted by: Mark Spender Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18081 Modified: head/sys/dev/sfxge/common/ef10_filter.c head/sys/dev/sfxge/common/efx.h head/sys/dev/sfxge/common/efx_filter.c Modified: head/sys/dev/sfxge/common/ef10_filter.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_filter.c Fri Nov 23 09:15:44 2018 (r340810) +++ head/sys/dev/sfxge/common/ef10_filter.c Fri Nov 23 09:15:56 2018 (r340811) @@ -229,10 +229,20 @@ efx_mcdi_filter_op_add( MC_CMD_FILTER_OP_EXT_IN_RX_DEST_HOST); MCDI_IN_SET_DWORD(req, FILTER_OP_EXT_IN_RX_QUEUE, spec->efs_dmaq_id); + +#if EFSYS_OPT_RX_SCALE if (spec->efs_flags & EFX_FILTER_FLAG_RX_RSS) { + uint32_t rss_context; + + if (spec->efs_rss_context == EFX_RSS_CONTEXT_DEFAULT) + rss_context = enp->en_rss_context; + else + rss_context = spec->efs_rss_context; MCDI_IN_SET_DWORD(req, FILTER_OP_EXT_IN_RX_CONTEXT, - spec->efs_rss_context); + rss_context); } +#endif + MCDI_IN_SET_DWORD(req, FILTER_OP_EXT_IN_RX_MODE, spec->efs_flags & EFX_FILTER_FLAG_RX_RSS ? MC_CMD_FILTER_OP_EXT_IN_RX_MODE_RSS : @@ -588,10 +598,6 @@ ef10_filter_add_internal( EFSYS_ASSERT(enp->en_family == EFX_FAMILY_HUNTINGTON || enp->en_family == EFX_FAMILY_MEDFORD); - -#if EFSYS_OPT_RX_SCALE - spec->efs_rss_context = enp->en_rss_context; -#endif hash = ef10_filter_hash(spec); Modified: head/sys/dev/sfxge/common/efx.h ============================================================================== --- head/sys/dev/sfxge/common/efx.h Fri Nov 23 09:15:44 2018 (r340810) +++ head/sys/dev/sfxge/common/efx.h Fri Nov 23 09:15:56 2018 (r340811) @@ -2426,7 +2426,12 @@ efx_filter_spec_set_encap_type( __in efx_tunnel_protocol_t encap_type, __in efx_filter_inner_frame_match_t inner_frame_match); - +#if EFSYS_OPT_RX_SCALE +extern __checkReturn efx_rc_t +efx_filter_spec_set_rss_context( + __inout efx_filter_spec_t *spec, + __in uint32_t rss_context); +#endif #endif /* EFSYS_OPT_FILTER */ /* HASH */ Modified: head/sys/dev/sfxge/common/efx_filter.c ============================================================================== --- head/sys/dev/sfxge/common/efx_filter.c Fri Nov 23 09:15:44 2018 (r340810) +++ head/sys/dev/sfxge/common/efx_filter.c Fri Nov 23 09:15:56 2018 (r340811) @@ -122,10 +122,6 @@ efx_filter_remove( EFSYS_ASSERT3P(spec, !=, NULL); EFSYS_ASSERT3U(spec->efs_flags, &, EFX_FILTER_FLAG_RX); -#if EFSYS_OPT_RX_SCALE - spec->efs_rss_context = enp->en_rss_context; -#endif - return (efop->efo_delete(enp, spec)); } @@ -495,7 +491,32 @@ fail1: return (rc); } +#if EFSYS_OPT_RX_SCALE + __checkReturn efx_rc_t +efx_filter_spec_set_rss_context( + __inout efx_filter_spec_t *spec, + __in uint32_t rss_context) +{ + efx_rc_t rc; + EFSYS_ASSERT3P(spec, !=, NULL); + + /* The filter must have been created with EFX_FILTER_FLAG_RX_RSS. */ + if ((spec->efs_flags & EFX_FILTER_FLAG_RX_RSS) == 0) { + rc = EINVAL; + goto fail1; + } + + spec->efs_rss_context = rss_context; + + return (0); + +fail1: + EFSYS_PROBE1(fail1, efx_rc_t, rc); + + return (rc); +} +#endif #if EFSYS_OPT_SIENA From owner-svn-src-all@freebsd.org Fri Nov 23 09:16:12 2018 Return-Path: Delivered-To: svn-src-all@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 1E4D411404F1; Fri, 23 Nov 2018 09:16:12 +0000 (UTC) (envelope-from arybchik@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 CAC747E335; Fri, 23 Nov 2018 09:16:11 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6FDBA1C8C3; Fri, 23 Nov 2018 09:16:08 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAN9G8pU000518; Fri, 23 Nov 2018 09:16:08 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAN9G81M000516; Fri, 23 Nov 2018 09:16:08 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811230916.wAN9G81M000516@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 23 Nov 2018 09:16:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340812 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 340812 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: CAC747E335 X-Spamd-Result: default: False [1.52 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.40)[0.400,0]; NEURAL_SPAM_MEDIUM(0.72)[0.721,0]; NEURAL_SPAM_SHORT(0.40)[0.395,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Nov 2018 09:16:12 -0000 Author: arybchik Date: Fri Nov 23 09:16:07 2018 New Revision: 340812 URL: https://svnweb.freebsd.org/changeset/base/340812 Log: sfxge(4): add RSS key size define Submitted by: Ivan Malov Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18082 Modified: head/sys/dev/sfxge/common/ef10_rx.c head/sys/dev/sfxge/common/efx.h Modified: head/sys/dev/sfxge/common/ef10_rx.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_rx.c Fri Nov 23 09:15:56 2018 (r340811) +++ head/sys/dev/sfxge/common/ef10_rx.c Fri Nov 23 09:16:07 2018 (r340812) @@ -588,6 +588,9 @@ ef10_rx_scale_key_set( { efx_rc_t rc; + EFX_STATIC_ASSERT(EFX_RSS_KEY_SIZE == + MC_CMD_RSS_CONTEXT_SET_KEY_IN_TOEPLITZ_KEY_LEN); + if (rss_context == EFX_RSS_CONTEXT_DEFAULT) { if (enp->en_rss_context_type == EFX_RX_SCALE_UNAVAILABLE) { rc = ENOTSUP; Modified: head/sys/dev/sfxge/common/efx.h ============================================================================== --- head/sys/dev/sfxge/common/efx.h Fri Nov 23 09:15:56 2018 (r340811) +++ head/sys/dev/sfxge/common/efx.h Fri Nov 23 09:16:07 2018 (r340812) @@ -1912,6 +1912,7 @@ typedef enum efx_rx_hash_support_e { EFX_RX_HASH_AVAILABLE /* Insert hash with/without RSS */ } efx_rx_hash_support_t; +#define EFX_RSS_KEY_SIZE 40 /* RSS key size (bytes) */ #define EFX_RSS_TBL_SIZE 128 /* Rows in RX indirection table */ #define EFX_MAXRSS 64 /* RX indirection entry range */ #define EFX_MAXRSS_LEGACY 16 /* See bug16611 and bug17213 */ From owner-svn-src-all@freebsd.org Fri Nov 23 10:19:47 2018 Return-Path: Delivered-To: svn-src-all@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 446F91141A5C; Fri, 23 Nov 2018 10:19:47 +0000 (UTC) (envelope-from arybchik@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 D963B808B7; Fri, 23 Nov 2018 10:19:46 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B48CE1D24D; Fri, 23 Nov 2018 10:19:46 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wANAJkLI031328; Fri, 23 Nov 2018 10:19:46 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wANAJkav031327; Fri, 23 Nov 2018 10:19:46 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811231019.wANAJkav031327@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 23 Nov 2018 10:19:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340813 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 340813 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D963B808B7 X-Spamd-Result: default: False [1.62 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.40)[0.400,0]; NEURAL_SPAM_SHORT(0.50)[0.501,0]; NEURAL_SPAM_MEDIUM(0.72)[0.721,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Nov 2018 10:19:47 -0000 Author: arybchik Date: Fri Nov 23 10:19:46 2018 New Revision: 340813 URL: https://svnweb.freebsd.org/changeset/base/340813 Log: sfxge(4): copy new header from firmware src Submitted by: Andrew Jackson Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18083 Modified: head/sys/dev/sfxge/common/siena_flash.h Modified: head/sys/dev/sfxge/common/siena_flash.h ============================================================================== --- head/sys/dev/sfxge/common/siena_flash.h Fri Nov 23 09:16:07 2018 (r340812) +++ head/sys/dev/sfxge/common/siena_flash.h Fri Nov 23 10:19:46 2018 (r340813) @@ -117,15 +117,21 @@ typedef struct siena_mc_boot_hdr_s { /* GENERATED BY efx_word_t checksum; /* of whole header area + firmware image */ efx_word_t firmware_version_d; efx_byte_t mcfw_subtype; - efx_byte_t generation; /* Valid for medford, SBZ for earlier chips */ + efx_byte_t generation; /* MC (Medford and later): MC partition generation when */ + /* written to NVRAM. */ + /* MUM & SUC images: subtype. */ + /* (Otherwise set to 0) */ efx_dword_t firmware_text_offset; /* offset to firmware .text */ efx_dword_t firmware_text_size; /* length of firmware .text, in bytes */ efx_dword_t firmware_data_offset; /* offset to firmware .data */ efx_dword_t firmware_data_size; /* length of firmware .data, in bytes */ efx_byte_t spi_rate; /* SPI rate for reading image, 0 is BootROM default */ efx_byte_t spi_phase_adj; /* SPI SDO/SCL phase adjustment, 0 is default (no adj) */ - efx_word_t xpm_sector; /* The sector that contains the key, or 0xffff if unsigned (medford) SBZ (earlier) */ - efx_dword_t reserved_c[7]; /* (set to 0) */ + efx_word_t xpm_sector; /* XPM (MEDFORD and later): The sector that contains */ + /* the key, or 0xffff if unsigned. (Otherwise set to 0) */ + efx_byte_t mumfw_subtype; /* MUM & SUC images: subtype. (Otherwise set to 0) */ + efx_byte_t reserved_b[3]; /* (set to 0) */ + efx_dword_t reserved_c[6]; /* (set to 0) */ } siena_mc_boot_hdr_t; #define SIENA_MC_BOOT_HDR_PADDING \ From owner-svn-src-all@freebsd.org Fri Nov 23 10:20:00 2018 Return-Path: Delivered-To: svn-src-all@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 95ABF1141A85; Fri, 23 Nov 2018 10:20:00 +0000 (UTC) (envelope-from arybchik@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 22158809B8; Fri, 23 Nov 2018 10:20:00 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1E3471D24E; Fri, 23 Nov 2018 10:19:58 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wANAJvj3031389; Fri, 23 Nov 2018 10:19:57 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wANAJvIx031388; Fri, 23 Nov 2018 10:19:57 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811231019.wANAJvIx031388@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 23 Nov 2018 10:19:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340814 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 340814 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 22158809B8 X-Spamd-Result: default: False [1.62 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.40)[0.400,0]; NEURAL_SPAM_MEDIUM(0.72)[0.721,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.50)[0.501,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Nov 2018 10:20:00 -0000 Author: arybchik Date: Fri Nov 23 10:19:57 2018 New Revision: 340814 URL: https://svnweb.freebsd.org/changeset/base/340814 Log: sfxge(4): fix result code in MCDI NVRAM update finish Submitted by: Andy Moreton Sponsored by: Solarflare Communications, Inc. MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D18084 Modified: head/sys/dev/sfxge/common/efx_nvram.c Modified: head/sys/dev/sfxge/common/efx_nvram.c ============================================================================== --- head/sys/dev/sfxge/common/efx_nvram.c Fri Nov 23 10:19:46 2018 (r340813) +++ head/sys/dev/sfxge/common/efx_nvram.c Fri Nov 23 10:19:57 2018 (r340814) @@ -926,7 +926,7 @@ efx_mcdi_nvram_update_finish( efx_mcdi_req_t req; uint8_t payload[MAX(MC_CMD_NVRAM_UPDATE_FINISH_V2_IN_LEN, MC_CMD_NVRAM_UPDATE_FINISH_V2_OUT_LEN)]; - uint32_t result = 0; /* FIXME: use MC_CMD_NVRAM_VERIFY_RC_UNKNOWN */ + uint32_t result = MC_CMD_NVRAM_VERIFY_RC_UNKNOWN; efx_rc_t rc; (void) memset(payload, 0, sizeof (payload)); From owner-svn-src-all@freebsd.org Fri Nov 23 10:20:13 2018 Return-Path: Delivered-To: svn-src-all@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 02B921141AB3; Fri, 23 Nov 2018 10:20:13 +0000 (UTC) (envelope-from arybchik@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 94F6E80ACB; Fri, 23 Nov 2018 10:20:12 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CE1041D256; Fri, 23 Nov 2018 10:20:08 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wANAK8jG031478; Fri, 23 Nov 2018 10:20:08 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wANAK8ok031477; Fri, 23 Nov 2018 10:20:08 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811231020.wANAK8ok031477@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 23 Nov 2018 10:20:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340815 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 340815 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 94F6E80ACB X-Spamd-Result: default: False [1.62 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.40)[0.400,0]; NEURAL_SPAM_MEDIUM(0.72)[0.721,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.50)[0.501,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Nov 2018 10:20:13 -0000 Author: arybchik Date: Fri Nov 23 10:20:08 2018 New Revision: 340815 URL: https://svnweb.freebsd.org/changeset/base/340815 Log: sfxge(4): simplify verify result handling Simplify verify result handling in NVRAM update finish Submitted by: Andy Moreton Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18085 Modified: head/sys/dev/sfxge/common/efx_nvram.c Modified: head/sys/dev/sfxge/common/efx_nvram.c ============================================================================== --- head/sys/dev/sfxge/common/efx_nvram.c Fri Nov 23 10:19:57 2018 (r340814) +++ head/sys/dev/sfxge/common/efx_nvram.c Fri Nov 23 10:20:08 2018 (r340815) @@ -949,24 +949,23 @@ efx_mcdi_nvram_update_finish( goto fail1; } - if (encp->enc_fw_verified_nvram_update_required == B_FALSE) { - /* Report success if verified updates are not supported. */ - result = MC_CMD_NVRAM_VERIFY_RC_SUCCESS; - } else { - /* Firmware-verified NVRAM updates are required */ - if (req.emr_out_length_used < - MC_CMD_NVRAM_UPDATE_FINISH_V2_OUT_LEN) { + if (req.emr_out_length_used < MC_CMD_NVRAM_UPDATE_FINISH_V2_OUT_LEN) { + result = MC_CMD_NVRAM_VERIFY_RC_UNKNOWN; + if (encp->enc_fw_verified_nvram_update_required) { + /* Mandatory verification result is missing */ rc = EMSGSIZE; goto fail2; } + } else { result = MCDI_OUT_DWORD(req, NVRAM_UPDATE_FINISH_V2_OUT_RESULT_CODE); + } - if (result != MC_CMD_NVRAM_VERIFY_RC_SUCCESS) { - /* Mandatory verification failed */ - rc = EINVAL; - goto fail3; - } + if ((encp->enc_fw_verified_nvram_update_required) && + (result != MC_CMD_NVRAM_VERIFY_RC_SUCCESS)) { + /* Mandatory verification failed */ + rc = EINVAL; + goto fail3; } if (resultp != NULL) From owner-svn-src-all@freebsd.org Fri Nov 23 10:20:27 2018 Return-Path: Delivered-To: svn-src-all@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 7D7C71141AEC; Fri, 23 Nov 2018 10:20:27 +0000 (UTC) (envelope-from arybchik@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 10D4B80BF2; Fri, 23 Nov 2018 10:20:26 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 538B71D25B; Fri, 23 Nov 2018 10:20:22 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wANAKMZE031541; Fri, 23 Nov 2018 10:20:22 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wANAKKdn031534; Fri, 23 Nov 2018 10:20:20 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811231020.wANAKKdn031534@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 23 Nov 2018 10:20:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340816 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 340816 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 10D4B80BF2 X-Spamd-Result: default: False [1.73 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.44)[0.439,0]; NEURAL_SPAM_MEDIUM(0.75)[0.754,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.54)[0.537,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Nov 2018 10:20:27 -0000 Author: arybchik Date: Fri Nov 23 10:20:20 2018 New Revision: 340816 URL: https://svnweb.freebsd.org/changeset/base/340816 Log: sfxge(4): report verify result from RW finish callback This makes the verify result visible to efx_nvram_rw_finish(), which can be extended to report it in a later patch. Submitted by: Andy Moreton Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18086 Modified: head/sys/dev/sfxge/common/ef10_impl.h head/sys/dev/sfxge/common/ef10_nvram.c head/sys/dev/sfxge/common/efx_impl.h head/sys/dev/sfxge/common/efx_nvram.c head/sys/dev/sfxge/common/siena_impl.h head/sys/dev/sfxge/common/siena_nvram.c head/sys/dev/sfxge/common/siena_vpd.c Modified: head/sys/dev/sfxge/common/ef10_impl.h ============================================================================== --- head/sys/dev/sfxge/common/ef10_impl.h Fri Nov 23 10:20:08 2018 (r340815) +++ head/sys/dev/sfxge/common/ef10_impl.h Fri Nov 23 10:20:20 2018 (r340816) @@ -462,7 +462,8 @@ ef10_nvram_partn_write( extern __checkReturn efx_rc_t ef10_nvram_partn_rw_finish( __in efx_nic_t *enp, - __in uint32_t partn); + __in uint32_t partn, + __out_opt uint32_t *verify_resultp); extern __checkReturn efx_rc_t ef10_nvram_partn_get_version( Modified: head/sys/dev/sfxge/common/ef10_nvram.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_nvram.c Fri Nov 23 10:20:08 2018 (r340815) +++ head/sys/dev/sfxge/common/ef10_nvram.c Fri Nov 23 10:20:20 2018 (r340816) @@ -2050,15 +2050,15 @@ fail1: ef10_nvram_partn_unlock( __in efx_nic_t *enp, __in uint32_t partn, - __out_opt uint32_t *resultp) + __out_opt uint32_t *verify_resultp) { boolean_t reboot = B_FALSE; efx_rc_t rc; - if (resultp != NULL) - *resultp = MC_CMD_NVRAM_VERIFY_RC_UNKNOWN; + if (verify_resultp != NULL) + *verify_resultp = MC_CMD_NVRAM_VERIFY_RC_UNKNOWN; - rc = efx_mcdi_nvram_update_finish(enp, partn, reboot, resultp); + rc = efx_mcdi_nvram_update_finish(enp, partn, reboot, verify_resultp); if (rc != 0) goto fail1; @@ -2368,11 +2368,12 @@ fail1: __checkReturn efx_rc_t ef10_nvram_partn_rw_finish( __in efx_nic_t *enp, - __in uint32_t partn) + __in uint32_t partn, + __out_opt uint32_t *verify_resultp) { efx_rc_t rc; - if ((rc = ef10_nvram_partn_unlock(enp, partn, NULL)) != 0) + if ((rc = ef10_nvram_partn_unlock(enp, partn, verify_resultp)) != 0) goto fail1; return (0); Modified: head/sys/dev/sfxge/common/efx_impl.h ============================================================================== --- head/sys/dev/sfxge/common/efx_impl.h Fri Nov 23 10:20:08 2018 (r340815) +++ head/sys/dev/sfxge/common/efx_impl.h Fri Nov 23 10:20:20 2018 (r340816) @@ -471,7 +471,8 @@ typedef struct efx_nvram_ops_s { unsigned int, size_t); efx_rc_t (*envo_partn_write)(efx_nic_t *, uint32_t, unsigned int, caddr_t, size_t); - efx_rc_t (*envo_partn_rw_finish)(efx_nic_t *, uint32_t); + efx_rc_t (*envo_partn_rw_finish)(efx_nic_t *, uint32_t, + uint32_t *); efx_rc_t (*envo_partn_get_version)(efx_nic_t *, uint32_t, uint32_t *, uint16_t *); efx_rc_t (*envo_partn_set_version)(efx_nic_t *, uint32_t, @@ -560,7 +561,7 @@ efx_mcdi_nvram_update_finish( __in efx_nic_t *enp, __in uint32_t partn, __in boolean_t reboot, - __out_opt uint32_t *resultp); + __out_opt uint32_t *verify_resultp); #if EFSYS_OPT_DIAG Modified: head/sys/dev/sfxge/common/efx_nvram.c ============================================================================== --- head/sys/dev/sfxge/common/efx_nvram.c Fri Nov 23 10:20:08 2018 (r340815) +++ head/sys/dev/sfxge/common/efx_nvram.c Fri Nov 23 10:20:20 2018 (r340816) @@ -371,6 +371,7 @@ efx_nvram_rw_finish( { const efx_nvram_ops_t *envop = enp->en_envop; uint32_t partn; + uint32_t verify_result; efx_rc_t rc; EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC); @@ -384,7 +385,7 @@ efx_nvram_rw_finish( if ((rc = envop->envo_type_to_partn(enp, type, &partn)) != 0) goto fail1; - if ((rc = envop->envo_partn_rw_finish(enp, partn)) != 0) + if ((rc = envop->envo_partn_rw_finish(enp, partn, &verify_result)) != 0) goto fail2; enp->en_nvram_locked = EFX_NVRAM_INVALID; @@ -920,13 +921,13 @@ efx_mcdi_nvram_update_finish( __in efx_nic_t *enp, __in uint32_t partn, __in boolean_t reboot, - __out_opt uint32_t *resultp) + __out_opt uint32_t *verify_resultp) { const efx_nic_cfg_t *encp = &enp->en_nic_cfg; efx_mcdi_req_t req; uint8_t payload[MAX(MC_CMD_NVRAM_UPDATE_FINISH_V2_IN_LEN, MC_CMD_NVRAM_UPDATE_FINISH_V2_OUT_LEN)]; - uint32_t result = MC_CMD_NVRAM_VERIFY_RC_UNKNOWN; + uint32_t verify_result = MC_CMD_NVRAM_VERIFY_RC_UNKNOWN; efx_rc_t rc; (void) memset(payload, 0, sizeof (payload)); @@ -950,26 +951,26 @@ efx_mcdi_nvram_update_finish( } if (req.emr_out_length_used < MC_CMD_NVRAM_UPDATE_FINISH_V2_OUT_LEN) { - result = MC_CMD_NVRAM_VERIFY_RC_UNKNOWN; + verify_result = MC_CMD_NVRAM_VERIFY_RC_UNKNOWN; if (encp->enc_fw_verified_nvram_update_required) { /* Mandatory verification result is missing */ rc = EMSGSIZE; goto fail2; } } else { - result = + verify_result = MCDI_OUT_DWORD(req, NVRAM_UPDATE_FINISH_V2_OUT_RESULT_CODE); } if ((encp->enc_fw_verified_nvram_update_required) && - (result != MC_CMD_NVRAM_VERIFY_RC_SUCCESS)) { + (verify_result != MC_CMD_NVRAM_VERIFY_RC_SUCCESS)) { /* Mandatory verification failed */ rc = EINVAL; goto fail3; } - if (resultp != NULL) - *resultp = result; + if (verify_resultp != NULL) + *verify_resultp = verify_result; return (0); @@ -981,8 +982,8 @@ fail1: EFSYS_PROBE1(fail1, efx_rc_t, rc); /* Always report verification result */ - if (resultp != NULL) - *resultp = result; + if (verify_resultp != NULL) + *verify_resultp = verify_result; return (rc); } Modified: head/sys/dev/sfxge/common/siena_impl.h ============================================================================== --- head/sys/dev/sfxge/common/siena_impl.h Fri Nov 23 10:20:08 2018 (r340815) +++ head/sys/dev/sfxge/common/siena_impl.h Fri Nov 23 10:20:20 2018 (r340816) @@ -147,7 +147,8 @@ siena_nvram_partn_lock( extern __checkReturn efx_rc_t siena_nvram_partn_unlock( __in efx_nic_t *enp, - __in uint32_t partn); + __in uint32_t partn, + __out_opt uint32_t *verify_resultp); extern __checkReturn efx_rc_t siena_nvram_get_dynamic_cfg( @@ -219,7 +220,8 @@ siena_nvram_partn_write( extern __checkReturn efx_rc_t siena_nvram_partn_rw_finish( __in efx_nic_t *enp, - __in uint32_t partn); + __in uint32_t partn, + __out_opt uint32_t *verify_resultp); extern __checkReturn efx_rc_t siena_nvram_partn_get_version( Modified: head/sys/dev/sfxge/common/siena_nvram.c ============================================================================== --- head/sys/dev/sfxge/common/siena_nvram.c Fri Nov 23 10:20:08 2018 (r340815) +++ head/sys/dev/sfxge/common/siena_nvram.c Fri Nov 23 10:20:20 2018 (r340816) @@ -175,7 +175,8 @@ fail1: __checkReturn efx_rc_t siena_nvram_partn_unlock( __in efx_nic_t *enp, - __in uint32_t partn) + __in uint32_t partn, + __out_opt uint32_t *verify_resultp) { boolean_t reboot; efx_rc_t rc; @@ -188,7 +189,7 @@ siena_nvram_partn_unlock( partn == MC_CMD_NVRAM_TYPE_PHY_PORT1 || partn == MC_CMD_NVRAM_TYPE_DISABLED_CALLISTO); - rc = efx_mcdi_nvram_update_finish(enp, partn, reboot, NULL); + rc = efx_mcdi_nvram_update_finish(enp, partn, reboot, verify_resultp); if (rc != 0) goto fail1; @@ -592,11 +593,12 @@ fail1: __checkReturn efx_rc_t siena_nvram_partn_rw_finish( __in efx_nic_t *enp, - __in uint32_t partn) + __in uint32_t partn, + __out_opt uint32_t *verify_resultp) { efx_rc_t rc; - if ((rc = siena_nvram_partn_unlock(enp, partn)) != 0) + if ((rc = siena_nvram_partn_unlock(enp, partn, verify_resultp)) != 0) goto fail1; return (0); @@ -710,7 +712,7 @@ siena_nvram_partn_set_version( EFSYS_KMEM_FREE(enp->en_esip, length, dcfg); - siena_nvram_partn_unlock(enp, dcfg_partn); + siena_nvram_partn_unlock(enp, dcfg_partn, NULL); return (0); Modified: head/sys/dev/sfxge/common/siena_vpd.c ============================================================================== --- head/sys/dev/sfxge/common/siena_vpd.c Fri Nov 23 10:20:08 2018 (r340815) +++ head/sys/dev/sfxge/common/siena_vpd.c Fri Nov 23 10:20:20 2018 (r340816) @@ -577,7 +577,7 @@ siena_vpd_write( EFSYS_KMEM_FREE(enp->en_esip, dcfg_size, dcfg); - siena_nvram_partn_unlock(enp, dcfg_partn); + siena_nvram_partn_unlock(enp, dcfg_partn, NULL); return (0); @@ -592,7 +592,7 @@ fail5: fail4: EFSYS_PROBE(fail4); - siena_nvram_partn_unlock(enp, dcfg_partn); + siena_nvram_partn_unlock(enp, dcfg_partn, NULL); fail3: EFSYS_PROBE(fail3); fail2: From owner-svn-src-all@freebsd.org Fri Nov 23 10:20:36 2018 Return-Path: Delivered-To: svn-src-all@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 9C3101141B2B; Fri, 23 Nov 2018 10:20:36 +0000 (UTC) (envelope-from arybchik@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 0548B80CB2; Fri, 23 Nov 2018 10:20:36 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E00DA1D345; Fri, 23 Nov 2018 10:20:33 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wANAKXma031601; Fri, 23 Nov 2018 10:20:33 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wANAKXHd031598; Fri, 23 Nov 2018 10:20:33 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811231020.wANAKXHd031598@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 23 Nov 2018 10:20:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340817 - in head/sys/dev/sfxge: . common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: in head/sys/dev/sfxge: . common X-SVN-Commit-Revision: 340817 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 0548B80CB2 X-Spamd-Result: default: False [1.68 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.42)[0.420,0]; NEURAL_SPAM_MEDIUM(0.74)[0.738,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.52)[0.519,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Nov 2018 10:20:37 -0000 Author: arybchik Date: Fri Nov 23 10:20:32 2018 New Revision: 340817 URL: https://svnweb.freebsd.org/changeset/base/340817 Log: sfxge(4): extend NVRAM RW finish to return verify result Extend efx_nvram_rw_finish() to return firmware verify result code. Submitted by: Andy Moreton Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18087 Modified: head/sys/dev/sfxge/common/efx.h head/sys/dev/sfxge/common/efx_bootcfg.c head/sys/dev/sfxge/common/efx_nvram.c head/sys/dev/sfxge/sfxge_nvram.c Modified: head/sys/dev/sfxge/common/efx.h ============================================================================== --- head/sys/dev/sfxge/common/efx.h Fri Nov 23 10:20:20 2018 (r340816) +++ head/sys/dev/sfxge/common/efx.h Fri Nov 23 10:20:32 2018 (r340817) @@ -1418,7 +1418,8 @@ efx_nvram_rw_start( extern __checkReturn efx_rc_t efx_nvram_rw_finish( __in efx_nic_t *enp, - __in efx_nvram_type_t type); + __in efx_nvram_type_t type, + __out_opt uint32_t *verify_resultp); extern __checkReturn efx_rc_t efx_nvram_get_version( Modified: head/sys/dev/sfxge/common/efx_bootcfg.c ============================================================================== --- head/sys/dev/sfxge/common/efx_bootcfg.c Fri Nov 23 10:20:20 2018 (r340816) +++ head/sys/dev/sfxge/common/efx_bootcfg.c Fri Nov 23 10:20:32 2018 (r340817) @@ -350,11 +350,11 @@ efx_bootcfg_read( if ((rc = efx_nvram_read_chunk(enp, EFX_NVRAM_BOOTROM_CFG, sector_offset, (caddr_t)payload, sector_length)) != 0) { - (void) efx_nvram_rw_finish(enp, EFX_NVRAM_BOOTROM_CFG); + (void) efx_nvram_rw_finish(enp, EFX_NVRAM_BOOTROM_CFG, NULL); goto fail6; } - if ((rc = efx_nvram_rw_finish(enp, EFX_NVRAM_BOOTROM_CFG)) != 0) + if ((rc = efx_nvram_rw_finish(enp, EFX_NVRAM_BOOTROM_CFG, NULL)) != 0) goto fail7; /* Verify that the area is correctly formatted and checksummed */ @@ -526,7 +526,7 @@ efx_bootcfg_write( 0, (caddr_t)partn_data, partn_length)) != 0) goto fail11; - if ((rc = efx_nvram_rw_finish(enp, EFX_NVRAM_BOOTROM_CFG)) != 0) + if ((rc = efx_nvram_rw_finish(enp, EFX_NVRAM_BOOTROM_CFG, NULL)) != 0) goto fail12; EFSYS_KMEM_FREE(enp->en_esip, partn_length, partn_data); @@ -542,7 +542,7 @@ fail10: fail9: EFSYS_PROBE(fail9); - (void) efx_nvram_rw_finish(enp, EFX_NVRAM_BOOTROM_CFG); + (void) efx_nvram_rw_finish(enp, EFX_NVRAM_BOOTROM_CFG, NULL); fail8: EFSYS_PROBE(fail8); Modified: head/sys/dev/sfxge/common/efx_nvram.c ============================================================================== --- head/sys/dev/sfxge/common/efx_nvram.c Fri Nov 23 10:20:20 2018 (r340816) +++ head/sys/dev/sfxge/common/efx_nvram.c Fri Nov 23 10:20:32 2018 (r340817) @@ -367,11 +367,12 @@ fail1: __checkReturn efx_rc_t efx_nvram_rw_finish( __in efx_nic_t *enp, - __in efx_nvram_type_t type) + __in efx_nvram_type_t type, + __out_opt uint32_t *verify_resultp) { const efx_nvram_ops_t *envop = enp->en_envop; uint32_t partn; - uint32_t verify_result; + uint32_t verify_result = 0; efx_rc_t rc; EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC); @@ -390,6 +391,9 @@ efx_nvram_rw_finish( enp->en_nvram_locked = EFX_NVRAM_INVALID; + if (verify_resultp != NULL) + *verify_resultp = verify_result; + return (0); fail2: @@ -398,6 +402,10 @@ fail2: fail1: EFSYS_PROBE1(fail1, efx_rc_t, rc); + + /* Always report verification result */ + if (verify_resultp != NULL) + *verify_resultp = verify_result; return (rc); } Modified: head/sys/dev/sfxge/sfxge_nvram.c ============================================================================== --- head/sys/dev/sfxge/sfxge_nvram.c Fri Nov 23 10:20:20 2018 (r340816) +++ head/sys/dev/sfxge/sfxge_nvram.c Fri Nov 23 10:20:32 2018 (r340817) @@ -104,7 +104,7 @@ sfxge_nvram_rw(struct sfxge_softc *sc, sfxge_ioc_t *ip fail3: free(buf, M_TEMP); - efx_nvram_rw_finish(enp, type); + efx_nvram_rw_finish(enp, type, NULL); fail1: return (rc); } @@ -125,7 +125,7 @@ sfxge_nvram_erase(struct sfxge_softc *sc, efx_nvram_ty rc = efx_nvram_erase(enp, type); - efx_nvram_rw_finish(enp, type); + efx_nvram_rw_finish(enp, type, NULL); return (rc); } From owner-svn-src-all@freebsd.org Fri Nov 23 10:20:50 2018 Return-Path: Delivered-To: svn-src-all@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 6A1641141B64; Fri, 23 Nov 2018 10:20:50 +0000 (UTC) (envelope-from arybchik@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 0B98180E3D; Fri, 23 Nov 2018 10:20:50 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A1FFE1D385; Fri, 23 Nov 2018 10:20:45 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wANAKj57032596; Fri, 23 Nov 2018 10:20:45 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wANAKiZg032592; Fri, 23 Nov 2018 10:20:44 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811231020.wANAKiZg032592@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 23 Nov 2018 10:20:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340818 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 340818 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 0B98180E3D X-Spamd-Result: default: False [1.68 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.42)[0.420,0]; NEURAL_SPAM_MEDIUM(0.74)[0.738,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.52)[0.519,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Nov 2018 10:20:50 -0000 Author: arybchik Date: Fri Nov 23 10:20:44 2018 New Revision: 340818 URL: https://svnweb.freebsd.org/changeset/base/340818 Log: sfxge(4): rename firmware update verify result cap field The existing name confuses support for secure boot with support for reporting a verify result after an NVRAM update. As the capability only reports support for returning a verify result, change the name to be less confusing. Submitted by: Andy Moreton Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18088 Modified: head/sys/dev/sfxge/common/ef10_mcdi.c head/sys/dev/sfxge/common/ef10_nic.c head/sys/dev/sfxge/common/efx.h head/sys/dev/sfxge/common/efx_nvram.c head/sys/dev/sfxge/common/siena_nic.c Modified: head/sys/dev/sfxge/common/ef10_mcdi.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_mcdi.c Fri Nov 23 10:20:32 2018 (r340817) +++ head/sys/dev/sfxge/common/ef10_mcdi.c Fri Nov 23 10:20:44 2018 (r340818) @@ -133,7 +133,7 @@ ef10_mcdi_get_timeout( case MC_CMD_NVRAM_ERASE: case MC_CMD_LICENSING_V3: case MC_CMD_NVRAM_UPDATE_FINISH: - if (encp->enc_fw_verified_nvram_update_required != B_FALSE) { + if (encp->enc_nvram_update_verify_result_supported != B_FALSE) { /* * Potentially longer running commands, which firmware * may choose to process in a background thread. Modified: head/sys/dev/sfxge/common/ef10_nic.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_nic.c Fri Nov 23 10:20:32 2018 (r340817) +++ head/sys/dev/sfxge/common/ef10_nic.c Fri Nov 23 10:20:44 2018 (r340818) @@ -1057,7 +1057,7 @@ ef10_get_datapath_caps( * and version 2 of MC_CMD_NVRAM_UPDATE_FINISH (to verify the updated * partition and report the result). */ - encp->enc_fw_verified_nvram_update_required = + encp->enc_nvram_update_verify_result_supported = CAP_FLAG2(flags2, NVRAM_UPDATE_REPORT_VERIFY_RESULT) ? B_TRUE : B_FALSE; Modified: head/sys/dev/sfxge/common/efx.h ============================================================================== --- head/sys/dev/sfxge/common/efx.h Fri Nov 23 10:20:32 2018 (r340817) +++ head/sys/dev/sfxge/common/efx.h Fri Nov 23 10:20:44 2018 (r340818) @@ -1213,7 +1213,7 @@ typedef struct efx_nic_cfg_s { uint32_t enc_required_pcie_bandwidth_mbps; uint32_t enc_max_pcie_link_gen; /* Firmware verifies integrity of NVRAM updates */ - uint32_t enc_fw_verified_nvram_update_required; + uint32_t enc_nvram_update_verify_result_supported; } efx_nic_cfg_t; #define EFX_PCI_FUNCTION_IS_PF(_encp) ((_encp)->enc_vf == 0xffff) Modified: head/sys/dev/sfxge/common/efx_nvram.c ============================================================================== --- head/sys/dev/sfxge/common/efx_nvram.c Fri Nov 23 10:20:32 2018 (r340817) +++ head/sys/dev/sfxge/common/efx_nvram.c Fri Nov 23 10:20:44 2018 (r340818) @@ -960,8 +960,8 @@ efx_mcdi_nvram_update_finish( if (req.emr_out_length_used < MC_CMD_NVRAM_UPDATE_FINISH_V2_OUT_LEN) { verify_result = MC_CMD_NVRAM_VERIFY_RC_UNKNOWN; - if (encp->enc_fw_verified_nvram_update_required) { - /* Mandatory verification result is missing */ + if (encp->enc_nvram_update_verify_result_supported) { + /* Result of update verification is missing */ rc = EMSGSIZE; goto fail2; } @@ -970,9 +970,9 @@ efx_mcdi_nvram_update_finish( MCDI_OUT_DWORD(req, NVRAM_UPDATE_FINISH_V2_OUT_RESULT_CODE); } - if ((encp->enc_fw_verified_nvram_update_required) && + if ((encp->enc_nvram_update_verify_result_supported) && (verify_result != MC_CMD_NVRAM_VERIFY_RC_SUCCESS)) { - /* Mandatory verification failed */ + /* Update verification failed */ rc = EINVAL; goto fail3; } Modified: head/sys/dev/sfxge/common/siena_nic.c ============================================================================== --- head/sys/dev/sfxge/common/siena_nic.c Fri Nov 23 10:20:32 2018 (r340817) +++ head/sys/dev/sfxge/common/siena_nic.c Fri Nov 23 10:20:44 2018 (r340818) @@ -179,7 +179,7 @@ siena_board_cfg( encp->enc_required_pcie_bandwidth_mbps = 2 * 10000; encp->enc_max_pcie_link_gen = EFX_PCIE_LINK_SPEED_GEN2; - encp->enc_fw_verified_nvram_update_required = B_FALSE; + encp->enc_nvram_update_verify_result_supported = B_FALSE; return (0); From owner-svn-src-all@freebsd.org Fri Nov 23 10:20:57 2018 Return-Path: Delivered-To: svn-src-all@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 79A901141BA5; Fri, 23 Nov 2018 10:20:57 +0000 (UTC) (envelope-from arybchik@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 C00E680EF2; Fri, 23 Nov 2018 10:20:56 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6A55F1D393; Fri, 23 Nov 2018 10:20:56 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wANAKuNd034869; Fri, 23 Nov 2018 10:20:56 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wANAKu2T034868; Fri, 23 Nov 2018 10:20:56 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811231020.wANAKu2T034868@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 23 Nov 2018 10:20:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340819 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 340819 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C00E680EF2 X-Spamd-Result: default: False [1.68 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.42)[0.420,0]; NEURAL_SPAM_MEDIUM(0.74)[0.738,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.52)[0.519,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Nov 2018 10:20:57 -0000 Author: arybchik Date: Fri Nov 23 10:20:55 2018 New Revision: 340819 URL: https://svnweb.freebsd.org/changeset/base/340819 Log: sfxge(4): simplify NVRAM type to partition mappings Submitted by: Andy Moreton Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18089 Modified: head/sys/dev/sfxge/common/ef10_nvram.c Modified: head/sys/dev/sfxge/common/ef10_nvram.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_nvram.c Fri Nov 23 10:20:44 2018 (r340818) +++ head/sys/dev/sfxge/common/ef10_nvram.c Fri Nov 23 10:20:55 2018 (r340819) @@ -2109,83 +2109,47 @@ fail1: typedef struct ef10_parttbl_entry_s { unsigned int partn; - unsigned int port; + unsigned int port_mask; efx_nvram_type_t nvtype; } ef10_parttbl_entry_t; +/* Port mask values */ +#define PORT_1 (1u << 1) +#define PORT_2 (1u << 2) +#define PORT_3 (1u << 3) +#define PORT_4 (1u << 4) +#define PORT_ALL (0xffffffffu) + +#define PARTN_MAP_ENTRY(partn, port_mask, nvtype) \ +{ (NVRAM_PARTITION_TYPE_##partn), (PORT_##port_mask), (EFX_NVRAM_##nvtype) } + /* Translate EFX NVRAM types to firmware partition types */ static ef10_parttbl_entry_t hunt_parttbl[] = { - {NVRAM_PARTITION_TYPE_MC_FIRMWARE, 1, EFX_NVRAM_MC_FIRMWARE}, - {NVRAM_PARTITION_TYPE_MC_FIRMWARE, 2, EFX_NVRAM_MC_FIRMWARE}, - {NVRAM_PARTITION_TYPE_MC_FIRMWARE, 3, EFX_NVRAM_MC_FIRMWARE}, - {NVRAM_PARTITION_TYPE_MC_FIRMWARE, 4, EFX_NVRAM_MC_FIRMWARE}, - {NVRAM_PARTITION_TYPE_MC_FIRMWARE_BACKUP, 1, EFX_NVRAM_MC_GOLDEN}, - {NVRAM_PARTITION_TYPE_MC_FIRMWARE_BACKUP, 2, EFX_NVRAM_MC_GOLDEN}, - {NVRAM_PARTITION_TYPE_MC_FIRMWARE_BACKUP, 3, EFX_NVRAM_MC_GOLDEN}, - {NVRAM_PARTITION_TYPE_MC_FIRMWARE_BACKUP, 4, EFX_NVRAM_MC_GOLDEN}, - {NVRAM_PARTITION_TYPE_EXPANSION_ROM, 1, EFX_NVRAM_BOOTROM}, - {NVRAM_PARTITION_TYPE_EXPANSION_ROM, 2, EFX_NVRAM_BOOTROM}, - {NVRAM_PARTITION_TYPE_EXPANSION_ROM, 3, EFX_NVRAM_BOOTROM}, - {NVRAM_PARTITION_TYPE_EXPANSION_ROM, 4, EFX_NVRAM_BOOTROM}, - {NVRAM_PARTITION_TYPE_EXPROM_CONFIG_PORT0, 1, EFX_NVRAM_BOOTROM_CFG}, - {NVRAM_PARTITION_TYPE_EXPROM_CONFIG_PORT1, 2, EFX_NVRAM_BOOTROM_CFG}, - {NVRAM_PARTITION_TYPE_EXPROM_CONFIG_PORT2, 3, EFX_NVRAM_BOOTROM_CFG}, - {NVRAM_PARTITION_TYPE_EXPROM_CONFIG_PORT3, 4, EFX_NVRAM_BOOTROM_CFG}, - {NVRAM_PARTITION_TYPE_DYNAMIC_CONFIG, 1, EFX_NVRAM_DYNAMIC_CFG}, - {NVRAM_PARTITION_TYPE_DYNAMIC_CONFIG, 2, EFX_NVRAM_DYNAMIC_CFG}, - {NVRAM_PARTITION_TYPE_DYNAMIC_CONFIG, 3, EFX_NVRAM_DYNAMIC_CFG}, - {NVRAM_PARTITION_TYPE_DYNAMIC_CONFIG, 4, EFX_NVRAM_DYNAMIC_CFG}, - {NVRAM_PARTITION_TYPE_FPGA, 1, EFX_NVRAM_FPGA}, - {NVRAM_PARTITION_TYPE_FPGA, 2, EFX_NVRAM_FPGA}, - {NVRAM_PARTITION_TYPE_FPGA, 3, EFX_NVRAM_FPGA}, - {NVRAM_PARTITION_TYPE_FPGA, 4, EFX_NVRAM_FPGA}, - {NVRAM_PARTITION_TYPE_FPGA_BACKUP, 1, EFX_NVRAM_FPGA_BACKUP}, - {NVRAM_PARTITION_TYPE_FPGA_BACKUP, 2, EFX_NVRAM_FPGA_BACKUP}, - {NVRAM_PARTITION_TYPE_FPGA_BACKUP, 3, EFX_NVRAM_FPGA_BACKUP}, - {NVRAM_PARTITION_TYPE_FPGA_BACKUP, 4, EFX_NVRAM_FPGA_BACKUP}, - {NVRAM_PARTITION_TYPE_LICENSE, 1, EFX_NVRAM_LICENSE}, - {NVRAM_PARTITION_TYPE_LICENSE, 2, EFX_NVRAM_LICENSE}, - {NVRAM_PARTITION_TYPE_LICENSE, 3, EFX_NVRAM_LICENSE}, - {NVRAM_PARTITION_TYPE_LICENSE, 4, EFX_NVRAM_LICENSE} + /* partn ports nvtype */ + PARTN_MAP_ENTRY(MC_FIRMWARE, ALL, MC_FIRMWARE), + PARTN_MAP_ENTRY(MC_FIRMWARE_BACKUP, ALL, MC_GOLDEN), + PARTN_MAP_ENTRY(EXPANSION_ROM, ALL, BOOTROM), + PARTN_MAP_ENTRY(EXPROM_CONFIG_PORT0, 1, BOOTROM_CFG), + PARTN_MAP_ENTRY(EXPROM_CONFIG_PORT1, 2, BOOTROM_CFG), + PARTN_MAP_ENTRY(EXPROM_CONFIG_PORT2, 3, BOOTROM_CFG), + PARTN_MAP_ENTRY(EXPROM_CONFIG_PORT3, 4, BOOTROM_CFG), + PARTN_MAP_ENTRY(DYNAMIC_CONFIG, ALL, DYNAMIC_CFG), + PARTN_MAP_ENTRY(FPGA, ALL, FPGA), + PARTN_MAP_ENTRY(FPGA_BACKUP, ALL, FPGA_BACKUP), + PARTN_MAP_ENTRY(LICENSE, ALL, LICENSE), }; static ef10_parttbl_entry_t medford_parttbl[] = { - {NVRAM_PARTITION_TYPE_MC_FIRMWARE, 1, EFX_NVRAM_MC_FIRMWARE}, - {NVRAM_PARTITION_TYPE_MC_FIRMWARE, 2, EFX_NVRAM_MC_FIRMWARE}, - {NVRAM_PARTITION_TYPE_MC_FIRMWARE, 3, EFX_NVRAM_MC_FIRMWARE}, - {NVRAM_PARTITION_TYPE_MC_FIRMWARE, 4, EFX_NVRAM_MC_FIRMWARE}, - {NVRAM_PARTITION_TYPE_MC_FIRMWARE_BACKUP, 1, EFX_NVRAM_MC_GOLDEN}, - {NVRAM_PARTITION_TYPE_MC_FIRMWARE_BACKUP, 2, EFX_NVRAM_MC_GOLDEN}, - {NVRAM_PARTITION_TYPE_MC_FIRMWARE_BACKUP, 3, EFX_NVRAM_MC_GOLDEN}, - {NVRAM_PARTITION_TYPE_MC_FIRMWARE_BACKUP, 4, EFX_NVRAM_MC_GOLDEN}, - {NVRAM_PARTITION_TYPE_EXPANSION_ROM, 1, EFX_NVRAM_BOOTROM}, - {NVRAM_PARTITION_TYPE_EXPANSION_ROM, 2, EFX_NVRAM_BOOTROM}, - {NVRAM_PARTITION_TYPE_EXPANSION_ROM, 3, EFX_NVRAM_BOOTROM}, - {NVRAM_PARTITION_TYPE_EXPANSION_ROM, 4, EFX_NVRAM_BOOTROM}, - {NVRAM_PARTITION_TYPE_EXPROM_CONFIG_PORT0, 1, EFX_NVRAM_BOOTROM_CFG}, - {NVRAM_PARTITION_TYPE_EXPROM_CONFIG_PORT0, 2, EFX_NVRAM_BOOTROM_CFG}, - {NVRAM_PARTITION_TYPE_EXPROM_CONFIG_PORT0, 3, EFX_NVRAM_BOOTROM_CFG}, - {NVRAM_PARTITION_TYPE_EXPROM_CONFIG_PORT0, 4, EFX_NVRAM_BOOTROM_CFG}, - {NVRAM_PARTITION_TYPE_DYNAMIC_CONFIG, 1, EFX_NVRAM_DYNAMIC_CFG}, - {NVRAM_PARTITION_TYPE_DYNAMIC_CONFIG, 2, EFX_NVRAM_DYNAMIC_CFG}, - {NVRAM_PARTITION_TYPE_DYNAMIC_CONFIG, 3, EFX_NVRAM_DYNAMIC_CFG}, - {NVRAM_PARTITION_TYPE_DYNAMIC_CONFIG, 4, EFX_NVRAM_DYNAMIC_CFG}, - {NVRAM_PARTITION_TYPE_FPGA, 1, EFX_NVRAM_FPGA}, - {NVRAM_PARTITION_TYPE_FPGA, 2, EFX_NVRAM_FPGA}, - {NVRAM_PARTITION_TYPE_FPGA, 3, EFX_NVRAM_FPGA}, - {NVRAM_PARTITION_TYPE_FPGA, 4, EFX_NVRAM_FPGA}, - {NVRAM_PARTITION_TYPE_FPGA_BACKUP, 1, EFX_NVRAM_FPGA_BACKUP}, - {NVRAM_PARTITION_TYPE_FPGA_BACKUP, 2, EFX_NVRAM_FPGA_BACKUP}, - {NVRAM_PARTITION_TYPE_FPGA_BACKUP, 3, EFX_NVRAM_FPGA_BACKUP}, - {NVRAM_PARTITION_TYPE_FPGA_BACKUP, 4, EFX_NVRAM_FPGA_BACKUP}, - {NVRAM_PARTITION_TYPE_LICENSE, 1, EFX_NVRAM_LICENSE}, - {NVRAM_PARTITION_TYPE_LICENSE, 2, EFX_NVRAM_LICENSE}, - {NVRAM_PARTITION_TYPE_LICENSE, 3, EFX_NVRAM_LICENSE}, - {NVRAM_PARTITION_TYPE_LICENSE, 4, EFX_NVRAM_LICENSE}, - {NVRAM_PARTITION_TYPE_EXPANSION_UEFI, 1, EFX_NVRAM_UEFIROM}, - {NVRAM_PARTITION_TYPE_EXPANSION_UEFI, 2, EFX_NVRAM_UEFIROM}, - {NVRAM_PARTITION_TYPE_EXPANSION_UEFI, 3, EFX_NVRAM_UEFIROM}, - {NVRAM_PARTITION_TYPE_EXPANSION_UEFI, 4, EFX_NVRAM_UEFIROM} + /* partn ports nvtype */ + PARTN_MAP_ENTRY(MC_FIRMWARE, ALL, MC_FIRMWARE), + PARTN_MAP_ENTRY(MC_FIRMWARE_BACKUP, ALL, MC_GOLDEN), + PARTN_MAP_ENTRY(EXPANSION_ROM, ALL, BOOTROM), + PARTN_MAP_ENTRY(EXPROM_CONFIG, ALL, BOOTROM_CFG), + PARTN_MAP_ENTRY(DYNAMIC_CONFIG, ALL, DYNAMIC_CFG), + PARTN_MAP_ENTRY(FPGA, ALL, FPGA), + PARTN_MAP_ENTRY(FPGA_BACKUP, ALL, FPGA_BACKUP), + PARTN_MAP_ENTRY(LICENSE, ALL, LICENSE), + PARTN_MAP_ENTRY(EXPANSION_UEFI, ALL, UEFIROM), }; static __checkReturn efx_rc_t @@ -2230,8 +2194,8 @@ ef10_nvram_type_to_partn( for (i = 0; i < parttbl_rows; i++) { ef10_parttbl_entry_t *entry = &parttbl[i]; - if (entry->nvtype == type && - entry->port == emip->emi_port) { + if ((entry->nvtype == type) && + (entry->port_mask & (1u << emip->emi_port))) { *partnp = entry->partn; return (0); } @@ -2260,8 +2224,8 @@ ef10_nvram_partn_to_type( for (i = 0; i < parttbl_rows; i++) { ef10_parttbl_entry_t *entry = &parttbl[i]; - if (entry->partn == partn && - entry->port == emip->emi_port) { + if ((entry->partn == partn) && + (entry->port_mask & (1u << emip->emi_port))) { *typep = entry->nvtype; return (0); } From owner-svn-src-all@freebsd.org Fri Nov 23 10:21:11 2018 Return-Path: Delivered-To: svn-src-all@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 29CE41141BEF; Fri, 23 Nov 2018 10:21:11 +0000 (UTC) (envelope-from arybchik@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 BE9C981078; Fri, 23 Nov 2018 10:21:10 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5FD131D3A2; Fri, 23 Nov 2018 10:21:07 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wANAL7k0035715; Fri, 23 Nov 2018 10:21:07 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wANAL7ml035713; Fri, 23 Nov 2018 10:21:07 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811231021.wANAL7ml035713@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 23 Nov 2018 10:21:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340820 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 340820 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: BE9C981078 X-Spamd-Result: default: False [1.68 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.42)[0.420,0]; NEURAL_SPAM_MEDIUM(0.74)[0.738,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.52)[0.519,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Nov 2018 10:21:11 -0000 Author: arybchik Date: Fri Nov 23 10:21:06 2018 New Revision: 340820 URL: https://svnweb.freebsd.org/changeset/base/340820 Log: sfxge(4): check NVRAM locking by partition ID Tracking which partition is locked avoids being overly conservative when EFX_NVRAM_xxx maps to more than one partition (depnding on the current port number). Submitted by: Andy Moreton Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18090 Modified: head/sys/dev/sfxge/common/efx_impl.h head/sys/dev/sfxge/common/efx_nvram.c Modified: head/sys/dev/sfxge/common/efx_impl.h ============================================================================== --- head/sys/dev/sfxge/common/efx_impl.h Fri Nov 23 10:20:55 2018 (r340819) +++ head/sys/dev/sfxge/common/efx_impl.h Fri Nov 23 10:21:06 2018 (r340820) @@ -457,6 +457,10 @@ typedef struct efx_mcdi_s { #endif /* EFSYS_OPT_MCDI */ #if EFSYS_OPT_NVRAM + +/* Invalid partition ID for en_nvram_partn_locked field of efx_nc_t */ +#define EFX_NVRAM_PARTN_INVALID (0xffffffffu) + typedef struct efx_nvram_ops_s { #if EFSYS_OPT_DIAG efx_rc_t (*envo_test)(efx_nic_t *); @@ -644,7 +648,7 @@ struct efx_nic_s { efx_mcdi_t en_mcdi; #endif /* EFSYS_OPT_MCDI */ #if EFSYS_OPT_NVRAM - efx_nvram_type_t en_nvram_locked; + uint32_t en_nvram_partn_locked; const efx_nvram_ops_t *en_envop; #endif /* EFSYS_OPT_NVRAM */ #if EFSYS_OPT_VPD Modified: head/sys/dev/sfxge/common/efx_nvram.c ============================================================================== --- head/sys/dev/sfxge/common/efx_nvram.c Fri Nov 23 10:20:55 2018 (r340819) +++ head/sys/dev/sfxge/common/efx_nvram.c Fri Nov 23 10:21:06 2018 (r340820) @@ -117,6 +117,8 @@ efx_nvram_init( enp->en_envop = envop; enp->en_mod_flags |= EFX_MOD_NVRAM; + enp->en_nvram_partn_locked = EFX_NVRAM_PARTN_INVALID; + return (0); fail1: @@ -232,15 +234,15 @@ efx_nvram_rw_start( EFSYS_ASSERT3U(type, <, EFX_NVRAM_NTYPES); EFSYS_ASSERT3U(type, !=, EFX_NVRAM_INVALID); - EFSYS_ASSERT3U(enp->en_nvram_locked, ==, EFX_NVRAM_INVALID); - if ((rc = envop->envo_type_to_partn(enp, type, &partn)) != 0) goto fail1; + EFSYS_ASSERT3U(enp->en_nvram_partn_locked, ==, EFX_NVRAM_PARTN_INVALID); + if ((rc = envop->envo_partn_rw_start(enp, partn, chunk_sizep)) != 0) goto fail2; - enp->en_nvram_locked = type; + enp->en_nvram_partn_locked = partn; return (0); @@ -270,11 +272,11 @@ efx_nvram_read_chunk( EFSYS_ASSERT3U(type, <, EFX_NVRAM_NTYPES); EFSYS_ASSERT3U(type, !=, EFX_NVRAM_INVALID); - EFSYS_ASSERT3U(enp->en_nvram_locked, ==, type); - if ((rc = envop->envo_type_to_partn(enp, type, &partn)) != 0) goto fail1; + EFSYS_ASSERT3U(enp->en_nvram_partn_locked, ==, partn); + if ((rc = envop->envo_partn_read(enp, partn, offset, data, size)) != 0) goto fail2; @@ -305,11 +307,11 @@ efx_nvram_erase( EFSYS_ASSERT3U(type, <, EFX_NVRAM_NTYPES); EFSYS_ASSERT3U(type, !=, EFX_NVRAM_INVALID); - EFSYS_ASSERT3U(enp->en_nvram_locked, ==, type); - if ((rc = envop->envo_type_to_partn(enp, type, &partn)) != 0) goto fail1; + EFSYS_ASSERT3U(enp->en_nvram_partn_locked, ==, partn); + if ((rc = envop->envo_partn_size(enp, partn, &size)) != 0) goto fail2; @@ -346,11 +348,11 @@ efx_nvram_write_chunk( EFSYS_ASSERT3U(type, <, EFX_NVRAM_NTYPES); EFSYS_ASSERT3U(type, !=, EFX_NVRAM_INVALID); - EFSYS_ASSERT3U(enp->en_nvram_locked, ==, type); - if ((rc = envop->envo_type_to_partn(enp, type, &partn)) != 0) goto fail1; + EFSYS_ASSERT3U(enp->en_nvram_partn_locked, ==, partn); + if ((rc = envop->envo_partn_write(enp, partn, offset, data, size)) != 0) goto fail2; @@ -381,15 +383,15 @@ efx_nvram_rw_finish( EFSYS_ASSERT3U(type, <, EFX_NVRAM_NTYPES); EFSYS_ASSERT3U(type, !=, EFX_NVRAM_INVALID); - EFSYS_ASSERT3U(enp->en_nvram_locked, ==, type); - if ((rc = envop->envo_type_to_partn(enp, type, &partn)) != 0) goto fail1; + EFSYS_ASSERT3U(enp->en_nvram_partn_locked, ==, partn); + if ((rc = envop->envo_partn_rw_finish(enp, partn, &verify_result)) != 0) goto fail2; - enp->en_nvram_locked = EFX_NVRAM_INVALID; + enp->en_nvram_partn_locked = EFX_NVRAM_PARTN_INVALID; if (verify_resultp != NULL) *verify_resultp = verify_result; @@ -398,7 +400,7 @@ efx_nvram_rw_finish( fail2: EFSYS_PROBE(fail2); - enp->en_nvram_locked = EFX_NVRAM_INVALID; + enp->en_nvram_partn_locked = EFX_NVRAM_PARTN_INVALID; fail1: EFSYS_PROBE1(fail1, efx_rc_t, rc); @@ -426,16 +428,16 @@ efx_nvram_set_version( EFSYS_ASSERT3U(type, <, EFX_NVRAM_NTYPES); + if ((rc = envop->envo_type_to_partn(enp, type, &partn)) != 0) + goto fail1; + /* * The Siena implementation of envo_set_version() will attempt to - * acquire the NVRAM_UPDATE lock for the DYNAMIC_CONFIG sector. + * acquire the NVRAM_UPDATE lock for the DYNAMIC_CONFIG partition. * Therefore, you can't have already acquired the NVRAM_UPDATE lock. */ - EFSYS_ASSERT3U(enp->en_nvram_locked, ==, EFX_NVRAM_INVALID); + EFSYS_ASSERT3U(enp->en_nvram_partn_locked, ==, EFX_NVRAM_PARTN_INVALID); - if ((rc = envop->envo_type_to_partn(enp, type, &partn)) != 0) - goto fail1; - if ((rc = envop->envo_partn_set_version(enp, partn, version)) != 0) goto fail2; @@ -495,7 +497,7 @@ efx_nvram_fini( EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_PROBE); EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_NVRAM); - EFSYS_ASSERT3U(enp->en_nvram_locked, ==, EFX_NVRAM_INVALID); + EFSYS_ASSERT3U(enp->en_nvram_partn_locked, ==, EFX_NVRAM_PARTN_INVALID); enp->en_envop = NULL; enp->en_mod_flags &= ~EFX_MOD_NVRAM; From owner-svn-src-all@freebsd.org Fri Nov 23 10:21:19 2018 Return-Path: Delivered-To: svn-src-all@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 8CCAD1141C30; Fri, 23 Nov 2018 10:21:19 +0000 (UTC) (envelope-from arybchik@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 0F96B81161; Fri, 23 Nov 2018 10:21:19 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4369B1D3B8; Fri, 23 Nov 2018 10:21:18 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wANALIL9035771; Fri, 23 Nov 2018 10:21:18 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wANALIUT035770; Fri, 23 Nov 2018 10:21:18 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811231021.wANALIUT035770@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 23 Nov 2018 10:21:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340821 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 340821 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 0F96B81161 X-Spamd-Result: default: False [1.62 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.40)[0.400,0]; NEURAL_SPAM_MEDIUM(0.72)[0.721,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.50)[0.501,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Nov 2018 10:21:19 -0000 Author: arybchik Date: Fri Nov 23 10:21:17 2018 New Revision: 340821 URL: https://svnweb.freebsd.org/changeset/base/340821 Log: sfxge(4): report correct partition write chunk size If the firmware reports a non-zero write chunk size then nvram writes may fail if a different granularity is used (e.g. for MUM firmware on Sorrento). Submitted by: Andy Moreton Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18091 Modified: head/sys/dev/sfxge/common/ef10_nvram.c Modified: head/sys/dev/sfxge/common/ef10_nvram.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_nvram.c Fri Nov 23 10:21:06 2018 (r340820) +++ head/sys/dev/sfxge/common/ef10_nvram.c Fri Nov 23 10:21:17 2018 (r340821) @@ -2313,16 +2313,27 @@ ef10_nvram_partn_rw_start( __in uint32_t partn, __out size_t *chunk_sizep) { + uint32_t write_size = 0; efx_rc_t rc; - if ((rc = ef10_nvram_partn_lock(enp, partn)) != 0) + if ((rc = efx_mcdi_nvram_info(enp, partn, NULL, NULL, + NULL, &write_size)) != 0) goto fail1; - if (chunk_sizep != NULL) - *chunk_sizep = EF10_NVRAM_CHUNK; + if ((rc = ef10_nvram_partn_lock(enp, partn)) != 0) + goto fail2; + if (chunk_sizep != NULL) { + if (write_size == 0) + *chunk_sizep = EF10_NVRAM_CHUNK; + else + *chunk_sizep = write_size; + } + return (0); +fail2: + EFSYS_PROBE(fail2); fail1: EFSYS_PROBE1(fail1, efx_rc_t, rc); From owner-svn-src-all@freebsd.org Fri Nov 23 10:21:30 2018 Return-Path: Delivered-To: svn-src-all@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 06B311141C77; Fri, 23 Nov 2018 10:21:30 +0000 (UTC) (envelope-from arybchik@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 837D281279; Fri, 23 Nov 2018 10:21:29 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 118991D3C4; Fri, 23 Nov 2018 10:21:29 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wANALSHO035828; Fri, 23 Nov 2018 10:21:28 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wANALSpg035827; Fri, 23 Nov 2018 10:21:28 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811231021.wANALSpg035827@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 23 Nov 2018 10:21:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340822 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 340822 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 837D281279 X-Spamd-Result: default: False [1.62 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.40)[0.400,0]; NEURAL_SPAM_MEDIUM(0.72)[0.721,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.50)[0.501,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Nov 2018 10:21:30 -0000 Author: arybchik Date: Fri Nov 23 10:21:28 2018 New Revision: 340822 URL: https://svnweb.freebsd.org/changeset/base/340822 Log: sfxge(4): fix check in NVRAM validate Submitted by: Andy Moreton Sponsored by: Solarflare Communications, Inc. MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D18092 Modified: head/sys/dev/sfxge/common/efx_nvram.c Modified: head/sys/dev/sfxge/common/efx_nvram.c ============================================================================== --- head/sys/dev/sfxge/common/efx_nvram.c Fri Nov 23 10:21:17 2018 (r340821) +++ head/sys/dev/sfxge/common/efx_nvram.c Fri Nov 23 10:21:28 2018 (r340822) @@ -473,10 +473,11 @@ efx_nvram_validate( if ((rc = envop->envo_type_to_partn(enp, type, &partn)) != 0) goto fail1; - if (envop->envo_type_to_partn != NULL && - ((rc = envop->envo_buffer_validate(enp, partn, - partn_data, partn_size)) != 0)) - goto fail2; + if (envop->envo_buffer_validate != NULL) { + if ((rc = envop->envo_buffer_validate(enp, partn, + partn_data, partn_size)) != 0) + goto fail2; + } return (0); From owner-svn-src-all@freebsd.org Fri Nov 23 10:21:40 2018 Return-Path: Delivered-To: svn-src-all@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 94AA51141DD2; Fri, 23 Nov 2018 10:21:40 +0000 (UTC) (envelope-from arybchik@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 CF31081390; Fri, 23 Nov 2018 10:21:39 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C9F8F1D3D5; Fri, 23 Nov 2018 10:21:37 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wANALbsN035889; Fri, 23 Nov 2018 10:21:37 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wANALao0035881; Fri, 23 Nov 2018 10:21:36 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811231021.wANALao0035881@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 23 Nov 2018 10:21:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340823 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 340823 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: CF31081390 X-Spamd-Result: default: False [1.68 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.42)[0.420,0]; NEURAL_SPAM_MEDIUM(0.74)[0.738,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.52)[0.519,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Nov 2018 10:21:40 -0000 Author: arybchik Date: Fri Nov 23 10:21:36 2018 New Revision: 340823 URL: https://svnweb.freebsd.org/changeset/base/340823 Log: sfxge(4): precheck and verify flash writes Read existing flash content before writing, so the flash write can be avoided if the existing partition content matches the new image. This avoids unnecessary write cycles for the flash device, and may also be faster. If the flash does need to be updated, verify the content after writing. Note that reading the flash content after writing but before calling efx_nvram-rw_finish() avoids firmware bug68170, which can lead to signed image updates failing on Medford. Submitted by: Andy Moreton Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18093 Modified: head/sys/dev/sfxge/common/ef10_impl.h head/sys/dev/sfxge/common/ef10_nvram.c head/sys/dev/sfxge/common/efx.h head/sys/dev/sfxge/common/efx_impl.h head/sys/dev/sfxge/common/efx_nvram.c Modified: head/sys/dev/sfxge/common/ef10_impl.h ============================================================================== --- head/sys/dev/sfxge/common/ef10_impl.h Fri Nov 23 10:21:28 2018 (r340822) +++ head/sys/dev/sfxge/common/ef10_impl.h Fri Nov 23 10:21:36 2018 (r340823) @@ -445,6 +445,14 @@ ef10_nvram_partn_read( __in size_t size); extern __checkReturn efx_rc_t +ef10_nvram_partn_read_backup( + __in efx_nic_t *enp, + __in uint32_t partn, + __in unsigned int offset, + __out_bcount(size) caddr_t data, + __in size_t size); + +extern __checkReturn efx_rc_t ef10_nvram_partn_erase( __in efx_nic_t *enp, __in uint32_t partn, Modified: head/sys/dev/sfxge/common/ef10_nvram.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_nvram.c Fri Nov 23 10:21:28 2018 (r340822) +++ head/sys/dev/sfxge/common/ef10_nvram.c Fri Nov 23 10:21:36 2018 (r340823) @@ -1940,11 +1940,34 @@ ef10_nvram_partn_read( __in size_t size) { /* - * Read requests which come in through the EFX API expect to - * read the current, active partition. + * An A/B partition has two data stores (current and backup). + * Read requests which come in through the EFX API expect to read the + * current, active store of an A/B partition. For non A/B partitions, + * there is only a single store and so the mode param is ignored. */ return ef10_nvram_partn_read_mode(enp, partn, offset, data, size, MC_CMD_NVRAM_READ_IN_V2_TARGET_CURRENT); +} + + __checkReturn efx_rc_t +ef10_nvram_partn_read_backup( + __in efx_nic_t *enp, + __in uint32_t partn, + __in unsigned int offset, + __out_bcount(size) caddr_t data, + __in size_t size) +{ + /* + * An A/B partition has two data stores (current and backup). + * Read the backup store of an A/B partition (i.e. the store currently + * being written to if the partition is locked). + * + * This is needed when comparing the existing partition content to avoid + * unnecessary writes, or to read back what has been written to check + * that the writes have succeeded. + */ + return ef10_nvram_partn_read_mode(enp, partn, offset, data, size, + MC_CMD_NVRAM_READ_IN_V2_TARGET_BACKUP); } __checkReturn efx_rc_t Modified: head/sys/dev/sfxge/common/efx.h ============================================================================== --- head/sys/dev/sfxge/common/efx.h Fri Nov 23 10:21:28 2018 (r340822) +++ head/sys/dev/sfxge/common/efx.h Fri Nov 23 10:21:36 2018 (r340823) @@ -1437,6 +1437,14 @@ efx_nvram_read_chunk( __in size_t size); extern __checkReturn efx_rc_t +efx_nvram_read_backup( + __in efx_nic_t *enp, + __in efx_nvram_type_t type, + __in unsigned int offset, + __out_bcount(size) caddr_t data, + __in size_t size); + +extern __checkReturn efx_rc_t efx_nvram_set_version( __in efx_nic_t *enp, __in efx_nvram_type_t type, Modified: head/sys/dev/sfxge/common/efx_impl.h ============================================================================== --- head/sys/dev/sfxge/common/efx_impl.h Fri Nov 23 10:21:28 2018 (r340822) +++ head/sys/dev/sfxge/common/efx_impl.h Fri Nov 23 10:21:36 2018 (r340823) @@ -471,6 +471,8 @@ typedef struct efx_nvram_ops_s { efx_rc_t (*envo_partn_rw_start)(efx_nic_t *, uint32_t, size_t *); efx_rc_t (*envo_partn_read)(efx_nic_t *, uint32_t, unsigned int, caddr_t, size_t); + efx_rc_t (*envo_partn_read_backup)(efx_nic_t *, uint32_t, + unsigned int, caddr_t, size_t); efx_rc_t (*envo_partn_erase)(efx_nic_t *, uint32_t, unsigned int, size_t); efx_rc_t (*envo_partn_write)(efx_nic_t *, uint32_t, Modified: head/sys/dev/sfxge/common/efx_nvram.c ============================================================================== --- head/sys/dev/sfxge/common/efx_nvram.c Fri Nov 23 10:21:28 2018 (r340822) +++ head/sys/dev/sfxge/common/efx_nvram.c Fri Nov 23 10:21:36 2018 (r340823) @@ -48,6 +48,7 @@ static const efx_nvram_ops_t __efx_nvram_siena_ops = { siena_nvram_partn_size, /* envo_partn_size */ siena_nvram_partn_rw_start, /* envo_partn_rw_start */ siena_nvram_partn_read, /* envo_partn_read */ + siena_nvram_partn_read, /* envo_partn_read_backup */ siena_nvram_partn_erase, /* envo_partn_erase */ siena_nvram_partn_write, /* envo_partn_write */ siena_nvram_partn_rw_finish, /* envo_partn_rw_finish */ @@ -68,6 +69,7 @@ static const efx_nvram_ops_t __efx_nvram_ef10_ops = { ef10_nvram_partn_size, /* envo_partn_size */ ef10_nvram_partn_rw_start, /* envo_partn_rw_start */ ef10_nvram_partn_read, /* envo_partn_read */ + ef10_nvram_partn_read_backup, /* envo_partn_read_backup */ ef10_nvram_partn_erase, /* envo_partn_erase */ ef10_nvram_partn_write, /* envo_partn_write */ ef10_nvram_partn_rw_finish, /* envo_partn_rw_finish */ @@ -278,6 +280,48 @@ efx_nvram_read_chunk( EFSYS_ASSERT3U(enp->en_nvram_partn_locked, ==, partn); if ((rc = envop->envo_partn_read(enp, partn, offset, data, size)) != 0) + goto fail2; + + return (0); + +fail2: + EFSYS_PROBE(fail2); +fail1: + EFSYS_PROBE1(fail1, efx_rc_t, rc); + + return (rc); +} + +/* + * Read from the backup (writeable) store of an A/B partition. + * For non A/B partitions, there is only a single store, and so this + * function has the same behaviour as efx_nvram_read_chunk(). + */ + __checkReturn efx_rc_t +efx_nvram_read_backup( + __in efx_nic_t *enp, + __in efx_nvram_type_t type, + __in unsigned int offset, + __out_bcount(size) caddr_t data, + __in size_t size) +{ + const efx_nvram_ops_t *envop = enp->en_envop; + uint32_t partn; + efx_rc_t rc; + + EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC); + EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_NVRAM); + + EFSYS_ASSERT3U(type, <, EFX_NVRAM_NTYPES); + EFSYS_ASSERT3U(type, !=, EFX_NVRAM_INVALID); + + if ((rc = envop->envo_type_to_partn(enp, type, &partn)) != 0) + goto fail1; + + EFSYS_ASSERT3U(enp->en_nvram_partn_locked, ==, partn); + + if ((rc = envop->envo_partn_read_backup(enp, partn, offset, + data, size)) != 0) goto fail2; return (0); From owner-svn-src-all@freebsd.org Fri Nov 23 10:21:55 2018 Return-Path: Delivered-To: svn-src-all@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 88CA21141E20; Fri, 23 Nov 2018 10:21:55 +0000 (UTC) (envelope-from arybchik@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 4E17B8151F; Fri, 23 Nov 2018 10:21:54 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 21FE81D3EE; Fri, 23 Nov 2018 10:21:51 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wANALoeT035948; Fri, 23 Nov 2018 10:21:50 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wANALopp035945; Fri, 23 Nov 2018 10:21:50 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811231021.wANALopp035945@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 23 Nov 2018 10:21:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340824 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 340824 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4E17B8151F X-Spamd-Result: default: False [1.68 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.42)[0.420,0]; NEURAL_SPAM_MEDIUM(0.74)[0.738,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.52)[0.519,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Nov 2018 10:21:55 -0000 Author: arybchik Date: Fri Nov 23 10:21:50 2018 New Revision: 340824 URL: https://svnweb.freebsd.org/changeset/base/340824 Log: sfxge(4): remove duplicate NVRAM asserts The checking performed in the ->envo_type_to_partn internal method make these assertions unnecessary. Submitted by: Andy Moreton Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18094 Modified: head/sys/dev/sfxge/common/ef10_nvram.c head/sys/dev/sfxge/common/efx_nvram.c head/sys/dev/sfxge/common/siena_nvram.c Modified: head/sys/dev/sfxge/common/ef10_nvram.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_nvram.c Fri Nov 23 10:21:36 2018 (r340823) +++ head/sys/dev/sfxge/common/ef10_nvram.c Fri Nov 23 10:21:50 2018 (r340824) @@ -2210,6 +2210,7 @@ ef10_nvram_type_to_partn( size_t parttbl_rows = 0; unsigned int i; + EFSYS_ASSERT3U(type, !=, EFX_NVRAM_INVALID); EFSYS_ASSERT3U(type, <, EFX_NVRAM_NTYPES); EFSYS_ASSERT(partnp != NULL); Modified: head/sys/dev/sfxge/common/efx_nvram.c ============================================================================== --- head/sys/dev/sfxge/common/efx_nvram.c Fri Nov 23 10:21:36 2018 (r340823) +++ head/sys/dev/sfxge/common/efx_nvram.c Fri Nov 23 10:21:50 2018 (r340824) @@ -167,8 +167,6 @@ efx_nvram_size( EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC); EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_NVRAM); - EFSYS_ASSERT3U(type, <, EFX_NVRAM_NTYPES); - if ((rc = envop->envo_type_to_partn(enp, type, &partn)) != 0) goto fail1; @@ -201,8 +199,6 @@ efx_nvram_get_version( EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_PROBE); EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_NVRAM); - EFSYS_ASSERT3U(type, <, EFX_NVRAM_NTYPES); - if ((rc = envop->envo_type_to_partn(enp, type, &partn)) != 0) goto fail1; @@ -233,9 +229,6 @@ efx_nvram_rw_start( EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC); EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_NVRAM); - EFSYS_ASSERT3U(type, <, EFX_NVRAM_NTYPES); - EFSYS_ASSERT3U(type, !=, EFX_NVRAM_INVALID); - if ((rc = envop->envo_type_to_partn(enp, type, &partn)) != 0) goto fail1; @@ -271,9 +264,6 @@ efx_nvram_read_chunk( EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC); EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_NVRAM); - EFSYS_ASSERT3U(type, <, EFX_NVRAM_NTYPES); - EFSYS_ASSERT3U(type, !=, EFX_NVRAM_INVALID); - if ((rc = envop->envo_type_to_partn(enp, type, &partn)) != 0) goto fail1; @@ -312,9 +302,6 @@ efx_nvram_read_backup( EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC); EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_NVRAM); - EFSYS_ASSERT3U(type, <, EFX_NVRAM_NTYPES); - EFSYS_ASSERT3U(type, !=, EFX_NVRAM_INVALID); - if ((rc = envop->envo_type_to_partn(enp, type, &partn)) != 0) goto fail1; @@ -348,9 +335,6 @@ efx_nvram_erase( EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC); EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_NVRAM); - EFSYS_ASSERT3U(type, <, EFX_NVRAM_NTYPES); - EFSYS_ASSERT3U(type, !=, EFX_NVRAM_INVALID); - if ((rc = envop->envo_type_to_partn(enp, type, &partn)) != 0) goto fail1; @@ -389,9 +373,6 @@ efx_nvram_write_chunk( EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC); EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_NVRAM); - EFSYS_ASSERT3U(type, <, EFX_NVRAM_NTYPES); - EFSYS_ASSERT3U(type, !=, EFX_NVRAM_INVALID); - if ((rc = envop->envo_type_to_partn(enp, type, &partn)) != 0) goto fail1; @@ -424,9 +405,6 @@ efx_nvram_rw_finish( EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC); EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_NVRAM); - EFSYS_ASSERT3U(type, <, EFX_NVRAM_NTYPES); - EFSYS_ASSERT3U(type, !=, EFX_NVRAM_INVALID); - if ((rc = envop->envo_type_to_partn(enp, type, &partn)) != 0) goto fail1; @@ -470,8 +448,6 @@ efx_nvram_set_version( EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_PROBE); EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_NVRAM); - EFSYS_ASSERT3U(type, <, EFX_NVRAM_NTYPES); - if ((rc = envop->envo_type_to_partn(enp, type, &partn)) != 0) goto fail1; @@ -510,9 +486,6 @@ efx_nvram_validate( EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC); EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_PROBE); EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_NVRAM); - - EFSYS_ASSERT3U(type, <, EFX_NVRAM_NTYPES); - if ((rc = envop->envo_type_to_partn(enp, type, &partn)) != 0) goto fail1; Modified: head/sys/dev/sfxge/common/siena_nvram.c ============================================================================== --- head/sys/dev/sfxge/common/siena_nvram.c Fri Nov 23 10:21:36 2018 (r340823) +++ head/sys/dev/sfxge/common/siena_nvram.c Fri Nov 23 10:21:50 2018 (r340824) @@ -245,6 +245,7 @@ siena_nvram_type_to_partn( efx_mcdi_iface_t *emip = &(enp->en_mcdi.em_emip); unsigned int i; + EFSYS_ASSERT3U(type, !=, EFX_NVRAM_INVALID); EFSYS_ASSERT3U(type, <, EFX_NVRAM_NTYPES); EFSYS_ASSERT(partnp != NULL); From owner-svn-src-all@freebsd.org Fri Nov 23 10:22:07 2018 Return-Path: Delivered-To: svn-src-all@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 898851141E69; Fri, 23 Nov 2018 10:22:07 +0000 (UTC) (envelope-from arybchik@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 8CBE28166A; Fri, 23 Nov 2018 10:22:06 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EBA361D403; Fri, 23 Nov 2018 10:22:01 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wANAM1qI036030; Fri, 23 Nov 2018 10:22:01 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wANAM1fa036029; Fri, 23 Nov 2018 10:22:01 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811231022.wANAM1fa036029@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 23 Nov 2018 10:22:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340825 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 340825 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 8CBE28166A X-Spamd-Result: default: False [1.62 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.40)[0.400,0]; NEURAL_SPAM_MEDIUM(0.72)[0.721,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.50)[0.501,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Nov 2018 10:22:07 -0000 Author: arybchik Date: Fri Nov 23 10:22:01 2018 New Revision: 340825 URL: https://svnweb.freebsd.org/changeset/base/340825 Log: sfxge(4): quieten get version methods Submitted by: Andy Moreton Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18095 Modified: head/sys/dev/sfxge/common/efx_nvram.c Modified: head/sys/dev/sfxge/common/efx_nvram.c ============================================================================== --- head/sys/dev/sfxge/common/efx_nvram.c Fri Nov 23 10:21:50 2018 (r340824) +++ head/sys/dev/sfxge/common/efx_nvram.c Fri Nov 23 10:22:01 2018 (r340825) @@ -613,7 +613,7 @@ efx_mcdi_nvram_metadata( MCDI_IN_SET_DWORD(req, NVRAM_METADATA_IN_TYPE, partn); - efx_mcdi_execute(enp, &req); + efx_mcdi_execute_quiet(enp, &req); if (req.emr_rc != 0) { rc = req.emr_rc; From owner-svn-src-all@freebsd.org Fri Nov 23 11:31:47 2018 Return-Path: Delivered-To: svn-src-all@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 17DD81143A7B; Fri, 23 Nov 2018 11:31:47 +0000 (UTC) (envelope-from arybchik@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 AE21C8472B; Fri, 23 Nov 2018 11:31:46 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8FFC71DFDA; Fri, 23 Nov 2018 11:31:46 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wANBVk6b072140; Fri, 23 Nov 2018 11:31:46 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wANBVkb0072139; Fri, 23 Nov 2018 11:31:46 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811231131.wANBVkb0072139@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 23 Nov 2018 11:31:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340826 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 340826 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: AE21C8472B X-Spamd-Result: default: False [1.77 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.40)[0.400,0]; NEURAL_SPAM_MEDIUM(0.72)[0.721,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.65)[0.646,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Nov 2018 11:31:47 -0000 Author: arybchik Date: Fri Nov 23 11:31:45 2018 New Revision: 340826 URL: https://svnweb.freebsd.org/changeset/base/340826 Log: sfxge(4): fix ignoring function return value fix PreFAST issue, add missing annotation that function return value should not be ignored. Fix alignment. Submitted by: Andy Moreton Sponsored by: Solarflare Communications, Inc. MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D18096 Modified: head/sys/dev/sfxge/common/efx.h head/sys/dev/sfxge/common/efx_phy.c Modified: head/sys/dev/sfxge/common/efx.h ============================================================================== --- head/sys/dev/sfxge/common/efx.h Fri Nov 23 10:22:01 2018 (r340825) +++ head/sys/dev/sfxge/common/efx.h Fri Nov 23 11:31:45 2018 (r340826) @@ -920,13 +920,13 @@ efx_phy_media_type_get( __in efx_nic_t *enp, __out efx_phy_media_type_t *typep); -extern efx_rc_t +extern __checkReturn efx_rc_t efx_phy_module_get_info( - __in efx_nic_t *enp, - __in uint8_t dev_addr, - __in uint8_t offset, - __in uint8_t len, - __out_bcount(len) uint8_t *data); + __in efx_nic_t *enp, + __in uint8_t dev_addr, + __in uint8_t offset, + __in uint8_t len, + __out_bcount(len) uint8_t *data); #if EFSYS_OPT_PHY_STATS Modified: head/sys/dev/sfxge/common/efx_phy.c ============================================================================== --- head/sys/dev/sfxge/common/efx_phy.c Fri Nov 23 10:22:01 2018 (r340825) +++ head/sys/dev/sfxge/common/efx_phy.c Fri Nov 23 11:31:45 2018 (r340826) @@ -301,7 +301,7 @@ efx_phy_media_type_get( *typep = epp->ep_fixed_port_type; } - __checkReturn efx_rc_t + __checkReturn efx_rc_t efx_phy_module_get_info( __in efx_nic_t *enp, __in uint8_t dev_addr, From owner-svn-src-all@freebsd.org Fri Nov 23 11:32:02 2018 Return-Path: Delivered-To: svn-src-all@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 4C64A1143AA2; Fri, 23 Nov 2018 11:32:02 +0000 (UTC) (envelope-from arybchik@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 2847A84849; Fri, 23 Nov 2018 11:32:01 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 478571DFEB; Fri, 23 Nov 2018 11:31:58 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wANBVwOO072198; Fri, 23 Nov 2018 11:31:58 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wANBVviC072196; Fri, 23 Nov 2018 11:31:57 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811231131.wANBVviC072196@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 23 Nov 2018 11:31:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340827 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 340827 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 2847A84849 X-Spamd-Result: default: False [1.77 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.40)[0.400,0]; NEURAL_SPAM_MEDIUM(0.72)[0.721,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.65)[0.646,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Nov 2018 11:32:02 -0000 Author: arybchik Date: Fri Nov 23 11:31:57 2018 New Revision: 340827 URL: https://svnweb.freebsd.org/changeset/base/340827 Log: sfxge(4): support MUM/SUC firmware partitions Submitted by: Andrew Lee Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18097 Modified: head/sys/dev/sfxge/common/ef10_nvram.c head/sys/dev/sfxge/common/efx.h Modified: head/sys/dev/sfxge/common/ef10_nvram.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_nvram.c Fri Nov 23 11:31:45 2018 (r340826) +++ head/sys/dev/sfxge/common/ef10_nvram.c Fri Nov 23 11:31:57 2018 (r340827) @@ -2173,6 +2173,7 @@ static ef10_parttbl_entry_t medford_parttbl[] = { PARTN_MAP_ENTRY(FPGA_BACKUP, ALL, FPGA_BACKUP), PARTN_MAP_ENTRY(LICENSE, ALL, LICENSE), PARTN_MAP_ENTRY(EXPANSION_UEFI, ALL, UEFIROM), + PARTN_MAP_ENTRY(MUM_FIRMWARE, ALL, MUM_FIRMWARE), }; static __checkReturn efx_rc_t Modified: head/sys/dev/sfxge/common/efx.h ============================================================================== --- head/sys/dev/sfxge/common/efx.h Fri Nov 23 11:31:45 2018 (r340826) +++ head/sys/dev/sfxge/common/efx.h Fri Nov 23 11:31:57 2018 (r340827) @@ -1388,6 +1388,7 @@ typedef enum efx_nvram_type_e { EFX_NVRAM_DYNAMIC_CFG, EFX_NVRAM_LICENSE, EFX_NVRAM_UEFIROM, + EFX_NVRAM_MUM_FIRMWARE, EFX_NVRAM_NTYPES, } efx_nvram_type_t; From owner-svn-src-all@freebsd.org Fri Nov 23 11:38:51 2018 Return-Path: Delivered-To: svn-src-all@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 9AE5711440AF; Fri, 23 Nov 2018 11:38:51 +0000 (UTC) (envelope-from arybchik@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 40F5684ED4; Fri, 23 Nov 2018 11:38:51 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1DE8B1E025; Fri, 23 Nov 2018 11:38:51 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wANBcoZa073243; Fri, 23 Nov 2018 11:38:50 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wANBcosh073238; Fri, 23 Nov 2018 11:38:50 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811231138.wANBcosh073238@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 23 Nov 2018 11:38:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340828 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 340828 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 40F5684ED4 X-Spamd-Result: default: False [1.51 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.40)[0.400,0]; NEURAL_SPAM_MEDIUM(0.72)[0.721,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.39)[0.390,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Nov 2018 11:38:51 -0000 Author: arybchik Date: Fri Nov 23 11:38:50 2018 New Revision: 340828 URL: https://svnweb.freebsd.org/changeset/base/340828 Log: sfxge(4): improve RxQ label init prototype RxQ type provides more information which may be useful to setup event queue appropriately. Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18098 Modified: head/sys/dev/sfxge/common/ef10_ev.c head/sys/dev/sfxge/common/ef10_impl.h head/sys/dev/sfxge/common/ef10_rx.c Modified: head/sys/dev/sfxge/common/ef10_ev.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_ev.c Fri Nov 23 11:31:57 2018 (r340827) +++ head/sys/dev/sfxge/common/ef10_ev.c Fri Nov 23 11:38:50 2018 (r340828) @@ -1344,9 +1344,11 @@ ef10_ev_rxlabel_init( __in efx_evq_t *eep, __in efx_rxq_t *erp, __in unsigned int label, - __in boolean_t packed_stream) + __in efx_rxq_type_t type) { efx_evq_rxq_state_t *eersp; + boolean_t packed_stream = (type >= EFX_RXQ_TYPE_PACKED_STREAM_1M) && + (type <= EFX_RXQ_TYPE_PACKED_STREAM_64K); EFSYS_ASSERT3U(label, <, EFX_ARRAY_SIZE(eep->ee_rxq_state)); eersp = &eep->ee_rxq_state[label]; Modified: head/sys/dev/sfxge/common/ef10_impl.h ============================================================================== --- head/sys/dev/sfxge/common/ef10_impl.h Fri Nov 23 11:31:57 2018 (r340827) +++ head/sys/dev/sfxge/common/ef10_impl.h Fri Nov 23 11:38:50 2018 (r340828) @@ -119,7 +119,7 @@ ef10_ev_rxlabel_init( __in efx_evq_t *eep, __in efx_rxq_t *erp, __in unsigned int label, - __in boolean_t packed_stream); + __in efx_rxq_type_t type); void ef10_ev_rxlabel_fini( Modified: head/sys/dev/sfxge/common/ef10_rx.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_rx.c Fri Nov 23 11:31:57 2018 (r340827) +++ head/sys/dev/sfxge/common/ef10_rx.c Fri Nov 23 11:38:50 2018 (r340828) @@ -995,7 +995,7 @@ ef10_rx_qcreate( erp->er_eep = eep; erp->er_label = label; - ef10_ev_rxlabel_init(eep, erp, label, ps_buf_size != 0); + ef10_ev_rxlabel_init(eep, erp, label, type); return (0); From owner-svn-src-all@freebsd.org Fri Nov 23 11:39:04 2018 Return-Path: Delivered-To: svn-src-all@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 0197111440DA; Fri, 23 Nov 2018 11:39:04 +0000 (UTC) (envelope-from arybchik@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 9932384FBD; Fri, 23 Nov 2018 11:39:03 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A28051E026; Fri, 23 Nov 2018 11:39:02 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wANBd2Dl073304; Fri, 23 Nov 2018 11:39:02 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wANBd2Vq073303; Fri, 23 Nov 2018 11:39:02 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811231139.wANBd2Vq073303@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 23 Nov 2018 11:39:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340829 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 340829 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 9932384FBD X-Spamd-Result: default: False [1.51 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.40)[0.400,0]; NEURAL_SPAM_SHORT(0.39)[0.390,0]; NEURAL_SPAM_MEDIUM(0.72)[0.721,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Nov 2018 11:39:04 -0000 Author: arybchik Date: Fri Nov 23 11:39:02 2018 New Revision: 340829 URL: https://svnweb.freebsd.org/changeset/base/340829 Log: sfxge(4): provide simple access to RxQ state in EvQ Packed stream Rx datapath requires access to packed stream state stored in event queue. Number of credits is upstead in event handler on a new buffer, packets parsing on 64k boundary crossing and Rx doorbell push to give credits back. Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18099 Modified: head/sys/dev/sfxge/common/ef10_rx.c head/sys/dev/sfxge/common/efx_impl.h Modified: head/sys/dev/sfxge/common/ef10_rx.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_rx.c Fri Nov 23 11:38:50 2018 (r340828) +++ head/sys/dev/sfxge/common/ef10_rx.c Fri Nov 23 11:39:02 2018 (r340829) @@ -787,8 +787,7 @@ ef10_rx_qpush_ps_credits( { efx_nic_t *enp = erp->er_enp; efx_dword_t dword; - efx_evq_rxq_state_t *rxq_state = - &erp->er_eep->ee_rxq_state[erp->er_label]; + efx_evq_rxq_state_t *rxq_state = erp->er_ev_qstate; uint32_t credits; EFSYS_ASSERT(rxq_state->eers_rx_packed_stream); @@ -837,8 +836,7 @@ ef10_rx_qps_packet_info( uint16_t buf_len; uint8_t *pkt_start; efx_qword_t *qwordp; - efx_evq_rxq_state_t *rxq_state = - &erp->er_eep->ee_rxq_state[erp->er_label]; + efx_evq_rxq_state_t *rxq_state = erp->er_ev_qstate; EFSYS_ASSERT(rxq_state->eers_rx_packed_stream); @@ -996,6 +994,8 @@ ef10_rx_qcreate( erp->er_label = label; ef10_ev_rxlabel_init(eep, erp, label, type); + + erp->er_ev_qstate = &erp->er_eep->ee_rxq_state[label]; return (0); Modified: head/sys/dev/sfxge/common/efx_impl.h ============================================================================== --- head/sys/dev/sfxge/common/efx_impl.h Fri Nov 23 11:38:50 2018 (r340828) +++ head/sys/dev/sfxge/common/efx_impl.h Fri Nov 23 11:39:02 2018 (r340829) @@ -757,6 +757,7 @@ struct efx_rxq_s { unsigned int er_label; unsigned int er_mask; efsys_mem_t *er_esmp; + efx_evq_rxq_state_t *er_ev_qstate; }; #define EFX_RXQ_MAGIC 0x15022005 From owner-svn-src-all@freebsd.org Fri Nov 23 11:39:18 2018 Return-Path: Delivered-To: svn-src-all@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 AD6711144107; Fri, 23 Nov 2018 11:39:18 +0000 (UTC) (envelope-from arybchik@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 BA276850DE; Fri, 23 Nov 2018 11:39:16 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BF0561E033; Fri, 23 Nov 2018 11:39:13 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wANBdD9R073363; Fri, 23 Nov 2018 11:39:13 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wANBdDaN073361; Fri, 23 Nov 2018 11:39:13 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811231139.wANBdDaN073361@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 23 Nov 2018 11:39:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340830 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 340830 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: BA276850DE X-Spamd-Result: default: False [1.51 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.40)[0.400,0]; NEURAL_SPAM_MEDIUM(0.72)[0.721,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.39)[0.390,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Nov 2018 11:39:19 -0000 Author: arybchik Date: Fri Nov 23 11:39:13 2018 New Revision: 340830 URL: https://svnweb.freebsd.org/changeset/base/340830 Log: sfxge(4): enforce packed stream fake buffer size In the case of packed stream real size of the buffer does not fit in Rx descriptor byte count. Real size is specified on Rx queue setup. Non-zero fake should be used to bypass hardware checks. Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18100 Modified: head/sys/dev/sfxge/common/ef10_rx.c head/sys/dev/sfxge/common/efx.h Modified: head/sys/dev/sfxge/common/ef10_rx.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_rx.c Fri Nov 23 11:39:02 2018 (r340829) +++ head/sys/dev/sfxge/common/ef10_rx.c Fri Nov 23 11:39:13 2018 (r340830) @@ -710,6 +710,14 @@ ef10_rx_prefix_hash( } #endif /* EFSYS_OPT_RX_SCALE */ +#if EFSYS_OPT_RX_PACKED_STREAM +/* + * Fake length for RXQ descriptors in packed stream mode + * to make hardware happy + */ +#define EFX_RXQ_PACKED_STREAM_FAKE_BUF_SIZE 32 +#endif + void ef10_rx_qpost( __in efx_rxq_t *erp, @@ -723,6 +731,15 @@ ef10_rx_qpost( unsigned int i; unsigned int offset; unsigned int id; + +#if EFSYS_OPT_RX_PACKED_STREAM + /* + * Real size of the buffer does not fit into ESF_DZ_RX_KER_BYTE_CNT + * and equal to 0 after applying mask. Hardware does not like it. + */ + if (erp->er_ev_qstate->eers_rx_packed_stream) + size = EFX_RXQ_PACKED_STREAM_FAKE_BUF_SIZE; +#endif /* The client driver must not overfill the queue */ EFSYS_ASSERT3U(added - completed + n, <=, Modified: head/sys/dev/sfxge/common/efx.h ============================================================================== --- head/sys/dev/sfxge/common/efx.h Fri Nov 23 11:39:02 2018 (r340829) +++ head/sys/dev/sfxge/common/efx.h Fri Nov 23 11:39:13 2018 (r340830) @@ -2050,12 +2050,6 @@ efx_rx_qpush( #if EFSYS_OPT_RX_PACKED_STREAM -/* - * Fake length for RXQ descriptors in packed stream mode - * to make hardware happy - */ -#define EFX_RXQ_PACKED_STREAM_FAKE_BUF_SIZE 32 - extern void efx_rx_qpush_ps_credits( __in efx_rxq_t *erp); From owner-svn-src-all@freebsd.org Fri Nov 23 11:39:27 2018 Return-Path: Delivered-To: svn-src-all@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 E7F9C1144143; Fri, 23 Nov 2018 11:39:25 +0000 (UTC) (envelope-from arybchik@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 DFFE88515D; Fri, 23 Nov 2018 11:39:24 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9D36D1E038; Fri, 23 Nov 2018 11:39:24 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wANBdOKr073420; Fri, 23 Nov 2018 11:39:24 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wANBdOba073419; Fri, 23 Nov 2018 11:39:24 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811231139.wANBdOba073419@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 23 Nov 2018 11:39:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340831 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 340831 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: DFFE88515D X-Spamd-Result: default: False [1.51 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.40)[0.400,0]; NEURAL_SPAM_MEDIUM(0.72)[0.721,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.39)[0.390,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Nov 2018 11:39:27 -0000 Author: arybchik Date: Fri Nov 23 11:39:24 2018 New Revision: 340831 URL: https://svnweb.freebsd.org/changeset/base/340831 Log: sfxge(4): make MAC naming consistent with other modules Submitted by: Andy Moreton Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18101 Modified: head/sys/dev/sfxge/common/efx_mac.c Modified: head/sys/dev/sfxge/common/efx_mac.c ============================================================================== --- head/sys/dev/sfxge/common/efx_mac.c Fri Nov 23 11:39:13 2018 (r340830) +++ head/sys/dev/sfxge/common/efx_mac.c Fri Nov 23 11:39:24 2018 (r340831) @@ -45,7 +45,7 @@ siena_mac_multicast_list_set( #endif /* EFSYS_OPT_SIENA */ #if EFSYS_OPT_SIENA -static const efx_mac_ops_t __efx_siena_mac_ops = { +static const efx_mac_ops_t __efx_mac_siena_ops = { siena_mac_poll, /* emo_poll */ siena_mac_up, /* emo_up */ siena_mac_reconfigure, /* emo_addr_set */ @@ -69,7 +69,7 @@ static const efx_mac_ops_t __efx_siena_mac_ops = { #endif /* EFSYS_OPT_SIENA */ #if EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD -static const efx_mac_ops_t __efx_ef10_mac_ops = { +static const efx_mac_ops_t __efx_mac_ef10_ops = { ef10_mac_poll, /* emo_poll */ ef10_mac_up, /* emo_up */ ef10_mac_addr_set, /* emo_addr_set */ @@ -845,21 +845,21 @@ efx_mac_select( switch (enp->en_family) { #if EFSYS_OPT_SIENA case EFX_FAMILY_SIENA: - emop = &__efx_siena_mac_ops; + emop = &__efx_mac_siena_ops; type = EFX_MAC_SIENA; break; #endif /* EFSYS_OPT_SIENA */ #if EFSYS_OPT_HUNTINGTON case EFX_FAMILY_HUNTINGTON: - emop = &__efx_ef10_mac_ops; + emop = &__efx_mac_ef10_ops; type = EFX_MAC_HUNTINGTON; break; #endif /* EFSYS_OPT_HUNTINGTON */ #if EFSYS_OPT_MEDFORD case EFX_FAMILY_MEDFORD: - emop = &__efx_ef10_mac_ops; + emop = &__efx_mac_ef10_ops; type = EFX_MAC_MEDFORD; break; #endif /* EFSYS_OPT_MEDFORD */ From owner-svn-src-all@freebsd.org Fri Nov 23 12:03:03 2018 Return-Path: Delivered-To: svn-src-all@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 2E120114532F; Fri, 23 Nov 2018 12:03:03 +0000 (UTC) (envelope-from thj@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 03C8386457; Fri, 23 Nov 2018 12:03:02 +0000 (UTC) (envelope-from thj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D4ABC1E503; Fri, 23 Nov 2018 12:03:01 +0000 (UTC) (envelope-from thj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wANC31B8088511; Fri, 23 Nov 2018 12:03:01 GMT (envelope-from thj@FreeBSD.org) Received: (from thj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wANC317N088510; Fri, 23 Nov 2018 12:03:01 GMT (envelope-from thj@FreeBSD.org) Message-Id: <201811231203.wANC317N088510@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: thj set sender to thj@FreeBSD.org using -f From: Tom Jones Date: Fri, 23 Nov 2018 12:03:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340832 - head/sys/dev/acpica X-SVN-Group: head X-SVN-Commit-Author: thj X-SVN-Commit-Paths: head/sys/dev/acpica X-SVN-Commit-Revision: 340832 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 03C8386457 X-Spamd-Result: default: False [1.51 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.40)[0.400,0]; NEURAL_SPAM_SHORT(0.39)[0.390,0]; NEURAL_SPAM_MEDIUM(0.72)[0.721,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Nov 2018 12:03:03 -0000 Author: thj Date: Fri Nov 23 12:03:01 2018 New Revision: 340832 URL: https://svnweb.freebsd.org/changeset/base/340832 Log: Add support for none ACPI battery method batteries Remove the requirement that a device be a ACPI method battery to be supported as a battery. Require now that the device be in the battery devclass and implement the get_status and get_info functions. This allows batteries which are not ACPI method batteries to be supported. Reviewed by: jtl Approved by: jtl (mentor) MFC after: 1 Month Differential Revision: https://reviews.freebsd.org/D17434 Modified: head/sys/dev/acpica/acpi_battery.c Modified: head/sys/dev/acpica/acpi_battery.c ============================================================================== --- head/sys/dev/acpica/acpi_battery.c Fri Nov 23 11:39:24 2018 (r340831) +++ head/sys/dev/acpica/acpi_battery.c Fri Nov 23 12:03:01 2018 (r340832) @@ -169,14 +169,11 @@ acpi_battery_get_battinfo(device_t dev, struct acpi_ba dev_idx = i; /* - * Be sure we can get various info from the battery. Note that - * acpi_BatteryIsPresent() is not enough because smart batteries only - * return that the device is present. + * Be sure we can get various info from the battery. */ - if (!acpi_BatteryIsPresent(batt_dev) || - ACPI_BATT_GET_STATUS(batt_dev, &bst[i]) != 0 || - ACPI_BATT_GET_INFO(batt_dev, bif) != 0) - continue; + if (ACPI_BATT_GET_STATUS(batt_dev, &bst[i]) != 0 || + ACPI_BATT_GET_INFO(batt_dev, bif) != 0) + continue; /* If a battery is not installed, we sometimes get strange values. */ if (!acpi_battery_bst_valid(&bst[i]) || From owner-svn-src-all@freebsd.org Fri Nov 23 13:12:06 2018 Return-Path: Delivered-To: svn-src-all@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 D022011469B5; Fri, 23 Nov 2018 13:12:05 +0000 (UTC) (envelope-from arybchik@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 6D82A891D4; Fri, 23 Nov 2018 13:12:05 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4EA0B1F000; Fri, 23 Nov 2018 13:12:05 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wANDC5ls022292; Fri, 23 Nov 2018 13:12:05 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wANDC4vb022289; Fri, 23 Nov 2018 13:12:04 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811231312.wANDC4vb022289@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 23 Nov 2018 13:12:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340833 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 340833 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 6D82A891D4 X-Spamd-Result: default: False [1.68 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.42)[0.420,0]; NEURAL_SPAM_MEDIUM(0.74)[0.738,0]; NEURAL_SPAM_SHORT(0.52)[0.522,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Nov 2018 13:12:06 -0000 Author: arybchik Date: Fri Nov 23 13:12:04 2018 New Revision: 340833 URL: https://svnweb.freebsd.org/changeset/base/340833 Log: sfxge(4): support inner checksum offload on transmit Inner checksum offloads may be used only if firmware supports these tunnels. Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18102 Modified: head/sys/dev/sfxge/common/ef10_tx.c head/sys/dev/sfxge/common/efx.h head/sys/dev/sfxge/common/efx_tx.c Modified: head/sys/dev/sfxge/common/ef10_tx.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_tx.c Fri Nov 23 12:03:01 2018 (r340832) +++ head/sys/dev/sfxge/common/ef10_tx.c Fri Nov 23 13:12:04 2018 (r340833) @@ -87,12 +87,16 @@ efx_mcdi_init_txq( MCDI_IN_SET_DWORD(req, INIT_TXQ_IN_LABEL, label); MCDI_IN_SET_DWORD(req, INIT_TXQ_IN_INSTANCE, instance); - MCDI_IN_POPULATE_DWORD_7(req, INIT_TXQ_IN_FLAGS, + MCDI_IN_POPULATE_DWORD_9(req, INIT_TXQ_IN_FLAGS, INIT_TXQ_IN_FLAG_BUFF_MODE, 0, INIT_TXQ_IN_FLAG_IP_CSUM_DIS, (flags & EFX_TXQ_CKSUM_IPV4) ? 0 : 1, INIT_TXQ_IN_FLAG_TCP_CSUM_DIS, (flags & EFX_TXQ_CKSUM_TCPUDP) ? 0 : 1, + INIT_TXQ_EXT_IN_FLAG_INNER_IP_CSUM_EN, + (flags & EFX_TXQ_CKSUM_INNER_IPV4) ? 1 : 0, + INIT_TXQ_EXT_IN_FLAG_INNER_TCP_CSUM_EN, + (flags & EFX_TXQ_CKSUM_INNER_TCPUDP) ? 1 : 0, INIT_TXQ_EXT_IN_FLAG_TSOV2_EN, (flags & EFX_TXQ_FATSOV2) ? 1 : 0, INIT_TXQ_IN_FLAG_TCP_UDP_ONLY, 0, INIT_TXQ_IN_CRC_MODE, 0, @@ -197,14 +201,23 @@ ef10_tx_qcreate( __in efx_txq_t *etp, __out unsigned int *addedp) { + efx_nic_cfg_t *encp = &enp->en_nic_cfg; + uint16_t inner_csum; efx_qword_t desc; efx_rc_t rc; _NOTE(ARGUNUSED(id)) + inner_csum = EFX_TXQ_CKSUM_INNER_IPV4 | EFX_TXQ_CKSUM_INNER_TCPUDP; + if (((flags & inner_csum) != 0) && + (encp->enc_tunnel_encapsulations_supported == 0)) { + rc = EINVAL; + goto fail1; + } + if ((rc = efx_mcdi_init_txq(enp, n, eep->ee_index, label, index, flags, esmp)) != 0) - goto fail1; + goto fail2; /* * A previous user of this TX queue may have written a descriptor to the @@ -215,19 +228,25 @@ ef10_tx_qcreate( * a no-op TX option descriptor. See bug29981 for details. */ *addedp = 1; - EFX_POPULATE_QWORD_4(desc, + EFX_POPULATE_QWORD_6(desc, ESF_DZ_TX_DESC_IS_OPT, 1, ESF_DZ_TX_OPTION_TYPE, ESE_DZ_TX_OPTION_DESC_CRC_CSUM, ESF_DZ_TX_OPTION_UDP_TCP_CSUM, (flags & EFX_TXQ_CKSUM_TCPUDP) ? 1 : 0, ESF_DZ_TX_OPTION_IP_CSUM, - (flags & EFX_TXQ_CKSUM_IPV4) ? 1 : 0); + (flags & EFX_TXQ_CKSUM_IPV4) ? 1 : 0, + ESF_DZ_TX_OPTION_INNER_UDP_TCP_CSUM, + (flags & EFX_TXQ_CKSUM_INNER_TCPUDP) ? 1 : 0, + ESF_DZ_TX_OPTION_INNER_IP_CSUM, + (flags & EFX_TXQ_CKSUM_INNER_IPV4) ? 1 : 0); EFSYS_MEM_WRITEQ(etp->et_esmp, 0, &desc); ef10_tx_qpush(etp, *addedp, 0); return (0); +fail2: + EFSYS_PROBE(fail2); fail1: EFSYS_PROBE1(fail1, efx_rc_t, rc); Modified: head/sys/dev/sfxge/common/efx.h ============================================================================== --- head/sys/dev/sfxge/common/efx.h Fri Nov 23 12:03:01 2018 (r340832) +++ head/sys/dev/sfxge/common/efx.h Fri Nov 23 13:12:04 2018 (r340833) @@ -2111,9 +2111,11 @@ efx_tx_fini( #define EFX_TXQ_MAX_BUFS 8 /* Maximum independent of EFX_BUG35388_WORKAROUND. */ -#define EFX_TXQ_CKSUM_IPV4 0x0001 -#define EFX_TXQ_CKSUM_TCPUDP 0x0002 -#define EFX_TXQ_FATSOV2 0x0004 +#define EFX_TXQ_CKSUM_IPV4 0x0001 +#define EFX_TXQ_CKSUM_TCPUDP 0x0002 +#define EFX_TXQ_FATSOV2 0x0004 +#define EFX_TXQ_CKSUM_INNER_IPV4 0x0008 +#define EFX_TXQ_CKSUM_INNER_TCPUDP 0x0010 extern __checkReturn efx_rc_t efx_tx_qcreate( Modified: head/sys/dev/sfxge/common/efx_tx.c ============================================================================== --- head/sys/dev/sfxge/common/efx_tx.c Fri Nov 23 12:03:01 2018 (r340832) +++ head/sys/dev/sfxge/common/efx_tx.c Fri Nov 23 13:12:04 2018 (r340833) @@ -905,6 +905,7 @@ siena_tx_qcreate( efx_nic_cfg_t *encp = &(enp->en_nic_cfg); efx_oword_t oword; uint32_t size; + uint16_t inner_csum; efx_rc_t rc; _NOTE(ARGUNUSED(esmp)) @@ -934,6 +935,12 @@ siena_tx_qcreate( goto fail3; } + inner_csum = EFX_TXQ_CKSUM_INNER_IPV4 | EFX_TXQ_CKSUM_INNER_TCPUDP; + if ((flags & inner_csum) != 0) { + rc = EINVAL; + goto fail4; + } + /* Set up the new descriptor queue */ *addedp = 0; @@ -956,6 +963,8 @@ siena_tx_qcreate( return (0); +fail4: + EFSYS_PROBE(fail4); fail3: EFSYS_PROBE(fail3); fail2: From owner-svn-src-all@freebsd.org Fri Nov 23 13:50:19 2018 Return-Path: Delivered-To: svn-src-all@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 A28BF11471B2; Fri, 23 Nov 2018 13:50:19 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3BC888A2FF; Fri, 23 Nov 2018 13:50:19 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 134E61F572; Fri, 23 Nov 2018 13:50:19 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wANDoI4b040442; Fri, 23 Nov 2018 13:50:18 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wANDoIvl040441; Fri, 23 Nov 2018 13:50:18 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201811231350.wANDoIvl040441@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 23 Nov 2018 13:50:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340834 - head/stand/i386 X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/stand/i386 X-SVN-Commit-Revision: 340834 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 3BC888A2FF X-Spamd-Result: default: False [1.64 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.52)[0.519,0]; NEURAL_SPAM_MEDIUM(0.72)[0.721,0]; NEURAL_SPAM_LONG(0.40)[0.400,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Nov 2018 13:50:19 -0000 Author: emaste Date: Fri Nov 23 13:50:18 2018 New Revision: 340834 URL: https://svnweb.freebsd.org/changeset/base/340834 Log: Disable build-id in i386 binary boot components A user may enable build-id for all builds by adding LDFLAGS=-Wl,--build-id=sha1 to /etc/make.conf. In this case the build-id note ends added up to mbr and pmbr's .text, which makes it too large (it ends up being 532 bytes). To avoid this explicitly turn off build-id for these components. Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D15470 Modified: head/stand/i386/Makefile.inc Modified: head/stand/i386/Makefile.inc ============================================================================== --- head/stand/i386/Makefile.inc Fri Nov 23 13:12:04 2018 (r340833) +++ head/stand/i386/Makefile.inc Fri Nov 23 13:50:18 2018 (r340834) @@ -2,6 +2,8 @@ # # $FreeBSD$ +.include "bsd.linker.mk" + LOADER_ADDRESS?=0x200000 LDFLAGS+= -nostdlib LDFLAGS.lld+= -Wl,--no-rosegment @@ -22,6 +24,9 @@ LDSCRIPT= ${BOOTSRC}/i386/boot.ldscript # LDFLAGS_BIN=-e start -Ttext ${ORG} -Wl,-T,${LDSCRIPT},-S,--oformat,binary # LD_FLAGS_BIN=-static -T ${LDSCRIPT} --gc-sections LDFLAGS_BIN=-e start -Ttext ${ORG} -Wl,-N,-S,--oformat,binary +.if ${LINKER_FEATURES:Mbuild-id} != "" +LDFLAGS_BIN+=-Wl,--build-id=none +.endif LD_FLAGS_BIN=-static -N --gc-sections .if ${MACHINE_CPUARCH} == "amd64" From owner-svn-src-all@freebsd.org Fri Nov 23 15:49:20 2018 Return-Path: Delivered-To: svn-src-all@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 11D67114A26D; Fri, 23 Nov 2018 15:49:20 +0000 (UTC) (envelope-from yuripv@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AC90F8F5DD; Fri, 23 Nov 2018 15:49:19 +0000 (UTC) (envelope-from yuripv@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 899C220A19; Fri, 23 Nov 2018 15:49:19 +0000 (UTC) (envelope-from yuripv@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wANFnJ8p004742; Fri, 23 Nov 2018 15:49:19 GMT (envelope-from yuripv@FreeBSD.org) Received: (from yuripv@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wANFnJ0n004739; Fri, 23 Nov 2018 15:49:19 GMT (envelope-from yuripv@FreeBSD.org) Message-Id: <201811231549.wANFnJ0n004739@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: yuripv set sender to yuripv@FreeBSD.org using -f From: Yuri Pankov Date: Fri, 23 Nov 2018 15:49:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340835 - in head/lib/libc: regex tests/regex X-SVN-Group: head X-SVN-Commit-Author: yuripv X-SVN-Commit-Paths: in head/lib/libc: regex tests/regex X-SVN-Commit-Revision: 340835 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: AC90F8F5DD X-Spamd-Result: default: False [0.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.21)[-0.215,0]; NEURAL_SPAM_LONG(0.42)[0.420,0]; NEURAL_SPAM_MEDIUM(0.74)[0.738,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Nov 2018 15:49:20 -0000 Author: yuripv Date: Fri Nov 23 15:49:18 2018 New Revision: 340835 URL: https://svnweb.freebsd.org/changeset/base/340835 Log: regexec: fix processing multibyte strings. Matcher function incorrectly assumed that moffset that we get from findmust is in bytes. Fix this by introducing a stepback function, taking short path if MB_CUR_MAX is 1, and going back byte-by-byte, checking if we have a legal character sequence otherwise. PR: 153502 Reviewed by: pfg, kevans Approved by: kib (mentor, implicit) Differential revision: https://reviews.freebsd.org/D18297 Added: head/lib/libc/tests/regex/multibyte.sh (contents, props changed) Modified: head/lib/libc/regex/engine.c head/lib/libc/tests/regex/Makefile Modified: head/lib/libc/regex/engine.c ============================================================================== --- head/lib/libc/regex/engine.c Fri Nov 23 13:50:18 2018 (r340834) +++ head/lib/libc/regex/engine.c Fri Nov 23 15:49:18 2018 (r340835) @@ -48,6 +48,7 @@ __FBSDID("$FreeBSD$"); */ #ifdef SNAMES +#define stepback sstepback #define matcher smatcher #define walk swalk #define dissect sdissect @@ -58,6 +59,7 @@ __FBSDID("$FreeBSD$"); #define match smat #endif #ifdef LNAMES +#define stepback lstepback #define matcher lmatcher #define walk lwalk #define dissect ldissect @@ -68,6 +70,7 @@ __FBSDID("$FreeBSD$"); #define match lmat #endif #ifdef MNAMES +#define stepback mstepback #define matcher mmatcher #define walk mwalk #define dissect mdissect @@ -142,6 +145,39 @@ static const char *pchar(int ch); #endif /* + * Given a multibyte string pointed to by start, step back nchar characters + * from current position pointed to by cur. + */ +static const char * +stepback(const char *start, const char *cur, int nchar) +{ + const char *ret; + int wc, mbc; + mbstate_t mbs; + size_t clen; + + if (MB_CUR_MAX == 1) + return ((cur - nchar) > start ? cur - nchar : NULL); + + ret = cur; + for (wc = nchar; wc > 0; wc--) { + for (mbc = 1; mbc <= MB_CUR_MAX; mbc++) { + if ((ret - mbc) < start) + return (NULL); + memset(&mbs, 0, sizeof(mbs)); + clen = mbrtowc(NULL, ret - mbc, mbc, &mbs); + if (clen != (size_t)-1 && clen != (size_t)-2) + break; + } + if (mbc > MB_CUR_MAX) + return (NULL); + ret -= mbc; + } + + return (ret); +} + +/* - matcher - the actual matching engine == static int matcher(struct re_guts *g, const char *string, \ == size_t nmatch, regmatch_t pmatch[], int eflags); @@ -244,9 +280,14 @@ matcher(struct re_guts *g, ZAPSTATE(&m->mbs); /* Adjust start according to moffset, to speed things up */ - if (dp != NULL && g->moffset > -1) - start = ((dp - g->moffset) < start) ? start : dp - g->moffset; + if (dp != NULL && g->moffset > -1) { + const char *nstart; + nstart = stepback(start, dp, g->moffset); + if (nstart != NULL) + start = nstart; + } + SP("mloop", m->st, *start); /* this loop does only one repetition except for backrefs */ @@ -1083,6 +1124,7 @@ pchar(int ch) #endif #endif +#undef stepback #undef matcher #undef walk #undef dissect Modified: head/lib/libc/tests/regex/Makefile ============================================================================== --- head/lib/libc/tests/regex/Makefile Fri Nov 23 13:50:18 2018 (r340834) +++ head/lib/libc/tests/regex/Makefile Fri Nov 23 15:49:18 2018 (r340835) @@ -2,6 +2,9 @@ PACKAGE= tests +# local test cases +ATF_TESTS_SH+= multibyte + .include "Makefile.inc" .include "${.CURDIR:H}/Makefile.netbsd-tests" .include Added: head/lib/libc/tests/regex/multibyte.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/tests/regex/multibyte.sh Fri Nov 23 15:49:18 2018 (r340835) @@ -0,0 +1,35 @@ +# $FreeBSD$ + +atf_test_case multibyte +multibyte_head() +{ + atf_set "descr" "Check matching multibyte characters (PR153502)" +} +multibyte_body() +{ + export LC_CTYPE="C.UTF-8" + + printf 'é' | atf_check -o "inline:é" \ + sed -ne '/^.$/p' + printf 'éé' | atf_check -o "inline:éé" \ + sed -ne '/^..$/p' + printf 'aéa' | atf_check -o "inline:aéa" \ + sed -ne '/a.a/p' + printf 'aéa'| atf_check -o "inline:aéa" \ + sed -ne '/a.*a/p' + printf 'aaéaa' | atf_check -o "inline:aaéaa" \ + sed -ne '/aa.aa/p' + printf 'aéaéa' | atf_check -o "inline:aéaéa" \ + sed -ne '/a.a.a/p' + printf 'éa' | atf_check -o "inline:éa" \ + sed -ne '/.a/p' + printf 'aéaa' | atf_check -o "inline:aéaa" \ + sed -ne '/a.aa/p' + printf 'éaé' | atf_check -o "inline:éaé" \ + sed -ne '/.a./p' +} + +atf_init_test_cases() +{ + atf_add_test_case multibyte +} From owner-svn-src-all@freebsd.org Fri Nov 23 15:59:38 2018 Return-Path: Delivered-To: svn-src-all@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 B924C114A798; Fri, 23 Nov 2018 15:59:38 +0000 (UTC) (envelope-from arybchik@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 5DCAD8FE5F; Fri, 23 Nov 2018 15:59:38 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3C9D620BBA; Fri, 23 Nov 2018 15:59:38 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wANFxc8r010085; Fri, 23 Nov 2018 15:59:38 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wANFxcrL010084; Fri, 23 Nov 2018 15:59:38 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811231559.wANFxcrL010084@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 23 Nov 2018 15:59:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340836 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 340836 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 5DCAD8FE5F X-Spamd-Result: default: False [0.81 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_MEDIUM(0.72)[0.721,0]; NEURAL_HAM_SHORT(-0.31)[-0.309,0]; NEURAL_SPAM_LONG(0.40)[0.400,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Nov 2018 15:59:38 -0000 Author: arybchik Date: Fri Nov 23 15:59:37 2018 New Revision: 340836 URL: https://svnweb.freebsd.org/changeset/base/340836 Log: sfxge(4): use MCDIv2 for requests with too long response Use MCDIv2 for requests with a response size too long for MCDIv1. Required for MC_CMD_MAC_STATS to reports the stats without using DMA. Submitted by: Mark Spender Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18103 Modified: head/sys/dev/sfxge/common/efx_mcdi.c Modified: head/sys/dev/sfxge/common/efx_mcdi.c ============================================================================== --- head/sys/dev/sfxge/common/efx_mcdi.c Fri Nov 23 15:49:18 2018 (r340835) +++ head/sys/dev/sfxge/common/efx_mcdi.c Fri Nov 23 15:59:37 2018 (r340836) @@ -295,7 +295,8 @@ efx_mcdi_request_start( */ if ((max_version >= 2) && ((emrp->emr_cmd > MC_CMD_CMD_SPACE_ESCAPE_7) || - (emrp->emr_in_length > MCDI_CTL_SDU_LEN_MAX_V1))) { + (emrp->emr_in_length > MCDI_CTL_SDU_LEN_MAX_V1) || + (emrp->emr_out_length > MCDI_CTL_SDU_LEN_MAX_V1))) { /* Construct MCDI v2 header */ hdr_len = sizeof (hdr); EFX_POPULATE_DWORD_8(hdr[0], From owner-svn-src-all@freebsd.org Fri Nov 23 15:59:51 2018 Return-Path: Delivered-To: svn-src-all@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 CE0BA114A7B8; Fri, 23 Nov 2018 15:59:51 +0000 (UTC) (envelope-from arybchik@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 6D55C8FF58; Fri, 23 Nov 2018 15:59:51 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 84C1120BBB; Fri, 23 Nov 2018 15:59:49 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wANFxnW3010142; Fri, 23 Nov 2018 15:59:49 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wANFxn66010141; Fri, 23 Nov 2018 15:59:49 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811231559.wANFxn66010141@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 23 Nov 2018 15:59:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340837 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 340837 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 6D55C8FF58 X-Spamd-Result: default: False [0.81 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.31)[-0.309,0]; NEURAL_SPAM_LONG(0.40)[0.400,0]; NEURAL_SPAM_MEDIUM(0.72)[0.721,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Nov 2018 15:59:52 -0000 Author: arybchik Date: Fri Nov 23 15:59:49 2018 New Revision: 340837 URL: https://svnweb.freebsd.org/changeset/base/340837 Log: sfxge(4): ignore error in completion event on MCDIv2 HW With MCDIv2, the reponse length can be to big to fit into the CMDDONE_DATALEN field in the MCDI completion event. But rather that the length being truncated, it can overflow into the CMDDONE_ERRNO field (this is a longstanding firmware bug). Hence the CMDDONE_ERRNO field may not be valid. It isn't necessary to use the value in the CMDDONE_ERRNO field though, so it can be ignored. The actual error code is already read from the response header on MCDIv2 capable hardware and stored in emr_rc, so that can be used instead. Submitted by: Mark Spender Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18104 Modified: head/sys/dev/sfxge/common/efx_mcdi.c Modified: head/sys/dev/sfxge/common/efx_mcdi.c ============================================================================== --- head/sys/dev/sfxge/common/efx_mcdi.c Fri Nov 23 15:59:37 2018 (r340836) +++ head/sys/dev/sfxge/common/efx_mcdi.c Fri Nov 23 15:59:49 2018 (r340837) @@ -798,9 +798,8 @@ efx_mcdi_ev_cpl( emrp->emr_rc = 0; } } - if (errcode == 0) { + if (emrp->emr_rc == 0) efx_mcdi_finish_response(enp, emrp); - } emtp->emt_ev_cpl(emtp->emt_context); } From owner-svn-src-all@freebsd.org Fri Nov 23 16:18:37 2018 Return-Path: Delivered-To: svn-src-all@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 65288114B340; Fri, 23 Nov 2018 16:18:37 +0000 (UTC) (envelope-from arybchik@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 052256AB49; Fri, 23 Nov 2018 16:18:37 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D811320FCF; Fri, 23 Nov 2018 16:18:36 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wANGIalj020382; Fri, 23 Nov 2018 16:18:36 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wANGIaMB020381; Fri, 23 Nov 2018 16:18:36 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811231618.wANGIaMB020381@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 23 Nov 2018 16:18:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340838 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 340838 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 052256AB49 X-Spamd-Result: default: False [1.02 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.14)[-0.137,0]; NEURAL_SPAM_LONG(0.42)[0.420,0]; NEURAL_SPAM_MEDIUM(0.74)[0.738,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Nov 2018 16:18:37 -0000 Author: arybchik Date: Fri Nov 23 16:18:36 2018 New Revision: 340838 URL: https://svnweb.freebsd.org/changeset/base/340838 Log: sfxge(4): request info about outer frame in Rx events For encapsulated packets, the firmware gives info about the inner frame fields by default. When not using encapsulation offload, ask for info about the outer frame instead. On SFN8xxx with firmware version before v6.4.2.1007 driver reload is needed after switching from full-feature to low-latency firmware variant since the driver still thinks that firmware supports encapsulation, but firmware does not tolerate request to provide info about outer frame in Rx events. Submitted by: Mark Spender Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18105 Modified: head/sys/dev/sfxge/common/ef10_rx.c Modified: head/sys/dev/sfxge/common/ef10_rx.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_rx.c Fri Nov 23 15:59:49 2018 (r340837) +++ head/sys/dev/sfxge/common/ef10_rx.c Fri Nov 23 16:18:36 2018 (r340838) @@ -49,6 +49,7 @@ efx_mcdi_init_rxq( __in boolean_t disable_scatter, __in uint32_t ps_bufsize) { + efx_nic_cfg_t *encp = &(enp->en_nic_cfg); efx_mcdi_req_t req; uint8_t payload[MAX(MC_CMD_INIT_RXQ_EXT_IN_LEN, MC_CMD_INIT_RXQ_EXT_OUT_LEN)]; @@ -58,6 +59,7 @@ efx_mcdi_init_rxq( uint64_t addr; efx_rc_t rc; uint32_t dma_mode; + boolean_t want_outer_classes; /* If this changes, then the payload size might need to change. */ EFSYS_ASSERT3U(MC_CMD_INIT_RXQ_OUT_LEN, ==, 0); @@ -68,6 +70,25 @@ efx_mcdi_init_rxq( else dma_mode = MC_CMD_INIT_RXQ_EXT_IN_SINGLE_PACKET; + if (encp->enc_tunnel_encapsulations_supported != 0) { + /* + * WANT_OUTER_CLASSES can only be specified on hardware which + * supports tunnel encapsulation offloads, even though it is + * effectively the behaviour the hardware gives. + * + * Also, on hardware which does support such offloads, older + * firmware rejects the flag if the offloads are not supported + * by the current firmware variant, which means this may fail if + * the capabilities are not updated when the firmware variant + * changes. This is not an issue on newer firmware, as it was + * changed in bug 69842 (v6.4.2.1007) to permit this flag to be + * specified on all firmware variants. + */ + want_outer_classes = B_TRUE; + } else { + want_outer_classes = B_FALSE; + } + (void) memset(payload, 0, sizeof (payload)); req.emr_cmd = MC_CMD_INIT_RXQ; req.emr_in_buf = payload; @@ -79,7 +100,7 @@ efx_mcdi_init_rxq( MCDI_IN_SET_DWORD(req, INIT_RXQ_EXT_IN_TARGET_EVQ, target_evq); MCDI_IN_SET_DWORD(req, INIT_RXQ_EXT_IN_LABEL, label); MCDI_IN_SET_DWORD(req, INIT_RXQ_EXT_IN_INSTANCE, instance); - MCDI_IN_POPULATE_DWORD_8(req, INIT_RXQ_EXT_IN_FLAGS, + MCDI_IN_POPULATE_DWORD_9(req, INIT_RXQ_EXT_IN_FLAGS, INIT_RXQ_EXT_IN_FLAG_BUFF_MODE, 0, INIT_RXQ_EXT_IN_FLAG_HDR_SPLIT, 0, INIT_RXQ_EXT_IN_FLAG_TIMESTAMP, 0, @@ -88,7 +109,8 @@ efx_mcdi_init_rxq( INIT_RXQ_EXT_IN_FLAG_DISABLE_SCATTER, disable_scatter, INIT_RXQ_EXT_IN_DMA_MODE, dma_mode, - INIT_RXQ_EXT_IN_PACKED_STREAM_BUFF_SIZE, ps_bufsize); + INIT_RXQ_EXT_IN_PACKED_STREAM_BUFF_SIZE, ps_bufsize, + INIT_RXQ_EXT_IN_FLAG_WANT_OUTER_CLASSES, want_outer_classes); MCDI_IN_SET_DWORD(req, INIT_RXQ_EXT_IN_OWNER_ID, 0); MCDI_IN_SET_DWORD(req, INIT_RXQ_EXT_IN_PORT_ID, EVB_PORT_ID_ASSIGNED); From owner-svn-src-all@freebsd.org Fri Nov 23 16:32:28 2018 Return-Path: Delivered-To: svn-src-all@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 219E2114B824; Fri, 23 Nov 2018 16:32:28 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.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 BE1AF6B490; Fri, 23 Nov 2018 16:32:27 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A0A1621310; Fri, 23 Nov 2018 16:32:27 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wANGWRTJ030599; Fri, 23 Nov 2018 16:32:27 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wANGWRQ1030598; Fri, 23 Nov 2018 16:32:27 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201811231632.wANGWRQ1030598@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Fri, 23 Nov 2018 16:32:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r340839 - in releng/12.0: release/pkg_repos sys/conf X-SVN-Group: releng X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: in releng/12.0: release/pkg_repos sys/conf X-SVN-Commit-Revision: 340839 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: BE1AF6B490 X-Spamd-Result: default: False [0.99 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.13)[-0.133,0]; NEURAL_SPAM_LONG(0.40)[0.400,0]; NEURAL_SPAM_MEDIUM(0.72)[0.721,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Nov 2018 16:32:28 -0000 Author: gjb Date: Fri Nov 23 16:32:27 2018 New Revision: 340839 URL: https://svnweb.freebsd.org/changeset/base/340839 Log: - Update releng/12.0 from RC1 to RC2 as part of the 12.0-RELEASE cycle. - Update the dvd1.iso pkg(8) configuration to use the release_0 package set to populate the dvd. Approved by: re (implicit) Sponsored by: The FreeBSD Foundation Modified: releng/12.0/release/pkg_repos/release-dvd.conf releng/12.0/sys/conf/newvers.sh Modified: releng/12.0/release/pkg_repos/release-dvd.conf ============================================================================== --- releng/12.0/release/pkg_repos/release-dvd.conf Fri Nov 23 16:18:36 2018 (r340838) +++ releng/12.0/release/pkg_repos/release-dvd.conf Fri Nov 23 16:32:27 2018 (r340839) @@ -1,6 +1,6 @@ # $FreeBSD$ release: { - url: "pkg+http://pkg.FreeBSD.org/${ABI}/quarterly", + url: "pkg+http://pkg.FreeBSD.org/${ABI}/release_0", mirror_type: "srv", signature_type: "fingerprints", fingerprints: "/usr/share/keys/pkg", Modified: releng/12.0/sys/conf/newvers.sh ============================================================================== --- releng/12.0/sys/conf/newvers.sh Fri Nov 23 16:18:36 2018 (r340838) +++ releng/12.0/sys/conf/newvers.sh Fri Nov 23 16:32:27 2018 (r340839) @@ -46,7 +46,7 @@ TYPE="FreeBSD" REVISION="12.0" -BRANCH="RC1" +BRANCH="RC2" if [ -n "${BRANCH_OVERRIDE}" ]; then BRANCH=${BRANCH_OVERRIDE} fi From owner-svn-src-all@freebsd.org Fri Nov 23 16:33:04 2018 Return-Path: Delivered-To: svn-src-all@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 B1201114B99E; Fri, 23 Nov 2018 16:33:04 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.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 4A7116B5E0; Fri, 23 Nov 2018 16:33:04 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2BA2021321; Fri, 23 Nov 2018 16:33:04 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wANGX33F030691; Fri, 23 Nov 2018 16:33:03 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wANGX3NM030690; Fri, 23 Nov 2018 16:33:03 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201811231633.wANGX3NM030690@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Fri, 23 Nov 2018 16:33:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340840 - head/lib/csu/mips X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: head/lib/csu/mips X-SVN-Commit-Revision: 340840 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4A7116B5E0 X-Spamd-Result: default: False [0.99 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_MEDIUM(0.72)[0.721,0]; NEURAL_HAM_SHORT(-0.13)[-0.133,0]; NEURAL_SPAM_LONG(0.40)[0.400,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Nov 2018 16:33:04 -0000 Author: andrew Date: Fri Nov 23 16:33:03 2018 New Revision: 340840 URL: https://svnweb.freebsd.org/changeset/base/340840 Log: Mark the function called by the MIPS .init/.fini sequence with .local. As with r328939 we need to mark local symbols as such. Without this the assembly parser treats the symbols as global and created relocations against these private symbols. MFC with: r339738 Sponsored by: DARPA, AFRL Modified: head/lib/csu/mips/crt.h Modified: head/lib/csu/mips/crt.h ============================================================================== --- head/lib/csu/mips/crt.h Fri Nov 23 16:32:27 2018 (r340839) +++ head/lib/csu/mips/crt.h Fri Nov 23 16:33:03 2018 (r340840) @@ -36,6 +36,7 @@ "1: \n" \ ".cpload $ra \n" \ ".set reorder \n" \ + ".local " __STRING(func) "\n" \ "jal " __STRING(func) #else #define INIT_CALL_SEQ(func) \ @@ -45,6 +46,7 @@ "1: \n" \ ".set reorder \n" \ ".cpsetup $ra, $v0, 1b \n" \ + ".local " __STRING(func) "\n" \ "jal " __STRING(func) #endif From owner-svn-src-all@freebsd.org Fri Nov 23 16:45:09 2018 Return-Path: Delivered-To: svn-src-all@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 2509E114BE38; Fri, 23 Nov 2018 16:45:09 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.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 BB4656BCBE; Fri, 23 Nov 2018 16:45:08 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 97631214C7; Fri, 23 Nov 2018 16:45:08 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wANGj840035697; Fri, 23 Nov 2018 16:45:08 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wANGj8BW035694; Fri, 23 Nov 2018 16:45:08 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201811231645.wANGj8BW035694@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Fri, 23 Nov 2018 16:45:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340841 - in head: . share/mk sys/sys X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: in head: . share/mk sys/sys X-SVN-Commit-Revision: 340841 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: BB4656BCBE X-Spamd-Result: default: False [0.99 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_MEDIUM(0.72)[0.721,0]; NEURAL_HAM_SHORT(-0.13)[-0.133,0]; NEURAL_SPAM_LONG(0.40)[0.400,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Nov 2018 16:45:09 -0000 Author: andrew Date: Fri Nov 23 16:45:07 2018 New Revision: 340841 URL: https://svnweb.freebsd.org/changeset/base/340841 Log: Enable the BSD crtbegin/crtend by default. It has passed an exp run on amd64 and i386, and has testing on arm64. On other architectures it is expected to run, however it can be disabled by building world with -DWITHOUT_BSD_CRTBEGIN. Sponsored by: DARPA, AFRL Modified: head/UPDATING head/share/mk/src.opts.mk head/sys/sys/param.h Modified: head/UPDATING ============================================================================== --- head/UPDATING Fri Nov 23 16:33:03 2018 (r340840) +++ head/UPDATING Fri Nov 23 16:45:07 2018 (r340841) @@ -31,6 +31,11 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 13.x IS SLOW: disable the most expensive debugging functionality run "ln -s 'abort:false,junk:false' /etc/malloc.conf".) +20181123: + The BSD crtbegin and crtend code has been enabled by default. It has + had extensive testing on amd64, arm64, and i386. It can be disabled + by building a world with -DWITHOUT_BSD_CRTBEGIN. + 20181115: The set of CTM commands (ctm, ctm_smail, ctm_rmail, ctm_dequeue) has been converted to a port (misc/ctm) and will be removed from Modified: head/share/mk/src.opts.mk ============================================================================== --- head/share/mk/src.opts.mk Fri Nov 23 16:33:03 2018 (r340840) +++ head/share/mk/src.opts.mk Fri Nov 23 16:45:07 2018 (r340841) @@ -71,6 +71,7 @@ __DEFAULT_YES_OPTIONS = \ BOOTPARAMD \ BOOTPD \ BSD_CPIO \ + BSD_CRTBEGIN \ BSDINSTALL \ BSNMP \ BZIP2 \ @@ -193,7 +194,6 @@ __DEFAULT_YES_OPTIONS = \ ZONEINFO __DEFAULT_NO_OPTIONS = \ - BSD_CRTBEGIN \ BSD_GREP \ CLANG_EXTRAS \ DTRACE_TESTS \ Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Fri Nov 23 16:33:03 2018 (r340840) +++ head/sys/sys/param.h Fri Nov 23 16:45:07 2018 (r340841) @@ -60,7 +60,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1300003 /* Master, propagated to newvers */ +#define __FreeBSD_version 1300004 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-all@freebsd.org Fri Nov 23 18:15:24 2018 Return-Path: Delivered-To: svn-src-all@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 16E20114E0BA; Fri, 23 Nov 2018 18:15:24 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.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 ACC6D6F1DC; Fri, 23 Nov 2018 18:15:23 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8AAC122352; Fri, 23 Nov 2018 18:15:23 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wANIFNDd082282; Fri, 23 Nov 2018 18:15:23 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wANIFN1q082281; Fri, 23 Nov 2018 18:15:23 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201811231815.wANIFN1q082281@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 23 Nov 2018 18:15:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340842 - head/libexec/rtld-elf/amd64 X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/libexec/rtld-elf/amd64 X-SVN-Commit-Revision: 340842 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: ACC6D6F1DC X-Spamd-Result: default: False [1.25 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.14)[0.139,0]; NEURAL_SPAM_MEDIUM(0.71)[0.712,0]; NEURAL_SPAM_LONG(0.40)[0.400,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Nov 2018 18:15:24 -0000 Author: kib Date: Fri Nov 23 18:15:23 2018 New Revision: 340842 URL: https://svnweb.freebsd.org/changeset/base/340842 Log: Silence gcc warnings. Reported by: emaste Sponsored by: The FreeBSD Foundation MFC after: 3 days Modified: head/libexec/rtld-elf/amd64/reloc.c Modified: head/libexec/rtld-elf/amd64/reloc.c ============================================================================== --- head/libexec/rtld-elf/amd64/reloc.c Fri Nov 23 16:45:07 2018 (r340841) +++ head/libexec/rtld-elf/amd64/reloc.c Fri Nov 23 18:15:23 2018 (r340842) @@ -138,6 +138,9 @@ reloc_non_plt(Obj_Entry *obj, Obj_Entry *obj_rtld, int int r; r = -1; + symval = 0; + def = NULL; + /* * The dynamic loader may be called from a thread, we have * limited amounts of stack available so we cannot use alloca(). From owner-svn-src-all@freebsd.org Fri Nov 23 18:23:30 2018 Return-Path: Delivered-To: svn-src-all@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 F0629114E4FB; Fri, 23 Nov 2018 18:23:29 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 94C4E6F7C4; Fri, 23 Nov 2018 18:23:29 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 74994224F2; Fri, 23 Nov 2018 18:23:29 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wANINTSo087469; Fri, 23 Nov 2018 18:23:29 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wANINTGa087468; Fri, 23 Nov 2018 18:23:29 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201811231823.wANINTGa087468@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Fri, 23 Nov 2018 18:23:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340843 - head/libexec/rtld-elf X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/libexec/rtld-elf X-SVN-Commit-Revision: 340843 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 94C4E6F7C4 X-Spamd-Result: default: False [1.37 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.40)[0.400,0]; NEURAL_SPAM_MEDIUM(0.71)[0.712,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.26)[0.257,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Nov 2018 18:23:30 -0000 Author: cem Date: Fri Nov 23 18:23:29 2018 New Revision: 340843 URL: https://svnweb.freebsd.org/changeset/base/340843 Log: rtld: Silence a false positive GCC 6.4.0 warning The function reloc_non_plt has complicated variable lifetimes that GCC 6.4.0 (the version currently used by amd64-xtoolchain-gcc) misunderstands and produces an erroneous warning about. Silence it to allow the -Werror build to proceed. Reviewed by: emaste Modified: head/libexec/rtld-elf/Makefile Modified: head/libexec/rtld-elf/Makefile ============================================================================== --- head/libexec/rtld-elf/Makefile Fri Nov 23 18:15:23 2018 (r340842) +++ head/libexec/rtld-elf/Makefile Fri Nov 23 18:23:29 2018 (r340843) @@ -102,6 +102,10 @@ ${PROG_FULL}: ${VERSION_MAP} # GCC warns about redeclarations even though they have __exported # and are therefore not identical to the ones from the system headers. CFLAGS+= -Wno-redundant-decls +# GCC (6.4.0) doesn't grok the complicated lifetimes in reloc_non_plt(): +.if ${MACHINE_CPUARCH} == "amd64" +CFLAGS.reloc.c+=-Wno-maybe-uninitialized +.endif .if ${COMPILER_VERSION} < 40300 # Silence -Wshadow false positives in ancient GCC CFLAGS+= -Wno-shadow From owner-svn-src-all@freebsd.org Fri Nov 23 18:27:17 2018 Return-Path: Delivered-To: svn-src-all@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 F1619114E5BB; Fri, 23 Nov 2018 18:27:16 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9713C6F973; Fri, 23 Nov 2018 18:27:16 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 74A60224F3; Fri, 23 Nov 2018 18:27:16 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wANIRGTe087656; Fri, 23 Nov 2018 18:27:16 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wANIRGkQ087655; Fri, 23 Nov 2018 18:27:16 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201811231827.wANIRGkQ087655@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Fri, 23 Nov 2018 18:27:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340844 - head/libexec/rtld-elf X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/libexec/rtld-elf X-SVN-Commit-Revision: 340844 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 9713C6F973 X-Spamd-Result: default: False [1.37 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.26)[0.257,0]; NEURAL_SPAM_MEDIUM(0.71)[0.712,0]; NEURAL_SPAM_LONG(0.40)[0.400,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Nov 2018 18:27:17 -0000 Author: cem Date: Fri Nov 23 18:27:16 2018 New Revision: 340844 URL: https://svnweb.freebsd.org/changeset/base/340844 Log: Revert r340843 - addressed independently in r340842! Modified: head/libexec/rtld-elf/Makefile Modified: head/libexec/rtld-elf/Makefile ============================================================================== --- head/libexec/rtld-elf/Makefile Fri Nov 23 18:23:29 2018 (r340843) +++ head/libexec/rtld-elf/Makefile Fri Nov 23 18:27:16 2018 (r340844) @@ -102,10 +102,6 @@ ${PROG_FULL}: ${VERSION_MAP} # GCC warns about redeclarations even though they have __exported # and are therefore not identical to the ones from the system headers. CFLAGS+= -Wno-redundant-decls -# GCC (6.4.0) doesn't grok the complicated lifetimes in reloc_non_plt(): -.if ${MACHINE_CPUARCH} == "amd64" -CFLAGS.reloc.c+=-Wno-maybe-uninitialized -.endif .if ${COMPILER_VERSION} < 40300 # Silence -Wshadow false positives in ancient GCC CFLAGS+= -Wno-shadow From owner-svn-src-all@freebsd.org Fri Nov 23 19:43:20 2018 Return-Path: Delivered-To: svn-src-all@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 3C12C114FCD7; Fri, 23 Nov 2018 19:43:20 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.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 D27B171FDB; Fri, 23 Nov 2018 19:43:19 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AEF1A23269; Fri, 23 Nov 2018 19:43:19 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wANJhJRm028117; Fri, 23 Nov 2018 19:43:19 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wANJhIA6028111; Fri, 23 Nov 2018 19:43:18 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201811231943.wANJhIA6028111@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Fri, 23 Nov 2018 19:43:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340845 - in head/sys: conf dev/extres/phy X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: in head/sys: conf dev/extres/phy X-SVN-Commit-Revision: 340845 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D27B171FDB X-Spamd-Result: default: False [1.55 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.44)[0.439,0]; NEURAL_SPAM_MEDIUM(0.75)[0.746,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.37)[0.368,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Nov 2018 19:43:20 -0000 Author: manu Date: Fri Nov 23 19:43:18 2018 New Revision: 340845 URL: https://svnweb.freebsd.org/changeset/base/340845 Log: Derive PHY class to new one specialized for USB PHY functions. Submitted by: mmel Added: head/sys/dev/extres/phy/phy_internal.h (contents, props changed) head/sys/dev/extres/phy/phy_usb.c (contents, props changed) head/sys/dev/extres/phy/phy_usb.h (contents, props changed) head/sys/dev/extres/phy/phynode_usb_if.m (contents, props changed) Modified: head/sys/conf/files head/sys/dev/extres/phy/phy.c Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Fri Nov 23 18:27:16 2018 (r340844) +++ head/sys/conf/files Fri Nov 23 19:43:18 2018 (r340845) @@ -1734,6 +1734,8 @@ dev/extres/clk/clk_mux.c optional ext_resources clk fd dev/extres/phy/phy.c optional ext_resources phy fdt dev/extres/phy/phydev_if.m optional ext_resources phy fdt dev/extres/phy/phynode_if.m optional ext_resources phy fdt +dev/extres/phy/phy_usb.c optional ext_resources phy fdt +dev/extres/phy/phynode_usb_if.m optional ext_resources phy fdt dev/extres/hwreset/hwreset.c optional ext_resources hwreset fdt dev/extres/hwreset/hwreset_if.m optional ext_resources hwreset fdt dev/extres/nvmem/nvmem.c optional ext_resources nvmem fdt Modified: head/sys/dev/extres/phy/phy.c ============================================================================== --- head/sys/dev/extres/phy/phy.c Fri Nov 23 18:27:16 2018 (r340844) +++ head/sys/dev/extres/phy/phy.c Fri Nov 23 19:43:18 2018 (r340845) @@ -43,18 +43,12 @@ __FBSDID("$FreeBSD$"); #endif #include +#include #include "phydev_if.h" MALLOC_DEFINE(M_PHY, "phy", "Phy framework"); -/* Forward declarations. */ -struct phy; -struct phynode; - -typedef TAILQ_HEAD(phynode_list, phynode) phynode_list_t; -typedef TAILQ_HEAD(phy_list, phy) phy_list_t; - /* Default phy methods. */ static int phynode_method_init(struct phynode *phynode); static int phynode_method_enable(struct phynode *phynode, bool disable); @@ -73,52 +67,9 @@ static phynode_method_t phynode_methods[] = { }; DEFINE_CLASS_0(phynode, phynode_class, phynode_methods, 0); -/* - * Phy node - */ -struct phynode { - KOBJ_FIELDS; - - TAILQ_ENTRY(phynode) phylist_link; /* Global list entry */ - phy_list_t consumers_list; /* Consumers list */ - - - /* Details of this device. */ - const char *name; /* Globally unique name */ - - device_t pdev; /* Producer device_t */ - void *softc; /* Producer softc */ - intptr_t id; /* Per producer unique id */ -#ifdef FDT - phandle_t ofw_node; /* OFW node of phy */ -#endif - struct sx lock; /* Lock for this phy */ - int ref_cnt; /* Reference counter */ - int enable_cnt; /* Enabled counter */ -}; - -struct phy { - device_t cdev; /* consumer device*/ - struct phynode *phynode; - TAILQ_ENTRY(phy) link; /* Consumers list entry */ - - int enable_cnt; -}; - static phynode_list_t phynode_list = TAILQ_HEAD_INITIALIZER(phynode_list); -static struct sx phynode_topo_lock; SX_SYSINIT(phy_topology, &phynode_topo_lock, "Phy topology lock"); - -#define PHY_TOPO_SLOCK() sx_slock(&phynode_topo_lock) -#define PHY_TOPO_XLOCK() sx_xlock(&phynode_topo_lock) -#define PHY_TOPO_UNLOCK() sx_unlock(&phynode_topo_lock) -#define PHY_TOPO_ASSERT() sx_assert(&phynode_topo_lock, SA_LOCKED) -#define PHY_TOPO_XASSERT() sx_assert(&phynode_topo_lock, SA_XLOCKED) - -#define PHYNODE_SLOCK(_sc) sx_slock(&((_sc)->lock)) -#define PHYNODE_XLOCK(_sc) sx_xlock(&((_sc)->lock)) -#define PHYNODE_UNLOCK(_sc) sx_unlock(&((_sc)->lock)) /* ---------------------------------------------------------------------------- * Added: head/sys/dev/extres/phy/phy_internal.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/extres/phy/phy_internal.h Fri Nov 23 19:43:18 2018 (r340845) @@ -0,0 +1,83 @@ +/*- + * Copyright 2018 Michal Meloun + * 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. + * + * $FreeBSD$ + */ + +#ifndef DEV_EXTRES_PHY_INTERNAL_H +#define DEV_EXTRES_PHY_INTERNAL_H + +/* Forward declarations. */ +struct phy; +struct phynode; + +typedef TAILQ_HEAD(phynode_list, phynode) phynode_list_t; +typedef TAILQ_HEAD(phy_list, phy) phy_list_t; + +/* + * Phy node + */ +struct phynode { + KOBJ_FIELDS; + + TAILQ_ENTRY(phynode) phylist_link; /* Global list entry */ + phy_list_t consumers_list; /* Consumers list */ + + + /* Details of this device. */ + const char *name; /* Globally unique name */ + + device_t pdev; /* Producer device_t */ + void *softc; /* Producer softc */ + intptr_t id; /* Per producer unique id */ +#ifdef FDT + phandle_t ofw_node; /* OFW node of phy */ +#endif + struct sx lock; /* Lock for this phy */ + int ref_cnt; /* Reference counter */ + int enable_cnt; /* Enabled counter */ +}; + +struct phy { + device_t cdev; /* consumer device*/ + struct phynode *phynode; + TAILQ_ENTRY(phy) link; /* Consumers list entry */ + + int enable_cnt; +}; + + +#define PHY_TOPO_SLOCK() sx_slock(&phynode_topo_lock) +#define PHY_TOPO_XLOCK() sx_xlock(&phynode_topo_lock) +#define PHY_TOPO_UNLOCK() sx_unlock(&phynode_topo_lock) +#define PHY_TOPO_ASSERT() sx_assert(&phynode_topo_lock, SA_LOCKED) +#define PHY_TOPO_XASSERT() sx_assert(&phynode_topo_lock, SA_XLOCKED) + +#define PHYNODE_SLOCK(_sc) sx_slock(&((_sc)->lock)) +#define PHYNODE_XLOCK(_sc) sx_xlock(&((_sc)->lock)) +#define PHYNODE_UNLOCK(_sc) sx_unlock(&((_sc)->lock)) + +struct sx phynode_topo_lock; + +#endif /* DEV_EXTRES_PHY_INTERNAL_H */ Added: head/sys/dev/extres/phy/phy_usb.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/extres/phy/phy_usb.c Fri Nov 23 19:43:18 2018 (r340845) @@ -0,0 +1,149 @@ +/*- + * Copyright 2018 Michal Meloun + * 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. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include + + +#include +#include + +#include "phydev_if.h" + +/* + * USB phy controller methods. + */ +static phynode_usb_method_t phynode_usb_methods[] = { + + PHYNODEUSBMETHOD_END +}; +DEFINE_CLASS_1(phynode_usb, phynode_usb_class, phynode_usb_methods, + 0, phynode_class); + +/* + * Create and initialize phy object, but do not register it. + */ +struct phynode * +phynode_usb_create(device_t pdev, phynode_class_t phynode_class, + struct phynode_usb_init_def *def) + +{ + struct phynode *phynode; + struct phynode_usb_sc *sc; + + phynode = phynode_create(pdev, phynode_class, &def->phynode_init_def); + if (phynode == NULL) + return (NULL); + sc = phynode_get_softc(phynode); + sc->std_param = def->std_param; + return (phynode); +} + +struct phynode +*phynode_usb_register(struct phynode *phynode) +{ + + return (phynode_register(phynode)); +} + +/* -------------------------------------------------------------------------- + * + * Real consumers executive + * + */ + +/* + * Set USB phy mode. (PHY_USB_MODE_*) + */ +int +phynode_usb_set_mode(struct phynode *phynode, int usb_mode) +{ + int rv; + + PHY_TOPO_ASSERT(); + + PHYNODE_XLOCK(phynode); + rv = PHYNODE_USB_SET_MODE(phynode, usb_mode); + PHYNODE_UNLOCK(phynode); + return (rv); +} + +/* + * Get USB phy mode. (PHY_USB_MODE_*) + */ +int +phynode_usb_get_mode(struct phynode *phynode, int *usb_mode) +{ + int rv; + + PHY_TOPO_ASSERT(); + + PHYNODE_XLOCK(phynode); + rv = PHYNODE_USB_GET_MODE(phynode, usb_mode); + PHYNODE_UNLOCK(phynode); + return (rv); +} + + /* -------------------------------------------------------------------------- + * + * USB phy consumers interface. + * + */ +int phy_usb_set_mode(phy_t phy, int usb_mode) +{ + int rv; + struct phynode *phynode; + + phynode = phy->phynode; + KASSERT(phynode->ref_cnt > 0, + ("Attempt to access unreferenced phy.\n")); + + PHY_TOPO_SLOCK(); + rv = phynode_usb_set_mode(phynode, usb_mode); + PHY_TOPO_UNLOCK(); + return (rv); +} + +int phy_usb_get_mode(phy_t phy, int *usb_mode) +{ + int rv; + struct phynode *phynode; + + phynode = phy->phynode; + KASSERT(phynode->ref_cnt > 0, + ("Attempt to access unreferenced phy.\n")); + + PHY_TOPO_SLOCK(); + rv = phynode_usb_get_mode(phynode, usb_mode); + PHY_TOPO_UNLOCK(); + return (rv); +} Added: head/sys/dev/extres/phy/phy_usb.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/extres/phy/phy_usb.h Fri Nov 23 19:43:18 2018 (r340845) @@ -0,0 +1,85 @@ +/*- + * Copyright 2018 Michal Meloun + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _DEV_EXTRES_PHY_USB_H_ +#define _DEV_EXTRES_PHY_USB_H_ + +#include +#include "phynode_usb_if.h" + +#define PHY_USB_MODE_UNKNOWN 0 +#define PHY_USB_MODE_HOST 1 +#define PHY_USB_MODE_OTG 2 +#define PHY_USB_MODE_DEVICE 3 + +/* Standard USB phy parameters. */ +struct phynode_usb_std_param { + int usb_mode; +}; + +struct phynode_usb_sc { + struct phynode_usb_std_param std_param; +}; + +/* Initialization parameters. */ +struct phynode_usb_init_def { + struct phynode_init_def phynode_init_def; + struct phynode_usb_std_param std_param; /* Standard parameters */ +}; + + +/* + * Shorthands for constructing method tables. + */ +#define PHYNODEUSBMETHOD KOBJMETHOD +#define PHYNODEUSBMETHOD_END KOBJMETHOD_END +#define phynode_usb_method_t kobj_method_t +#define phynode_usb_class_t kobj_class_t +DECLARE_CLASS(phynode_usb_class); + +struct phynode *phynode_usb_create(device_t pdev, phynode_class_t phynode_class, + struct phynode_usb_init_def *def); +struct phynode *phynode_usb_register(struct phynode *phynode); + +#if 0 +/* XXX to be implemented */ +#ifdef FDT +int phynode_usb_parse_ofw_stdparam(device_t dev, phandle_t node, + struct phynode_usb_init_def *def); +#endif +#endif + +/* Phynode functions. */ +int phynode_usb_set_mode(struct phynode *phynode, int usb_mode); +int phynode_usb_get_mode(struct phynode *phynode, int *usb_mode); + +/* Consumer functions. */ +int phy_usb_set_mode(phy_t phy, int usb_mode); +int phy_usb_get_mode(phy_t phy, int *usb_mode); + +#endif /*_DEV_EXTRES_PHY_USB_H_*/ Added: head/sys/dev/extres/phy/phynode_usb_if.m ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/extres/phy/phynode_usb_if.m Fri Nov 23 19:43:18 2018 (r340845) @@ -0,0 +1,51 @@ +#- +# Copyright 2018 Michal Meloun +# 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$ +# + +INTERFACE phynode_usb; + +HEADER { + struct phynode; +} + +# +# Set USB mode for phy +# Returns 0 on success or a standard errno value. +# +METHOD int set_mode { + struct phynode *phynode; + int usb_mode; /* PHY_USB_MODE_* */ +}; + +# +# Get USB mode +# Returns 0 on success or a standard errno value. +# +METHOD int get_mode { + struct phynode *phynode; + int *usb_mode; /* PHY_USB_MODE_* */ +}; From owner-svn-src-all@freebsd.org Fri Nov 23 19:44:27 2018 Return-Path: Delivered-To: svn-src-all@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 22701114FD77; Fri, 23 Nov 2018 19:44:27 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.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 BD0CA72213; Fri, 23 Nov 2018 19:44:26 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9DEAA2326C; Fri, 23 Nov 2018 19:44:26 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wANJiQnm028471; Fri, 23 Nov 2018 19:44:26 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wANJiQJW028470; Fri, 23 Nov 2018 19:44:26 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201811231944.wANJiQJW028470@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Fri, 23 Nov 2018 19:44:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340846 - head/sys/arm/allwinner X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/arm/allwinner X-SVN-Commit-Revision: 340846 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: BD0CA72213 X-Spamd-Result: default: False [1.52 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.37)[0.368,0]; NEURAL_SPAM_MEDIUM(0.73)[0.730,0]; NEURAL_SPAM_LONG(0.42)[0.420,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Nov 2018 19:44:27 -0000 Author: manu Date: Fri Nov 23 19:44:26 2018 New Revision: 340846 URL: https://svnweb.freebsd.org/changeset/base/340846 Log: aw_usbphy: Convert to usbphy subclass Instead of routing the phy when enabling it, do the configuration and routing in the phynode_usb_set_mode function. While here, if we don't have a vbus detection method, enable the phy if requested. MFC after: 1 month Modified: head/sys/arm/allwinner/aw_usbphy.c Modified: head/sys/arm/allwinner/aw_usbphy.c ============================================================================== --- head/sys/arm/allwinner/aw_usbphy.c Fri Nov 23 19:43:18 2018 (r340845) +++ head/sys/arm/allwinner/aw_usbphy.c Fri Nov 23 19:44:26 2018 (r340846) @@ -49,7 +49,7 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include +#include #include "phynode_if.h" @@ -139,17 +139,22 @@ struct awusbphy_softc { gpio_pin_t vbus_det_pin; int vbus_det_valid; struct aw_usbphy_conf *phy_conf; + int mode; }; /* Phy class and methods. */ static int awusbphy_phy_enable(struct phynode *phy, bool enable); -static phynode_method_t awusbphy_phynode_methods[] = { +static int awusbphy_get_mode(struct phynode *phy, int *mode); +static int awusbphy_set_mode(struct phynode *phy, int mode); +static phynode_usb_method_t awusbphy_phynode_methods[] = { PHYNODEMETHOD(phynode_enable, awusbphy_phy_enable), + PHYNODEMETHOD(phynode_usb_get_mode, awusbphy_get_mode), + PHYNODEMETHOD(phynode_usb_set_mode, awusbphy_set_mode), PHYNODEMETHOD_END }; DEFINE_CLASS_1(awusbphy_phynode, awusbphy_phynode_class, awusbphy_phynode_methods, - 0, phynode_class); + sizeof(struct phynode_usb_sc), phynode_usb_class); #define RD4(res, o) bus_read_4(res, (o)) #define WR4(res, o, v) bus_write_4(res, (o), (v)) @@ -165,6 +170,18 @@ DEFINE_CLASS_1(awusbphy_phynode, awusbphy_phynode_clas #define PMU_ULPI_BYPASS (1 << 0) #define PMU_UNK_H3 0x10 #define PMU_UNK_H3_CLR 0x2 +#define PHY_CSR 0x00 +#define ID_PULLUP_EN (1 << 17) +#define DPDM_PULLUP_EN (1 << 16) +#define FORCE_ID (0x3 << 14) +#define FORCE_ID_SHIFT 14 +#define FORCE_ID_LOW 2 +#define FORCE_VBUS_VALID (0x3 << 12) +#define FORCE_VBUS_VALID_SHIFT 12 +#define FORCE_VBUS_VALID_HIGH 3 +#define VBUS_CHANGE_DET (1 << 6) +#define ID_CHANGE_DET (1 << 5) +#define DPDM_CHANGE_DET (1 << 4) static void awusbphy_configure(device_t dev, int phyno) @@ -287,7 +304,7 @@ awusbphy_vbus_detect(device_t dev, int *val) return (0); } - *val = 1; + *val = 0; return (0); } @@ -315,30 +332,22 @@ awusbphy_phy_enable(struct phynode *phynode, bool enab if (reg == NULL) return (0); - if (enable) { + if (phy == 0) { /* If an external vbus is detected, do not enable phy 0 */ - if (phy == 0) { - error = awusbphy_vbus_detect(dev, &vbus_det); - if (error) - goto out; + error = awusbphy_vbus_detect(dev, &vbus_det); + if (error) + goto out; - /* Depending on the PHY we need to route OTG to OHCI/EHCI */ - if (sc->phy_conf->phy0_route == true) { - if (vbus_det == 0) - /* Host mode */ - CLR4(sc->phy_ctrl, OTG_PHY_CFG, - OTG_PHY_ROUTE_OTG); - else - /* Peripheral mode */ - SET4(sc->phy_ctrl, OTG_PHY_CFG, - OTG_PHY_ROUTE_OTG); - } - if (vbus_det == 1) - return (0); - } else - error = 0; - if (error == 0) - error = regulator_enable(reg); + if (vbus_det == 1) { + if (bootverbose) + device_printf(dev, "External VBUS detected, not enabling the regulator\n"); + + return (0); + } + } + if (enable) { + /* Depending on the PHY we need to route OTG to OHCI/EHCI */ + error = regulator_enable(reg); } else error = regulator_disable(reg); @@ -350,6 +359,70 @@ out: return (error); } + return (0); +} + +static int +awusbphy_get_mode(struct phynode *phynode, int *mode) +{ + struct awusbphy_softc *sc; + device_t dev; + + dev = phynode_get_device(phynode); + sc = device_get_softc(dev); + + *mode = sc->mode; + + return (0); +} + +static int +awusbphy_set_mode(struct phynode *phynode, int mode) +{ + device_t dev; + intptr_t phy; + struct awusbphy_softc *sc; + uint32_t val; + int error, vbus_det; + + dev = phynode_get_device(phynode); + phy = phynode_get_id(phynode); + sc = device_get_softc(dev); + + if (phy != 0) + return (EINVAL); + + switch (mode) { + case PHY_USB_MODE_HOST: + val = bus_read_4(sc->phy_ctrl, PHY_CSR); + val &= ~(VBUS_CHANGE_DET | ID_CHANGE_DET | DPDM_CHANGE_DET); + val |= (ID_PULLUP_EN | DPDM_PULLUP_EN); + val &= ~FORCE_ID; + val |= (FORCE_ID_LOW << FORCE_ID_SHIFT); + val &= ~FORCE_VBUS_VALID; + val |= (FORCE_VBUS_VALID_HIGH << FORCE_VBUS_VALID_SHIFT); + bus_write_4(sc->phy_ctrl, PHY_CSR, val); + if (sc->phy_conf->phy0_route == true) { + error = awusbphy_vbus_detect(dev, &vbus_det); + if (error) + goto out; + if (vbus_det == 0) + CLR4(sc->phy_ctrl, OTG_PHY_CFG, + OTG_PHY_ROUTE_OTG); + else + SET4(sc->phy_ctrl, OTG_PHY_CFG, + OTG_PHY_ROUTE_OTG); + } + break; + case PHY_USB_MODE_OTG: + /* TODO */ + break; + } + + sc->mode = mode; + + +out: return (0); } From owner-svn-src-all@freebsd.org Fri Nov 23 19:45:12 2018 Return-Path: Delivered-To: svn-src-all@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 CBBF8114FDED; Fri, 23 Nov 2018 19:45:12 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.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 5C9B272343; Fri, 23 Nov 2018 19:45:12 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3D9932326E; Fri, 23 Nov 2018 19:45:12 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wANJjCPR028559; Fri, 23 Nov 2018 19:45:12 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wANJjCnh028558; Fri, 23 Nov 2018 19:45:12 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201811231945.wANJjCnh028558@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Fri, 23 Nov 2018 19:45:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340847 - head/sys/arm/allwinner X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/arm/allwinner X-SVN-Commit-Revision: 340847 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 5C9B272343 X-Spamd-Result: default: False [1.48 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.40)[0.400,0]; NEURAL_SPAM_MEDIUM(0.71)[0.712,0]; NEURAL_SPAM_SHORT(0.37)[0.368,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Nov 2018 19:45:13 -0000 Author: manu Date: Fri Nov 23 19:45:11 2018 New Revision: 340847 URL: https://svnweb.freebsd.org/changeset/base/340847 Log: a10_ehci: Always set the phy to host mode MFC after: 1 month Modified: head/sys/arm/allwinner/a10_ehci.c Modified: head/sys/arm/allwinner/a10_ehci.c ============================================================================== --- head/sys/arm/allwinner/a10_ehci.c Fri Nov 23 19:44:26 2018 (r340846) +++ head/sys/arm/allwinner/a10_ehci.c Fri Nov 23 19:45:11 2018 (r340847) @@ -63,7 +63,7 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include +#include #define EHCI_HC_DEVSTR "Allwinner Integrated USB 2.0 controller" @@ -242,6 +242,11 @@ a10_ehci_attach(device_t self) /* Enable USB PHY */ if (phy_get_by_ofw_name(self, 0, "usb", &aw_sc->phy) == 0) { + err = phy_usb_set_mode(aw_sc->phy, PHY_USB_MODE_HOST); + if (err != 0) { + device_printf(self, "Could not set phy to host mode\n"); + goto error; + } err = phy_enable(aw_sc->phy); if (err != 0) { device_printf(self, "Could not enable phy\n"); From owner-svn-src-all@freebsd.org Fri Nov 23 19:45:58 2018 Return-Path: Delivered-To: svn-src-all@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 B239A110200F; Fri, 23 Nov 2018 19:45:58 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.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 45A22725A7; Fri, 23 Nov 2018 19:45:58 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 267BF2326F; Fri, 23 Nov 2018 19:45:58 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wANJjwoO028634; Fri, 23 Nov 2018 19:45:58 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wANJjwKE028633; Fri, 23 Nov 2018 19:45:58 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201811231945.wANJjwKE028633@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Fri, 23 Nov 2018 19:45:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340848 - head/sys/arm/allwinner X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/arm/allwinner X-SVN-Commit-Revision: 340848 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 45A22725A7 X-Spamd-Result: default: False [1.55 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.44)[0.439,0]; NEURAL_SPAM_SHORT(0.37)[0.368,0]; NEURAL_SPAM_MEDIUM(0.75)[0.746,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Nov 2018 19:45:58 -0000 Author: manu Date: Fri Nov 23 19:45:57 2018 New Revision: 340848 URL: https://svnweb.freebsd.org/changeset/base/340848 Log: axp8xx: Rework the enable part and add the GPIOXLDO regulators MFC after: 1 month Modified: head/sys/arm/allwinner/axp81x.c Modified: head/sys/arm/allwinner/axp81x.c ============================================================================== --- head/sys/arm/allwinner/axp81x.c Fri Nov 23 19:45:11 2018 (r340847) +++ head/sys/arm/allwinner/axp81x.c Fri Nov 23 19:45:57 2018 (r340848) @@ -126,12 +126,16 @@ MALLOC_DEFINE(M_AXP8XX_REG, "AXP8xx regulator", "AXP8x #define AXP_IRQSTAT5 0x4c #define AXP_IRQSTAT5_POKSIRQ (1 << 4) #define AXP_GPIO0_CTRL 0x90 +#define AXP_GPIO0LDO_CTRL 0x91 #define AXP_GPIO1_CTRL 0x92 +#define AXP_GPIO1LDO_CTRL 0x93 #define AXP_GPIO_FUNC (0x7 << 0) #define AXP_GPIO_FUNC_SHIFT 0 #define AXP_GPIO_FUNC_DRVLO 0 #define AXP_GPIO_FUNC_DRVHI 1 #define AXP_GPIO_FUNC_INPUT 2 +#define AXP_GPIO_FUNC_LDO_ON 3 +#define AXP_GPIO_FUNC_LDO_OFF 4 #define AXP_GPIO_SIGBIT 0x94 #define AXP_GPIO_PD 0x97 @@ -166,6 +170,8 @@ struct axp8xx_regdef { char *supply_name; uint8_t enable_reg; uint8_t enable_mask; + uint8_t enable_value; + uint8_t disable_value; uint8_t voltage_reg; int voltage_min; int voltage_max; @@ -197,6 +203,8 @@ enum axp8xx_reg_id { AXP8XX_REG_ID_FLDO1, AXP8XX_REG_ID_FLDO2, AXP813_REG_ID_FLDO3, + AXP8XX_REG_ID_GPIO0_LDO, + AXP8XX_REG_ID_GPIO1_LDO, }; static struct axp8xx_regdef axp803_regdefs[] = { @@ -204,7 +212,8 @@ static struct axp8xx_regdef axp803_regdefs[] = { .id = AXP803_REG_ID_DC1SW, .name = "dc1sw", .enable_reg = AXP_POWERCTL2, - .enable_mask = AXP_POWERCTL2_DC1SW, + .enable_mask = (uint8_t) AXP_POWERCTL2_DC1SW, + .enable_value = AXP_POWERCTL2_DC1SW, }, }; @@ -213,7 +222,8 @@ static struct axp8xx_regdef axp813_regdefs[] = { .id = AXP813_REG_ID_DCDC7, .name = "dcdc7", .enable_reg = AXP_POWERCTL1, - .enable_mask = AXP_POWERCTL1_DCDC7, + .enable_mask = (uint8_t) AXP_POWERCTL1_DCDC7, + .enable_value = AXP_POWERCTL1_DCDC7, .voltage_reg = AXP_VOLTCTL_DCDC7, .voltage_min = 600, .voltage_max = 1520, @@ -229,7 +239,8 @@ static struct axp8xx_regdef axp8xx_common_regdefs[] = .id = AXP8XX_REG_ID_DCDC1, .name = "dcdc1", .enable_reg = AXP_POWERCTL1, - .enable_mask = AXP_POWERCTL1_DCDC1, + .enable_mask = (uint8_t) AXP_POWERCTL1_DCDC1, + .enable_value = AXP_POWERCTL1_DCDC1, .voltage_reg = AXP_VOLTCTL_DCDC1, .voltage_min = 1600, .voltage_max = 3400, @@ -240,7 +251,8 @@ static struct axp8xx_regdef axp8xx_common_regdefs[] = .id = AXP8XX_REG_ID_DCDC2, .name = "dcdc2", .enable_reg = AXP_POWERCTL1, - .enable_mask = AXP_POWERCTL1_DCDC2, + .enable_mask = (uint8_t) AXP_POWERCTL1_DCDC2, + .enable_value = AXP_POWERCTL1_DCDC2, .voltage_reg = AXP_VOLTCTL_DCDC2, .voltage_min = 500, .voltage_max = 1300, @@ -253,7 +265,8 @@ static struct axp8xx_regdef axp8xx_common_regdefs[] = .id = AXP8XX_REG_ID_DCDC3, .name = "dcdc3", .enable_reg = AXP_POWERCTL1, - .enable_mask = AXP_POWERCTL1_DCDC3, + .enable_mask = (uint8_t) AXP_POWERCTL1_DCDC3, + .enable_value = AXP_POWERCTL1_DCDC3, .voltage_reg = AXP_VOLTCTL_DCDC3, .voltage_min = 500, .voltage_max = 1300, @@ -266,7 +279,8 @@ static struct axp8xx_regdef axp8xx_common_regdefs[] = .id = AXP8XX_REG_ID_DCDC4, .name = "dcdc4", .enable_reg = AXP_POWERCTL1, - .enable_mask = AXP_POWERCTL1_DCDC4, + .enable_mask = (uint8_t) AXP_POWERCTL1_DCDC4, + .enable_value = AXP_POWERCTL1_DCDC4, .voltage_reg = AXP_VOLTCTL_DCDC4, .voltage_min = 500, .voltage_max = 1300, @@ -279,7 +293,8 @@ static struct axp8xx_regdef axp8xx_common_regdefs[] = .id = AXP8XX_REG_ID_DCDC5, .name = "dcdc5", .enable_reg = AXP_POWERCTL1, - .enable_mask = AXP_POWERCTL1_DCDC5, + .enable_mask = (uint8_t) AXP_POWERCTL1_DCDC5, + .enable_value = AXP_POWERCTL1_DCDC5, .voltage_reg = AXP_VOLTCTL_DCDC5, .voltage_min = 800, .voltage_max = 1840, @@ -292,7 +307,8 @@ static struct axp8xx_regdef axp8xx_common_regdefs[] = .id = AXP8XX_REG_ID_DCDC6, .name = "dcdc6", .enable_reg = AXP_POWERCTL1, - .enable_mask = AXP_POWERCTL1_DCDC6, + .enable_mask = (uint8_t) AXP_POWERCTL1_DCDC6, + .enable_value = AXP_POWERCTL1_DCDC6, .voltage_reg = AXP_VOLTCTL_DCDC6, .voltage_min = 600, .voltage_max = 1520, @@ -305,7 +321,8 @@ static struct axp8xx_regdef axp8xx_common_regdefs[] = .id = AXP8XX_REG_ID_DLDO1, .name = "dldo1", .enable_reg = AXP_POWERCTL2, - .enable_mask = AXP_POWERCTL2_DLDO1, + .enable_mask = (uint8_t) AXP_POWERCTL2_DLDO1, + .enable_value = AXP_POWERCTL2_DLDO1, .voltage_reg = AXP_VOLTCTL_DLDO1, .voltage_min = 700, .voltage_max = 3300, @@ -316,7 +333,8 @@ static struct axp8xx_regdef axp8xx_common_regdefs[] = .id = AXP8XX_REG_ID_DLDO2, .name = "dldo2", .enable_reg = AXP_POWERCTL2, - .enable_mask = AXP_POWERCTL2_DLDO2, + .enable_mask = (uint8_t) AXP_POWERCTL2_DLDO2, + .enable_value = AXP_POWERCTL2_DLDO2, .voltage_reg = AXP_VOLTCTL_DLDO2, .voltage_min = 700, .voltage_max = 4200, @@ -329,7 +347,8 @@ static struct axp8xx_regdef axp8xx_common_regdefs[] = .id = AXP8XX_REG_ID_DLDO3, .name = "dldo3", .enable_reg = AXP_POWERCTL2, - .enable_mask = AXP_POWERCTL2_DLDO3, + .enable_mask = (uint8_t) AXP_POWERCTL2_DLDO3, + .enable_value = AXP_POWERCTL2_DLDO3, .voltage_reg = AXP_VOLTCTL_DLDO3, .voltage_min = 700, .voltage_max = 3300, @@ -340,7 +359,8 @@ static struct axp8xx_regdef axp8xx_common_regdefs[] = .id = AXP8XX_REG_ID_DLDO4, .name = "dldo4", .enable_reg = AXP_POWERCTL2, - .enable_mask = AXP_POWERCTL2_DLDO4, + .enable_mask = (uint8_t) AXP_POWERCTL2_DLDO4, + .enable_value = AXP_POWERCTL2_DLDO4, .voltage_reg = AXP_VOLTCTL_DLDO4, .voltage_min = 700, .voltage_max = 3300, @@ -351,7 +371,8 @@ static struct axp8xx_regdef axp8xx_common_regdefs[] = .id = AXP8XX_REG_ID_ALDO1, .name = "aldo1", .enable_reg = AXP_POWERCTL3, - .enable_mask = AXP_POWERCTL3_ALDO1, + .enable_mask = (uint8_t) AXP_POWERCTL3_ALDO1, + .enable_value = AXP_POWERCTL3_ALDO1, .voltage_min = 700, .voltage_max = 3300, .voltage_step1 = 100, @@ -361,7 +382,8 @@ static struct axp8xx_regdef axp8xx_common_regdefs[] = .id = AXP8XX_REG_ID_ALDO2, .name = "aldo2", .enable_reg = AXP_POWERCTL3, - .enable_mask = AXP_POWERCTL3_ALDO2, + .enable_mask = (uint8_t) AXP_POWERCTL3_ALDO2, + .enable_value = AXP_POWERCTL3_ALDO2, .voltage_min = 700, .voltage_max = 3300, .voltage_step1 = 100, @@ -371,7 +393,8 @@ static struct axp8xx_regdef axp8xx_common_regdefs[] = .id = AXP8XX_REG_ID_ALDO3, .name = "aldo3", .enable_reg = AXP_POWERCTL3, - .enable_mask = AXP_POWERCTL3_ALDO3, + .enable_mask = (uint8_t) AXP_POWERCTL3_ALDO3, + .enable_value = AXP_POWERCTL3_ALDO3, .voltage_min = 700, .voltage_max = 3300, .voltage_step1 = 100, @@ -381,7 +404,8 @@ static struct axp8xx_regdef axp8xx_common_regdefs[] = .id = AXP8XX_REG_ID_ELDO1, .name = "eldo1", .enable_reg = AXP_POWERCTL2, - .enable_mask = AXP_POWERCTL2_ELDO1, + .enable_mask = (uint8_t) AXP_POWERCTL2_ELDO1, + .enable_value = AXP_POWERCTL2_ELDO1, .voltage_min = 700, .voltage_max = 1900, .voltage_step1 = 50, @@ -391,7 +415,8 @@ static struct axp8xx_regdef axp8xx_common_regdefs[] = .id = AXP8XX_REG_ID_ELDO2, .name = "eldo2", .enable_reg = AXP_POWERCTL2, - .enable_mask = AXP_POWERCTL2_ELDO2, + .enable_mask = (uint8_t) AXP_POWERCTL2_ELDO2, + .enable_value = AXP_POWERCTL2_ELDO2, .voltage_min = 700, .voltage_max = 1900, .voltage_step1 = 50, @@ -401,7 +426,8 @@ static struct axp8xx_regdef axp8xx_common_regdefs[] = .id = AXP8XX_REG_ID_ELDO3, .name = "eldo3", .enable_reg = AXP_POWERCTL2, - .enable_mask = AXP_POWERCTL2_ELDO3, + .enable_mask = (uint8_t) AXP_POWERCTL2_ELDO3, + .enable_value = AXP_POWERCTL2_ELDO3, .voltage_min = 700, .voltage_max = 1900, .voltage_step1 = 50, @@ -411,7 +437,8 @@ static struct axp8xx_regdef axp8xx_common_regdefs[] = .id = AXP8XX_REG_ID_FLDO1, .name = "fldo1", .enable_reg = AXP_POWERCTL3, - .enable_mask = AXP_POWERCTL3_FLDO1, + .enable_mask = (uint8_t) ~AXP_POWERCTL3_FLDO1, + .enable_value = AXP_POWERCTL3_FLDO1, .voltage_min = 700, .voltage_max = 1450, .voltage_step1 = 50, @@ -421,12 +448,39 @@ static struct axp8xx_regdef axp8xx_common_regdefs[] = .id = AXP8XX_REG_ID_FLDO2, .name = "fldo2", .enable_reg = AXP_POWERCTL3, - .enable_mask = AXP_POWERCTL3_FLDO2, + .enable_mask = (uint8_t) AXP_POWERCTL3_FLDO2, + .enable_value = AXP_POWERCTL3_FLDO2, .voltage_min = 700, .voltage_max = 1450, .voltage_step1 = 50, .voltage_nstep1 = 15, }, + { + .id = AXP8XX_REG_ID_GPIO0_LDO, + .name = "ldo-io0", + .enable_reg = AXP_GPIO0_CTRL, + .enable_mask = (uint8_t) AXP_GPIO_FUNC, + .enable_value = AXP_GPIO_FUNC_LDO_ON, + .disable_value = AXP_GPIO_FUNC_LDO_OFF, + .voltage_reg = AXP_GPIO0LDO_CTRL, + .voltage_min = 700, + .voltage_max = 3300, + .voltage_step1 = 100, + .voltage_nstep1 = 26, + }, + { + .id = AXP8XX_REG_ID_GPIO1_LDO, + .name = "ldo-io1", + .enable_reg = AXP_GPIO1_CTRL, + .enable_mask = (uint8_t) AXP_GPIO_FUNC, + .enable_value = AXP_GPIO_FUNC_LDO_ON, + .disable_value = AXP_GPIO_FUNC_LDO_OFF, + .voltage_reg = AXP_GPIO1LDO_CTRL, + .voltage_min = 700, + .voltage_max = 3300, + .voltage_step1 = 100, + .voltage_nstep1 = 26, + }, }; struct axp8xx_softc; @@ -520,10 +574,15 @@ axp8xx_regnode_enable(struct regnode *regnode, bool en sc->def->name); axp8xx_read(sc->base_dev, sc->def->enable_reg, &val, 1); + val &= ~sc->def->enable_mask; if (enable) - val |= sc->def->enable_mask; - else - val &= ~sc->def->enable_mask; + val |= sc->def->enable_value; + else { + if (sc->def->disable_value) + val |= sc->def->disable_value; + else + val &= ~sc->def->enable_value; + } axp8xx_write(sc->base_dev, sc->def->enable_reg, val); *udelay = 0; From owner-svn-src-all@freebsd.org Fri Nov 23 20:29:48 2018 Return-Path: Delivered-To: svn-src-all@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 BD14B1102F3A; Fri, 23 Nov 2018 20:29:48 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 641AB73B8E; Fri, 23 Nov 2018 20:29:48 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4537B238D3; Fri, 23 Nov 2018 20:29:48 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wANKTmsZ049590; Fri, 23 Nov 2018 20:29:48 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wANKTmsw049589; Fri, 23 Nov 2018 20:29:48 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201811232029.wANKTmsw049589@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 23 Nov 2018 20:29:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r340849 - stable/12/sys/fs/nfsserver X-SVN-Group: stable-12 X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: stable/12/sys/fs/nfsserver X-SVN-Commit-Revision: 340849 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 641AB73B8E X-Spamd-Result: default: False [1.40 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.39)[0.387,0]; NEURAL_SPAM_SHORT(0.32)[0.320,0]; NEURAL_SPAM_MEDIUM(0.70)[0.697,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Nov 2018 20:29:48 -0000 Author: emaste Date: Fri Nov 23 20:29:47 2018 New Revision: 340849 URL: https://svnweb.freebsd.org/changeset/base/340849 Log: MFC r340661 (rmacklem): r304026 added code that started statistics gathering for an operation before the operation number (the variable called "op") was sanity checked. This patch moves the code down to below the range sanity check for "op". Modified: stable/12/sys/fs/nfsserver/nfs_nfsdsocket.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/fs/nfsserver/nfs_nfsdsocket.c ============================================================================== --- stable/12/sys/fs/nfsserver/nfs_nfsdsocket.c Fri Nov 23 19:45:57 2018 (r340848) +++ stable/12/sys/fs/nfsserver/nfs_nfsdsocket.c Fri Nov 23 20:29:47 2018 (r340849) @@ -766,11 +766,6 @@ nfsrvd_compound(struct nfsrv_descript *nd, int isdgram *repp = *tl; op = fxdr_unsigned(int, *tl); NFSD_DEBUG(4, "op=%d\n", op); - - binuptime(&start_time); - nfsrvd_statstart(op, &start_time); - statsinprog = 1; - if (op < NFSV4OP_ACCESS || (op >= NFSV4OP_NOPS && (nd->nd_flag & ND_NFSV41) == 0) || (op >= NFSV41_NOPS && (nd->nd_flag & ND_NFSV41) != 0)) { @@ -782,6 +777,11 @@ nfsrvd_compound(struct nfsrv_descript *nd, int isdgram } else { repp++; } + + binuptime(&start_time); + nfsrvd_statstart(op, &start_time); + statsinprog = 1; + if (i == 0) op0 = op; if (i == numops - 1) From owner-svn-src-all@freebsd.org Fri Nov 23 20:31:28 2018 Return-Path: Delivered-To: svn-src-all@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 08DBA1103170; Fri, 23 Nov 2018 20:31:28 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A2BFD73EB9; Fri, 23 Nov 2018 20:31:27 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 856B223A35; Fri, 23 Nov 2018 20:31:27 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wANKVRwO054351; Fri, 23 Nov 2018 20:31:27 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wANKVRA1054350; Fri, 23 Nov 2018 20:31:27 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201811232031.wANKVRA1054350@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 23 Nov 2018 20:31:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r340850 - stable/12/sys/fs/nfs X-SVN-Group: stable-12 X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: stable/12/sys/fs/nfs X-SVN-Commit-Revision: 340850 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A2BFD73EB9 X-Spamd-Result: default: False [1.40 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.39)[0.387,0]; NEURAL_SPAM_MEDIUM(0.70)[0.697,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.32)[0.320,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Nov 2018 20:31:28 -0000 Author: emaste Date: Fri Nov 23 20:31:27 2018 New Revision: 340850 URL: https://svnweb.freebsd.org/changeset/base/340850 Log: MFC r340662 (rmacklem): nfsm_advance() would panic() when the offs argument was negative. The code assumed that this would indicate a corrupted mbuf chain, but it could simply be caused by bogus RPC message data. This patch replaces the panic() with a printf() plus error return. Modified: stable/12/sys/fs/nfs/nfs_commonsubs.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/fs/nfs/nfs_commonsubs.c ============================================================================== --- stable/12/sys/fs/nfs/nfs_commonsubs.c Fri Nov 23 20:29:47 2018 (r340849) +++ stable/12/sys/fs/nfs/nfs_commonsubs.c Fri Nov 23 20:31:27 2018 (r340850) @@ -725,10 +725,14 @@ nfsm_advance(struct nfsrv_descript *nd, int offs, int if (offs == 0) goto out; /* - * A negative offs should be considered a serious problem. + * A negative offs might indicate a corrupted mbuf chain and, + * as such, a printf is logged. */ - if (offs < 0) - panic("nfsrv_advance"); + if (offs < 0) { + printf("nfsrv_advance: negative offs\n"); + error = EBADRPC; + goto out; + } /* * If left == -1, calculate it here. From owner-svn-src-all@freebsd.org Fri Nov 23 20:32:42 2018 Return-Path: Delivered-To: svn-src-all@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 BFF711103209; Fri, 23 Nov 2018 20:32:42 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5C4C7740B0; Fri, 23 Nov 2018 20:32:42 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3D2DE23A86; Fri, 23 Nov 2018 20:32:42 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wANKWgxx054450; Fri, 23 Nov 2018 20:32:42 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wANKWgP8054449; Fri, 23 Nov 2018 20:32:42 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201811232032.wANKWgP8054449@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 23 Nov 2018 20:32:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r340851 - stable/12/sys/fs/nfsserver X-SVN-Group: stable-12 X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: stable/12/sys/fs/nfsserver X-SVN-Commit-Revision: 340851 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 5C4C7740B0 X-Spamd-Result: default: False [1.40 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.39)[0.387,0]; NEURAL_SPAM_SHORT(0.32)[0.320,0]; NEURAL_SPAM_MEDIUM(0.70)[0.697,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Nov 2018 20:32:42 -0000 Author: emaste Date: Fri Nov 23 20:32:41 2018 New Revision: 340851 URL: https://svnweb.freebsd.org/changeset/base/340851 Log: MFC r340663 (rmacklem): Improve sanity checking for the dircount hint argument to NFSv3's ReaddirPlus and NFSv4's Readdir operations. The code checked for a zero argument, but did not check for a very large value. This patch clips dircount at the server's maximum data size. Modified: stable/12/sys/fs/nfsserver/nfs_nfsdport.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/fs/nfsserver/nfs_nfsdport.c ============================================================================== --- stable/12/sys/fs/nfsserver/nfs_nfsdport.c Fri Nov 23 20:31:27 2018 (r340850) +++ stable/12/sys/fs/nfsserver/nfs_nfsdport.c Fri Nov 23 20:32:41 2018 (r340851) @@ -2107,9 +2107,15 @@ nfsrvd_readdirplus(struct nfsrv_descript *nd, int isdg * cookie) should be in the reply. At least one client "hints" 0, * so I set it to cnt for that case. I also round it up to the * next multiple of DIRBLKSIZ. + * Since the size of a Readdirplus directory entry reply will always + * be greater than a directory entry returned by VOP_READDIR(), it + * does not make sense to read more than NFS_SRVMAXDATA() via + * VOP_READDIR(). */ if (siz <= 0) siz = cnt; + else if (siz > NFS_SRVMAXDATA(nd)) + siz = NFS_SRVMAXDATA(nd); siz = ((siz + DIRBLKSIZ - 1) & ~(DIRBLKSIZ - 1)); if (nd->nd_flag & ND_NFSV4) { From owner-svn-src-all@freebsd.org Fri Nov 23 20:38:51 2018 Return-Path: Delivered-To: svn-src-all@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 BB0BA11033A7; Fri, 23 Nov 2018 20:38:51 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5F7447429B; Fri, 23 Nov 2018 20:38:51 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3CE0A23A88; Fri, 23 Nov 2018 20:38:51 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wANKcpnV054769; Fri, 23 Nov 2018 20:38:51 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wANKcpQ4054768; Fri, 23 Nov 2018 20:38:51 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201811232038.wANKcpQ4054768@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 23 Nov 2018 20:38:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r340852 - stable/11/sys/fs/nfsserver X-SVN-Group: stable-11 X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: stable/11/sys/fs/nfsserver X-SVN-Commit-Revision: 340852 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 5F7447429B X-Spamd-Result: default: False [1.40 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.32)[0.320,0]; NEURAL_SPAM_MEDIUM(0.70)[0.697,0]; NEURAL_SPAM_LONG(0.39)[0.387,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Nov 2018 20:38:51 -0000 Author: emaste Date: Fri Nov 23 20:38:50 2018 New Revision: 340852 URL: https://svnweb.freebsd.org/changeset/base/340852 Log: MFC r340661 (rmacklem): r304026 added code that started statistics gathering for an operation before the operation number (the variable called "op") was sanity checked. This patch moves the code down to below the range sanity check for "op". Modified: stable/11/sys/fs/nfsserver/nfs_nfsdsocket.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/fs/nfsserver/nfs_nfsdsocket.c ============================================================================== --- stable/11/sys/fs/nfsserver/nfs_nfsdsocket.c Fri Nov 23 20:32:41 2018 (r340851) +++ stable/11/sys/fs/nfsserver/nfs_nfsdsocket.c Fri Nov 23 20:38:50 2018 (r340852) @@ -758,11 +758,6 @@ nfsrvd_compound(struct nfsrv_descript *nd, int isdgram *repp = *tl; op = fxdr_unsigned(int, *tl); NFSD_DEBUG(4, "op=%d\n", op); - - binuptime(&start_time); - nfsrvd_statstart(op, &start_time); - statsinprog = 1; - if (op < NFSV4OP_ACCESS || (op >= NFSV4OP_NOPS && (nd->nd_flag & ND_NFSV41) == 0) || (op >= NFSV41_NOPS && (nd->nd_flag & ND_NFSV41) != 0)) { @@ -774,6 +769,11 @@ nfsrvd_compound(struct nfsrv_descript *nd, int isdgram } else { repp++; } + + binuptime(&start_time); + nfsrvd_statstart(op, &start_time); + statsinprog = 1; + if (i == 0) op0 = op; if (i == numops - 1) From owner-svn-src-all@freebsd.org Fri Nov 23 20:39:38 2018 Return-Path: Delivered-To: svn-src-all@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 6A9191103413; Fri, 23 Nov 2018 20:39:38 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0CADC743CF; Fri, 23 Nov 2018 20:39:38 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E1FC423A89; Fri, 23 Nov 2018 20:39:37 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wANKdb4l054862; Fri, 23 Nov 2018 20:39:37 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wANKdbh8054861; Fri, 23 Nov 2018 20:39:37 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201811232039.wANKdbh8054861@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 23 Nov 2018 20:39:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r340853 - stable/11/sys/fs/nfs X-SVN-Group: stable-11 X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: stable/11/sys/fs/nfs X-SVN-Commit-Revision: 340853 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 0CADC743CF X-Spamd-Result: default: False [1.40 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.39)[0.387,0]; NEURAL_SPAM_MEDIUM(0.70)[0.697,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.32)[0.320,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Nov 2018 20:39:38 -0000 Author: emaste Date: Fri Nov 23 20:39:37 2018 New Revision: 340853 URL: https://svnweb.freebsd.org/changeset/base/340853 Log: MFC r340662 (rmacklem): nfsm_advance() would panic() when the offs argument was negative. The code assumed that this would indicate a corrupted mbuf chain, but it could simply be caused by bogus RPC message data. This patch replaces the panic() with a printf() plus error return. Modified: stable/11/sys/fs/nfs/nfs_commonsubs.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/fs/nfs/nfs_commonsubs.c ============================================================================== --- stable/11/sys/fs/nfs/nfs_commonsubs.c Fri Nov 23 20:38:50 2018 (r340852) +++ stable/11/sys/fs/nfs/nfs_commonsubs.c Fri Nov 23 20:39:37 2018 (r340853) @@ -360,10 +360,14 @@ nfsm_advance(struct nfsrv_descript *nd, int offs, int if (offs == 0) goto out; /* - * A negative offs should be considered a serious problem. + * A negative offs might indicate a corrupted mbuf chain and, + * as such, a printf is logged. */ - if (offs < 0) - panic("nfsrv_advance"); + if (offs < 0) { + printf("nfsrv_advance: negative offs\n"); + error = EBADRPC; + goto out; + } /* * If left == -1, calculate it here. From owner-svn-src-all@freebsd.org Fri Nov 23 20:41:55 2018 Return-Path: Delivered-To: svn-src-all@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 9715111036A2; Fri, 23 Nov 2018 20:41:55 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3D6617474D; Fri, 23 Nov 2018 20:41:55 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1F89B23C29; Fri, 23 Nov 2018 20:41:55 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wANKftUf058705; Fri, 23 Nov 2018 20:41:55 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wANKftsn058691; Fri, 23 Nov 2018 20:41:55 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201811232041.wANKftsn058691@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 23 Nov 2018 20:41:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r340854 - stable/11/sys/fs/nfsserver X-SVN-Group: stable-11 X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: stable/11/sys/fs/nfsserver X-SVN-Commit-Revision: 340854 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 3D6617474D X-Spamd-Result: default: False [1.40 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.39)[0.387,0]; NEURAL_SPAM_MEDIUM(0.70)[0.697,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.32)[0.320,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Nov 2018 20:41:55 -0000 Author: emaste Date: Fri Nov 23 20:41:54 2018 New Revision: 340854 URL: https://svnweb.freebsd.org/changeset/base/340854 Log: MFC r340663 (rmacklem): Improve sanity checking for the dircount hint argument to NFSv3's ReaddirPlus and NFSv4's Readdir operations. The code checked for a zero argument, but did not check for a very large value. This patch clips dircount at the server's maximum data size. Modified: stable/11/sys/fs/nfsserver/nfs_nfsdport.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/fs/nfsserver/nfs_nfsdport.c ============================================================================== --- stable/11/sys/fs/nfsserver/nfs_nfsdport.c Fri Nov 23 20:39:37 2018 (r340853) +++ stable/11/sys/fs/nfsserver/nfs_nfsdport.c Fri Nov 23 20:41:54 2018 (r340854) @@ -1858,9 +1858,15 @@ nfsrvd_readdirplus(struct nfsrv_descript *nd, int isdg * cookie) should be in the reply. At least one client "hints" 0, * so I set it to cnt for that case. I also round it up to the * next multiple of DIRBLKSIZ. + * Since the size of a Readdirplus directory entry reply will always + * be greater than a directory entry returned by VOP_READDIR(), it + * does not make sense to read more than NFS_SRVMAXDATA() via + * VOP_READDIR(). */ if (siz <= 0) siz = cnt; + else if (siz > NFS_SRVMAXDATA(nd)) + siz = NFS_SRVMAXDATA(nd); siz = ((siz + DIRBLKSIZ - 1) & ~(DIRBLKSIZ - 1)); if (nd->nd_flag & ND_NFSV4) { From owner-svn-src-all@freebsd.org Fri Nov 23 21:08:12 2018 Return-Path: Delivered-To: svn-src-all@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 AE1A41103F1D; Fri, 23 Nov 2018 21:08:12 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 516BB75190; Fri, 23 Nov 2018 21:08:12 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2DEC123F8F; Fri, 23 Nov 2018 21:08:12 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wANL8C3K070321; Fri, 23 Nov 2018 21:08:12 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wANL8BhU070318; Fri, 23 Nov 2018 21:08:11 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201811232108.wANL8BhU070318@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 23 Nov 2018 21:08:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r340855 - in releng/12.0/sys/fs: nfs nfsserver X-SVN-Group: releng X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: in releng/12.0/sys/fs: nfs nfsserver X-SVN-Commit-Revision: 340855 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 516BB75190 X-Spamd-Result: default: False [1.52 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.37)[0.368,0]; NEURAL_SPAM_MEDIUM(0.73)[0.730,0]; NEURAL_SPAM_LONG(0.42)[0.420,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Nov 2018 21:08:13 -0000 Author: emaste Date: Fri Nov 23 21:08:11 2018 New Revision: 340855 URL: https://svnweb.freebsd.org/changeset/base/340855 Log: MFS12 r340849, r340850, r340851: MFC r340661 (rmacklem): r304026 added code that started statistics gathering for an operation before the operation number (the variable called "op") was sanity checked. This patch moves the code down to below the range sanity check for "op". MFC r340662 (rmacklem): nfsm_advance() would panic() when the offs argument was negative. The code assumed that this would indicate a corrupted mbuf chain, but it could simply be caused by bogus RPC message data. This patch replaces the panic() with a printf() plus error return. MFC r340663 (rmacklem): Improve sanity checking for the dircount hint argument to NFSv3's ReaddirPlus and NFSv4's Readdir operations. The code checked for a zero argument, but did not check for a very large value. This patch clips dircount at the server's maximum data size. Approved by: re (kib) Modified: releng/12.0/sys/fs/nfs/nfs_commonsubs.c releng/12.0/sys/fs/nfsserver/nfs_nfsdport.c releng/12.0/sys/fs/nfsserver/nfs_nfsdsocket.c Directory Properties: releng/12.0/ (props changed) Modified: releng/12.0/sys/fs/nfs/nfs_commonsubs.c ============================================================================== --- releng/12.0/sys/fs/nfs/nfs_commonsubs.c Fri Nov 23 20:41:54 2018 (r340854) +++ releng/12.0/sys/fs/nfs/nfs_commonsubs.c Fri Nov 23 21:08:11 2018 (r340855) @@ -725,10 +725,14 @@ nfsm_advance(struct nfsrv_descript *nd, int offs, int if (offs == 0) goto out; /* - * A negative offs should be considered a serious problem. + * A negative offs might indicate a corrupted mbuf chain and, + * as such, a printf is logged. */ - if (offs < 0) - panic("nfsrv_advance"); + if (offs < 0) { + printf("nfsrv_advance: negative offs\n"); + error = EBADRPC; + goto out; + } /* * If left == -1, calculate it here. Modified: releng/12.0/sys/fs/nfsserver/nfs_nfsdport.c ============================================================================== --- releng/12.0/sys/fs/nfsserver/nfs_nfsdport.c Fri Nov 23 20:41:54 2018 (r340854) +++ releng/12.0/sys/fs/nfsserver/nfs_nfsdport.c Fri Nov 23 21:08:11 2018 (r340855) @@ -2107,9 +2107,15 @@ nfsrvd_readdirplus(struct nfsrv_descript *nd, int isdg * cookie) should be in the reply. At least one client "hints" 0, * so I set it to cnt for that case. I also round it up to the * next multiple of DIRBLKSIZ. + * Since the size of a Readdirplus directory entry reply will always + * be greater than a directory entry returned by VOP_READDIR(), it + * does not make sense to read more than NFS_SRVMAXDATA() via + * VOP_READDIR(). */ if (siz <= 0) siz = cnt; + else if (siz > NFS_SRVMAXDATA(nd)) + siz = NFS_SRVMAXDATA(nd); siz = ((siz + DIRBLKSIZ - 1) & ~(DIRBLKSIZ - 1)); if (nd->nd_flag & ND_NFSV4) { Modified: releng/12.0/sys/fs/nfsserver/nfs_nfsdsocket.c ============================================================================== --- releng/12.0/sys/fs/nfsserver/nfs_nfsdsocket.c Fri Nov 23 20:41:54 2018 (r340854) +++ releng/12.0/sys/fs/nfsserver/nfs_nfsdsocket.c Fri Nov 23 21:08:11 2018 (r340855) @@ -766,11 +766,6 @@ nfsrvd_compound(struct nfsrv_descript *nd, int isdgram *repp = *tl; op = fxdr_unsigned(int, *tl); NFSD_DEBUG(4, "op=%d\n", op); - - binuptime(&start_time); - nfsrvd_statstart(op, &start_time); - statsinprog = 1; - if (op < NFSV4OP_ACCESS || (op >= NFSV4OP_NOPS && (nd->nd_flag & ND_NFSV41) == 0) || (op >= NFSV41_NOPS && (nd->nd_flag & ND_NFSV41) != 0)) { @@ -782,6 +777,11 @@ nfsrvd_compound(struct nfsrv_descript *nd, int isdgram } else { repp++; } + + binuptime(&start_time); + nfsrvd_statstart(op, &start_time); + statsinprog = 1; + if (i == 0) op0 = op; if (i == numops - 1) From owner-svn-src-all@freebsd.org Fri Nov 23 22:25:04 2018 Return-Path: Delivered-To: svn-src-all@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 54C401106E20; Fri, 23 Nov 2018 22:25:04 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.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 03513772FC; Fri, 23 Nov 2018 22:25:04 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D5B9D24C69; Fri, 23 Nov 2018 22:25:03 +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 wANMP32j011389; Fri, 23 Nov 2018 22:25:03 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wANMOxxB011356; Fri, 23 Nov 2018 22:24:59 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201811232224.wANMOxxB011356@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Fri, 23 Nov 2018 22:24:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340856 - in head/sys: cddl/contrib/opensolaris/uts/common/fs/zfs fs/autofs fs/cd9660 fs/devfs fs/ext2fs fs/fdescfs fs/fuse fs/msdosfs fs/nandfs fs/pseudofs fs/smbfs fs/tmpfs fs/udf ker... X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in head/sys: cddl/contrib/opensolaris/uts/common/fs/zfs fs/autofs fs/cd9660 fs/devfs fs/ext2fs fs/fdescfs fs/fuse fs/msdosfs fs/nandfs fs/pseudofs fs/smbfs fs/tmpfs fs/udf kern sys ufs/ufs X-SVN-Commit-Revision: 340856 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 03513772FC X-Spamd-Result: default: False [1.65 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.43)[0.433,0]; NEURAL_SPAM_MEDIUM(0.76)[0.762,0]; NEURAL_SPAM_LONG(0.46)[0.458,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Nov 2018 22:25:04 -0000 Author: markj Date: Fri Nov 23 22:24:59 2018 New Revision: 340856 URL: https://svnweb.freebsd.org/changeset/base/340856 Log: Ensure that directory entry padding bytes are zeroed. Directory entries must be padded to maintain alignment; in many filesystems the padding was not initialized, resulting in stack memory being copied out to userspace. With the ino64 work there are also some explicit pad fields in struct dirent. Add a subroutine to clear these bytes and use it in the in-tree filesystems. The NFS client is omitted for now as it was fixed separately in r340787. Reported by: Thomas Barabosch, Fraunhofer FKIE Reviewed by: kib MFC after: 3 days Sponsored by: The FreeBSD Foundation Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c head/sys/fs/autofs/autofs_vnops.c head/sys/fs/cd9660/cd9660_vnops.c head/sys/fs/devfs/devfs_devs.c head/sys/fs/ext2fs/ext2_lookup.c head/sys/fs/fdescfs/fdesc_vnops.c head/sys/fs/fuse/fuse_internal.c head/sys/fs/msdosfs/msdosfs_vnops.c head/sys/fs/nandfs/nandfs_vnops.c head/sys/fs/pseudofs/pseudofs_vnops.c head/sys/fs/smbfs/smbfs_io.c head/sys/fs/tmpfs/tmpfs_subr.c head/sys/fs/tmpfs/tmpfs_vfsops.c head/sys/fs/tmpfs/tmpfs_vnops.c head/sys/fs/udf/udf_vnops.c head/sys/kern/uipc_mqueue.c head/sys/kern/vfs_export.c head/sys/sys/dirent.h head/sys/ufs/ufs/ufs_vnops.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c Fri Nov 23 21:08:11 2018 (r340855) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c Fri Nov 23 22:24:59 2018 (r340856) @@ -262,9 +262,9 @@ sfs_readdir_common(uint64_t parent_id, uint64_t id, st entry.d_fileno = id; entry.d_type = DT_DIR; entry.d_name[0] = '.'; - entry.d_name[1] = '\0'; entry.d_namlen = 1; entry.d_reclen = sizeof(entry); + dirent_terminate(&entry); error = vfs_read_dirent(ap, &entry, uio->uio_offset); if (error != 0) return (SET_ERROR(error)); @@ -277,9 +277,9 @@ sfs_readdir_common(uint64_t parent_id, uint64_t id, st entry.d_type = DT_DIR; entry.d_name[0] = '.'; entry.d_name[1] = '.'; - entry.d_name[2] = '\0'; entry.d_namlen = 2; entry.d_reclen = sizeof(entry); + dirent_terminate(&entry); error = vfs_read_dirent(ap, &entry, uio->uio_offset); if (error != 0) return (SET_ERROR(error)); @@ -694,6 +694,7 @@ zfsctl_root_readdir(ap) strcpy(entry.d_name, node->snapdir->sn_name); entry.d_namlen = strlen(entry.d_name); entry.d_reclen = sizeof(entry); + dirent_terminate(&entry); error = vfs_read_dirent(ap, &entry, uio->uio_offset); if (error != 0) { if (error == ENAMETOOLONG) @@ -1099,6 +1100,7 @@ zfsctl_snapdir_readdir(ap) entry.d_reclen = sizeof(entry); /* NOTE: d_off is the offset for the *next* entry. */ entry.d_off = cookie + dots_offset; + dirent_terminate(&entry); error = vfs_read_dirent(ap, &entry, uio->uio_offset); if (error != 0) { if (error == ENAMETOOLONG) Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Fri Nov 23 21:08:11 2018 (r340855) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Fri Nov 23 22:24:59 2018 (r340856) @@ -2547,6 +2547,7 @@ zfs_readdir(vnode_t *vp, uio_t *uio, cred_t *cr, int * next = &odp->d_off; (void) strlcpy(odp->d_name, zap.za_name, odp->d_namlen + 1); odp->d_type = type; + dirent_terminate(odp); odp = (dirent64_t *)((intptr_t)odp + reclen); } outcount += reclen; Modified: head/sys/fs/autofs/autofs_vnops.c ============================================================================== --- head/sys/fs/autofs/autofs_vnops.c Fri Nov 23 21:08:11 2018 (r340855) +++ head/sys/fs/autofs/autofs_vnops.c Fri Nov 23 22:24:59 2018 (r340856) @@ -34,6 +34,7 @@ __FBSDID("$FreeBSD$"); #include +#include #include #include #include @@ -44,7 +45,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include @@ -354,14 +354,11 @@ autofs_readdir_one(struct uio *uio, const char *name, size_t *reclenp) { struct dirent dirent; - size_t namlen, padded_namlen, reclen; + size_t namlen, reclen; int error; namlen = strlen(name); - padded_namlen = roundup2(namlen + 1, __alignof(struct dirent)); - KASSERT(padded_namlen <= MAXNAMLEN, ("%zd > MAXNAMLEN", padded_namlen)); - reclen = offsetof(struct dirent, d_name) + padded_namlen; - + reclen = _GENERIC_DIRLEN(namlen); if (reclenp != NULL) *reclenp = reclen; @@ -376,7 +373,7 @@ autofs_readdir_one(struct uio *uio, const char *name, dirent.d_type = DT_DIR; dirent.d_namlen = namlen; memcpy(dirent.d_name, name, namlen); - memset(dirent.d_name + namlen, 0, padded_namlen - namlen); + dirent_terminate(&dirent); error = uiomove(&dirent, reclen, uio); return (error); Modified: head/sys/fs/cd9660/cd9660_vnops.c ============================================================================== --- head/sys/fs/cd9660/cd9660_vnops.c Fri Nov 23 21:08:11 2018 (r340855) +++ head/sys/fs/cd9660/cd9660_vnops.c Fri Nov 23 22:24:59 2018 (r340856) @@ -380,8 +380,8 @@ iso_uiodir(idp,dp,off) { int error; - dp->d_name[dp->d_namlen] = 0; dp->d_reclen = GENERIC_DIRSIZ(dp); + dirent_terminate(dp); if (idp->uio->uio_resid < dp->d_reclen) { idp->eofflag = 0; Modified: head/sys/fs/devfs/devfs_devs.c ============================================================================== --- head/sys/fs/devfs/devfs_devs.c Fri Nov 23 21:08:11 2018 (r340855) +++ head/sys/fs/devfs/devfs_devs.c Fri Nov 23 22:24:59 2018 (r340856) @@ -226,7 +226,7 @@ devfs_newdirent(char *name, int namelen) de->de_dirent->d_namlen = namelen; de->de_dirent->d_reclen = GENERIC_DIRSIZ(&d); bcopy(name, de->de_dirent->d_name, namelen); - de->de_dirent->d_name[namelen] = '\0'; + dirent_terminate(de->de_dirent); vfs_timestamp(&de->de_ctime); de->de_mtime = de->de_atime = de->de_ctime; de->de_links = 1; Modified: head/sys/fs/ext2fs/ext2_lookup.c ============================================================================== --- head/sys/fs/ext2fs/ext2_lookup.c Fri Nov 23 21:08:11 2018 (r340855) +++ head/sys/fs/ext2fs/ext2_lookup.c Fri Nov 23 22:24:59 2018 (r340856) @@ -223,9 +223,9 @@ ext2_readdir(struct vop_readdir_args *ap) dstdp.d_fileno = dp->e2d_ino; dstdp.d_reclen = GENERIC_DIRSIZ(&dstdp); bcopy(dp->e2d_name, dstdp.d_name, dstdp.d_namlen); - dstdp.d_name[dstdp.d_namlen] = '\0'; /* NOTE: d_off is the offset of the *next* entry. */ dstdp.d_off = offset + dp->e2d_reclen; + dirent_terminate(&dstdp); if (dstdp.d_reclen > uio->uio_resid) { if (uio->uio_resid == startresid) error = EINVAL; Modified: head/sys/fs/fdescfs/fdesc_vnops.c ============================================================================== --- head/sys/fs/fdescfs/fdesc_vnops.c Fri Nov 23 21:08:11 2018 (r340855) +++ head/sys/fs/fdescfs/fdesc_vnops.c Fri Nov 23 22:24:59 2018 (r340856) @@ -561,8 +561,8 @@ fdesc_readdir(struct vop_readdir_args *ap) dp->d_namlen = i + 1; dp->d_reclen = UIO_MX; bcopy("..", dp->d_name, dp->d_namlen); - dp->d_name[i + 1] = '\0'; dp->d_type = DT_DIR; + dirent_terminate(dp); break; default: if (fdp->fd_ofiles[fcnt].fde_file == NULL) @@ -572,6 +572,7 @@ fdesc_readdir(struct vop_readdir_args *ap) dp->d_type = (fmp->flags & FMNT_LINRDLNKF) == 0 ? DT_CHR : DT_LNK; dp->d_fileno = i + FD_DESC; + dirent_terminate(dp); break; } /* NOTE: d_off is the offset of the *next* entry. */ Modified: head/sys/fs/fuse/fuse_internal.c ============================================================================== --- head/sys/fs/fuse/fuse_internal.c Fri Nov 23 21:08:11 2018 (r340855) +++ head/sys/fs/fuse/fuse_internal.c Fri Nov 23 22:24:59 2018 (r340856) @@ -357,7 +357,7 @@ fuse_internal_readdir_processdata(struct uio *uio, memcpy((char *)cookediov->base + sizeof(struct dirent) - MAXNAMLEN - 1, (char *)buf + FUSE_NAME_OFFSET, fudge->namelen); - ((char *)cookediov->base)[bytesavail - 1] = '\0'; + dirent_terminate(de); err = uiomove(cookediov->base, cookediov->len, uio); if (err) { Modified: head/sys/fs/msdosfs/msdosfs_vnops.c ============================================================================== --- head/sys/fs/msdosfs/msdosfs_vnops.c Fri Nov 23 21:08:11 2018 (r340855) +++ head/sys/fs/msdosfs/msdosfs_vnops.c Fri Nov 23 22:24:59 2018 (r340856) @@ -1550,16 +1550,18 @@ msdosfs_readdir(struct vop_readdir_args *ap) switch (n) { case 0: dirbuf.d_namlen = 1; - strcpy(dirbuf.d_name, "."); + dirbuf.d_name[0] = '.'; break; case 1: dirbuf.d_namlen = 2; - strcpy(dirbuf.d_name, ".."); + dirbuf.d_name[0] = '.'; + dirbuf.d_name[1] = '.'; break; } dirbuf.d_reclen = GENERIC_DIRSIZ(&dirbuf); /* NOTE: d_off is the offset of the *next* entry. */ dirbuf.d_off = offset + sizeof(struct direntry); + dirent_terminate(&dirbuf); if (uio->uio_resid < dirbuf.d_reclen) goto out; error = uiomove(&dirbuf, dirbuf.d_reclen, uio); Modified: head/sys/fs/nandfs/nandfs_vnops.c ============================================================================== --- head/sys/fs/nandfs/nandfs_vnops.c Fri Nov 23 21:08:11 2018 (r340855) +++ head/sys/fs/nandfs/nandfs_vnops.c Fri Nov 23 22:24:59 2018 (r340856) @@ -1226,7 +1226,6 @@ nandfs_readdir(struct vop_readdir_args *ap) ndirent = (struct nandfs_dir_entry *)pos; name_len = ndirent->name_len; - memset(&dirent, 0, sizeof(struct dirent)); dirent.d_fileno = ndirent->inode; if (dirent.d_fileno) { dirent.d_type = ndirent->file_type; @@ -1235,6 +1234,7 @@ nandfs_readdir(struct vop_readdir_args *ap) dirent.d_reclen = GENERIC_DIRSIZ(&dirent); /* NOTE: d_off is the offset of the *next* entry. */ dirent.d_off = diroffset + ndirent->rec_len; + dirent_terminate(&dirent); DPRINTF(READDIR, ("copying `%*.*s`\n", name_len, name_len, dirent.d_name)); } @@ -1243,12 +1243,12 @@ nandfs_readdir(struct vop_readdir_args *ap) * If there isn't enough space in the uio to return a * whole dirent, break off read */ - if (uio->uio_resid < GENERIC_DIRSIZ(&dirent)) + if (uio->uio_resid < dirent.d_reclen) break; /* Transfer */ if (dirent.d_fileno) - uiomove(&dirent, GENERIC_DIRSIZ(&dirent), uio); + uiomove(&dirent, dirent.d_reclen, uio); /* Advance */ diroffset += ndirent->rec_len; Modified: head/sys/fs/pseudofs/pseudofs_vnops.c ============================================================================== --- head/sys/fs/pseudofs/pseudofs_vnops.c Fri Nov 23 21:08:11 2018 (r340855) +++ head/sys/fs/pseudofs/pseudofs_vnops.c Fri Nov 23 22:24:59 2018 (r340856) @@ -828,7 +828,6 @@ pfs_readdir(struct vop_readdir_args *va) /* PFS_DELEN was picked to fit PFS_NAMLEN */ for (i = 0; i < PFS_NAMELEN - 1 && pn->pn_name[i] != '\0'; ++i) pfsent->entry.d_name[i] = pn->pn_name[i]; - pfsent->entry.d_name[i] = 0; pfsent->entry.d_namlen = i; /* NOTE: d_off is the offset of the *next* entry. */ pfsent->entry.d_off = offset + PFS_DELEN; @@ -855,6 +854,7 @@ pfs_readdir(struct vop_readdir_args *va) panic("%s has unexpected node type: %d", pn->pn_name, pn->pn_type); } PFS_TRACE(("%s", pfsent->entry.d_name)); + dirent_terminate(&pfsent->entry); STAILQ_INSERT_TAIL(&lst, pfsent, link); offset += PFS_DELEN; resid -= PFS_DELEN; Modified: head/sys/fs/smbfs/smbfs_io.c ============================================================================== --- head/sys/fs/smbfs/smbfs_io.c Fri Nov 23 21:08:11 2018 (r340855) +++ head/sys/fs/smbfs/smbfs_io.c Fri Nov 23 22:24:59 2018 (r340856) @@ -106,8 +106,8 @@ smbfs_readvdir(struct vnode *vp, struct uio *uio, stru de.d_namlen = offset + 1; de.d_name[0] = '.'; de.d_name[1] = '.'; - de.d_name[offset + 1] = '\0'; de.d_type = DT_DIR; + dirent_terminate(&de); error = uiomove(&de, DE_SIZE, uio); if (error) goto out; @@ -156,7 +156,7 @@ smbfs_readvdir(struct vnode *vp, struct uio *uio, stru de.d_type = (ctx->f_attr.fa_attr & SMB_FA_DIR) ? DT_DIR : DT_REG; de.d_namlen = ctx->f_nmlen; bcopy(ctx->f_name, de.d_name, de.d_namlen); - de.d_name[de.d_namlen] = '\0'; + dirent_terminate(&de); if (smbfs_fastlookup) { error = smbfs_nget(vp->v_mount, vp, ctx->f_name, ctx->f_nmlen, &ctx->f_attr, &newvp); Modified: head/sys/fs/tmpfs/tmpfs_subr.c ============================================================================== --- head/sys/fs/tmpfs/tmpfs_subr.c Fri Nov 23 21:08:11 2018 (r340855) +++ head/sys/fs/tmpfs/tmpfs_subr.c Fri Nov 23 22:24:59 2018 (r340856) @@ -39,6 +39,7 @@ __FBSDID("$FreeBSD$"); #include +#include #include #include #include @@ -50,7 +51,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include @@ -1120,8 +1120,8 @@ tmpfs_dir_getdotdent(struct tmpfs_node *node, struct u dent.d_type = DT_DIR; dent.d_namlen = 1; dent.d_name[0] = '.'; - dent.d_name[1] = '\0'; dent.d_reclen = GENERIC_DIRSIZ(&dent); + dirent_terminate(&dent); if (dent.d_reclen > uio->uio_resid) error = EJUSTRETURN; @@ -1164,8 +1164,8 @@ tmpfs_dir_getdotdotdent(struct tmpfs_node *node, struc dent.d_namlen = 2; dent.d_name[0] = '.'; dent.d_name[1] = '.'; - dent.d_name[2] = '\0'; dent.d_reclen = GENERIC_DIRSIZ(&dent); + dirent_terminate(&dent); if (dent.d_reclen > uio->uio_resid) error = EJUSTRETURN; @@ -1285,8 +1285,8 @@ tmpfs_dir_getdents(struct tmpfs_node *node, struct uio d.d_namlen = de->td_namelen; MPASS(de->td_namelen < sizeof(d.d_name)); (void)memcpy(d.d_name, de->ud.td_name, de->td_namelen); - d.d_name[de->td_namelen] = '\0'; d.d_reclen = GENERIC_DIRSIZ(&d); + dirent_terminate(&d); /* Stop reading if the directory entry we are treating is * bigger than the amount of data that can be returned. */ Modified: head/sys/fs/tmpfs/tmpfs_vfsops.c ============================================================================== --- head/sys/fs/tmpfs/tmpfs_vfsops.c Fri Nov 23 21:08:11 2018 (r340855) +++ head/sys/fs/tmpfs/tmpfs_vfsops.c Fri Nov 23 22:24:59 2018 (r340856) @@ -46,6 +46,7 @@ __FBSDID("$FreeBSD$"); #include +#include #include #include #include @@ -56,7 +57,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include Modified: head/sys/fs/tmpfs/tmpfs_vnops.c ============================================================================== --- head/sys/fs/tmpfs/tmpfs_vnops.c Fri Nov 23 21:08:11 2018 (r340855) +++ head/sys/fs/tmpfs/tmpfs_vnops.c Fri Nov 23 22:24:59 2018 (r340856) @@ -39,6 +39,7 @@ __FBSDID("$FreeBSD$"); #include +#include #include #include #include @@ -51,7 +52,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include Modified: head/sys/fs/udf/udf_vnops.c ============================================================================== --- head/sys/fs/udf/udf_vnops.c Fri Nov 23 21:08:11 2018 (r340855) +++ head/sys/fs/udf/udf_vnops.c Fri Nov 23 22:24:59 2018 (r340856) @@ -843,10 +843,10 @@ udf_readdir(struct vop_readdir_args *a) dir.d_fileno = node->hash_id; dir.d_type = DT_DIR; dir.d_name[0] = '.'; - dir.d_name[1] = '\0'; dir.d_namlen = 1; dir.d_reclen = GENERIC_DIRSIZ(&dir); dir.d_off = 1; + dirent_terminate(&dir); uiodir.dirent = &dir; error = udf_uiodir(&uiodir, dir.d_reclen, uio, 1); if (error) @@ -856,10 +856,10 @@ udf_readdir(struct vop_readdir_args *a) dir.d_type = DT_DIR; dir.d_name[0] = '.'; dir.d_name[1] = '.'; - dir.d_name[2] = '\0'; dir.d_namlen = 2; dir.d_reclen = GENERIC_DIRSIZ(&dir); dir.d_off = 2; + dirent_terminate(&dir); uiodir.dirent = &dir; error = udf_uiodir(&uiodir, dir.d_reclen, uio, 2); } else { @@ -870,6 +870,7 @@ udf_readdir(struct vop_readdir_args *a) DT_DIR : DT_UNKNOWN; dir.d_reclen = GENERIC_DIRSIZ(&dir); dir.d_off = ds->this_off; + dirent_terminate(&dir); uiodir.dirent = &dir; error = udf_uiodir(&uiodir, dir.d_reclen, uio, ds->this_off); Modified: head/sys/kern/uipc_mqueue.c ============================================================================== --- head/sys/kern/uipc_mqueue.c Fri Nov 23 21:08:11 2018 (r340855) +++ head/sys/kern/uipc_mqueue.c Fri Nov 23 22:24:59 2018 (r340856) @@ -1428,7 +1428,6 @@ mqfs_readdir(struct vop_readdir_args *ap) entry.d_fileno = pn->mn_fileno; for (i = 0; i < MQFS_NAMELEN - 1 && pn->mn_name[i] != '\0'; ++i) entry.d_name[i] = pn->mn_name[i]; - entry.d_name[i] = 0; entry.d_namlen = i; switch (pn->mn_type) { case mqfstype_root: @@ -1447,6 +1446,7 @@ mqfs_readdir(struct vop_readdir_args *ap) panic("%s has unexpected node type: %d", pn->mn_name, pn->mn_type); } + dirent_terminate(&entry); if (entry.d_reclen > uio->uio_resid) break; if (offset >= uio->uio_offset) { Modified: head/sys/kern/vfs_export.c ============================================================================== --- head/sys/kern/vfs_export.c Fri Nov 23 21:08:11 2018 (r340855) +++ head/sys/kern/vfs_export.c Fri Nov 23 22:24:59 2018 (r340856) @@ -43,6 +43,7 @@ __FBSDID("$FreeBSD$"); #include "opt_inet6.h" #include +#include #include #include #include @@ -55,7 +56,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include Modified: head/sys/sys/dirent.h ============================================================================== --- head/sys/sys/dirent.h Fri Nov 23 21:08:11 2018 (r340855) +++ head/sys/sys/dirent.h Fri Nov 23 22:24:59 2018 (r340856) @@ -126,6 +126,19 @@ struct freebsd11_dirent { #ifdef _KERNEL #define GENERIC_DIRSIZ(dp) _GENERIC_DIRSIZ(dp) + +/* + * Ensure that padding bytes are zeroed and that the name is NUL-terminated. + */ +static inline void +dirent_terminate(struct dirent *dp) +{ + + dp->d_pad0 = 0; + dp->d_pad1 = 0; + memset(dp->d_name + dp->d_namlen, 0, + dp->d_reclen - (__offsetof(struct dirent, d_name) + dp->d_namlen)); +} #endif #endif /* !_SYS_DIRENT_H_ */ Modified: head/sys/ufs/ufs/ufs_vnops.c ============================================================================== --- head/sys/ufs/ufs/ufs_vnops.c Fri Nov 23 21:08:11 2018 (r340855) +++ head/sys/ufs/ufs/ufs_vnops.c Fri Nov 23 22:24:59 2018 (r340856) @@ -2217,9 +2217,9 @@ ufs_readdir(ap) dstdp.d_fileno = dp->d_ino; dstdp.d_reclen = GENERIC_DIRSIZ(&dstdp); bcopy(dp->d_name, dstdp.d_name, dstdp.d_namlen); - dstdp.d_name[dstdp.d_namlen] = '\0'; /* NOTE: d_off is the offset of the *next* entry. */ dstdp.d_off = offset + dp->d_reclen; + dirent_terminate(&dstdp); if (dstdp.d_reclen > uio->uio_resid) { if (uio->uio_resid == startresid) error = EINVAL; From owner-svn-src-all@freebsd.org Fri Nov 23 22:36:57 2018 Return-Path: Delivered-To: svn-src-all@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 3B961113314F; Fri, 23 Nov 2018 22:36:57 +0000 (UTC) (envelope-from sobomax@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.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 AF818778ED; Fri, 23 Nov 2018 22:36:56 +0000 (UTC) (envelope-from sobomax@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8BC3024E02; Fri, 23 Nov 2018 22:36:56 +0000 (UTC) (envelope-from sobomax@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wANMauKl016900; Fri, 23 Nov 2018 22:36:56 GMT (envelope-from sobomax@FreeBSD.org) Received: (from sobomax@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wANMau1c016899; Fri, 23 Nov 2018 22:36:56 GMT (envelope-from sobomax@FreeBSD.org) Message-Id: <201811232236.wANMau1c016899@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sobomax set sender to sobomax@FreeBSD.org using -f From: Maxim Sobolev Date: Fri, 23 Nov 2018 22:36:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340857 - head/stand/common X-SVN-Group: head X-SVN-Commit-Author: sobomax X-SVN-Commit-Paths: head/stand/common X-SVN-Commit-Revision: 340857 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: AF818778ED X-Spamd-Result: default: False [1.56 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.41)[0.415,0]; NEURAL_SPAM_MEDIUM(0.73)[0.730,0]; NEURAL_SPAM_LONG(0.42)[0.420,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Nov 2018 22:36:57 -0000 Author: sobomax Date: Fri Nov 23 22:36:56 2018 New Revision: 340857 URL: https://svnweb.freebsd.org/changeset/base/340857 Log: Nuke out buffer overflow safety marker code, it duplicates similar code in the malloc()/free() as well as having potential of softening the handling in case error is detected down to a mere warning as compared to hard panic in free(). Submitted by: tsoome Differential Revision: https://reviews.freebsd.org/D18299 Modified: head/stand/common/bcache.c Modified: head/stand/common/bcache.c ============================================================================== --- head/stand/common/bcache.c Fri Nov 23 22:24:59 2018 (r340856) +++ head/stand/common/bcache.c Fri Nov 23 22:36:56 2018 (r340857) @@ -86,7 +86,6 @@ static u_int bcache_rablks; ((bc)->bcache_ctl[BHASH((bc), (blkno))].bc_blkno != (blkno)) #define BCACHE_READAHEAD 256 #define BCACHE_MINREADAHEAD 32 -#define BCACHE_MARKER 0xdeadbeef static void bcache_invalidate(struct bcache *bc, daddr_t blkno); static void bcache_insert(struct bcache *bc, daddr_t blkno); @@ -123,7 +122,6 @@ bcache_allocate(void) u_int i; struct bcache *bc = malloc(sizeof (struct bcache)); int disks = bcache_numdev; - uint32_t *marker; if (disks == 0) disks = 1; /* safe guard */ @@ -142,8 +140,7 @@ bcache_allocate(void) bc->bcache_nblks = bcache_total_nblks >> i; bcache_unit_nblks = bc->bcache_nblks; - bc->bcache_data = malloc(bc->bcache_nblks * bcache_blksize + - sizeof(uint32_t)); + bc->bcache_data = malloc(bc->bcache_nblks * bcache_blksize); if (bc->bcache_data == NULL) { /* dont error out yet. fall back to 32 blocks and try again */ bc->bcache_nblks = 32; @@ -158,9 +155,6 @@ bcache_allocate(void) errno = ENOMEM; return (NULL); } - /* Insert cache end marker. */ - marker = (uint32_t *)(bc->bcache_data + bc->bcache_nblks * bcache_blksize); - *marker = BCACHE_MARKER; /* Flush the cache */ for (i = 0; i < bc->bcache_nblks; i++) { @@ -222,15 +216,12 @@ read_strategy(void *devdata, int rw, daddr_t blk, size int result; daddr_t p_blk; caddr_t p_buf; - uint32_t *marker; if (bc == NULL) { errno = ENODEV; return (-1); } - marker = (uint32_t *)(bc->bcache_data + bc->bcache_nblks * bcache_blksize); - if (rsize != NULL) *rsize = 0; @@ -348,12 +339,6 @@ read_strategy(void *devdata, int rw, daddr_t blk, size if (size != 0) { bcopy(bc->bcache_data + (bcache_blksize * BHASH(bc, blk)), buf, size); result = 0; - } - - if (*marker != BCACHE_MARKER) { - printf("BUG: bcache corruption detected: nblks: %zu p_blk: %lu, " - "p_size: %zu, ra: %zu\n", bc->bcache_nblks, - (long unsigned)BHASH(bc, p_blk), p_size, ra); } done: From owner-svn-src-all@freebsd.org Fri Nov 23 22:37:36 2018 Return-Path: Delivered-To: svn-src-all@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 D5FE511331A8; Fri, 23 Nov 2018 22:37:36 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 76CAD77A3B; Fri, 23 Nov 2018 22:37:36 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 58D5424E07; Fri, 23 Nov 2018 22:37:36 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wANMbaQI017004; Fri, 23 Nov 2018 22:37:36 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wANMbaWc017002; Fri, 23 Nov 2018 22:37:36 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201811232237.wANMbaWc017002@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 23 Nov 2018 22:37:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340858 - head/libexec/rtld-elf X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/libexec/rtld-elf X-SVN-Commit-Revision: 340858 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 76CAD77A3B X-Spamd-Result: default: False [1.52 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.40)[0.400,0]; NEURAL_SPAM_SHORT(0.41)[0.405,0]; NEURAL_SPAM_MEDIUM(0.71)[0.712,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Nov 2018 22:37:37 -0000 Author: kib Date: Fri Nov 23 22:37:35 2018 New Revision: 340858 URL: https://svnweb.freebsd.org/changeset/base/340858 Log: rtld: parse FreeBSD Feature Control note on the object load. Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Modified: head/libexec/rtld-elf/rtld.c head/libexec/rtld-elf/rtld.h Modified: head/libexec/rtld-elf/rtld.c ============================================================================== --- head/libexec/rtld-elf/rtld.c Fri Nov 23 22:36:56 2018 (r340857) +++ head/libexec/rtld-elf/rtld.c Fri Nov 23 22:37:35 2018 (r340858) @@ -1477,6 +1477,7 @@ digest_notes(Obj_Entry *obj, Elf_Addr note_start, Elf_ note->n_descsz != sizeof(int32_t)) continue; if (note->n_type != NT_FREEBSD_ABI_TAG && + note->n_type != NT_FREEBSD_FEATURE_CTL && note->n_type != NT_FREEBSD_NOINIT_TAG) continue; note_name = (const char *)(note + 1); @@ -1490,6 +1491,13 @@ digest_notes(Obj_Entry *obj, Elf_Addr note_start, Elf_ p += roundup2(note->n_namesz, sizeof(Elf32_Addr)); obj->osrel = *(const int32_t *)(p); dbg("note osrel %d", obj->osrel); + break; + case NT_FREEBSD_FEATURE_CTL: + /* FreeBSD ABI feature control note */ + p = (uintptr_t)(note + 1); + p += roundup2(note->n_namesz, sizeof(Elf32_Addr)); + obj->fctl0 = *(const uint32_t *)(p); + dbg("note fctl0 %#x", obj->fctl0); break; case NT_FREEBSD_NOINIT_TAG: /* FreeBSD 'crt does not call init' note */ Modified: head/libexec/rtld-elf/rtld.h ============================================================================== --- head/libexec/rtld-elf/rtld.h Fri Nov 23 22:36:56 2018 (r340857) +++ head/libexec/rtld-elf/rtld.h Fri Nov 23 22:37:35 2018 (r340858) @@ -235,6 +235,7 @@ typedef struct Struct_Obj_Entry { int fini_array_num; /* Number of entries in fini_array */ int32_t osrel; /* OSREL note value */ + uint32_t fctl0; /* FEATURE_CONTROL note desc[0] value */ bool mainprog : 1; /* True if this is the main program */ bool rtld : 1; /* True if this is the dynamic linker */ From owner-svn-src-all@freebsd.org Fri Nov 23 23:07:51 2018 Return-Path: Delivered-To: svn-src-all@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 E59F311339F8; Fri, 23 Nov 2018 23:07:50 +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 62B197872F; Fri, 23 Nov 2018 23:07:50 +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 35397252D7; Fri, 23 Nov 2018 23:07:50 +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 wANN7obi032723; Fri, 23 Nov 2018 23:07:50 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wANN7oNH032722; Fri, 23 Nov 2018 23:07:50 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201811232307.wANN7oNH032722@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Fri, 23 Nov 2018 23:07:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340859 - head/sys/fs/nandfs X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/fs/nandfs X-SVN-Commit-Revision: 340859 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 62B197872F X-Spamd-Result: default: False [1.61 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.50)[0.502,0]; NEURAL_SPAM_MEDIUM(0.71)[0.712,0]; NEURAL_SPAM_LONG(0.40)[0.400,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Nov 2018 23:07:51 -0000 Author: markj Date: Fri Nov 23 23:07:49 2018 New Revision: 340859 URL: https://svnweb.freebsd.org/changeset/base/340859 Log: Ensure the dirent remains initialized when dirent.d_fileno is unset. Reported by: rmacklem MFC with: r340856 Sponsored by: The FreeBSD Foundation Modified: head/sys/fs/nandfs/nandfs_vnops.c Modified: head/sys/fs/nandfs/nandfs_vnops.c ============================================================================== --- head/sys/fs/nandfs/nandfs_vnops.c Fri Nov 23 22:37:35 2018 (r340858) +++ head/sys/fs/nandfs/nandfs_vnops.c Fri Nov 23 23:07:49 2018 (r340859) @@ -1226,6 +1226,7 @@ nandfs_readdir(struct vop_readdir_args *ap) ndirent = (struct nandfs_dir_entry *)pos; name_len = ndirent->name_len; + memset(&dirent, 0, sizeof(dirent)); dirent.d_fileno = ndirent->inode; if (dirent.d_fileno) { dirent.d_type = ndirent->file_type; @@ -1243,7 +1244,7 @@ nandfs_readdir(struct vop_readdir_args *ap) * If there isn't enough space in the uio to return a * whole dirent, break off read */ - if (uio->uio_resid < dirent.d_reclen) + if (uio->uio_resid < GENERIC_DIRSIZ(&dirent)) break; /* Transfer */ From owner-svn-src-all@freebsd.org Fri Nov 23 23:08:04 2018 Return-Path: Delivered-To: svn-src-all@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 0F7151133A1A; Fri, 23 Nov 2018 23:08:04 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 695337880B; Fri, 23 Nov 2018 23:08:02 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 40E20252D8; Fri, 23 Nov 2018 23:07:58 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wANN7wAF032779; Fri, 23 Nov 2018 23:07:58 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wANN7vYH032776; Fri, 23 Nov 2018 23:07:57 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201811232307.wANN7vYH032776@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 23 Nov 2018 23:07:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340860 - in head/sys: kern sys X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in head/sys: kern sys X-SVN-Commit-Revision: 340860 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 695337880B X-Spamd-Result: default: False [1.66 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.42)[0.420,0]; NEURAL_SPAM_MEDIUM(0.73)[0.730,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.51)[0.506,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Nov 2018 23:08:04 -0000 Author: kib Date: Fri Nov 23 23:07:57 2018 New Revision: 340860 URL: https://svnweb.freebsd.org/changeset/base/340860 Log: Provide storage for the process feature control flags in struct proc. The flags are cleared on exec, it is up to the image activator to set them. Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Modified: head/sys/kern/kern_exec.c head/sys/kern/kern_thread.c head/sys/sys/proc.h Modified: head/sys/kern/kern_exec.c ============================================================================== --- head/sys/kern/kern_exec.c Fri Nov 23 23:07:49 2018 (r340859) +++ head/sys/kern/kern_exec.c Fri Nov 23 23:07:57 2018 (r340860) @@ -488,6 +488,7 @@ interpret: goto exec_fail_dealloc; imgp->proc->p_osrel = 0; + imgp->proc->p_fctl0 = 0; /* * Implement image setuid/setgid. Modified: head/sys/kern/kern_thread.c ============================================================================== --- head/sys/kern/kern_thread.c Fri Nov 23 23:07:49 2018 (r340859) +++ head/sys/kern/kern_thread.c Fri Nov 23 23:07:57 2018 (r340860) @@ -92,9 +92,9 @@ _Static_assert(offsetof(struct proc, p_pid) == 0xbc, "struct proc KBI p_pid"); _Static_assert(offsetof(struct proc, p_filemon) == 0x3d0, "struct proc KBI p_filemon"); -_Static_assert(offsetof(struct proc, p_comm) == 0x3e4, +_Static_assert(offsetof(struct proc, p_comm) == 0x3e8, "struct proc KBI p_comm"); -_Static_assert(offsetof(struct proc, p_emuldata) == 0x4b8, +_Static_assert(offsetof(struct proc, p_emuldata) == 0x4c0, "struct proc KBI p_emuldata"); #endif #ifdef __i386__ @@ -112,9 +112,9 @@ _Static_assert(offsetof(struct proc, p_pid) == 0x74, "struct proc KBI p_pid"); _Static_assert(offsetof(struct proc, p_filemon) == 0x27c, "struct proc KBI p_filemon"); -_Static_assert(offsetof(struct proc, p_comm) == 0x28c, +_Static_assert(offsetof(struct proc, p_comm) == 0x290, "struct proc KBI p_comm"); -_Static_assert(offsetof(struct proc, p_emuldata) == 0x318, +_Static_assert(offsetof(struct proc, p_emuldata) == 0x31c, "struct proc KBI p_emuldata"); #endif Modified: head/sys/sys/proc.h ============================================================================== --- head/sys/sys/proc.h Fri Nov 23 23:07:49 2018 (r340859) +++ head/sys/sys/proc.h Fri Nov 23 23:07:57 2018 (r340860) @@ -642,6 +642,7 @@ struct proc { u_int p_magic; /* (b) Magic number. */ int p_osrel; /* (x) osreldate for the binary (from ELF note, if any) */ + uint32_t p_fctl0; /* (x) ABI feature control, ELF note */ char p_comm[MAXCOMLEN + 1]; /* (x) Process name. */ struct sysentvec *p_sysent; /* (b) Syscall dispatch info. */ struct pargs *p_args; /* (c) Process arguments. */ From owner-svn-src-all@freebsd.org Fri Nov 23 23:10:04 2018 Return-Path: Delivered-To: svn-src-all@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 DF58C1133B0B; Fri, 23 Nov 2018 23:10:04 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.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 8429B78E21; Fri, 23 Nov 2018 23:10:04 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 65520252DE; Fri, 23 Nov 2018 23:10:04 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wANNA4bq032946; Fri, 23 Nov 2018 23:10:04 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wANNA4ct032945; Fri, 23 Nov 2018 23:10:04 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201811232310.wANNA4ct032945@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Fri, 23 Nov 2018 23:10:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340861 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 340861 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 8429B78E21 X-Spamd-Result: default: False [1.61 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.40)[0.400,0]; NEURAL_SPAM_MEDIUM(0.71)[0.712,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.50)[0.502,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Nov 2018 23:10:05 -0000 Author: markj Date: Fri Nov 23 23:10:03 2018 New Revision: 340861 URL: https://svnweb.freebsd.org/changeset/base/340861 Log: Honour the waitok parameter in kevent_expand(). Reviewed by: kib MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D18316 Modified: head/sys/kern/kern_event.c Modified: head/sys/kern/kern_event.c ============================================================================== --- head/sys/kern/kern_event.c Fri Nov 23 23:07:57 2018 (r340860) +++ head/sys/kern/kern_event.c Fri Nov 23 23:10:03 2018 (r340861) @@ -1686,10 +1686,6 @@ kqueue_schedtask(struct kqueue *kq) * Expand the kq to make sure we have storage for fops/ident pair. * * Return 0 on success (or no work necessary), return errno on failure. - * - * Not calling hashinit w/ waitok (proper malloc flag) should be safe. - * If kqueue_register is called from a non-fd context, there usually/should - * be no locks held. */ static int kqueue_expand(struct kqueue *kq, struct filterops *fops, uintptr_t ident, @@ -1734,8 +1730,9 @@ kqueue_expand(struct kqueue *kq, struct filterops *fop } } else { if (kq->kq_knhashmask == 0) { - tmp_knhash = hashinit(KN_HASHSIZE, M_KQUEUE, - &tmp_knhashmask); + tmp_knhash = hashinit_flags(KN_HASHSIZE, M_KQUEUE, + &tmp_knhashmask, + waitok ? HASH_WAITOK : HASH_NOWAIT); if (tmp_knhash == NULL) return ENOMEM; KQ_LOCK(kq); From owner-svn-src-all@freebsd.org Fri Nov 23 23:16:02 2018 Return-Path: Delivered-To: svn-src-all@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 A44461133FDD; Fri, 23 Nov 2018 23:16:02 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6BB6579351; Fri, 23 Nov 2018 23:16:02 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 482B425472; Fri, 23 Nov 2018 23:16:02 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wANNG2DZ037678; Fri, 23 Nov 2018 23:16:02 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wANNG2nK037677; Fri, 23 Nov 2018 23:16:02 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201811232316.wANNG2nK037677@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 23 Nov 2018 23:16:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340862 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 340862 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 6BB6579351 X-Spamd-Result: default: False [1.61 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.50)[0.502,0]; NEURAL_SPAM_MEDIUM(0.71)[0.712,0]; NEURAL_SPAM_LONG(0.40)[0.400,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Nov 2018 23:16:02 -0000 Author: kib Date: Fri Nov 23 23:16:01 2018 New Revision: 340862 URL: https://svnweb.freebsd.org/changeset/base/340862 Log: Trivial reduction of the code duplication, reuse the return FALSE code. Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Modified: head/sys/kern/imgact_elf.c Modified: head/sys/kern/imgact_elf.c ============================================================================== --- head/sys/kern/imgact_elf.c Fri Nov 23 23:10:03 2018 (r340861) +++ head/sys/kern/imgact_elf.c Fri Nov 23 23:16:01 2018 (r340862) @@ -2364,8 +2364,7 @@ __elfN(parse_notes)(struct image_params *imgp, Elf_Bra curthread->td_ucred, NOCRED, NULL, curthread); if (error != 0) { uprintf("i/o error PT_NOTE\n"); - res = FALSE; - goto ret; + goto retf; } note = note0 = (const Elf_Note *)buf; note_end = (const Elf_Note *)(buf + pnote->p_filesz); @@ -2379,8 +2378,7 @@ __elfN(parse_notes)(struct image_params *imgp, Elf_Bra for (i = 0; i < 100 && note >= note0 && note < note_end; i++) { if (!aligned(note, Elf32_Addr) || (const char *)note_end - (const char *)note < sizeof(Elf_Note)) { - res = FALSE; - goto ret; + goto retf; } if (note->n_namesz != checknote->hdr.n_namesz || note->n_descsz != checknote->hdr.n_descsz || @@ -2408,6 +2406,7 @@ nextnote: roundup2(note->n_namesz, ELF_NOTE_ROUNDSIZE) + roundup2(note->n_descsz, ELF_NOTE_ROUNDSIZE)); } +retf: res = FALSE; ret: free(buf, M_TEMP); From owner-svn-src-all@freebsd.org Fri Nov 23 23:29:15 2018 Return-Path: Delivered-To: svn-src-all@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 0FC94113453B; Fri, 23 Nov 2018 23:29:15 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AA5E5798A3; Fri, 23 Nov 2018 23:29:14 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 865E325633; Fri, 23 Nov 2018 23:29:14 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wANNTE16042908; Fri, 23 Nov 2018 23:29:14 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wANNTEAx042907; Fri, 23 Nov 2018 23:29:14 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201811232329.wANNTEAx042907@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 23 Nov 2018 23:29:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340863 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 340863 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: AA5E5798A3 X-Spamd-Result: default: False [1.66 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.42)[0.420,0]; NEURAL_SPAM_SHORT(0.51)[0.506,0]; NEURAL_SPAM_MEDIUM(0.73)[0.730,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Nov 2018 23:29:15 -0000 Author: kib Date: Fri Nov 23 23:29:14 2018 New Revision: 340863 URL: https://svnweb.freebsd.org/changeset/base/340863 Log: Generalize ELF parse_notes(). Remove the knowledge of the ABI note type and brandnote from it, instead provide it with a callback to do note-specific matching and data fetching. Implement callback to match against ELF brand. Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Modified: head/sys/kern/imgact_elf.c Modified: head/sys/kern/imgact_elf.c ============================================================================== --- head/sys/kern/imgact_elf.c Fri Nov 23 23:16:01 2018 (r340862) +++ head/sys/kern/imgact_elf.c Fri Nov 23 23:29:14 2018 (r340863) @@ -2341,8 +2341,9 @@ __elfN(note_procstat_auxv)(void *arg, struct sbuf *sb, } static boolean_t -__elfN(parse_notes)(struct image_params *imgp, Elf_Brandnote *checknote, - int32_t *osrel, const Elf_Phdr *pnote) +__elfN(parse_notes)(struct image_params *imgp, Elf_Note *checknote, + const char *note_vendor, const Elf_Phdr *pnote, + boolean_t (*cb)(const Elf_Note *, void *, boolean_t *), void *cb_arg) { const Elf_Note *note, *note0, *note_end; const char *note_name; @@ -2380,27 +2381,18 @@ __elfN(parse_notes)(struct image_params *imgp, Elf_Bra (const char *)note < sizeof(Elf_Note)) { goto retf; } - if (note->n_namesz != checknote->hdr.n_namesz || - note->n_descsz != checknote->hdr.n_descsz || - note->n_type != checknote->hdr.n_type) + if (note->n_namesz != checknote->n_namesz || + note->n_descsz != checknote->n_descsz || + note->n_type != checknote->n_type) goto nextnote; note_name = (const char *)(note + 1); - if (note_name + checknote->hdr.n_namesz >= - (const char *)note_end || strncmp(checknote->vendor, - note_name, checknote->hdr.n_namesz) != 0) + if (note_name + checknote->n_namesz >= + (const char *)note_end || strncmp(note_vendor, + note_name, checknote->n_namesz) != 0) goto nextnote; - /* - * Fetch the osreldate for binary - * from the ELF OSABI-note if necessary. - */ - if ((checknote->flags & BN_TRANSLATE_OSREL) != 0 && - checknote->trans_osrel != NULL) { - res = checknote->trans_osrel(note, osrel); + if (cb(note, cb_arg, &res)) goto ret; - } - res = TRUE; - goto ret; nextnote: note = (const Elf_Note *)((const char *)(note + 1) + roundup2(note->n_namesz, ELF_NOTE_ROUNDSIZE) + @@ -2413,26 +2405,54 @@ ret: return (res); } +struct brandnote_cb_arg { + Elf_Brandnote *brandnote; + int32_t *osrel; +}; + +static boolean_t +brandnote_cb(const Elf_Note *note, void *arg0, boolean_t *res) +{ + struct brandnote_cb_arg *arg; + + arg = arg0; + + /* + * Fetch the osreldate for binary from the ELF OSABI-note if + * necessary. + */ + *res = (arg->brandnote->flags & BN_TRANSLATE_OSREL) != 0 && + arg->brandnote->trans_osrel != NULL ? + arg->brandnote->trans_osrel(note, arg->osrel) : TRUE; + + return (TRUE); +} + /* * Try to find the appropriate ABI-note section for checknote, * fetch the osreldate for binary from the ELF OSABI-note. Only the * first page of the image is searched, the same as for headers. */ static boolean_t -__elfN(check_note)(struct image_params *imgp, Elf_Brandnote *checknote, +__elfN(check_note)(struct image_params *imgp, Elf_Brandnote *brandnote, int32_t *osrel) { const Elf_Phdr *phdr; const Elf_Ehdr *hdr; + struct brandnote_cb_arg b_arg; int i; hdr = (const Elf_Ehdr *)imgp->image_header; phdr = (const Elf_Phdr *)(imgp->image_header + hdr->e_phoff); + b_arg.brandnote = brandnote; + b_arg.osrel = osrel; for (i = 0; i < hdr->e_phnum; i++) { - if (phdr[i].p_type == PT_NOTE && - __elfN(parse_notes)(imgp, checknote, osrel, &phdr[i])) + if (phdr[i].p_type == PT_NOTE && __elfN(parse_notes)(imgp, + &brandnote->hdr, brandnote->vendor, &phdr[i], brandnote_cb, + &b_arg)) { return (TRUE); + } } return (FALSE); From owner-svn-src-all@freebsd.org Fri Nov 23 23:33:56 2018 Return-Path: Delivered-To: svn-src-all@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 6F98B1134782; Fri, 23 Nov 2018 23:33:56 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.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 0F3C579D62; Fri, 23 Nov 2018 23:33:56 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C5D2E257C5; Fri, 23 Nov 2018 23:33:55 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wANNXta3047713; Fri, 23 Nov 2018 23:33:55 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wANNXtts047712; Fri, 23 Nov 2018 23:33:55 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201811232333.wANNXtts047712@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 23 Nov 2018 23:33:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340864 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 340864 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 0F3C579D62 X-Spamd-Result: default: False [1.66 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.42)[0.420,0]; NEURAL_SPAM_MEDIUM(0.73)[0.730,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.51)[0.506,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Nov 2018 23:33:56 -0000 Author: kib Date: Fri Nov 23 23:33:55 2018 New Revision: 340864 URL: https://svnweb.freebsd.org/changeset/base/340864 Log: Parse FreeBSD Feature Control note on the ELF image activation. Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Modified: head/sys/kern/imgact_elf.c Modified: head/sys/kern/imgact_elf.c ============================================================================== --- head/sys/kern/imgact_elf.c Fri Nov 23 23:29:14 2018 (r340863) +++ head/sys/kern/imgact_elf.c Fri Nov 23 23:33:55 2018 (r340864) @@ -88,7 +88,7 @@ __FBSDID("$FreeBSD$"); static int __elfN(check_header)(const Elf_Ehdr *hdr); static Elf_Brandinfo *__elfN(get_brandinfo)(struct image_params *imgp, - const char *interp, int interp_name_len, int32_t *osrel); + const char *interp, int interp_name_len, int32_t *osrel, uint32_t *fctl0); static int __elfN(load_file)(struct proc *p, const char *file, u_long *addr, u_long *entry, size_t pagesize); static int __elfN(load_section)(struct image_params *imgp, vm_ooffset_t offset, @@ -99,7 +99,7 @@ static bool __elfN(freebsd_trans_osrel)(const Elf_Note int32_t *osrel); static bool kfreebsd_trans_osrel(const Elf_Note *note, int32_t *osrel); static boolean_t __elfN(check_note)(struct image_params *imgp, - Elf_Brandnote *checknote, int32_t *osrel); + Elf_Brandnote *checknote, int32_t *osrel, uint32_t *fctl0); static vm_prot_t __elfN(trans_prot)(Elf_Word); static Elf_Word __elfN(untrans_prot)(vm_prot_t); @@ -256,7 +256,7 @@ __elfN(brand_inuse)(Elf_Brandinfo *entry) static Elf_Brandinfo * __elfN(get_brandinfo)(struct image_params *imgp, const char *interp, - int interp_name_len, int32_t *osrel) + int interp_name_len, int32_t *osrel, uint32_t *fctl0) { const Elf_Ehdr *hdr = (const Elf_Ehdr *)imgp->image_header; Elf_Brandinfo *bi, *bi_m; @@ -280,7 +280,8 @@ __elfN(get_brandinfo)(struct image_params *imgp, const continue; if (hdr->e_machine == bi->machine && (bi->flags & (BI_BRAND_NOTE|BI_BRAND_NOTE_MANDATORY)) != 0) { - ret = __elfN(check_note)(imgp, bi->brand_note, osrel); + ret = __elfN(check_note)(imgp, bi->brand_note, osrel, + fctl0); /* Give brand a chance to veto check_note's guess */ if (ret && bi->header_supported) ret = bi->header_supported(imgp); @@ -789,6 +790,7 @@ __CONCAT(exec_, __elfN(imgact))(struct image_params *i vm_prot_t prot; u_long text_size, data_size, total_size, text_addr, data_addr; u_long seg_size, seg_addr, addr, baddr, et_dyn_addr, entry, proghdr; + uint32_t fctl0; int32_t osrel; int error, i, n, interp_name_len, have_interp; @@ -824,6 +826,7 @@ __CONCAT(exec_, __elfN(imgact))(struct image_params *i n = error = 0; baddr = 0; osrel = 0; + fctl0 = 0; text_size = data_size = total_size = text_addr = data_addr = 0; entry = proghdr = 0; interp_name_len = 0; @@ -889,7 +892,7 @@ __CONCAT(exec_, __elfN(imgact))(struct image_params *i } brand_info = __elfN(get_brandinfo)(imgp, interp, interp_name_len, - &osrel); + &osrel, &fctl0); if (brand_info == NULL) { uprintf("ELF binary type \"%u\" not known.\n", hdr->e_ident[EI_OSABI]); @@ -1092,6 +1095,7 @@ __CONCAT(exec_, __elfN(imgact))(struct image_params *i imgp->interpreted = 0; imgp->reloc_base = addr; imgp->proc->p_osrel = osrel; + imgp->proc->p_fctl0 = fctl0; imgp->proc->p_elf_machine = hdr->e_machine; imgp->proc->p_elf_flags = hdr->e_flags; @@ -2428,29 +2432,64 @@ brandnote_cb(const Elf_Note *note, void *arg0, boolean return (TRUE); } +static Elf_Note fctl_note = { + .n_namesz = sizeof(FREEBSD_ABI_VENDOR), + .n_descsz = sizeof(uint32_t), + .n_type = NT_FREEBSD_FEATURE_CTL, +}; + +struct fctl_cb_arg { + uint32_t *fctl0; +}; + +static boolean_t +note_fctl_cb(const Elf_Note *note, void *arg0, boolean_t *res) +{ + struct fctl_cb_arg *arg; + const Elf32_Word *desc; + uintptr_t p; + + arg = arg0; + p = (uintptr_t)(note + 1); + p += roundup2(note->n_namesz, ELF_NOTE_ROUNDSIZE); + desc = (const Elf32_Word *)p; + *arg->fctl0 = desc[0]; + return (TRUE); +} + /* - * Try to find the appropriate ABI-note section for checknote, - * fetch the osreldate for binary from the ELF OSABI-note. Only the - * first page of the image is searched, the same as for headers. + * Try to find the appropriate ABI-note section for checknote, fetch + * the osreldate and feature control flags for binary from the ELF + * OSABI-note. Only the first page of the image is searched, the same + * as for headers. */ static boolean_t __elfN(check_note)(struct image_params *imgp, Elf_Brandnote *brandnote, - int32_t *osrel) + int32_t *osrel, uint32_t *fctl0) { const Elf_Phdr *phdr; const Elf_Ehdr *hdr; struct brandnote_cb_arg b_arg; - int i; + struct fctl_cb_arg f_arg; + int i, j; hdr = (const Elf_Ehdr *)imgp->image_header; phdr = (const Elf_Phdr *)(imgp->image_header + hdr->e_phoff); b_arg.brandnote = brandnote; b_arg.osrel = osrel; + f_arg.fctl0 = fctl0; for (i = 0; i < hdr->e_phnum; i++) { if (phdr[i].p_type == PT_NOTE && __elfN(parse_notes)(imgp, &brandnote->hdr, brandnote->vendor, &phdr[i], brandnote_cb, &b_arg)) { + for (j = 0; j < hdr->e_phnum; j++) { + if (phdr[j].p_type == PT_NOTE && + __elfN(parse_notes)(imgp, &fctl_note, + FREEBSD_ABI_VENDOR, &phdr[j], + note_fctl_cb, &f_arg)) + break; + } return (TRUE); } } From owner-svn-src-all@freebsd.org Sat Nov 24 01:15:12 2018 Return-Path: Delivered-To: svn-src-all@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 563A6113676B; Sat, 24 Nov 2018 01:15:12 +0000 (UTC) (envelope-from mm@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 0A01C7C6B3; Sat, 24 Nov 2018 01:15:12 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C79FF268A1; Sat, 24 Nov 2018 01:15:11 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAO1FBGX098919; Sat, 24 Nov 2018 01:15:11 GMT (envelope-from mm@FreeBSD.org) Received: (from mm@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAO1F9K5098905; Sat, 24 Nov 2018 01:15:09 GMT (envelope-from mm@FreeBSD.org) Message-Id: <201811240115.wAO1F9K5098905@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mm set sender to mm@FreeBSD.org using -f From: Martin Matuska Date: Sat, 24 Nov 2018 01:15:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r340865 - in vendor/libarchive/dist: build/cmake cpio libarchive libarchive/test tar X-SVN-Group: vendor X-SVN-Commit-Author: mm X-SVN-Commit-Paths: in vendor/libarchive/dist: build/cmake cpio libarchive libarchive/test tar X-SVN-Commit-Revision: 340865 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 0A01C7C6B3 X-Spamd-Result: default: False [1.41 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.46)[0.458,0]; NEURAL_SPAM_MEDIUM(0.76)[0.762,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.19)[0.194,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Nov 2018 01:15:12 -0000 Author: mm Date: Sat Nov 24 01:15:08 2018 New Revision: 340865 URL: https://svnweb.freebsd.org/changeset/base/340865 Log: Update vendor/libarchive/dist to git 0e416f2fe757ad6841dbb3386a17d88b5c9f5533 Relevant vendor changes: PR #1080: Spelling fixes PR #1084: RAR5 reader bugfixes PR #1091: fix use-after-free in delayed newc link processing PR #1092: Fix a few obvious resource leaks and strcpy() misuses Modified: vendor/libarchive/dist/build/cmake/config.h.in vendor/libarchive/dist/cpio/cpio.c vendor/libarchive/dist/libarchive/archive_acl.c vendor/libarchive/dist/libarchive/archive_read_support_format_rar5.c vendor/libarchive/dist/libarchive/archive_windows.c vendor/libarchive/dist/libarchive/archive_write_set_format_iso9660.c vendor/libarchive/dist/libarchive/archive_write_set_format_mtree.c vendor/libarchive/dist/libarchive/archive_write_set_format_pax.c vendor/libarchive/dist/libarchive/archive_write_set_format_xar.c vendor/libarchive/dist/libarchive/test/test_fuzz.c vendor/libarchive/dist/libarchive/test/test_read_format_rar5.c vendor/libarchive/dist/libarchive/test/test_write_disk_perms.c vendor/libarchive/dist/tar/write.c Modified: vendor/libarchive/dist/build/cmake/config.h.in ============================================================================== --- vendor/libarchive/dist/build/cmake/config.h.in Fri Nov 23 23:33:55 2018 (r340864) +++ vendor/libarchive/dist/build/cmake/config.h.in Sat Nov 24 01:15:08 2018 (r340865) @@ -680,6 +680,12 @@ typedef uint64_t uintmax_t; /* Define to 1 if you have the `bz2' library (-lbz2). */ #cmakedefine HAVE_LIBBZ2 1 +/* Define to 1 if you have the `b2' library (-lb2). */ +#cmakedefine HAVE_LIBB2 1 + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_BLAKE2_H 1 + /* Define to 1 if you have the `charset' library (-lcharset). */ #cmakedefine HAVE_LIBCHARSET 1 Modified: vendor/libarchive/dist/cpio/cpio.c ============================================================================== --- vendor/libarchive/dist/cpio/cpio.c Fri Nov 23 23:33:55 2018 (r340864) +++ vendor/libarchive/dist/cpio/cpio.c Sat Nov 24 01:15:08 2018 (r340865) @@ -755,8 +755,10 @@ file_to_archive(struct cpio *cpio, const char *srcpath } if (cpio->option_rename) destpath = cpio_rename(destpath); - if (destpath == NULL) + if (destpath == NULL) { + archive_entry_free(entry); return (0); + } archive_entry_copy_pathname(entry, destpath); /* Modified: vendor/libarchive/dist/libarchive/archive_acl.c ============================================================================== --- vendor/libarchive/dist/libarchive/archive_acl.c Fri Nov 23 23:33:55 2018 (r340864) +++ vendor/libarchive/dist/libarchive/archive_acl.c Sat Nov 24 01:15:08 2018 (r340865) @@ -753,8 +753,10 @@ archive_acl_to_text_w(struct archive_acl *acl, ssize_t append_entry_w(&wp, prefix, ap->type, ap->tag, flags, wname, ap->permset, id); count++; - } else if (r < 0 && errno == ENOMEM) + } else if (r < 0 && errno == ENOMEM) { + free(ws); return (NULL); + } } /* Add terminating character */ @@ -975,8 +977,10 @@ archive_acl_to_text_l(struct archive_acl *acl, ssize_t prefix = NULL; r = archive_mstring_get_mbs_l( &ap->name, &name, &len, sc); - if (r != 0) + if (r != 0) { + free(s); return (NULL); + } if (count > 0) *p++ = separator; if (name == NULL || Modified: vendor/libarchive/dist/libarchive/archive_read_support_format_rar5.c ============================================================================== --- vendor/libarchive/dist/libarchive/archive_read_support_format_rar5.c Fri Nov 23 23:33:55 2018 (r340864) +++ vendor/libarchive/dist/libarchive/archive_read_support_format_rar5.c Sat Nov 24 01:15:08 2018 (r340865) @@ -88,6 +88,7 @@ struct file_header { uint8_t solid : 1; /* Is this a solid stream? */ uint8_t service : 1; /* Is this file a service data? */ + uint8_t eof : 1; /* Did we finish unpacking the file? */ /* Optional time fields. */ uint64_t e_mtime; @@ -176,7 +177,7 @@ struct comp_state { decompression. */ uint8_t* filtered_buf; /* Buffer used when applying filters. */ const uint8_t* block_buf; /* Buffer used when merging blocks. */ - size_t window_mask; /* Convinience field; window_size - 1. */ + size_t window_mask; /* Convenience field; window_size - 1. */ int64_t write_ptr; /* This amount of data has been unpacked in the window buffer. */ int64_t last_write_ptr; /* This amount of data has been stored in @@ -279,7 +280,7 @@ struct rar5 { int skip_mode; /* An offset to QuickOpen list. This is not supported by this unpacker, - * becuase we're focusing on streaming interface. QuickOpen is designed + * because we're focusing on streaming interface. QuickOpen is designed * to make things quicker for non-stream interfaces, so it's not our * use case. */ uint64_t qlist_offset; @@ -387,7 +388,7 @@ static void cdeque_pop_front_fast(struct cdeque* d, vo d->size--; } -/* Pops a front element of this cicrular deque object and returns its value. +/* Pops a front element of this circular deque object and returns its value. * This function performs bounds checking. */ static int cdeque_pop_front(struct cdeque* d, void** value) { if(!d || !value) @@ -400,17 +401,17 @@ static int cdeque_pop_front(struct cdeque* d, void** v return CDE_OK; } -/* Convinience function to cast filter_info** to void **. */ +/* Convenience function to cast filter_info** to void **. */ static void** cdeque_filter_p(struct filter_info** f) { return (void**) (size_t) f; } -/* Convinience function to cast filter_info* to void *. */ +/* Convenience function to cast filter_info* to void *. */ static void* cdeque_filter(struct filter_info* f) { return (void**) (size_t) f; } -/* Destroys this circular deque object. Dellocates the memory of the collection +/* Destroys this circular deque object. Deallocates the memory of the collection * buffer, but doesn't deallocate the memory of any pointer passed to this * deque as a value. */ static void cdeque_free(struct cdeque* d) { @@ -434,7 +435,7 @@ static inline struct rar5* get_context(struct archive_ // TODO: make sure these functions return a little endian number -/* Convinience functions used by filter implementations. */ +/* Convenience functions used by filter implementations. */ static uint32_t read_filter_data(struct rar5* rar, uint32_t offset) { uint32_t* dptr = (uint32_t*) &rar->cstate.window_buf[offset]; @@ -672,7 +673,7 @@ static void push_data(struct archive_read* a, struct r } } -/* Convinience function that submits the data to the user. It uses the +/* Convenience function that submits the data to the user. It uses the * unpack window buffer as a source location. */ static void push_window_data(struct archive_read* a, struct rar5* rar, int64_t idx_begin, int64_t idx_end) @@ -753,7 +754,7 @@ static void free_filters(struct rar5* rar) { /* Free any remaining filters. All filters should be naturally consumed by * the unpacking function, so remaining filters after unpacking normally - * mean that unpacking wasn't successfull. But still of course we shouldn't + * mean that unpacking wasn't successful. But still of course we shouldn't * leak memory in such case. */ /* cdeque_size() is a fast operation, so we can use it as a loop @@ -885,7 +886,7 @@ static int read_var(struct archive_read* a, uint64_t* * it will not have the possibility to advance the file * pointer, because it will not know how many bytes it needs * to consume. This is why we handle such situation here - * autmatically. */ + * automatically. */ if(ARCHIVE_OK != consume(a, 1 + i)) { return 0; } @@ -918,7 +919,7 @@ static int read_var_sized(struct archive_read* a, size size_t* pvalue_len) { uint64_t v; - uint64_t v_size; + uint64_t v_size = 0; const int ret = pvalue_len ? read_var(a, &v, &v_size) @@ -1218,7 +1219,7 @@ static int process_head_file_extra(struct archive_read ssize_t extra_data_size) { size_t extra_field_size; - size_t extra_field_id; + size_t extra_field_id = 0; int ret = ARCHIVE_FATAL; size_t var_size; @@ -1288,7 +1289,7 @@ static int process_head_file(struct archive_read* a, s size_t host_os = 0; size_t name_size = 0; uint64_t unpacked_size; - uint32_t mtime = 0, crc; + uint32_t mtime = 0, crc = 0; int c_method = 0, c_version = 0, is_dir; char name_utf8_buf[2048 * 4]; const uint8_t* p; @@ -1522,7 +1523,7 @@ static int process_head_main(struct archive_read* a, s enum MAIN_FLAGS { VOLUME = 0x0001, /* multi-volume archive */ - VOLUME_NUMBER = 0x0002, /* volume number, first vol doesnt have it */ + VOLUME_NUMBER = 0x0002, /* volume number, first vol doesn't have it */ SOLID = 0x0004, /* solid archive */ PROTECT = 0x0008, /* contains Recovery info */ LOCK = 0x0010, /* readonly flag, not used */ @@ -1647,7 +1648,7 @@ static int process_base_block(struct archive_read* a, { struct rar5* rar = get_context(a); uint32_t hdr_crc, computed_crc; - size_t raw_hdr_size, hdr_size_len, hdr_size; + size_t raw_hdr_size = 0, hdr_size_len, hdr_size; size_t header_id = 0; size_t header_flags = 0; const uint8_t* p; @@ -2211,7 +2212,7 @@ static int parse_block_header(struct archive_read* a, return ARCHIVE_OK; } -/* Convinience function used during filter processing. */ +/* Convenience function used during filter processing. */ static int parse_filter_data(struct rar5* rar, const uint8_t* p, uint32_t* filter_data) { @@ -2685,6 +2686,12 @@ static int merge_block(struct archive_read* a, ssize_t cur_block_size = rar5_min(rar->file.bytes_remaining, block_size - partial_offset); + if(cur_block_size == 0) { + archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT, + "Encountered block size == 0 during block merge"); + return ARCHIVE_FATAL; + } + if(!read_ahead(a, cur_block_size, &lp)) return ARCHIVE_EOF; @@ -3116,6 +3123,9 @@ static int do_unstore_file(struct archive_read* a, } size_t to_read = rar5_min(rar->file.bytes_remaining, 64 * 1024); + if(to_read == 0) { + return ARCHIVE_EOF; + } if(!read_ahead(a, to_read, &p)) { archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT, "I/O error " @@ -3186,7 +3196,7 @@ static int verify_checksums(struct archive_read* a) { * data and discarding the result). */ if(!rar->skip_mode) { - /* Always check checkums if we're not in skip mode */ + /* Always check checksums if we're not in skip mode */ verify_crc = 1; } else { /* We can override the logic above with a compile-time option @@ -3283,9 +3293,14 @@ static int rar5_read_data(struct archive_read *a, cons } ret = use_data(rar, buff, size, offset); - if(ret == ARCHIVE_OK) + if(ret == ARCHIVE_OK) { return ret; + } + if(rar->file.eof == 1) { + return ARCHIVE_EOF; + } + ret = do_unpack(a, rar, buff, size, offset); if(ret != ARCHIVE_OK) { return ret; @@ -3301,6 +3316,7 @@ static int rar5_read_data(struct archive_read *a, cons * value in the last `archive_read_data` call to signal an error * to the user. */ + rar->file.eof = 1; return verify_global_checksums(a); } Modified: vendor/libarchive/dist/libarchive/archive_windows.c ============================================================================== --- vendor/libarchive/dist/libarchive/archive_windows.c Fri Nov 23 23:33:55 2018 (r340864) +++ vendor/libarchive/dist/libarchive/archive_windows.c Sat Nov 24 01:15:08 2018 (r340865) @@ -445,7 +445,8 @@ fileTimeToUTC(const FILETIME *filetime, time_t *t, lon * Windows' stat() does not accept the path added "\\?\" especially "?" * character. * It means we cannot access the long name path longer than MAX_PATH. - * So I've implemented simular Windows' stat() to access the long name path. + * So I've implemented a function similar to Windows' stat() to access the + * long name path. * And I've added some feature. * 1. set st_ino by nFileIndexHigh and nFileIndexLow of * BY_HANDLE_FILE_INFORMATION. Modified: vendor/libarchive/dist/libarchive/archive_write_set_format_iso9660.c ============================================================================== --- vendor/libarchive/dist/libarchive/archive_write_set_format_iso9660.c Fri Nov 23 23:33:55 2018 (r340864) +++ vendor/libarchive/dist/libarchive/archive_write_set_format_iso9660.c Sat Nov 24 01:15:08 2018 (r340865) @@ -4899,10 +4899,10 @@ isofile_gen_utility_names(struct archive_write *a, str if (p[0] == '/') { if (p[1] == '/') /* Convert '//' --> '/' */ - strcpy(p, p+1); + memmove(p, p+1, strlen(p+1) + 1); else if (p[1] == '.' && p[2] == '/') /* Convert '/./' --> '/' */ - strcpy(p, p+2); + memmove(p, p+2, strlen(p+2) + 1); else if (p[1] == '.' && p[2] == '.' && p[3] == '/') { /* Convert 'dir/dir1/../dir2/' * --> 'dir/dir2/' Modified: vendor/libarchive/dist/libarchive/archive_write_set_format_mtree.c ============================================================================== --- vendor/libarchive/dist/libarchive/archive_write_set_format_mtree.c Fri Nov 23 23:33:55 2018 (r340864) +++ vendor/libarchive/dist/libarchive/archive_write_set_format_mtree.c Sat Nov 24 01:15:08 2018 (r340865) @@ -1810,10 +1810,10 @@ mtree_entry_setup_filenames(struct archive_write *a, s if (p[0] == '/') { if (p[1] == '/') /* Convert '//' --> '/' */ - strcpy(p, p+1); + memmove(p, p+1, strlen(p+1) + 1); else if (p[1] == '.' && p[2] == '/') /* Convert '/./' --> '/' */ - strcpy(p, p+2); + memmove(p, p+2, strlen(p+2) + 1); else if (p[1] == '.' && p[2] == '.' && p[3] == '/') { /* Convert 'dir/dir1/../dir2/' * --> 'dir/dir2/' Modified: vendor/libarchive/dist/libarchive/archive_write_set_format_pax.c ============================================================================== --- vendor/libarchive/dist/libarchive/archive_write_set_format_pax.c Fri Nov 23 23:33:55 2018 (r340864) +++ vendor/libarchive/dist/libarchive/archive_write_set_format_pax.c Sat Nov 24 01:15:08 2018 (r340865) @@ -522,11 +522,13 @@ add_pax_acl(struct archive_write *a, ARCHIVE_ERRNO_FILE_FORMAT, "%s %s %s", "Can't translate ", attr, " to UTF-8"); return(ARCHIVE_WARN); - } else if (*p != '\0') { + } + + if (*p != '\0') { add_pax_attr(&(pax->pax_header), attr, p); - free(p); } + free(p); return(ARCHIVE_OK); } Modified: vendor/libarchive/dist/libarchive/archive_write_set_format_xar.c ============================================================================== --- vendor/libarchive/dist/libarchive/archive_write_set_format_xar.c Fri Nov 23 23:33:55 2018 (r340864) +++ vendor/libarchive/dist/libarchive/archive_write_set_format_xar.c Sat Nov 24 01:15:08 2018 (r340865) @@ -2120,10 +2120,10 @@ file_gen_utility_names(struct archive_write *a, struct if (p[0] == '/') { if (p[1] == '/') /* Convert '//' --> '/' */ - strcpy(p, p+1); + memmove(p, p+1, strlen(p+1) + 1); else if (p[1] == '.' && p[2] == '/') /* Convert '/./' --> '/' */ - strcpy(p, p+2); + memmove(p, p+2, strlen(p+2) + 1); else if (p[1] == '.' && p[2] == '.' && p[3] == '/') { /* Convert 'dir/dir1/../dir2/' * --> 'dir/dir2/' @@ -3169,8 +3169,10 @@ save_xattrs(struct archive_write *a, struct file *file checksum_update(&(xar->a_sumwrk), xar->wbuff, size); if (write_to_temp(a, xar->wbuff, size) - != ARCHIVE_OK) + != ARCHIVE_OK) { + free(heap); return (ARCHIVE_FATAL); + } if (r == ARCHIVE_OK) { xar->stream.next_out = xar->wbuff; xar->stream.avail_out = sizeof(xar->wbuff); Modified: vendor/libarchive/dist/libarchive/test/test_fuzz.c ============================================================================== --- vendor/libarchive/dist/libarchive/test/test_fuzz.c Fri Nov 23 23:33:55 2018 (r340864) +++ vendor/libarchive/dist/libarchive/test/test_fuzz.c Sat Nov 24 01:15:08 2018 (r340865) @@ -433,7 +433,7 @@ DEFINE_TEST(test_fuzz_tar) {0, fileset9}, /* Exercise lzo decompressor. */ #endif #if HAVE_ZSTD_H && HAVE_LIBZSTD - {0, fileset10}, /* Excercise zstd decompressor. */ + {0, fileset10}, /* Exercise zstd decompressor. */ #endif {1, NULL} }; Modified: vendor/libarchive/dist/libarchive/test/test_read_format_rar5.c ============================================================================== --- vendor/libarchive/dist/libarchive/test/test_read_format_rar5.c Fri Nov 23 23:33:55 2018 (r340864) +++ vendor/libarchive/dist/libarchive/test/test_read_format_rar5.c Sat Nov 24 01:15:08 2018 (r340865) @@ -726,3 +726,44 @@ DEFINE_TEST(test_read_format_rar5_extract_win32) assertA(0 == extract_one(a, ae, 0x36A448FF)); EPILOGUE(); } + +DEFINE_TEST(test_read_format_rar5_block_by_block) +{ + /* This test uses strange buffer sizes intentionally. */ + + struct archive_entry *ae; + struct archive *a; + uint8_t buf[173]; + int bytes_read; + uint32_t computed_crc = 0; + + extract_reference_file("test_read_format_rar5_compressed.rar"); + assert((a = archive_read_new()) != NULL); + assertA(0 == archive_read_support_filter_all(a)); + assertA(0 == archive_read_support_format_all(a)); + assertA(0 == archive_read_open_filename(a, "test_read_format_rar5_compressed.rar", 130)); + assertA(0 == archive_read_next_header(a, &ae)); + assertEqualString("test.bin", archive_entry_pathname(ae)); + assertEqualInt(1200, archive_entry_size(ae)); + + /* File size is 1200 bytes, we're reading it using a buffer of 173 bytes. + * Libarchive is configured to use a buffer of 130 bytes. */ + + while(1) { + /* archive_read_data should return one of: + * a) 0, if there is no more data to be read, + * b) negative value, if there was an error, + * c) positive value, meaning how many bytes were read. + */ + + bytes_read = archive_read_data(a, buf, sizeof(buf)); + assertA(bytes_read >= 0); + if(bytes_read <= 0) + break; + + computed_crc = crc32(computed_crc, buf, bytes_read); + } + + assertEqualInt(computed_crc, 0x7CCA70CD); + EPILOGUE(); +} Modified: vendor/libarchive/dist/libarchive/test/test_write_disk_perms.c ============================================================================== --- vendor/libarchive/dist/libarchive/test/test_write_disk_perms.c Fri Nov 23 23:33:55 2018 (r340864) +++ vendor/libarchive/dist/libarchive/test/test_write_disk_perms.c Sat Nov 24 01:15:08 2018 (r340865) @@ -203,7 +203,7 @@ DEFINE_TEST(test_write_disk_perms) failure("dir_overwrite_0744: st.st_mode=%o", st.st_mode); assertEqualInt(st.st_mode & 0777, 0744); - /* For dir, the owner should get left when not overwritting. */ + /* For dir, the owner should get left when not overwriting. */ assertMakeDir("dir_owner", 0744); if (getuid() == 0) { Modified: vendor/libarchive/dist/tar/write.c ============================================================================== --- vendor/libarchive/dist/tar/write.c Fri Nov 23 23:33:55 2018 (r340864) +++ vendor/libarchive/dist/tar/write.c Sat Nov 24 01:15:08 2018 (r340865) @@ -540,8 +540,7 @@ write_archive(struct archive *a, struct bsdtar *bsdtar lafe_warnc(archive_errno(disk), "%s", archive_error_string(disk)); bsdtar->return_value = 1; - archive_entry_free(entry); - continue; + goto next_entry; } /* @@ -557,15 +556,14 @@ write_archive(struct archive *a, struct bsdtar *bsdtar "%s", archive_error_string(disk)); if (r == ARCHIVE_FATAL) bsdtar->return_value = 1; - else - archive_read_close(disk); - archive_entry_free(entry); - continue; + archive_read_close(disk); + goto next_entry; } write_file(bsdtar, a, entry); - archive_entry_free(entry); archive_read_close(disk); +next_entry: + archive_entry_free(entry); entry = NULL; archive_entry_linkify(bsdtar->resolver, &entry, &sparse_entry); } From owner-svn-src-all@freebsd.org Sat Nov 24 01:25:48 2018 Return-Path: Delivered-To: svn-src-all@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 208731137424; Sat, 24 Nov 2018 01:25:48 +0000 (UTC) (envelope-from mm@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 C9A927D01F; Sat, 24 Nov 2018 01:25:47 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AA93926BCB; Sat, 24 Nov 2018 01:25:47 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAO1PlGb004373; Sat, 24 Nov 2018 01:25:47 GMT (envelope-from mm@FreeBSD.org) Received: (from mm@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAO1PjKn004363; Sat, 24 Nov 2018 01:25:45 GMT (envelope-from mm@FreeBSD.org) Message-Id: <201811240125.wAO1PjKn004363@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mm set sender to mm@FreeBSD.org using -f From: Martin Matuska Date: Sat, 24 Nov 2018 01:25:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340866 - in head/contrib/libarchive: cpio libarchive libarchive/test tar X-SVN-Group: head X-SVN-Commit-Author: mm X-SVN-Commit-Paths: in head/contrib/libarchive: cpio libarchive libarchive/test tar X-SVN-Commit-Revision: 340866 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C9A927D01F X-Spamd-Result: default: False [1.41 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.46)[0.458,0]; NEURAL_SPAM_MEDIUM(0.76)[0.762,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.19)[0.194,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Nov 2018 01:25:48 -0000 Author: mm Date: Sat Nov 24 01:25:45 2018 New Revision: 340866 URL: https://svnweb.freebsd.org/changeset/base/340866 Log: MFV r340865: Sync libarchive with vendor. Relevant vendor changes: PR #1080: Spelling fixes PR #1084: RAR5 reader bugfixes PR #1091: fix use-after-free in delayed newc link processing PR #1092: Fix a few obvious resource leaks and strcpy() misuses MFC after: 1 week Modified: head/contrib/libarchive/cpio/cpio.c head/contrib/libarchive/libarchive/archive_acl.c head/contrib/libarchive/libarchive/archive_read_support_format_rar5.c head/contrib/libarchive/libarchive/archive_write_set_format_iso9660.c head/contrib/libarchive/libarchive/archive_write_set_format_mtree.c head/contrib/libarchive/libarchive/archive_write_set_format_pax.c head/contrib/libarchive/libarchive/archive_write_set_format_xar.c head/contrib/libarchive/libarchive/test/test_fuzz.c head/contrib/libarchive/libarchive/test/test_read_format_rar5.c head/contrib/libarchive/libarchive/test/test_write_disk_perms.c head/contrib/libarchive/tar/write.c Directory Properties: head/contrib/libarchive/ (props changed) Modified: head/contrib/libarchive/cpio/cpio.c ============================================================================== --- head/contrib/libarchive/cpio/cpio.c Sat Nov 24 01:15:08 2018 (r340865) +++ head/contrib/libarchive/cpio/cpio.c Sat Nov 24 01:25:45 2018 (r340866) @@ -755,8 +755,10 @@ file_to_archive(struct cpio *cpio, const char *srcpath } if (cpio->option_rename) destpath = cpio_rename(destpath); - if (destpath == NULL) + if (destpath == NULL) { + archive_entry_free(entry); return (0); + } archive_entry_copy_pathname(entry, destpath); /* Modified: head/contrib/libarchive/libarchive/archive_acl.c ============================================================================== --- head/contrib/libarchive/libarchive/archive_acl.c Sat Nov 24 01:15:08 2018 (r340865) +++ head/contrib/libarchive/libarchive/archive_acl.c Sat Nov 24 01:25:45 2018 (r340866) @@ -753,8 +753,10 @@ archive_acl_to_text_w(struct archive_acl *acl, ssize_t append_entry_w(&wp, prefix, ap->type, ap->tag, flags, wname, ap->permset, id); count++; - } else if (r < 0 && errno == ENOMEM) + } else if (r < 0 && errno == ENOMEM) { + free(ws); return (NULL); + } } /* Add terminating character */ @@ -975,8 +977,10 @@ archive_acl_to_text_l(struct archive_acl *acl, ssize_t prefix = NULL; r = archive_mstring_get_mbs_l( &ap->name, &name, &len, sc); - if (r != 0) + if (r != 0) { + free(s); return (NULL); + } if (count > 0) *p++ = separator; if (name == NULL || Modified: head/contrib/libarchive/libarchive/archive_read_support_format_rar5.c ============================================================================== --- head/contrib/libarchive/libarchive/archive_read_support_format_rar5.c Sat Nov 24 01:15:08 2018 (r340865) +++ head/contrib/libarchive/libarchive/archive_read_support_format_rar5.c Sat Nov 24 01:25:45 2018 (r340866) @@ -88,6 +88,7 @@ struct file_header { uint8_t solid : 1; /* Is this a solid stream? */ uint8_t service : 1; /* Is this file a service data? */ + uint8_t eof : 1; /* Did we finish unpacking the file? */ /* Optional time fields. */ uint64_t e_mtime; @@ -176,7 +177,7 @@ struct comp_state { decompression. */ uint8_t* filtered_buf; /* Buffer used when applying filters. */ const uint8_t* block_buf; /* Buffer used when merging blocks. */ - size_t window_mask; /* Convinience field; window_size - 1. */ + size_t window_mask; /* Convenience field; window_size - 1. */ int64_t write_ptr; /* This amount of data has been unpacked in the window buffer. */ int64_t last_write_ptr; /* This amount of data has been stored in @@ -279,7 +280,7 @@ struct rar5 { int skip_mode; /* An offset to QuickOpen list. This is not supported by this unpacker, - * becuase we're focusing on streaming interface. QuickOpen is designed + * because we're focusing on streaming interface. QuickOpen is designed * to make things quicker for non-stream interfaces, so it's not our * use case. */ uint64_t qlist_offset; @@ -387,7 +388,7 @@ static void cdeque_pop_front_fast(struct cdeque* d, vo d->size--; } -/* Pops a front element of this cicrular deque object and returns its value. +/* Pops a front element of this circular deque object and returns its value. * This function performs bounds checking. */ static int cdeque_pop_front(struct cdeque* d, void** value) { if(!d || !value) @@ -400,17 +401,17 @@ static int cdeque_pop_front(struct cdeque* d, void** v return CDE_OK; } -/* Convinience function to cast filter_info** to void **. */ +/* Convenience function to cast filter_info** to void **. */ static void** cdeque_filter_p(struct filter_info** f) { return (void**) (size_t) f; } -/* Convinience function to cast filter_info* to void *. */ +/* Convenience function to cast filter_info* to void *. */ static void* cdeque_filter(struct filter_info* f) { return (void**) (size_t) f; } -/* Destroys this circular deque object. Dellocates the memory of the collection +/* Destroys this circular deque object. Deallocates the memory of the collection * buffer, but doesn't deallocate the memory of any pointer passed to this * deque as a value. */ static void cdeque_free(struct cdeque* d) { @@ -434,7 +435,7 @@ static inline struct rar5* get_context(struct archive_ // TODO: make sure these functions return a little endian number -/* Convinience functions used by filter implementations. */ +/* Convenience functions used by filter implementations. */ static uint32_t read_filter_data(struct rar5* rar, uint32_t offset) { uint32_t* dptr = (uint32_t*) &rar->cstate.window_buf[offset]; @@ -672,7 +673,7 @@ static void push_data(struct archive_read* a, struct r } } -/* Convinience function that submits the data to the user. It uses the +/* Convenience function that submits the data to the user. It uses the * unpack window buffer as a source location. */ static void push_window_data(struct archive_read* a, struct rar5* rar, int64_t idx_begin, int64_t idx_end) @@ -753,7 +754,7 @@ static void free_filters(struct rar5* rar) { /* Free any remaining filters. All filters should be naturally consumed by * the unpacking function, so remaining filters after unpacking normally - * mean that unpacking wasn't successfull. But still of course we shouldn't + * mean that unpacking wasn't successful. But still of course we shouldn't * leak memory in such case. */ /* cdeque_size() is a fast operation, so we can use it as a loop @@ -885,7 +886,7 @@ static int read_var(struct archive_read* a, uint64_t* * it will not have the possibility to advance the file * pointer, because it will not know how many bytes it needs * to consume. This is why we handle such situation here - * autmatically. */ + * automatically. */ if(ARCHIVE_OK != consume(a, 1 + i)) { return 0; } @@ -918,7 +919,7 @@ static int read_var_sized(struct archive_read* a, size size_t* pvalue_len) { uint64_t v; - uint64_t v_size; + uint64_t v_size = 0; const int ret = pvalue_len ? read_var(a, &v, &v_size) @@ -1218,7 +1219,7 @@ static int process_head_file_extra(struct archive_read ssize_t extra_data_size) { size_t extra_field_size; - size_t extra_field_id; + size_t extra_field_id = 0; int ret = ARCHIVE_FATAL; size_t var_size; @@ -1288,7 +1289,7 @@ static int process_head_file(struct archive_read* a, s size_t host_os = 0; size_t name_size = 0; uint64_t unpacked_size; - uint32_t mtime = 0, crc; + uint32_t mtime = 0, crc = 0; int c_method = 0, c_version = 0, is_dir; char name_utf8_buf[2048 * 4]; const uint8_t* p; @@ -1522,7 +1523,7 @@ static int process_head_main(struct archive_read* a, s enum MAIN_FLAGS { VOLUME = 0x0001, /* multi-volume archive */ - VOLUME_NUMBER = 0x0002, /* volume number, first vol doesnt have it */ + VOLUME_NUMBER = 0x0002, /* volume number, first vol doesn't have it */ SOLID = 0x0004, /* solid archive */ PROTECT = 0x0008, /* contains Recovery info */ LOCK = 0x0010, /* readonly flag, not used */ @@ -1647,7 +1648,7 @@ static int process_base_block(struct archive_read* a, { struct rar5* rar = get_context(a); uint32_t hdr_crc, computed_crc; - size_t raw_hdr_size, hdr_size_len, hdr_size; + size_t raw_hdr_size = 0, hdr_size_len, hdr_size; size_t header_id = 0; size_t header_flags = 0; const uint8_t* p; @@ -2211,7 +2212,7 @@ static int parse_block_header(struct archive_read* a, return ARCHIVE_OK; } -/* Convinience function used during filter processing. */ +/* Convenience function used during filter processing. */ static int parse_filter_data(struct rar5* rar, const uint8_t* p, uint32_t* filter_data) { @@ -2685,6 +2686,12 @@ static int merge_block(struct archive_read* a, ssize_t cur_block_size = rar5_min(rar->file.bytes_remaining, block_size - partial_offset); + if(cur_block_size == 0) { + archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT, + "Encountered block size == 0 during block merge"); + return ARCHIVE_FATAL; + } + if(!read_ahead(a, cur_block_size, &lp)) return ARCHIVE_EOF; @@ -3116,6 +3123,9 @@ static int do_unstore_file(struct archive_read* a, } size_t to_read = rar5_min(rar->file.bytes_remaining, 64 * 1024); + if(to_read == 0) { + return ARCHIVE_EOF; + } if(!read_ahead(a, to_read, &p)) { archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT, "I/O error " @@ -3186,7 +3196,7 @@ static int verify_checksums(struct archive_read* a) { * data and discarding the result). */ if(!rar->skip_mode) { - /* Always check checkums if we're not in skip mode */ + /* Always check checksums if we're not in skip mode */ verify_crc = 1; } else { /* We can override the logic above with a compile-time option @@ -3283,9 +3293,14 @@ static int rar5_read_data(struct archive_read *a, cons } ret = use_data(rar, buff, size, offset); - if(ret == ARCHIVE_OK) + if(ret == ARCHIVE_OK) { return ret; + } + if(rar->file.eof == 1) { + return ARCHIVE_EOF; + } + ret = do_unpack(a, rar, buff, size, offset); if(ret != ARCHIVE_OK) { return ret; @@ -3301,6 +3316,7 @@ static int rar5_read_data(struct archive_read *a, cons * value in the last `archive_read_data` call to signal an error * to the user. */ + rar->file.eof = 1; return verify_global_checksums(a); } Modified: head/contrib/libarchive/libarchive/archive_write_set_format_iso9660.c ============================================================================== --- head/contrib/libarchive/libarchive/archive_write_set_format_iso9660.c Sat Nov 24 01:15:08 2018 (r340865) +++ head/contrib/libarchive/libarchive/archive_write_set_format_iso9660.c Sat Nov 24 01:25:45 2018 (r340866) @@ -4899,10 +4899,10 @@ isofile_gen_utility_names(struct archive_write *a, str if (p[0] == '/') { if (p[1] == '/') /* Convert '//' --> '/' */ - strcpy(p, p+1); + memmove(p, p+1, strlen(p+1) + 1); else if (p[1] == '.' && p[2] == '/') /* Convert '/./' --> '/' */ - strcpy(p, p+2); + memmove(p, p+2, strlen(p+2) + 1); else if (p[1] == '.' && p[2] == '.' && p[3] == '/') { /* Convert 'dir/dir1/../dir2/' * --> 'dir/dir2/' Modified: head/contrib/libarchive/libarchive/archive_write_set_format_mtree.c ============================================================================== --- head/contrib/libarchive/libarchive/archive_write_set_format_mtree.c Sat Nov 24 01:15:08 2018 (r340865) +++ head/contrib/libarchive/libarchive/archive_write_set_format_mtree.c Sat Nov 24 01:25:45 2018 (r340866) @@ -1810,10 +1810,10 @@ mtree_entry_setup_filenames(struct archive_write *a, s if (p[0] == '/') { if (p[1] == '/') /* Convert '//' --> '/' */ - strcpy(p, p+1); + memmove(p, p+1, strlen(p+1) + 1); else if (p[1] == '.' && p[2] == '/') /* Convert '/./' --> '/' */ - strcpy(p, p+2); + memmove(p, p+2, strlen(p+2) + 1); else if (p[1] == '.' && p[2] == '.' && p[3] == '/') { /* Convert 'dir/dir1/../dir2/' * --> 'dir/dir2/' Modified: head/contrib/libarchive/libarchive/archive_write_set_format_pax.c ============================================================================== --- head/contrib/libarchive/libarchive/archive_write_set_format_pax.c Sat Nov 24 01:15:08 2018 (r340865) +++ head/contrib/libarchive/libarchive/archive_write_set_format_pax.c Sat Nov 24 01:25:45 2018 (r340866) @@ -522,11 +522,13 @@ add_pax_acl(struct archive_write *a, ARCHIVE_ERRNO_FILE_FORMAT, "%s %s %s", "Can't translate ", attr, " to UTF-8"); return(ARCHIVE_WARN); - } else if (*p != '\0') { + } + + if (*p != '\0') { add_pax_attr(&(pax->pax_header), attr, p); - free(p); } + free(p); return(ARCHIVE_OK); } Modified: head/contrib/libarchive/libarchive/archive_write_set_format_xar.c ============================================================================== --- head/contrib/libarchive/libarchive/archive_write_set_format_xar.c Sat Nov 24 01:15:08 2018 (r340865) +++ head/contrib/libarchive/libarchive/archive_write_set_format_xar.c Sat Nov 24 01:25:45 2018 (r340866) @@ -2120,10 +2120,10 @@ file_gen_utility_names(struct archive_write *a, struct if (p[0] == '/') { if (p[1] == '/') /* Convert '//' --> '/' */ - strcpy(p, p+1); + memmove(p, p+1, strlen(p+1) + 1); else if (p[1] == '.' && p[2] == '/') /* Convert '/./' --> '/' */ - strcpy(p, p+2); + memmove(p, p+2, strlen(p+2) + 1); else if (p[1] == '.' && p[2] == '.' && p[3] == '/') { /* Convert 'dir/dir1/../dir2/' * --> 'dir/dir2/' @@ -3169,8 +3169,10 @@ save_xattrs(struct archive_write *a, struct file *file checksum_update(&(xar->a_sumwrk), xar->wbuff, size); if (write_to_temp(a, xar->wbuff, size) - != ARCHIVE_OK) + != ARCHIVE_OK) { + free(heap); return (ARCHIVE_FATAL); + } if (r == ARCHIVE_OK) { xar->stream.next_out = xar->wbuff; xar->stream.avail_out = sizeof(xar->wbuff); Modified: head/contrib/libarchive/libarchive/test/test_fuzz.c ============================================================================== --- head/contrib/libarchive/libarchive/test/test_fuzz.c Sat Nov 24 01:15:08 2018 (r340865) +++ head/contrib/libarchive/libarchive/test/test_fuzz.c Sat Nov 24 01:25:45 2018 (r340866) @@ -433,7 +433,7 @@ DEFINE_TEST(test_fuzz_tar) {0, fileset9}, /* Exercise lzo decompressor. */ #endif #if HAVE_ZSTD_H && HAVE_LIBZSTD - {0, fileset10}, /* Excercise zstd decompressor. */ + {0, fileset10}, /* Exercise zstd decompressor. */ #endif {1, NULL} }; Modified: head/contrib/libarchive/libarchive/test/test_read_format_rar5.c ============================================================================== --- head/contrib/libarchive/libarchive/test/test_read_format_rar5.c Sat Nov 24 01:15:08 2018 (r340865) +++ head/contrib/libarchive/libarchive/test/test_read_format_rar5.c Sat Nov 24 01:25:45 2018 (r340866) @@ -726,3 +726,44 @@ DEFINE_TEST(test_read_format_rar5_extract_win32) assertA(0 == extract_one(a, ae, 0x36A448FF)); EPILOGUE(); } + +DEFINE_TEST(test_read_format_rar5_block_by_block) +{ + /* This test uses strange buffer sizes intentionally. */ + + struct archive_entry *ae; + struct archive *a; + uint8_t buf[173]; + int bytes_read; + uint32_t computed_crc = 0; + + extract_reference_file("test_read_format_rar5_compressed.rar"); + assert((a = archive_read_new()) != NULL); + assertA(0 == archive_read_support_filter_all(a)); + assertA(0 == archive_read_support_format_all(a)); + assertA(0 == archive_read_open_filename(a, "test_read_format_rar5_compressed.rar", 130)); + assertA(0 == archive_read_next_header(a, &ae)); + assertEqualString("test.bin", archive_entry_pathname(ae)); + assertEqualInt(1200, archive_entry_size(ae)); + + /* File size is 1200 bytes, we're reading it using a buffer of 173 bytes. + * Libarchive is configured to use a buffer of 130 bytes. */ + + while(1) { + /* archive_read_data should return one of: + * a) 0, if there is no more data to be read, + * b) negative value, if there was an error, + * c) positive value, meaning how many bytes were read. + */ + + bytes_read = archive_read_data(a, buf, sizeof(buf)); + assertA(bytes_read >= 0); + if(bytes_read <= 0) + break; + + computed_crc = crc32(computed_crc, buf, bytes_read); + } + + assertEqualInt(computed_crc, 0x7CCA70CD); + EPILOGUE(); +} Modified: head/contrib/libarchive/libarchive/test/test_write_disk_perms.c ============================================================================== --- head/contrib/libarchive/libarchive/test/test_write_disk_perms.c Sat Nov 24 01:15:08 2018 (r340865) +++ head/contrib/libarchive/libarchive/test/test_write_disk_perms.c Sat Nov 24 01:25:45 2018 (r340866) @@ -203,7 +203,7 @@ DEFINE_TEST(test_write_disk_perms) failure("dir_overwrite_0744: st.st_mode=%o", st.st_mode); assertEqualInt(st.st_mode & 0777, 0744); - /* For dir, the owner should get left when not overwritting. */ + /* For dir, the owner should get left when not overwriting. */ assertMakeDir("dir_owner", 0744); if (getuid() == 0) { Modified: head/contrib/libarchive/tar/write.c ============================================================================== --- head/contrib/libarchive/tar/write.c Sat Nov 24 01:15:08 2018 (r340865) +++ head/contrib/libarchive/tar/write.c Sat Nov 24 01:25:45 2018 (r340866) @@ -540,8 +540,7 @@ write_archive(struct archive *a, struct bsdtar *bsdtar lafe_warnc(archive_errno(disk), "%s", archive_error_string(disk)); bsdtar->return_value = 1; - archive_entry_free(entry); - continue; + goto next_entry; } /* @@ -557,15 +556,14 @@ write_archive(struct archive *a, struct bsdtar *bsdtar "%s", archive_error_string(disk)); if (r == ARCHIVE_FATAL) bsdtar->return_value = 1; - else - archive_read_close(disk); - archive_entry_free(entry); - continue; + archive_read_close(disk); + goto next_entry; } write_file(bsdtar, a, entry); - archive_entry_free(entry); archive_read_close(disk); +next_entry: + archive_entry_free(entry); entry = NULL; archive_entry_linkify(bsdtar->resolver, &entry, &sparse_entry); } From owner-svn-src-all@freebsd.org Sat Nov 24 07:16:45 2018 Return-Path: Delivered-To: svn-src-all@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 AD9EE114424C; Sat, 24 Nov 2018 07:16:45 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.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 4FBAB6BE6F; Sat, 24 Nov 2018 07:16:45 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2C019286E; Sat, 24 Nov 2018 07:16:45 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAO7GjnS083245; Sat, 24 Nov 2018 07:16:45 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAO7GjCM083244; Sat, 24 Nov 2018 07:16:45 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201811240716.wAO7GjCM083244@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Sat, 24 Nov 2018 07:16:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340868 - head/sys/contrib/ipfilter/netinet X-SVN-Group: head X-SVN-Commit-Author: cy X-SVN-Commit-Paths: head/sys/contrib/ipfilter/netinet X-SVN-Commit-Revision: 340868 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4FBAB6BE6F X-Spamd-Result: default: False [1.08 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.03)[-0.031,0]; NEURAL_SPAM_LONG(0.40)[0.400,0]; NEURAL_SPAM_MEDIUM(0.71)[0.712,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Nov 2018 07:16:45 -0000 Author: cy Date: Sat Nov 24 07:16:44 2018 New Revision: 340868 URL: https://svnweb.freebsd.org/changeset/base/340868 Log: An OSF/1 ifdef makes absolutley no sense in a FreeBSD specific source file. MFC after: 1 week Modified: head/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c Modified: head/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c ============================================================================== --- head/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c Sat Nov 24 06:49:41 2018 (r340867) +++ head/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c Sat Nov 24 07:16:44 2018 (r340868) @@ -58,9 +58,6 @@ static const char rcsid[] = "@(#)$Id$"; #include #include #include -#if defined(__osf__) -# include -#endif #include #include #include From owner-svn-src-all@freebsd.org Sat Nov 24 06:49:42 2018 Return-Path: Delivered-To: svn-src-all@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 AED051143318; Sat, 24 Nov 2018 06:49:42 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.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 436C06AFED; Sat, 24 Nov 2018 06:49:42 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1AF3423A2; Sat, 24 Nov 2018 06:49:42 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAO6nfXT068169; Sat, 24 Nov 2018 06:49:41 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAO6nfCb068168; Sat, 24 Nov 2018 06:49:41 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201811240649.wAO6nfCb068168@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Sat, 24 Nov 2018 06:49:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340867 - head/sys/contrib/ipfilter/netinet X-SVN-Group: head X-SVN-Commit-Author: cy X-SVN-Commit-Paths: head/sys/contrib/ipfilter/netinet X-SVN-Commit-Revision: 340867 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 436C06AFED X-Spamd-Result: default: False [1.08 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.03)[-0.031,0]; NEURAL_SPAM_LONG(0.40)[0.400,0]; NEURAL_SPAM_MEDIUM(0.71)[0.712,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Nov 2018 06:49:42 -0000 Author: cy Date: Sat Nov 24 06:49:41 2018 New Revision: 340867 URL: https://svnweb.freebsd.org/changeset/base/340867 Log: FreeBSD 7 has been history for many moons. Remove some dead code. MFC after: 1 week Modified: head/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c Modified: head/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c ============================================================================== --- head/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c Sat Nov 24 01:25:45 2018 (r340866) +++ head/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c Sat Nov 24 06:49:41 2018 (r340867) @@ -57,15 +57,7 @@ static const char rcsid[] = "@(#)$Id$"; #include #include #include -#if defined(__FreeBSD_version) && (__FreeBSD_version >= 800000) #include -#else -#define CURVNET_SET(arg) -#define CURVNET_RESTORE() -#define VNET_DEFINE(_t, _v) _t _v -#define VNET_DECLARE(_t, _v) extern _t _v -#define VNET(arg) arg -#endif #if defined(__osf__) # include #endif From owner-svn-src-all@freebsd.org Sat Nov 24 13:28:43 2018 Return-Path: Delivered-To: svn-src-all@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 6A610114ECBF; Sat, 24 Nov 2018 13:28:43 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1014F78625; Sat, 24 Nov 2018 13:28:43 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1033) id F24F5FDAA; Sat, 24 Nov 2018 13:28:42 +0000 (UTC) Date: Sat, 24 Nov 2018 13:28:42 +0000 From: Alexey Dokuchaev To: Ed Maste Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r340702 - in head/lib/csu: amd64 common i386 Message-ID: <20181124132842.GA50931@FreeBSD.org> References: <201811202104.wAKL4KZl030127@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201811202104.wAKL4KZl030127@repo.freebsd.org> User-Agent: Mutt/1.10.1 (2018-07-13) X-Rspamd-Queue-Id: 1014F78625 X-Spamd-Result: default: False [1.95 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_SPAM_LONG(0.84)[0.836,0]; NEURAL_SPAM_SHORT(0.22)[0.217,0]; NEURAL_SPAM_MEDIUM(0.90)[0.900,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Nov 2018 13:28:43 -0000 On Tue, Nov 20, 2018 at 09:04:20PM +0000, Ed Maste wrote: > New Revision: 340702 > URL: https://svnweb.freebsd.org/changeset/base/340702 > > Log: > csu: use BSD-1-clause license on csu files > > Copyright on these files is held by kib@ and/or the Foundation, > and both agree to this change. Out of curiosity (and in faint hope that maybe one day people would start writing sensible commit logs): may I ask why? ./danfe From owner-svn-src-all@freebsd.org Sat Nov 24 15:10:06 2018 Return-Path: Delivered-To: svn-src-all@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 59903115109D; Sat, 24 Nov 2018 15:10:06 +0000 (UTC) (envelope-from bcr@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F13CF7BFFD; Sat, 24 Nov 2018 15:10:05 +0000 (UTC) (envelope-from bcr@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CDA64795D; Sat, 24 Nov 2018 15:10:05 +0000 (UTC) (envelope-from bcr@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAOFA5Un040613; Sat, 24 Nov 2018 15:10:05 GMT (envelope-from bcr@FreeBSD.org) Received: (from bcr@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAOFA5QF040612; Sat, 24 Nov 2018 15:10:05 GMT (envelope-from bcr@FreeBSD.org) Message-Id: <201811241510.wAOFA5QF040612@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bcr set sender to bcr@FreeBSD.org using -f From: Benedict Reuschling Date: Sat, 24 Nov 2018 15:10:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r340870 - stable/12/usr.bin/fortune/datfiles X-SVN-Group: stable-12 X-SVN-Commit-Author: bcr X-SVN-Commit-Paths: stable/12/usr.bin/fortune/datfiles X-SVN-Commit-Revision: 340870 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: F13CF7BFFD X-Spamd-Result: default: False [1.51 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.61)[0.611,0]; NEURAL_SPAM_SHORT(0.20)[0.201,0]; NEURAL_SPAM_MEDIUM(0.70)[0.697,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Nov 2018 15:10:06 -0000 Author: bcr (doc committer) Date: Sat Nov 24 15:10:05 2018 New Revision: 340870 URL: https://svnweb.freebsd.org/changeset/base/340870 Log: MFC r340649: Add a fortune describing how to upload a machine's dmesg information to the NYCBUG database. We want to encourage our users to upload their dmesgs so that the project can get a better insight into what kind of hardware is run on. This helps in making data-driven decisions about i.e., platform and driver support. Note that dmesgs may contain sensitive information like hardware serial numbers, hence uploading them without review is discouraged. Reviewed by: brooks, imp, allanjude Approved by: allanjude Differential Revision: https://reviews.freebsd.org/D17705 Modified: stable/12/usr.bin/fortune/datfiles/freebsd-tips Directory Properties: stable/12/ (props changed) Modified: stable/12/usr.bin/fortune/datfiles/freebsd-tips ============================================================================== --- stable/12/usr.bin/fortune/datfiles/freebsd-tips Sat Nov 24 14:46:06 2018 (r340869) +++ stable/12/usr.bin/fortune/datfiles/freebsd-tips Sat Nov 24 15:10:05 2018 (r340870) @@ -554,3 +554,9 @@ Use "sysrc name=value" to add an entry and "sysrc -x n -- Lars Engels % +You can upload the dmesg of your system to help developers get an overview of commonly used hardware and peripherals for FreeBSD. +Use the curl package to upload it in one command: +curl -v -d "nickname=$USER" -d "description=FreeBSD/$(uname -m) on \ +$(kenv smbios.system.maker) $(kenv smbios.system.product)" -d "do=addd" \ +--data-urlencode 'dmesg@/var/run/dmesg.boot' http://dmesgd.nycbug.org/index.cgi +% From owner-svn-src-all@freebsd.org Sat Nov 24 15:22:58 2018 Return-Path: Delivered-To: svn-src-all@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 BB26811515F6; Sat, 24 Nov 2018 15:22:58 +0000 (UTC) (envelope-from arybchik@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 5B3B17C7DE; Sat, 24 Nov 2018 15:22:58 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 36CC57C86; Sat, 24 Nov 2018 15:22:58 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAOFMwmm050917; Sat, 24 Nov 2018 15:22:58 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAOFMwAX050916; Sat, 24 Nov 2018 15:22:58 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811241522.wAOFMwAX050916@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Sat, 24 Nov 2018 15:22:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340871 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 340871 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 5B3B17C7DE X-Spamd-Result: default: False [1.58 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.64)[0.643,0]; NEURAL_SPAM_SHORT(0.23)[0.227,0]; NEURAL_SPAM_MEDIUM(0.71)[0.712,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Nov 2018 15:22:58 -0000 Author: arybchik Date: Sat Nov 24 15:22:57 2018 New Revision: 340871 URL: https://svnweb.freebsd.org/changeset/base/340871 Log: sfxge(4): remove assertion on no longer used define MC_CMD_INIT_RXQ_OUT_LEN is not used any more. Submitted by: Mark Spender Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18106 Modified: head/sys/dev/sfxge/common/ef10_rx.c Modified: head/sys/dev/sfxge/common/ef10_rx.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_rx.c Sat Nov 24 15:10:05 2018 (r340870) +++ head/sys/dev/sfxge/common/ef10_rx.c Sat Nov 24 15:22:57 2018 (r340871) @@ -61,8 +61,6 @@ efx_mcdi_init_rxq( uint32_t dma_mode; boolean_t want_outer_classes; - /* If this changes, then the payload size might need to change. */ - EFSYS_ASSERT3U(MC_CMD_INIT_RXQ_OUT_LEN, ==, 0); EFSYS_ASSERT3U(size, <=, EFX_RXQ_MAXNDESCS); if (ps_bufsize > 0) From owner-svn-src-all@freebsd.org Sat Nov 24 15:23:11 2018 Return-Path: Delivered-To: svn-src-all@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 A75831151617; Sat, 24 Nov 2018 15:23:11 +0000 (UTC) (envelope-from arybchik@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 4D9DF7C8BE; Sat, 24 Nov 2018 15:23:11 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F244A7C87; Sat, 24 Nov 2018 15:23:10 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAOFNAMs050993; Sat, 24 Nov 2018 15:23:10 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAOFNAQP050988; Sat, 24 Nov 2018 15:23:10 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811241523.wAOFNAQP050988@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Sat, 24 Nov 2018 15:23:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340872 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 340872 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4D9DF7C8BE X-Spamd-Result: default: False [1.61 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.66)[0.661,0]; NEURAL_SPAM_MEDIUM(0.73)[0.730,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.22)[0.216,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Nov 2018 15:23:11 -0000 Author: arybchik Date: Sat Nov 24 15:23:09 2018 New Revision: 340872 URL: https://svnweb.freebsd.org/changeset/base/340872 Log: sfxge(4): improve names for EVQ descriptor counts Submitted by: Andy Moreton Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18107 Modified: head/sys/dev/sfxge/common/ef10_ev.c head/sys/dev/sfxge/common/ef10_impl.h head/sys/dev/sfxge/common/efx.h head/sys/dev/sfxge/common/efx_ev.c Modified: head/sys/dev/sfxge/common/ef10_ev.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_ev.c Sat Nov 24 15:22:57 2018 (r340871) +++ head/sys/dev/sfxge/common/ef10_ev.c Sat Nov 24 15:23:09 2018 (r340872) @@ -466,7 +466,7 @@ ef10_ev_qcreate( __in efx_nic_t *enp, __in unsigned int index, __in efsys_mem_t *esmp, - __in size_t n, + __in size_t ndescs, __in uint32_t id, __in uint32_t us, __in uint32_t flags, @@ -480,7 +480,8 @@ ef10_ev_qcreate( EFX_STATIC_ASSERT(ISP2(EFX_EVQ_MAXNEVS)); EFX_STATIC_ASSERT(ISP2(EFX_EVQ_MINNEVS)); - if (!ISP2(n) || (n < EFX_EVQ_MINNEVS) || (n > EFX_EVQ_MAXNEVS)) { + if (!ISP2(ndescs) || + (ndescs < EFX_EVQ_MINNEVS) || (ndescs > EFX_EVQ_MAXNEVS)) { rc = EINVAL; goto fail1; } @@ -529,7 +530,8 @@ ef10_ev_qcreate( * it will choose the best settings for low latency, otherwise * it will choose the best settings for throughput. */ - rc = efx_mcdi_init_evq_v2(enp, index, esmp, n, irq, us, flags); + rc = efx_mcdi_init_evq_v2(enp, index, esmp, ndescs, irq, us, + flags); if (rc != 0) goto fail4; } else { @@ -545,7 +547,7 @@ ef10_ev_qcreate( * to choose it.) */ boolean_t low_latency = encp->enc_datapath_cap_evb ? 0 : 1; - rc = efx_mcdi_init_evq(enp, index, esmp, n, irq, us, flags, + rc = efx_mcdi_init_evq(enp, index, esmp, ndescs, irq, us, flags, low_latency); if (rc != 0) goto fail5; Modified: head/sys/dev/sfxge/common/ef10_impl.h ============================================================================== --- head/sys/dev/sfxge/common/ef10_impl.h Sat Nov 24 15:22:57 2018 (r340871) +++ head/sys/dev/sfxge/common/ef10_impl.h Sat Nov 24 15:23:09 2018 (r340872) @@ -82,7 +82,7 @@ ef10_ev_qcreate( __in efx_nic_t *enp, __in unsigned int index, __in efsys_mem_t *esmp, - __in size_t n, + __in size_t ndescs, __in uint32_t id, __in uint32_t us, __in uint32_t flags, Modified: head/sys/dev/sfxge/common/efx.h ============================================================================== --- head/sys/dev/sfxge/common/efx.h Sat Nov 24 15:22:57 2018 (r340871) +++ head/sys/dev/sfxge/common/efx.h Sat Nov 24 15:23:09 2018 (r340872) @@ -1638,7 +1638,7 @@ efx_ev_qcreate( __in efx_nic_t *enp, __in unsigned int index, __in efsys_mem_t *esmp, - __in size_t n, + __in size_t ndescs, __in uint32_t id, __in uint32_t us, __in uint32_t flags, Modified: head/sys/dev/sfxge/common/efx_ev.c ============================================================================== --- head/sys/dev/sfxge/common/efx_ev.c Sat Nov 24 15:22:57 2018 (r340871) +++ head/sys/dev/sfxge/common/efx_ev.c Sat Nov 24 15:23:09 2018 (r340872) @@ -70,7 +70,7 @@ siena_ev_qcreate( __in efx_nic_t *enp, __in unsigned int index, __in efsys_mem_t *esmp, - __in size_t n, + __in size_t ndescs, __in uint32_t id, __in uint32_t us, __in uint32_t flags, @@ -221,7 +221,7 @@ efx_ev_qcreate( __in efx_nic_t *enp, __in unsigned int index, __in efsys_mem_t *esmp, - __in size_t n, + __in size_t ndescs, __in uint32_t id, __in uint32_t us, __in uint32_t flags, @@ -261,7 +261,7 @@ efx_ev_qcreate( eep->ee_magic = EFX_EVQ_MAGIC; eep->ee_enp = enp; eep->ee_index = index; - eep->ee_mask = n - 1; + eep->ee_mask = ndescs - 1; eep->ee_flags = flags; eep->ee_esmp = esmp; @@ -276,7 +276,7 @@ efx_ev_qcreate( enp->en_ev_qcount++; *eepp = eep; - if ((rc = eevop->eevo_qcreate(enp, index, esmp, n, id, us, flags, + if ((rc = eevop->eevo_qcreate(enp, index, esmp, ndescs, id, us, flags, eep)) != 0) goto fail4; @@ -1286,7 +1286,7 @@ siena_ev_qcreate( __in efx_nic_t *enp, __in unsigned int index, __in efsys_mem_t *esmp, - __in size_t n, + __in size_t ndescs, __in uint32_t id, __in uint32_t us, __in uint32_t flags, @@ -1303,7 +1303,8 @@ siena_ev_qcreate( EFX_STATIC_ASSERT(ISP2(EFX_EVQ_MAXNEVS)); EFX_STATIC_ASSERT(ISP2(EFX_EVQ_MINNEVS)); - if (!ISP2(n) || (n < EFX_EVQ_MINNEVS) || (n > EFX_EVQ_MAXNEVS)) { + if (!ISP2(ndescs) || + (ndescs < EFX_EVQ_MINNEVS) || (ndescs > EFX_EVQ_MAXNEVS)) { rc = EINVAL; goto fail1; } @@ -1320,7 +1321,7 @@ siena_ev_qcreate( #endif for (size = 0; (1 << size) <= (EFX_EVQ_MAXNEVS / EFX_EVQ_MINNEVS); size++) - if ((1 << size) == (int)(n / EFX_EVQ_MINNEVS)) + if ((1 << size) == (int)(ndescs / EFX_EVQ_MINNEVS)) break; if (id + (1 << size) >= encp->enc_buftbl_limit) { rc = EINVAL; From owner-svn-src-all@freebsd.org Sat Nov 24 15:23:25 2018 Return-Path: Delivered-To: svn-src-all@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 BE6541151641; Sat, 24 Nov 2018 15:23:25 +0000 (UTC) (envelope-from arybchik@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 6141F7C9E3; Sat, 24 Nov 2018 15:23:25 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 50E427C88; Sat, 24 Nov 2018 15:23:23 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAOFNNbo051061; Sat, 24 Nov 2018 15:23:23 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAOFNMeu051057; Sat, 24 Nov 2018 15:23:22 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811241523.wAOFNMeu051057@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Sat, 24 Nov 2018 15:23:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340873 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 340873 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 6141F7C9E3 X-Spamd-Result: default: False [1.63 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.68)[0.678,0]; NEURAL_SPAM_MEDIUM(0.75)[0.746,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.21)[0.205,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Nov 2018 15:23:26 -0000 Author: arybchik Date: Sat Nov 24 15:23:22 2018 New Revision: 340873 URL: https://svnweb.freebsd.org/changeset/base/340873 Log: sfxge(4): improve names for RXQ descriptor counts Submitted by: Andy Moreton Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18108 Modified: head/sys/dev/sfxge/common/ef10_impl.h head/sys/dev/sfxge/common/ef10_rx.c head/sys/dev/sfxge/common/efx.h head/sys/dev/sfxge/common/efx_rx.c Modified: head/sys/dev/sfxge/common/ef10_impl.h ============================================================================== --- head/sys/dev/sfxge/common/ef10_impl.h Sat Nov 24 15:23:09 2018 (r340872) +++ head/sys/dev/sfxge/common/ef10_impl.h Sat Nov 24 15:23:22 2018 (r340873) @@ -956,14 +956,14 @@ ef10_rx_prefix_pktlen( __in uint8_t *buffer, __out uint16_t *lengthp); -extern void +extern void ef10_rx_qpost( - __in efx_rxq_t *erp, - __in_ecount(n) efsys_dma_addr_t *addrp, - __in size_t size, - __in unsigned int n, - __in unsigned int completed, - __in unsigned int added); + __in efx_rxq_t *erp, + __in_ecount(ndescs) efsys_dma_addr_t *addrp, + __in size_t size, + __in unsigned int ndescs, + __in unsigned int completed, + __in unsigned int added); extern void ef10_rx_qpush( @@ -986,7 +986,7 @@ ef10_rx_qcreate( __in unsigned int label, __in efx_rxq_type_t type, __in efsys_mem_t *esmp, - __in size_t n, + __in size_t ndescs, __in uint32_t id, __in efx_evq_t *eep, __in efx_rxq_t *erp); Modified: head/sys/dev/sfxge/common/ef10_rx.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_rx.c Sat Nov 24 15:23:09 2018 (r340872) +++ head/sys/dev/sfxge/common/ef10_rx.c Sat Nov 24 15:23:22 2018 (r340873) @@ -41,7 +41,7 @@ __FBSDID("$FreeBSD$"); static __checkReturn efx_rc_t efx_mcdi_init_rxq( __in efx_nic_t *enp, - __in uint32_t size, + __in uint32_t ndescs, __in uint32_t target_evq, __in uint32_t label, __in uint32_t instance, @@ -53,7 +53,7 @@ efx_mcdi_init_rxq( efx_mcdi_req_t req; uint8_t payload[MAX(MC_CMD_INIT_RXQ_EXT_IN_LEN, MC_CMD_INIT_RXQ_EXT_OUT_LEN)]; - int npages = EFX_RXQ_NBUFS(size); + int npages = EFX_RXQ_NBUFS(ndescs); int i; efx_qword_t *dma_addr; uint64_t addr; @@ -61,7 +61,7 @@ efx_mcdi_init_rxq( uint32_t dma_mode; boolean_t want_outer_classes; - EFSYS_ASSERT3U(size, <=, EFX_RXQ_MAXNDESCS); + EFSYS_ASSERT3U(ndescs, <=, EFX_RXQ_MAXNDESCS); if (ps_bufsize > 0) dma_mode = MC_CMD_INIT_RXQ_EXT_IN_PACKED_STREAM; @@ -94,7 +94,7 @@ efx_mcdi_init_rxq( req.emr_out_buf = payload; req.emr_out_length = MC_CMD_INIT_RXQ_EXT_OUT_LEN; - MCDI_IN_SET_DWORD(req, INIT_RXQ_EXT_IN_SIZE, size); + MCDI_IN_SET_DWORD(req, INIT_RXQ_EXT_IN_SIZE, ndescs); MCDI_IN_SET_DWORD(req, INIT_RXQ_EXT_IN_TARGET_EVQ, target_evq); MCDI_IN_SET_DWORD(req, INIT_RXQ_EXT_IN_LABEL, label); MCDI_IN_SET_DWORD(req, INIT_RXQ_EXT_IN_INSTANCE, instance); @@ -738,14 +738,14 @@ ef10_rx_prefix_hash( #define EFX_RXQ_PACKED_STREAM_FAKE_BUF_SIZE 32 #endif - void + void ef10_rx_qpost( - __in efx_rxq_t *erp, - __in_ecount(n) efsys_dma_addr_t *addrp, - __in size_t size, - __in unsigned int n, - __in unsigned int completed, - __in unsigned int added) + __in efx_rxq_t *erp, + __in_ecount(ndescs) efsys_dma_addr_t *addrp, + __in size_t size, + __in unsigned int ndescs, + __in unsigned int completed, + __in unsigned int added) { efx_qword_t qword; unsigned int i; @@ -762,11 +762,11 @@ ef10_rx_qpost( #endif /* The client driver must not overfill the queue */ - EFSYS_ASSERT3U(added - completed + n, <=, + EFSYS_ASSERT3U(added - completed + ndescs, <=, EFX_RXQ_LIMIT(erp->er_mask + 1)); id = added & (erp->er_mask); - for (i = 0; i < n; i++) { + for (i = 0; i < ndescs; i++) { EFSYS_PROBE4(rx_post, unsigned int, erp->er_index, unsigned int, id, efsys_dma_addr_t, addrp[i], size_t, size); @@ -944,7 +944,7 @@ ef10_rx_qcreate( __in unsigned int label, __in efx_rxq_type_t type, __in efsys_mem_t *esmp, - __in size_t n, + __in size_t ndescs, __in uint32_t id, __in efx_evq_t *eep, __in efx_rxq_t *erp) @@ -963,7 +963,8 @@ ef10_rx_qcreate( EFX_STATIC_ASSERT(ISP2(EFX_RXQ_MAXNDESCS)); EFX_STATIC_ASSERT(ISP2(EFX_RXQ_MINNDESCS)); - if (!ISP2(n) || (n < EFX_RXQ_MINNDESCS) || (n > EFX_RXQ_MAXNDESCS)) { + if (!ISP2(ndescs) || + (ndescs < EFX_RXQ_MINNDESCS) || (ndescs > EFX_RXQ_MAXNDESCS)) { rc = EINVAL; goto fail1; } @@ -1023,7 +1024,7 @@ ef10_rx_qcreate( else disable_scatter = encp->enc_rx_disable_scatter_supported; - if ((rc = efx_mcdi_init_rxq(enp, n, eep->ee_index, label, index, + if ((rc = efx_mcdi_init_rxq(enp, ndescs, eep->ee_index, label, index, esmp, disable_scatter, ps_buf_size)) != 0) goto fail6; Modified: head/sys/dev/sfxge/common/efx.h ============================================================================== --- head/sys/dev/sfxge/common/efx.h Sat Nov 24 15:23:09 2018 (r340872) +++ head/sys/dev/sfxge/common/efx.h Sat Nov 24 15:23:22 2018 (r340873) @@ -2018,7 +2018,7 @@ efx_rx_qcreate( __in unsigned int label, __in efx_rxq_type_t type, __in efsys_mem_t *esmp, - __in size_t n, + __in size_t ndescs, __in uint32_t id, __in efx_evq_t *eep, __deref_out efx_rxq_t **erpp); @@ -2033,14 +2033,14 @@ typedef struct efx_desc_s { efx_qword_t ed_eq; } efx_desc_t; -extern void +extern void efx_rx_qpost( - __in efx_rxq_t *erp, - __in_ecount(n) efsys_dma_addr_t *addrp, - __in size_t size, - __in unsigned int n, - __in unsigned int completed, - __in unsigned int added); + __in efx_rxq_t *erp, + __in_ecount(ndescs) efsys_dma_addr_t *addrp, + __in size_t size, + __in unsigned int ndescs, + __in unsigned int completed, + __in unsigned int added); extern void efx_rx_qpush( Modified: head/sys/dev/sfxge/common/efx_rx.c ============================================================================== --- head/sys/dev/sfxge/common/efx_rx.c Sat Nov 24 15:23:09 2018 (r340872) +++ head/sys/dev/sfxge/common/efx_rx.c Sat Nov 24 15:23:22 2018 (r340873) @@ -91,14 +91,14 @@ siena_rx_prefix_pktlen( __in uint8_t *buffer, __out uint16_t *lengthp); -static void +static void siena_rx_qpost( - __in efx_rxq_t *erp, - __in_ecount(n) efsys_dma_addr_t *addrp, - __in size_t size, - __in unsigned int n, - __in unsigned int completed, - __in unsigned int added); + __in efx_rxq_t *erp, + __in_ecount(ndescs) efsys_dma_addr_t *addrp, + __in size_t size, + __in unsigned int ndescs, + __in unsigned int completed, + __in unsigned int added); static void siena_rx_qpush( @@ -137,7 +137,7 @@ siena_rx_qcreate( __in unsigned int label, __in efx_rxq_type_t type, __in efsys_mem_t *esmp, - __in size_t n, + __in size_t ndescs, __in uint32_t id, __in efx_evq_t *eep, __in efx_rxq_t *erp); @@ -517,21 +517,21 @@ fail1: } #endif /* EFSYS_OPT_RX_SCALE */ - void + void efx_rx_qpost( - __in efx_rxq_t *erp, - __in_ecount(n) efsys_dma_addr_t *addrp, - __in size_t size, - __in unsigned int n, - __in unsigned int completed, - __in unsigned int added) + __in efx_rxq_t *erp, + __in_ecount(ndescs) efsys_dma_addr_t *addrp, + __in size_t size, + __in unsigned int ndescs, + __in unsigned int completed, + __in unsigned int added) { efx_nic_t *enp = erp->er_enp; const efx_rx_ops_t *erxop = enp->en_erxop; EFSYS_ASSERT3U(erp->er_magic, ==, EFX_RXQ_MAGIC); - erxop->erxo_qpost(erp, addrp, size, n, completed, added); + erxop->erxo_qpost(erp, addrp, size, ndescs, completed, added); } #if EFSYS_OPT_RX_PACKED_STREAM @@ -622,7 +622,7 @@ efx_rx_qcreate( __in unsigned int label, __in efx_rxq_type_t type, __in efsys_mem_t *esmp, - __in size_t n, + __in size_t ndescs, __in uint32_t id, __in efx_evq_t *eep, __deref_out efx_rxq_t **erpp) @@ -645,10 +645,10 @@ efx_rx_qcreate( erp->er_magic = EFX_RXQ_MAGIC; erp->er_enp = enp; erp->er_index = index; - erp->er_mask = n - 1; + erp->er_mask = ndescs - 1; erp->er_esmp = esmp; - if ((rc = erxop->erxo_qcreate(enp, index, label, type, esmp, n, id, + if ((rc = erxop->erxo_qcreate(enp, index, label, type, esmp, ndescs, id, eep, erp)) != 0) goto fail2; @@ -1168,14 +1168,14 @@ siena_rx_prefix_pktlen( } -static void +static void siena_rx_qpost( - __in efx_rxq_t *erp, - __in_ecount(n) efsys_dma_addr_t *addrp, - __in size_t size, - __in unsigned int n, - __in unsigned int completed, - __in unsigned int added) + __in efx_rxq_t *erp, + __in_ecount(ndescs) efsys_dma_addr_t *addrp, + __in size_t size, + __in unsigned int ndescs, + __in unsigned int completed, + __in unsigned int added) { efx_qword_t qword; unsigned int i; @@ -1183,11 +1183,11 @@ siena_rx_qpost( unsigned int id; /* The client driver must not overfill the queue */ - EFSYS_ASSERT3U(added - completed + n, <=, + EFSYS_ASSERT3U(added - completed + ndescs, <=, EFX_RXQ_LIMIT(erp->er_mask + 1)); id = added & (erp->er_mask); - for (i = 0; i < n; i++) { + for (i = 0; i < ndescs; i++) { EFSYS_PROBE4(rx_post, unsigned int, erp->er_index, unsigned int, id, efsys_dma_addr_t, addrp[i], size_t, size); @@ -1309,7 +1309,7 @@ siena_rx_qcreate( __in unsigned int label, __in efx_rxq_type_t type, __in efsys_mem_t *esmp, - __in size_t n, + __in size_t ndescs, __in uint32_t id, __in efx_evq_t *eep, __in efx_rxq_t *erp) @@ -1330,7 +1330,8 @@ siena_rx_qcreate( EFX_STATIC_ASSERT(ISP2(EFX_RXQ_MAXNDESCS)); EFX_STATIC_ASSERT(ISP2(EFX_RXQ_MINNDESCS)); - if (!ISP2(n) || (n < EFX_RXQ_MINNDESCS) || (n > EFX_RXQ_MAXNDESCS)) { + if (!ISP2(ndescs) || + (ndescs < EFX_RXQ_MINNDESCS) || (ndescs > EFX_RXQ_MAXNDESCS)) { rc = EINVAL; goto fail1; } @@ -1340,7 +1341,7 @@ siena_rx_qcreate( } for (size = 0; (1 << size) <= (EFX_RXQ_MAXNDESCS / EFX_RXQ_MINNDESCS); size++) - if ((1 << size) == (int)(n / EFX_RXQ_MINNDESCS)) + if ((1 << size) == (int)(ndescs / EFX_RXQ_MINNDESCS)) break; if (id + (1 << size) >= encp->enc_buftbl_limit) { rc = EINVAL; From owner-svn-src-all@freebsd.org Sat Nov 24 15:23:38 2018 Return-Path: Delivered-To: svn-src-all@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 EC0341151680; Sat, 24 Nov 2018 15:23:37 +0000 (UTC) (envelope-from arybchik@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 905857CAE8; Sat, 24 Nov 2018 15:23:37 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 66B5D7C92; Sat, 24 Nov 2018 15:23:35 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAOFNZ99051129; Sat, 24 Nov 2018 15:23:35 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAOFNYPm051126; Sat, 24 Nov 2018 15:23:34 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811241523.wAOFNYPm051126@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Sat, 24 Nov 2018 15:23:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340874 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 340874 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 905857CAE8 X-Spamd-Result: default: False [1.63 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.68)[0.678,0]; NEURAL_SPAM_MEDIUM(0.75)[0.746,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.21)[0.205,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Nov 2018 15:23:38 -0000 Author: arybchik Date: Sat Nov 24 15:23:34 2018 New Revision: 340874 URL: https://svnweb.freebsd.org/changeset/base/340874 Log: sfxge(4): improve names for TXQ descriptor counts Submitted by: Andy Moreton Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18109 Modified: head/sys/dev/sfxge/common/ef10_impl.h head/sys/dev/sfxge/common/ef10_tx.c head/sys/dev/sfxge/common/efx.h head/sys/dev/sfxge/common/efx_tx.c Modified: head/sys/dev/sfxge/common/ef10_impl.h ============================================================================== --- head/sys/dev/sfxge/common/ef10_impl.h Sat Nov 24 15:23:22 2018 (r340873) +++ head/sys/dev/sfxge/common/ef10_impl.h Sat Nov 24 15:23:34 2018 (r340874) @@ -670,7 +670,7 @@ ef10_tx_qcreate( __in unsigned int index, __in unsigned int label, __in efsys_mem_t *esmp, - __in size_t n, + __in size_t ndescs, __in uint32_t id, __in uint16_t flags, __in efx_evq_t *eep, @@ -681,13 +681,13 @@ extern void ef10_tx_qdestroy( __in efx_txq_t *etp); -extern __checkReturn efx_rc_t +extern __checkReturn efx_rc_t ef10_tx_qpost( - __in efx_txq_t *etp, - __in_ecount(n) efx_buffer_t *eb, - __in unsigned int n, - __in unsigned int completed, - __inout unsigned int *addedp); + __in efx_txq_t *etp, + __in_ecount(ndescs) efx_buffer_t *ebp, + __in unsigned int ndescs, + __in unsigned int completed, + __inout unsigned int *addedp); extern void ef10_tx_qpush( Modified: head/sys/dev/sfxge/common/ef10_tx.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_tx.c Sat Nov 24 15:23:22 2018 (r340873) +++ head/sys/dev/sfxge/common/ef10_tx.c Sat Nov 24 15:23:34 2018 (r340874) @@ -50,7 +50,7 @@ __FBSDID("$FreeBSD$"); static __checkReturn efx_rc_t efx_mcdi_init_txq( __in efx_nic_t *enp, - __in uint32_t size, + __in uint32_t ndescs, __in uint32_t target_evq, __in uint32_t label, __in uint32_t instance, @@ -69,7 +69,7 @@ efx_mcdi_init_txq( EFSYS_ASSERT(EFX_TXQ_MAX_BUFS >= EFX_TXQ_NBUFS(enp->en_nic_cfg.enc_txq_max_ndescs)); - npages = EFX_TXQ_NBUFS(size); + npages = EFX_TXQ_NBUFS(ndescs); if (MC_CMD_INIT_TXQ_IN_LEN(npages) > sizeof (payload)) { rc = EINVAL; goto fail1; @@ -82,7 +82,7 @@ efx_mcdi_init_txq( req.emr_out_buf = payload; req.emr_out_length = MC_CMD_INIT_TXQ_OUT_LEN; - MCDI_IN_SET_DWORD(req, INIT_TXQ_IN_SIZE, size); + MCDI_IN_SET_DWORD(req, INIT_TXQ_IN_SIZE, ndescs); MCDI_IN_SET_DWORD(req, INIT_TXQ_IN_TARGET_EVQ, target_evq); MCDI_IN_SET_DWORD(req, INIT_TXQ_IN_LABEL, label); MCDI_IN_SET_DWORD(req, INIT_TXQ_IN_INSTANCE, instance); @@ -194,7 +194,7 @@ ef10_tx_qcreate( __in unsigned int index, __in unsigned int label, __in efsys_mem_t *esmp, - __in size_t n, + __in size_t ndescs, __in uint32_t id, __in uint16_t flags, __in efx_evq_t *eep, @@ -215,8 +215,8 @@ ef10_tx_qcreate( goto fail1; } - if ((rc = efx_mcdi_init_txq(enp, n, eep->ee_index, label, index, flags, - esmp)) != 0) + if ((rc = efx_mcdi_init_txq(enp, ndescs, eep->ee_index, label, index, + flags, esmp)) != 0) goto fail2; /* @@ -436,24 +436,24 @@ fail1: return (rc); } - __checkReturn efx_rc_t + __checkReturn efx_rc_t ef10_tx_qpost( - __in efx_txq_t *etp, - __in_ecount(n) efx_buffer_t *eb, - __in unsigned int n, - __in unsigned int completed, - __inout unsigned int *addedp) + __in efx_txq_t *etp, + __in_ecount(ndescs) efx_buffer_t *eb, + __in unsigned int ndescs, + __in unsigned int completed, + __inout unsigned int *addedp) { unsigned int added = *addedp; unsigned int i; efx_rc_t rc; - if (added - completed + n > EFX_TXQ_LIMIT(etp->et_mask + 1)) { + if (added - completed + ndescs > EFX_TXQ_LIMIT(etp->et_mask + 1)) { rc = ENOSPC; goto fail1; } - for (i = 0; i < n; i++) { + for (i = 0; i < ndescs; i++) { efx_buffer_t *ebp = &eb[i]; efsys_dma_addr_t addr = ebp->eb_addr; size_t size = ebp->eb_size; @@ -559,24 +559,24 @@ ef10_tx_qpush( } } - __checkReturn efx_rc_t + __checkReturn efx_rc_t ef10_tx_qdesc_post( - __in efx_txq_t *etp, - __in_ecount(n) efx_desc_t *ed, - __in unsigned int n, - __in unsigned int completed, - __inout unsigned int *addedp) + __in efx_txq_t *etp, + __in_ecount(ndescs) efx_desc_t *ed, + __in unsigned int ndescs, + __in unsigned int completed, + __inout unsigned int *addedp) { unsigned int added = *addedp; unsigned int i; efx_rc_t rc; - if (added - completed + n > EFX_TXQ_LIMIT(etp->et_mask + 1)) { + if (added - completed + ndescs > EFX_TXQ_LIMIT(etp->et_mask + 1)) { rc = ENOSPC; goto fail1; } - for (i = 0; i < n; i++) { + for (i = 0; i < ndescs; i++) { efx_desc_t *edp = &ed[i]; unsigned int id; size_t offset; @@ -588,7 +588,7 @@ ef10_tx_qdesc_post( } EFSYS_PROBE3(tx_desc_post, unsigned int, etp->et_index, - unsigned int, added, unsigned int, n); + unsigned int, added, unsigned int, ndescs); EFX_TX_QSTAT_INCR(etp, TX_POST); Modified: head/sys/dev/sfxge/common/efx.h ============================================================================== --- head/sys/dev/sfxge/common/efx.h Sat Nov 24 15:23:22 2018 (r340873) +++ head/sys/dev/sfxge/common/efx.h Sat Nov 24 15:23:34 2018 (r340874) @@ -2130,13 +2130,13 @@ efx_tx_qcreate( __deref_out efx_txq_t **etpp, __out unsigned int *addedp); -extern __checkReturn efx_rc_t +extern __checkReturn efx_rc_t efx_tx_qpost( - __in efx_txq_t *etp, - __in_ecount(n) efx_buffer_t *eb, - __in unsigned int n, - __in unsigned int completed, - __inout unsigned int *addedp); + __in efx_txq_t *etp, + __in_ecount(ndescs) efx_buffer_t *eb, + __in unsigned int ndescs, + __in unsigned int completed, + __inout unsigned int *addedp); extern __checkReturn efx_rc_t efx_tx_qpace( Modified: head/sys/dev/sfxge/common/efx_tx.c ============================================================================== --- head/sys/dev/sfxge/common/efx_tx.c Sat Nov 24 15:23:22 2018 (r340873) +++ head/sys/dev/sfxge/common/efx_tx.c Sat Nov 24 15:23:34 2018 (r340874) @@ -62,7 +62,7 @@ siena_tx_qcreate( __in unsigned int index, __in unsigned int label, __in efsys_mem_t *esmp, - __in size_t n, + __in size_t ndescs, __in uint32_t id, __in uint16_t flags, __in efx_evq_t *eep, @@ -73,13 +73,13 @@ static void siena_tx_qdestroy( __in efx_txq_t *etp); -static __checkReturn efx_rc_t +static __checkReturn efx_rc_t siena_tx_qpost( - __in efx_txq_t *etp, - __in_ecount(n) efx_buffer_t *eb, - __in unsigned int n, - __in unsigned int completed, - __inout unsigned int *addedp); + __in efx_txq_t *etp, + __in_ecount(ndescs) efx_buffer_t *eb, + __in unsigned int ndescs, + __in unsigned int completed, + __inout unsigned int *addedp); static void siena_tx_qpush( @@ -100,13 +100,13 @@ static void siena_tx_qenable( __in efx_txq_t *etp); - __checkReturn efx_rc_t + __checkReturn efx_rc_t siena_tx_qdesc_post( - __in efx_txq_t *etp, - __in_ecount(n) efx_desc_t *ed, - __in unsigned int n, - __in unsigned int completed, - __inout unsigned int *addedp); + __in efx_txq_t *etp, + __in_ecount(ndescs) efx_desc_t *ed, + __in unsigned int ndescs, + __in unsigned int completed, + __inout unsigned int *addedp); void siena_tx_qdesc_dma_create( @@ -295,7 +295,7 @@ efx_tx_qcreate( __in unsigned int index, __in unsigned int label, __in efsys_mem_t *esmp, - __in size_t n, + __in size_t ndescs, __in uint32_t id, __in uint16_t flags, __in efx_evq_t *eep, @@ -323,14 +323,14 @@ efx_tx_qcreate( etp->et_magic = EFX_TXQ_MAGIC; etp->et_enp = enp; etp->et_index = index; - etp->et_mask = n - 1; + etp->et_mask = ndescs - 1; etp->et_esmp = esmp; /* Initial descriptor index may be modified by etxo_qcreate */ *addedp = 0; if ((rc = etxop->etxo_qcreate(enp, index, label, esmp, - n, id, flags, eep, etp, addedp)) != 0) + ndescs, id, flags, eep, etp, addedp)) != 0) goto fail2; enp->en_tx_qcount++; @@ -364,13 +364,13 @@ efx_tx_qdestroy( EFSYS_KMEM_FREE(enp->en_esip, sizeof (efx_txq_t), etp); } - __checkReturn efx_rc_t + __checkReturn efx_rc_t efx_tx_qpost( - __in efx_txq_t *etp, - __in_ecount(n) efx_buffer_t *eb, - __in unsigned int n, - __in unsigned int completed, - __inout unsigned int *addedp) + __in efx_txq_t *etp, + __in_ecount(ndescs) efx_buffer_t *eb, + __in unsigned int ndescs, + __in unsigned int completed, + __inout unsigned int *addedp) { efx_nic_t *enp = etp->et_enp; const efx_tx_ops_t *etxop = enp->en_etxop; @@ -378,8 +378,7 @@ efx_tx_qpost( EFSYS_ASSERT3U(etp->et_magic, ==, EFX_TXQ_MAGIC); - if ((rc = etxop->etxo_qpost(etp, eb, - n, completed, addedp)) != 0) + if ((rc = etxop->etxo_qpost(etp, eb, ndescs, completed, addedp)) != 0) goto fail1; return (0); @@ -555,13 +554,13 @@ fail1: return (rc); } - __checkReturn efx_rc_t + __checkReturn efx_rc_t efx_tx_qdesc_post( - __in efx_txq_t *etp, - __in_ecount(n) efx_desc_t *ed, - __in unsigned int n, - __in unsigned int completed, - __inout unsigned int *addedp) + __in efx_txq_t *etp, + __in_ecount(ndescs) efx_desc_t *ed, + __in unsigned int ndescs, + __in unsigned int completed, + __inout unsigned int *addedp) { efx_nic_t *enp = etp->et_enp; const efx_tx_ops_t *etxop = enp->en_etxop; @@ -570,7 +569,7 @@ efx_tx_qdesc_post( EFSYS_ASSERT3U(etp->et_magic, ==, EFX_TXQ_MAGIC); if ((rc = etxop->etxo_qdesc_post(etp, ed, - n, completed, addedp)) != 0) + ndescs, completed, addedp)) != 0) goto fail1; return (0); @@ -729,22 +728,22 @@ siena_tx_init( _NOTE(CONSTANTCONDITION) \ } while (B_FALSE) -static __checkReturn efx_rc_t +static __checkReturn efx_rc_t siena_tx_qpost( - __in efx_txq_t *etp, - __in_ecount(n) efx_buffer_t *eb, - __in unsigned int n, - __in unsigned int completed, - __inout unsigned int *addedp) + __in efx_txq_t *etp, + __in_ecount(ndescs) efx_buffer_t *eb, + __in unsigned int ndescs, + __in unsigned int completed, + __inout unsigned int *addedp) { unsigned int added = *addedp; unsigned int i; int rc = ENOSPC; - if (added - completed + n > EFX_TXQ_LIMIT(etp->et_mask + 1)) + if (added - completed + ndescs > EFX_TXQ_LIMIT(etp->et_mask + 1)) goto fail1; - for (i = 0; i < n; i++) { + for (i = 0; i < ndescs; i++) { efx_buffer_t *ebp = &eb[i]; efsys_dma_addr_t start = ebp->eb_addr; size_t size = ebp->eb_size; @@ -895,7 +894,7 @@ siena_tx_qcreate( __in unsigned int index, __in unsigned int label, __in efsys_mem_t *esmp, - __in size_t n, + __in size_t ndescs, __in uint32_t id, __in uint16_t flags, __in efx_evq_t *eep, @@ -917,7 +916,8 @@ siena_tx_qcreate( EFSYS_ASSERT(ISP2(encp->enc_txq_max_ndescs)); EFX_STATIC_ASSERT(ISP2(EFX_TXQ_MINNDESCS)); - if (!ISP2(n) || (n < EFX_TXQ_MINNDESCS) || (n > EFX_EVQ_MAXNEVS)) { + if (!ISP2(ndescs) || + (ndescs < EFX_TXQ_MINNDESCS) || (ndescs > EFX_EVQ_MAXNEVS)) { rc = EINVAL; goto fail1; } @@ -928,7 +928,7 @@ siena_tx_qcreate( for (size = 0; (1 << size) <= (int)(encp->enc_txq_max_ndescs / EFX_TXQ_MINNDESCS); size++) - if ((1 << size) == (int)(n / EFX_TXQ_MINNDESCS)) + if ((1 << size) == (int)(ndescs / EFX_TXQ_MINNDESCS)) break; if (id + (1 << size) >= encp->enc_buftbl_limit) { rc = EINVAL; @@ -975,24 +975,24 @@ fail1: return (rc); } - __checkReturn efx_rc_t + __checkReturn efx_rc_t siena_tx_qdesc_post( - __in efx_txq_t *etp, - __in_ecount(n) efx_desc_t *ed, - __in unsigned int n, - __in unsigned int completed, - __inout unsigned int *addedp) + __in efx_txq_t *etp, + __in_ecount(ndescs) efx_desc_t *ed, + __in unsigned int ndescs, + __in unsigned int completed, + __inout unsigned int *addedp) { unsigned int added = *addedp; unsigned int i; efx_rc_t rc; - if (added - completed + n > EFX_TXQ_LIMIT(etp->et_mask + 1)) { + if (added - completed + ndescs > EFX_TXQ_LIMIT(etp->et_mask + 1)) { rc = ENOSPC; goto fail1; } - for (i = 0; i < n; i++) { + for (i = 0; i < ndescs; i++) { efx_desc_t *edp = &ed[i]; unsigned int id; size_t offset; @@ -1004,7 +1004,7 @@ siena_tx_qdesc_post( } EFSYS_PROBE3(tx_desc_post, unsigned int, etp->et_index, - unsigned int, added, unsigned int, n); + unsigned int, added, unsigned int, ndescs); EFX_TX_QSTAT_INCR(etp, TX_POST); From owner-svn-src-all@freebsd.org Sat Nov 24 15:23:50 2018 Return-Path: Delivered-To: svn-src-all@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 C521D11516A6; Sat, 24 Nov 2018 15:23:50 +0000 (UTC) (envelope-from arybchik@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 6B4777CBEB; Sat, 24 Nov 2018 15:23:50 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 95F637C9B; Sat, 24 Nov 2018 15:23:47 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAOFNlaN051200; Sat, 24 Nov 2018 15:23:47 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAOFNkiR051196; Sat, 24 Nov 2018 15:23:46 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811241523.wAOFNkiR051196@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Sat, 24 Nov 2018 15:23:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340875 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 340875 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 6B4777CBEB X-Spamd-Result: default: False [1.61 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.66)[0.661,0]; NEURAL_SPAM_MEDIUM(0.73)[0.730,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.22)[0.216,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Nov 2018 15:23:51 -0000 Author: arybchik Date: Sat Nov 24 15:23:46 2018 New Revision: 340875 URL: https://svnweb.freebsd.org/changeset/base/340875 Log: sfxge(4): fix build issue with PHY LED control enabled Fixed build issue with the EFSYS_OPT_PHY_LED_CONTROL for Huntigton and Medford. Submitted by: Vijay Srivastava Sponsored by: Solarflare Communications, Inc. MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D18110 Modified: head/sys/dev/sfxge/common/ef10_phy.c head/sys/dev/sfxge/common/efx_check.h head/sys/dev/sfxge/common/siena_nic.c head/sys/dev/sfxge/common/siena_phy.c Modified: head/sys/dev/sfxge/common/ef10_phy.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_phy.c Sat Nov 24 15:23:34 2018 (r340874) +++ head/sys/dev/sfxge/common/ef10_phy.c Sat Nov 24 15:23:46 2018 (r340875) @@ -283,7 +283,9 @@ ef10_phy_reconfigure( uint8_t payload[MAX(MC_CMD_SET_LINK_IN_LEN, MC_CMD_SET_LINK_OUT_LEN)]; uint32_t cap_mask; +#if EFSYS_OPT_PHY_LED_CONTROL unsigned int led_mode; +#endif unsigned int speed; boolean_t supported; efx_rc_t rc; Modified: head/sys/dev/sfxge/common/efx_check.h ============================================================================== --- head/sys/dev/sfxge/common/efx_check.h Sat Nov 24 15:23:34 2018 (r340874) +++ head/sys/dev/sfxge/common/efx_check.h Sat Nov 24 15:23:46 2018 (r340875) @@ -226,8 +226,8 @@ /* Support for PHY LED control */ #if EFSYS_OPT_PHY_LED_CONTROL -# if !EFSYS_OPT_SIENA -# error "PHY_LED_CONTROL requires SIENA" +# if !(EFSYS_OPT_SIENA || EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD) +# error "PHY_LED_CONTROL requires SIENA or HUNTINGTON or MEDFORD" # endif #endif /* EFSYS_OPT_PHY_LED_CONTROL */ Modified: head/sys/dev/sfxge/common/siena_nic.c ============================================================================== --- head/sys/dev/sfxge/common/siena_nic.c Sat Nov 24 15:23:34 2018 (r340874) +++ head/sys/dev/sfxge/common/siena_nic.c Sat Nov 24 15:23:46 2018 (r340875) @@ -195,7 +195,9 @@ static __checkReturn efx_rc_t siena_phy_cfg( __in efx_nic_t *enp) { +#if EFSYS_OPT_PHY_STATS efx_nic_cfg_t *encp = &(enp->en_nic_cfg); +#endif /* EFSYS_OPT_PHY_STATS */ efx_rc_t rc; /* Fill out fields in enp->en_port and enp->en_nic_cfg from MCDI */ Modified: head/sys/dev/sfxge/common/siena_phy.c ============================================================================== --- head/sys/dev/sfxge/common/siena_phy.c Sat Nov 24 15:23:34 2018 (r340874) +++ head/sys/dev/sfxge/common/siena_phy.c Sat Nov 24 15:23:46 2018 (r340875) @@ -278,7 +278,9 @@ siena_phy_reconfigure( MAX(MC_CMD_SET_LINK_IN_LEN, MC_CMD_SET_LINK_OUT_LEN))]; uint32_t cap_mask; +#if EFSYS_OPT_PHY_LED_CONTROL unsigned int led_mode; +#endif unsigned int speed; efx_rc_t rc; From owner-svn-src-all@freebsd.org Sat Nov 24 15:24:04 2018 Return-Path: Delivered-To: svn-src-all@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 8098D11516E3; Sat, 24 Nov 2018 15:24:04 +0000 (UTC) (envelope-from arybchik@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 231687CD44; Sat, 24 Nov 2018 15:24:04 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7795E7CA0; Sat, 24 Nov 2018 15:23:59 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAOFNxJb051268; Sat, 24 Nov 2018 15:23:59 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAOFNwUE051266; Sat, 24 Nov 2018 15:23:58 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811241523.wAOFNwUE051266@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Sat, 24 Nov 2018 15:23:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340876 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 340876 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 231687CD44 X-Spamd-Result: default: False [1.58 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.64)[0.643,0]; NEURAL_SPAM_MEDIUM(0.71)[0.712,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.23)[0.227,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Nov 2018 15:24:04 -0000 Author: arybchik Date: Sat Nov 24 15:23:58 2018 New Revision: 340876 URL: https://svnweb.freebsd.org/changeset/base/340876 Log: sfxge(4): move Siena-specific defs to right header Submitted by: Andy Moreton Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18111 Modified: head/sys/dev/sfxge/common/efx.h head/sys/dev/sfxge/common/efx_impl.h head/sys/dev/sfxge/common/siena_impl.h Modified: head/sys/dev/sfxge/common/efx.h ============================================================================== --- head/sys/dev/sfxge/common/efx.h Sat Nov 24 15:23:46 2018 (r340875) +++ head/sys/dev/sfxge/common/efx.h Sat Nov 24 15:23:58 2018 (r340876) @@ -2107,7 +2107,6 @@ efx_tx_fini( #define EFX_TXQ_SIZE(_ndescs) ((_ndescs) * sizeof (efx_qword_t)) #define EFX_TXQ_NBUFS(_ndescs) (EFX_TXQ_SIZE(_ndescs) / EFX_BUF_SIZE) #define EFX_TXQ_LIMIT(_ndescs) ((_ndescs) - 16) -#define EFX_TXQ_DC_NDESCS(_dcsize) (8 << _dcsize) #define EFX_TXQ_MAX_BUFS 8 /* Maximum independent of EFX_BUG35388_WORKAROUND. */ Modified: head/sys/dev/sfxge/common/efx_impl.h ============================================================================== --- head/sys/dev/sfxge/common/efx_impl.h Sat Nov 24 15:23:46 2018 (r340875) +++ head/sys/dev/sfxge/common/efx_impl.h Sat Nov 24 15:23:58 2018 (r340876) @@ -362,12 +362,7 @@ typedef struct efx_nic_ops_s { #ifndef EFX_RXQ_LIMIT_TARGET #define EFX_RXQ_LIMIT_TARGET 512 #endif -#ifndef EFX_TXQ_DC_SIZE -#define EFX_TXQ_DC_SIZE 1 /* 16 descriptors */ -#endif -#ifndef EFX_RXQ_DC_SIZE -#define EFX_RXQ_DC_SIZE 3 /* 64 descriptors */ -#endif + #if EFSYS_OPT_FILTER Modified: head/sys/dev/sfxge/common/siena_impl.h ============================================================================== --- head/sys/dev/sfxge/common/siena_impl.h Sat Nov 24 15:23:46 2018 (r340875) +++ head/sys/dev/sfxge/common/siena_impl.h Sat Nov 24 15:23:58 2018 (r340876) @@ -44,7 +44,16 @@ extern "C" { #endif +#ifndef EFX_TXQ_DC_SIZE +#define EFX_TXQ_DC_SIZE 1 /* 16 descriptors */ +#endif +#ifndef EFX_RXQ_DC_SIZE +#define EFX_RXQ_DC_SIZE 3 /* 64 descriptors */ +#endif +#define EFX_TXQ_DC_NDESCS(_dcsize) (8 << (_dcsize)) + #define SIENA_NVRAM_CHUNK 0x80 + extern __checkReturn efx_rc_t siena_nic_probe( From owner-svn-src-all@freebsd.org Sat Nov 24 15:24:17 2018 Return-Path: Delivered-To: svn-src-all@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 442821151723; Sat, 24 Nov 2018 15:24:17 +0000 (UTC) (envelope-from arybchik@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 DD36E7CE5E; Sat, 24 Nov 2018 15:24:16 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 07DC87CA5; Sat, 24 Nov 2018 15:24:13 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAOFOCv5051343; Sat, 24 Nov 2018 15:24:12 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAOFOCoD051339; Sat, 24 Nov 2018 15:24:12 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811241524.wAOFOCoD051339@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Sat, 24 Nov 2018 15:24:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340877 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 340877 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: DD36E7CE5E X-Spamd-Result: default: False [1.58 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.64)[0.643,0]; NEURAL_SPAM_MEDIUM(0.71)[0.712,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.23)[0.227,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Nov 2018 15:24:17 -0000 Author: arybchik Date: Sat Nov 24 15:24:12 2018 New Revision: 340877 URL: https://svnweb.freebsd.org/changeset/base/340877 Log: sfxge(4): add new sensors Submitted by: Andy Moreton Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18112 Modified: head/sys/dev/sfxge/common/efx.h head/sys/dev/sfxge/common/efx_mon.c Modified: head/sys/dev/sfxge/common/efx.h ============================================================================== --- head/sys/dev/sfxge/common/efx.h Sat Nov 24 15:23:58 2018 (r340876) +++ head/sys/dev/sfxge/common/efx.h Sat Nov 24 15:24:12 2018 (r340877) @@ -631,7 +631,7 @@ efx_mon_init( #define EFX_MON_STATS_PAGE_SIZE 0x100 #define EFX_MON_MASK_ELEMENT_SIZE 32 -/* START MKCONFIG GENERATED MonitorHeaderStatsBlock 5d4ee5185e419abe */ +/* START MKCONFIG GENERATED MonitorHeaderStatsBlock aa0233c80156308e */ typedef enum efx_mon_stat_e { EFX_MON_STAT_2_5V, EFX_MON_STAT_VCCP1, @@ -710,6 +710,8 @@ typedef enum efx_mon_stat_e { EFX_MON_STAT_CONTROLLER_TDIODE_TEMP, EFX_MON_STAT_BOARD_FRONT_TEMP, EFX_MON_STAT_BOARD_BACK_TEMP, + EFX_MON_STAT_I1V8, + EFX_MON_STAT_I2V5, EFX_MON_NSTATS } efx_mon_stat_t; Modified: head/sys/dev/sfxge/common/efx_mon.c ============================================================================== --- head/sys/dev/sfxge/common/efx_mon.c Sat Nov 24 15:23:58 2018 (r340876) +++ head/sys/dev/sfxge/common/efx_mon.c Sat Nov 24 15:24:12 2018 (r340877) @@ -128,7 +128,7 @@ fail1: #if EFSYS_OPT_NAMES -/* START MKCONFIG GENERATED MonitorStatNamesBlock 5daa2a5725ba734b */ +/* START MKCONFIG GENERATED MonitorStatNamesBlock d92af1538001301f */ static const char * const __mon_stat_name[] = { "value_2_5v", "value_vccp1", @@ -207,6 +207,8 @@ static const char * const __mon_stat_name[] = { "controller_tdiode_temp", "board_front_temp", "board_back_temp", + "i1v8", + "i2v5", }; /* END MKCONFIG GENERATED MonitorStatNamesBlock */ From owner-svn-src-all@freebsd.org Sat Nov 24 15:24:27 2018 Return-Path: Delivered-To: svn-src-all@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 B56BB1151762; Sat, 24 Nov 2018 15:24:27 +0000 (UTC) (envelope-from arybchik@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 5C81F7CF2F; Sat, 24 Nov 2018 15:24:27 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 62EAD7CA6; Sat, 24 Nov 2018 15:24:24 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAOFOOLm051406; Sat, 24 Nov 2018 15:24:24 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAOFOOxN051404; Sat, 24 Nov 2018 15:24:24 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811241524.wAOFOOxN051404@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Sat, 24 Nov 2018 15:24:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340878 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 340878 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 5C81F7CF2F X-Spamd-Result: default: False [1.58 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.64)[0.643,0]; NEURAL_SPAM_MEDIUM(0.71)[0.712,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.23)[0.227,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Nov 2018 15:24:27 -0000 Author: arybchik Date: Sat Nov 24 15:24:23 2018 New Revision: 340878 URL: https://svnweb.freebsd.org/changeset/base/340878 Log: sfxge(4): support new sensors Submitted by: Andrew Jackson Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18113 Modified: head/sys/dev/sfxge/common/mcdi_mon.c Modified: head/sys/dev/sfxge/common/mcdi_mon.c ============================================================================== --- head/sys/dev/sfxge/common/mcdi_mon.c Sat Nov 24 15:24:12 2018 (r340877) +++ head/sys/dev/sfxge/common/mcdi_mon.c Sat Nov 24 15:24:23 2018 (r340878) @@ -160,6 +160,8 @@ static const struct mcdi_sensor_map_s { STAT(Px, CONTROLLER_TDIODE_TEMP), /* 0x4e CONTROLLER_TDIODE_TEMP */ STAT(Px, BOARD_FRONT_TEMP), /* 0x4f BOARD_FRONT_TEMP */ STAT(Px, BOARD_BACK_TEMP), /* 0x50 BOARD_BACK_TEMP */ + STAT(Px, I1V8), /* 0x51 IN_I1V8 */ + STAT(Px, I2V5), /* 0x52 IN_I2V5 */ }; #define MCDI_STATIC_SENSOR_ASSERT(_field) \ From owner-svn-src-all@freebsd.org Sat Nov 24 15:24:38 2018 Return-Path: Delivered-To: svn-src-all@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 F0130115179F; Sat, 24 Nov 2018 15:24:37 +0000 (UTC) (envelope-from arybchik@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 97DF07D031; Sat, 24 Nov 2018 15:24:37 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B58DF7CAB; Sat, 24 Nov 2018 15:24:35 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAOFOZXl051472; Sat, 24 Nov 2018 15:24:35 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAOFOZeK051471; Sat, 24 Nov 2018 15:24:35 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811241524.wAOFOZeK051471@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Sat, 24 Nov 2018 15:24:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340879 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 340879 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 97DF07D031 X-Spamd-Result: default: False [1.58 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.64)[0.643,0]; NEURAL_SPAM_MEDIUM(0.71)[0.712,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.23)[0.227,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Nov 2018 15:24:38 -0000 Author: arybchik Date: Sat Nov 24 15:24:35 2018 New Revision: 340879 URL: https://svnweb.freebsd.org/changeset/base/340879 Log: sfxge(4): remove unused defined for WPTR alignment MEDFORD_RX_WPTR_ALIGN is not used. Submitted by: Andy Moreton Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18114 Modified: head/sys/dev/sfxge/common/medford_impl.h Modified: head/sys/dev/sfxge/common/medford_impl.h ============================================================================== --- head/sys/dev/sfxge/common/medford_impl.h Sat Nov 24 15:24:23 2018 (r340878) +++ head/sys/dev/sfxge/common/medford_impl.h Sat Nov 24 15:24:35 2018 (r340879) @@ -37,14 +37,6 @@ extern "C" { #endif -/* Alignment requirement for value written to RX WPTR: - * the WPTR must be aligned to an 8 descriptor boundary - * - * FIXME: Is this the same on Medford as Huntington? - */ -#define MEDFORD_RX_WPTR_ALIGN 8 - - #ifndef ER_EZ_TX_PIOBUF_SIZE #define ER_EZ_TX_PIOBUF_SIZE 4096 From owner-svn-src-all@freebsd.org Sat Nov 24 15:24:54 2018 Return-Path: Delivered-To: svn-src-all@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 0654B11517DF; Sat, 24 Nov 2018 15:24:54 +0000 (UTC) (envelope-from arybchik@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 A61287D1CF; Sat, 24 Nov 2018 15:24:53 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1C9A87CB4; Sat, 24 Nov 2018 15:24:49 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAOFOnDa051548; Sat, 24 Nov 2018 15:24:49 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAOFOlXg051536; Sat, 24 Nov 2018 15:24:47 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811241524.wAOFOlXg051536@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Sat, 24 Nov 2018 15:24:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340880 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 340880 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A61287D1CF X-Spamd-Result: default: False [1.67 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.71)[0.710,0]; NEURAL_SPAM_SHORT(0.18)[0.185,0]; NEURAL_SPAM_MEDIUM(0.78)[0.776,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Nov 2018 15:24:54 -0000 Author: arybchik Date: Sat Nov 24 15:24:47 2018 New Revision: 340880 URL: https://svnweb.freebsd.org/changeset/base/340880 Log: sfxge(4): fix coding style Submitted by: Andy Moreton Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18115 Modified: head/sys/dev/sfxge/common/ef10_filter.c head/sys/dev/sfxge/common/ef10_impl.h head/sys/dev/sfxge/common/efx.h head/sys/dev/sfxge/common/efx_impl.h head/sys/dev/sfxge/common/efx_lic.c head/sys/dev/sfxge/common/efx_mcdi.h head/sys/dev/sfxge/common/efx_nic.c head/sys/dev/sfxge/common/efx_types.h head/sys/dev/sfxge/common/medford_nic.c Modified: head/sys/dev/sfxge/common/ef10_filter.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_filter.c Sat Nov 24 15:24:35 2018 (r340879) +++ head/sys/dev/sfxge/common/ef10_filter.c Sat Nov 24 15:24:47 2018 (r340880) @@ -1246,8 +1246,8 @@ typedef struct ef10_filter_encap_entry_s { uint32_t inner_frame_match; } ef10_filter_encap_entry_t; -#define EF10_ENCAP_FILTER_ENTRY(ipv, encap_type, inner_frame_match) \ - { EFX_ETHER_TYPE_##ipv, EFX_TUNNEL_PROTOCOL_##encap_type, \ +#define EF10_ENCAP_FILTER_ENTRY(ipv, encap_type, inner_frame_match) \ + { EFX_ETHER_TYPE_##ipv, EFX_TUNNEL_PROTOCOL_##encap_type, \ EFX_FILTER_INNER_FRAME_MATCH_UNKNOWN_##inner_frame_match } static ef10_filter_encap_entry_t ef10_filter_encap_list[] = { @@ -1308,8 +1308,8 @@ ef10_filter_insert_encap_filters( */ if ((mulcst == B_FALSE) && (encap_filter->inner_frame_match == - EFX_FILTER_INNER_FRAME_MATCH_UNKNOWN_MCAST_DST)) - continue; + EFX_FILTER_INNER_FRAME_MATCH_UNKNOWN_MCAST_DST)) + continue; efx_filter_spec_init_rx(&spec, EFX_FILTER_PRI_AUTO, filter_flags, Modified: head/sys/dev/sfxge/common/ef10_impl.h ============================================================================== --- head/sys/dev/sfxge/common/ef10_impl.h Sat Nov 24 15:24:35 2018 (r340879) +++ head/sys/dev/sfxge/common/ef10_impl.h Sat Nov 24 15:24:47 2018 (r340880) @@ -52,8 +52,9 @@ extern "C" { */ #define EF10_NVRAM_CHUNK 0x80 -/* Alignment requirement for value written to RX WPTR: - * the WPTR must be aligned to an 8 descriptor boundary +/* + * Alignment requirement for value written to RX WPTR: the WPTR must be aligned + * to an 8 descriptor boundary. */ #define EF10_RX_WPTR_ALIGN 8 @@ -507,8 +508,7 @@ ef10_nvram_buffer_find_item_start( __in_bcount(buffer_size) caddr_t bufferp, __in size_t buffer_size, - __out uint32_t *startp - ); + __out uint32_t *startp); extern __checkReturn efx_rc_t ef10_nvram_buffer_find_end( @@ -516,8 +516,7 @@ ef10_nvram_buffer_find_end( caddr_t bufferp, __in size_t buffer_size, __in uint32_t offset, - __out uint32_t *endp - ); + __out uint32_t *endp); extern __checkReturn __success(return != B_FALSE) boolean_t ef10_nvram_buffer_find_item( @@ -526,8 +525,7 @@ ef10_nvram_buffer_find_item( __in size_t buffer_size, __in uint32_t offset, __out uint32_t *startp, - __out uint32_t *lengthp - ); + __out uint32_t *lengthp); extern __checkReturn efx_rc_t ef10_nvram_buffer_get_item( @@ -539,8 +537,7 @@ ef10_nvram_buffer_get_item( __out_bcount_part(item_max_size, *lengthp) caddr_t itemp, __in size_t item_max_size, - __out uint32_t *lengthp - ); + __out uint32_t *lengthp); extern __checkReturn efx_rc_t ef10_nvram_buffer_insert_item( @@ -550,8 +547,7 @@ ef10_nvram_buffer_insert_item( __in uint32_t offset, __in_bcount(length) caddr_t keyp, __in uint32_t length, - __out uint32_t *lengthp - ); + __out uint32_t *lengthp); extern __checkReturn efx_rc_t ef10_nvram_buffer_delete_item( @@ -560,15 +556,13 @@ ef10_nvram_buffer_delete_item( __in size_t buffer_size, __in uint32_t offset, __in uint32_t length, - __in uint32_t end - ); + __in uint32_t end); extern __checkReturn efx_rc_t ef10_nvram_buffer_finish( __in_bcount(buffer_size) caddr_t bufferp, - __in size_t buffer_size - ); + __in size_t buffer_size); #endif /* EFSYS_OPT_NVRAM */ @@ -797,7 +791,7 @@ ef10_tx_qstats_update( typedef uint32_t efx_piobuf_handle_t; -#define EFX_PIOBUF_HANDLE_INVALID ((efx_piobuf_handle_t) -1) +#define EFX_PIOBUF_HANDLE_INVALID ((efx_piobuf_handle_t)-1) extern __checkReturn efx_rc_t ef10_nic_pio_alloc( @@ -1036,7 +1030,7 @@ typedef struct ef10_filter_entry_s { * IPv4 or IPv6 outer frame, VXLAN, GENEVE or NVGRE packet type, and unicast or * multicast inner frames. */ -#define EFX_EF10_FILTER_ENCAP_FILTERS_MAX 12 +#define EFX_EF10_FILTER_ENCAP_FILTERS_MAX 12 typedef struct ef10_filter_table_s { ef10_filter_entry_t eft_entry[EFX_EF10_FILTER_TBL_ROWS]; @@ -1203,9 +1197,9 @@ ef10_external_port_mapping( /* Minimum space for packet in packed stream mode */ #define EFX_RX_PACKED_STREAM_MIN_PACKET_SPACE \ P2ROUNDUP(EFX_RX_PACKED_STREAM_RX_PREFIX_SIZE + \ - EFX_MAC_PDU_MIN + \ - EFX_RX_PACKED_STREAM_ALIGNMENT, \ - EFX_RX_PACKED_STREAM_ALIGNMENT) + EFX_MAC_PDU_MIN + \ + EFX_RX_PACKED_STREAM_ALIGNMENT, \ + EFX_RX_PACKED_STREAM_ALIGNMENT) /* Maximum number of credits */ #define EFX_RX_PACKED_STREAM_MAX_CREDITS 127 Modified: head/sys/dev/sfxge/common/efx.h ============================================================================== --- head/sys/dev/sfxge/common/efx.h Sat Nov 24 15:24:35 2018 (r340879) +++ head/sys/dev/sfxge/common/efx.h Sat Nov 24 15:24:47 2018 (r340880) @@ -44,13 +44,13 @@ extern "C" { #endif #define EFX_STATIC_ASSERT(_cond) \ - ((void)sizeof(char[(_cond) ? 1 : -1])) + ((void)sizeof (char[(_cond) ? 1 : -1])) #define EFX_ARRAY_SIZE(_array) \ - (sizeof(_array) / sizeof((_array)[0])) + (sizeof (_array) / sizeof ((_array)[0])) #define EFX_FIELD_OFFSET(_type, _field) \ - ((size_t) &(((_type *)0)->_field)) + ((size_t)&(((_type *)0)->_field)) /* The macro expands divider twice */ #define EFX_DIV_ROUND_UP(_n, _d) (((_n) + (_d) - 1) / (_d)) @@ -562,7 +562,7 @@ efx_mac_stats_get_mask( #define EFX_MAC_STAT_SUPPORTED(_mask, _stat) \ ((_mask)[(_stat) / EFX_MAC_STATS_MASK_BITS_PER_PAGE] & \ - (1ULL << ((_stat) & (EFX_MAC_STATS_MASK_BITS_PER_PAGE - 1)))) + (1ULL << ((_stat) & (EFX_MAC_STATS_MASK_BITS_PER_PAGE - 1)))) #define EFX_MAC_STATS_SIZE 0x400 @@ -912,7 +912,8 @@ typedef enum efx_phy_media_type_e { EFX_PHY_MEDIA_NTYPES } efx_phy_media_type_t; -/* Get the type of medium currently used. If the board has ports for +/* + * Get the type of medium currently used. If the board has ports for * modules, a module is present, and we recognise the media type of * the module, then this will be the media type of the module. * Otherwise it will be the media type of the port. @@ -1013,7 +1014,7 @@ typedef enum efx_bist_type_e { EFX_BIST_TYPE_PHY_CABLE_SHORT, EFX_BIST_TYPE_PHY_CABLE_LONG, EFX_BIST_TYPE_MC_MEM, /* Test the MC DMEM and IMEM */ - EFX_BIST_TYPE_SAT_MEM, /* Test the DMEM and IMEM of satellite cpus*/ + EFX_BIST_TYPE_SAT_MEM, /* Test the DMEM and IMEM of satellite cpus */ EFX_BIST_TYPE_REG, /* Test the register memories */ EFX_BIST_TYPE_NTYPES, } efx_bist_type_t; @@ -1044,8 +1045,10 @@ typedef enum efx_bist_value_e { EFX_BIST_PHY_CABLE_STATUS_C, EFX_BIST_PHY_CABLE_STATUS_D, EFX_BIST_FAULT_CODE, - /* Memory BIST specific values. These match to the MC_CMD_BIST_POLL - * response. */ + /* + * Memory BIST specific values. These match to the MC_CMD_BIST_POLL + * response. + */ EFX_BIST_MEM_TEST, EFX_BIST_MEM_ADDR, EFX_BIST_MEM_BUS, @@ -1797,8 +1800,7 @@ typedef __checkReturn boolean_t typedef __checkReturn boolean_t (*efx_mac_stats_ev_t)( __in_opt void *arg, - __in uint32_t generation - ); + __in uint32_t generation); #endif /* EFSYS_OPT_MAC_STATS */ @@ -2514,8 +2516,7 @@ efx_lic_find_start( __in_bcount(buffer_size) caddr_t bufferp, __in size_t buffer_size, - __out uint32_t *startp - ); + __out uint32_t *startp); extern __checkReturn efx_rc_t efx_lic_find_end( @@ -2524,8 +2525,7 @@ efx_lic_find_end( caddr_t bufferp, __in size_t buffer_size, __in uint32_t offset, - __out uint32_t *endp - ); + __out uint32_t *endp); extern __checkReturn __success(return != B_FALSE) boolean_t efx_lic_find_key( @@ -2535,15 +2535,13 @@ efx_lic_find_key( __in size_t buffer_size, __in uint32_t offset, __out uint32_t *startp, - __out uint32_t *lengthp - ); + __out uint32_t *lengthp); extern __checkReturn __success(return != B_FALSE) boolean_t efx_lic_validate_key( __in efx_nic_t *enp, __in_bcount(length) caddr_t keyp, - __in uint32_t length - ); + __in uint32_t length); extern __checkReturn efx_rc_t efx_lic_read_key( @@ -2556,8 +2554,7 @@ efx_lic_read_key( __out_bcount_part(key_max_size, *lengthp) caddr_t keyp, __in size_t key_max_size, - __out uint32_t *lengthp - ); + __out uint32_t *lengthp); extern __checkReturn efx_rc_t efx_lic_write_key( @@ -2568,8 +2565,7 @@ efx_lic_write_key( __in uint32_t offset, __in_bcount(length) caddr_t keyp, __in uint32_t length, - __out uint32_t *lengthp - ); + __out uint32_t *lengthp); __checkReturn efx_rc_t efx_lic_delete_key( @@ -2580,24 +2576,21 @@ efx_lic_delete_key( __in uint32_t offset, __in uint32_t length, __in uint32_t end, - __out uint32_t *deltap - ); + __out uint32_t *deltap); extern __checkReturn efx_rc_t efx_lic_create_partition( __in efx_nic_t *enp, __in_bcount(buffer_size) caddr_t bufferp, - __in size_t buffer_size - ); + __in size_t buffer_size); extern __checkReturn efx_rc_t efx_lic_finish_partition( __in efx_nic_t *enp, __in_bcount(buffer_size) caddr_t bufferp, - __in size_t buffer_size - ); + __in size_t buffer_size); #endif /* EFSYS_OPT_LICENSING */ Modified: head/sys/dev/sfxge/common/efx_impl.h ============================================================================== --- head/sys/dev/sfxge/common/efx_impl.h Sat Nov 24 15:24:35 2018 (r340879) +++ head/sys/dev/sfxge/common/efx_impl.h Sat Nov 24 15:24:47 2018 (r340880) @@ -1035,8 +1035,7 @@ struct efx_txq_s { do { \ EFX_CHECK_REG((_enp), (_reg)); \ EFSYS_PROBE7(efx_bar_tbl_doorbell_writeo, \ - const char *, \ - #_reg, \ + const char *, #_reg, \ uint32_t, (_index), \ uint32_t, _reg ## _OFST, \ uint32_t, (_eop)->eo_u32[3], \ Modified: head/sys/dev/sfxge/common/efx_lic.c ============================================================================== --- head/sys/dev/sfxge/common/efx_lic.c Sat Nov 24 15:24:35 2018 (r340879) +++ head/sys/dev/sfxge/common/efx_lic.c Sat Nov 24 15:24:47 2018 (r340880) @@ -46,8 +46,7 @@ efx_lic_v1v2_find_start( __in_bcount(buffer_size) caddr_t bufferp, __in size_t buffer_size, - __out uint32_t *startp - ); + __out uint32_t *startp); __checkReturn efx_rc_t efx_lic_v1v2_find_end( @@ -56,8 +55,7 @@ efx_lic_v1v2_find_end( caddr_t bufferp, __in size_t buffer_size, __in uint32_t offset, - __out uint32_t *endp - ); + __out uint32_t *endp); __checkReturn __success(return != B_FALSE) boolean_t efx_lic_v1v2_find_key( @@ -67,15 +65,13 @@ efx_lic_v1v2_find_key( __in size_t buffer_size, __in uint32_t offset, __out uint32_t *startp, - __out uint32_t *lengthp - ); + __out uint32_t *lengthp); __checkReturn __success(return != B_FALSE) boolean_t efx_lic_v1v2_validate_key( __in efx_nic_t *enp, __in_bcount(length) caddr_t keyp, - __in uint32_t length - ); + __in uint32_t length); __checkReturn efx_rc_t efx_lic_v1v2_read_key( @@ -88,8 +84,7 @@ efx_lic_v1v2_read_key( __out_bcount_part(key_max_size, *lengthp) caddr_t keyp, __in size_t key_max_size, - __out uint32_t *lengthp - ); + __out uint32_t *lengthp); __checkReturn efx_rc_t efx_lic_v1v2_write_key( @@ -100,8 +95,7 @@ efx_lic_v1v2_write_key( __in uint32_t offset, __in_bcount(length) caddr_t keyp, __in uint32_t length, - __out uint32_t *lengthp - ); + __out uint32_t *lengthp); __checkReturn efx_rc_t efx_lic_v1v2_delete_key( @@ -112,24 +106,21 @@ efx_lic_v1v2_delete_key( __in uint32_t offset, __in uint32_t length, __in uint32_t end, - __out uint32_t *deltap - ); + __out uint32_t *deltap); __checkReturn efx_rc_t efx_lic_v1v2_create_partition( __in efx_nic_t *enp, __in_bcount(buffer_size) caddr_t bufferp, - __in size_t buffer_size - ); + __in size_t buffer_size); __checkReturn efx_rc_t efx_lic_v1v2_finish_partition( __in efx_nic_t *enp, __in_bcount(buffer_size) caddr_t bufferp, - __in size_t buffer_size - ); + __in size_t buffer_size); #endif /* EFSYS_OPT_HUNTINGTON | EFSYS_OPT_SIENA */ @@ -230,8 +221,7 @@ efx_lic_v3_find_start( __in_bcount(buffer_size) caddr_t bufferp, __in size_t buffer_size, - __out uint32_t *startp - ); + __out uint32_t *startp); __checkReturn efx_rc_t efx_lic_v3_find_end( @@ -240,8 +230,7 @@ efx_lic_v3_find_end( caddr_t bufferp, __in size_t buffer_size, __in uint32_t offset, - __out uint32_t *endp - ); + __out uint32_t *endp); __checkReturn __success(return != B_FALSE) boolean_t efx_lic_v3_find_key( @@ -251,15 +240,13 @@ efx_lic_v3_find_key( __in size_t buffer_size, __in uint32_t offset, __out uint32_t *startp, - __out uint32_t *lengthp - ); + __out uint32_t *lengthp); __checkReturn __success(return != B_FALSE) boolean_t efx_lic_v3_validate_key( __in efx_nic_t *enp, __in_bcount(length) caddr_t keyp, - __in uint32_t length - ); + __in uint32_t length); __checkReturn efx_rc_t efx_lic_v3_read_key( @@ -272,8 +259,7 @@ efx_lic_v3_read_key( __out_bcount_part(key_max_size, *lengthp) caddr_t keyp, __in size_t key_max_size, - __out uint32_t *lengthp - ); + __out uint32_t *lengthp); __checkReturn efx_rc_t efx_lic_v3_write_key( @@ -284,8 +270,7 @@ efx_lic_v3_write_key( __in uint32_t offset, __in_bcount(length) caddr_t keyp, __in uint32_t length, - __out uint32_t *lengthp - ); + __out uint32_t *lengthp); __checkReturn efx_rc_t efx_lic_v3_delete_key( @@ -296,31 +281,28 @@ efx_lic_v3_delete_key( __in uint32_t offset, __in uint32_t length, __in uint32_t end, - __out uint32_t *deltap - ); + __out uint32_t *deltap); __checkReturn efx_rc_t efx_lic_v3_create_partition( __in efx_nic_t *enp, __in_bcount(buffer_size) caddr_t bufferp, - __in size_t buffer_size - ); + __in size_t buffer_size); __checkReturn efx_rc_t efx_lic_v3_finish_partition( __in efx_nic_t *enp, __in_bcount(buffer_size) caddr_t bufferp, - __in size_t buffer_size - ); + __in size_t buffer_size); static const efx_lic_ops_t __efx_lic_v3_ops = { efx_mcdi_licensing_v3_update_licenses, /* elo_update_licenses */ efx_mcdi_licensing_v3_report_license, /* elo_get_key_stats */ efx_mcdi_licensing_v3_app_state, /* elo_app_state */ efx_mcdi_licensing_v3_get_id, /* elo_get_id */ - efx_lic_v3_find_start, /* elo_find_start*/ + efx_lic_v3_find_start, /* elo_find_start */ efx_lic_v3_find_end, /* elo_find_end */ efx_lic_v3_find_key, /* elo_find_key */ efx_lic_v3_validate_key, /* elo_validate_key */ @@ -455,8 +437,8 @@ fail1: * Length (L): 16bit - value length in bytes * Value (V): L bytes - payload */ -#define EFX_LICENSE_V1V2_PAYLOAD_LENGTH_MAX (256) -#define EFX_LICENSE_V1V2_HEADER_LENGTH (2 * sizeof(uint16_t)) +#define EFX_LICENSE_V1V2_PAYLOAD_LENGTH_MAX (256) +#define EFX_LICENSE_V1V2_HEADER_LENGTH (2 * sizeof (uint16_t)) __checkReturn efx_rc_t efx_lic_v1v2_find_start( @@ -464,8 +446,7 @@ efx_lic_v1v2_find_start( __in_bcount(buffer_size) caddr_t bufferp, __in size_t buffer_size, - __out uint32_t *startp - ) + __out uint32_t *startp) { _NOTE(ARGUNUSED(enp, bufferp, buffer_size)) @@ -480,8 +461,7 @@ efx_lic_v1v2_find_end( caddr_t bufferp, __in size_t buffer_size, __in uint32_t offset, - __out uint32_t *endp - ) + __out uint32_t *endp) { _NOTE(ARGUNUSED(enp, bufferp, buffer_size)) @@ -497,8 +477,7 @@ efx_lic_v1v2_find_key( __in size_t buffer_size, __in uint32_t offset, __out uint32_t *startp, - __out uint32_t *lengthp - ) + __out uint32_t *lengthp) { boolean_t found; uint16_t tlv_type; @@ -531,8 +510,7 @@ fail1: efx_lic_v1v2_validate_key( __in efx_nic_t *enp, __in_bcount(length) caddr_t keyp, - __in uint32_t length - ) + __in uint32_t length) { uint16_t tlv_type; uint16_t tlv_length; @@ -582,8 +560,7 @@ efx_lic_v1v2_read_key( __out_bcount_part(key_max_size, *lengthp) caddr_t keyp, __in size_t key_max_size, - __out uint32_t *lengthp - ) + __out uint32_t *lengthp) { efx_rc_t rc; @@ -616,8 +593,7 @@ efx_lic_v1v2_write_key( __in uint32_t offset, __in_bcount(length) caddr_t keyp, __in uint32_t length, - __out uint32_t *lengthp - ) + __out uint32_t *lengthp) { efx_rc_t rc; @@ -653,8 +629,7 @@ efx_lic_v1v2_delete_key( __in uint32_t offset, __in uint32_t length, __in uint32_t end, - __out uint32_t *deltap - ) + __out uint32_t *deltap) { uint32_t move_start = offset + length; uint32_t move_length = end - move_start; @@ -675,8 +650,7 @@ efx_lic_v1v2_create_partition( __in efx_nic_t *enp, __in_bcount(buffer_size) caddr_t bufferp, - __in size_t buffer_size - ) + __in size_t buffer_size) { _NOTE(ARGUNUSED(enp)) EFSYS_ASSERT(EFX_LICENSE_V1V2_HEADER_LENGTH <= buffer_size); @@ -692,8 +666,7 @@ efx_lic_v1v2_finish_partition( __in efx_nic_t *enp, __in_bcount(buffer_size) caddr_t bufferp, - __in size_t buffer_size - ) + __in size_t buffer_size) { _NOTE(ARGUNUSED(enp, bufferp, buffer_size)) @@ -1005,7 +978,8 @@ efx_mcdi_licensing_v3_app_state( goto fail1; } - if (req.emr_out_length_used < MC_CMD_GET_LICENSED_V3_APP_STATE_OUT_LEN) { + if (req.emr_out_length_used < + MC_CMD_GET_LICENSED_V3_APP_STATE_OUT_LEN) { rc = EMSGSIZE; goto fail2; } @@ -1055,7 +1029,8 @@ efx_mcdi_licensing_v3_get_id( req.emr_in_buf = bufferp; req.emr_in_length = MC_CMD_LICENSING_GET_ID_V3_IN_LEN; req.emr_out_buf = bufferp; - req.emr_out_length = MIN(buffer_size, MC_CMD_LICENSING_GET_ID_V3_OUT_LENMAX); + req.emr_out_length = + MIN(buffer_size, MC_CMD_LICENSING_GET_ID_V3_OUT_LENMAX); (void) memset(bufferp, 0, req.emr_out_length); } @@ -1072,12 +1047,14 @@ efx_mcdi_licensing_v3_get_id( } *typep = MCDI_OUT_DWORD(req, LICENSING_GET_ID_V3_OUT_LICENSE_TYPE); - *lengthp = MCDI_OUT_DWORD(req, LICENSING_GET_ID_V3_OUT_LICENSE_ID_LENGTH); + *lengthp = + MCDI_OUT_DWORD(req, LICENSING_GET_ID_V3_OUT_LICENSE_ID_LENGTH); if (bufferp == NULL) { - /* modify length requirements to indicate to caller the extra buffering - ** needed to read the complete output. - */ + /* + * Modify length requirements to indicate to caller the extra + * buffering needed to read the complete output. + */ *lengthp += MC_CMD_LICENSING_GET_ID_V3_OUT_LENMIN; } else { /* Shift ID down to start of buffer */ @@ -1099,8 +1076,8 @@ fail1: } /* V3 format uses Huntington TLV format partition. See SF-108797-SW */ -#define EFX_LICENSE_V3_KEY_LENGTH_MIN (64) -#define EFX_LICENSE_V3_KEY_LENGTH_MAX (160) +#define EFX_LICENSE_V3_KEY_LENGTH_MIN (64) +#define EFX_LICENSE_V3_KEY_LENGTH_MAX (160) __checkReturn efx_rc_t efx_lic_v3_find_start( @@ -1108,12 +1085,12 @@ efx_lic_v3_find_start( __in_bcount(buffer_size) caddr_t bufferp, __in size_t buffer_size, - __out uint32_t *startp - ) + __out uint32_t *startp) { _NOTE(ARGUNUSED(enp)) - return ef10_nvram_buffer_find_item_start(bufferp, buffer_size, startp); + return (ef10_nvram_buffer_find_item_start(bufferp, buffer_size, + startp)); } __checkReturn efx_rc_t @@ -1123,12 +1100,11 @@ efx_lic_v3_find_end( caddr_t bufferp, __in size_t buffer_size, __in uint32_t offset, - __out uint32_t *endp - ) + __out uint32_t *endp) { _NOTE(ARGUNUSED(enp)) - return ef10_nvram_buffer_find_end(bufferp, buffer_size, offset, endp); + return (ef10_nvram_buffer_find_end(bufferp, buffer_size, offset, endp)); } __checkReturn __success(return != B_FALSE) boolean_t @@ -1139,8 +1115,7 @@ efx_lic_v3_find_key( __in size_t buffer_size, __in uint32_t offset, __out uint32_t *startp, - __out uint32_t *lengthp - ) + __out uint32_t *lengthp) { _NOTE(ARGUNUSED(enp)) @@ -1152,8 +1127,7 @@ efx_lic_v3_find_key( efx_lic_v3_validate_key( __in efx_nic_t *enp, __in_bcount(length) caddr_t keyp, - __in uint32_t length - ) + __in uint32_t length) { /* Check key is a valid V3 key */ uint8_t key_type; @@ -1203,8 +1177,7 @@ efx_lic_v3_read_key( __out_bcount_part(key_max_size, *lengthp) caddr_t keyp, __in size_t key_max_size, - __out uint32_t *lengthp - ) + __out uint32_t *lengthp) { _NOTE(ARGUNUSED(enp)) @@ -1221,8 +1194,7 @@ efx_lic_v3_write_key( __in uint32_t offset, __in_bcount(length) caddr_t keyp, __in uint32_t length, - __out uint32_t *lengthp - ) + __out uint32_t *lengthp) { _NOTE(ARGUNUSED(enp)) EFSYS_ASSERT(length <= EFX_LICENSE_V3_KEY_LENGTH_MAX); @@ -1240,8 +1212,7 @@ efx_lic_v3_delete_key( __in uint32_t offset, __in uint32_t length, __in uint32_t end, - __out uint32_t *deltap - ) + __out uint32_t *deltap) { efx_rc_t rc; @@ -1267,8 +1238,7 @@ efx_lic_v3_create_partition( __in efx_nic_t *enp, __in_bcount(buffer_size) caddr_t bufferp, - __in size_t buffer_size - ) + __in size_t buffer_size) { efx_rc_t rc; @@ -1293,8 +1263,7 @@ efx_lic_v3_finish_partition( __in efx_nic_t *enp, __in_bcount(buffer_size) caddr_t bufferp, - __in size_t buffer_size - ) + __in size_t buffer_size) { efx_rc_t rc; @@ -1386,7 +1355,7 @@ efx_lic_check_support( EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_PROBE); EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_LIC); - return enp->en_licensing_supported; + return (enp->en_licensing_supported); } void @@ -1477,8 +1446,7 @@ efx_lic_get_id( __in size_t buffer_size, __out uint32_t *typep, __out size_t *lengthp, - __out_opt uint8_t *bufferp - ) + __out_opt uint8_t *bufferp) { const efx_lic_ops_t *elop = enp->en_elop; efx_rc_t rc; @@ -1501,7 +1469,10 @@ fail1: return (rc); } -/* Buffer management API - abstracts varying TLV format used for License partition */ +/* + * Buffer management API - abstracts varying TLV format used for License + * partition. + */ __checkReturn efx_rc_t efx_lic_find_start( @@ -1509,8 +1480,7 @@ efx_lic_find_start( __in_bcount(buffer_size) caddr_t bufferp, __in size_t buffer_size, - __out uint32_t *startp - ) + __out uint32_t *startp) { const efx_lic_ops_t *elop = enp->en_elop; efx_rc_t rc; @@ -1536,8 +1506,7 @@ efx_lic_find_end( caddr_t bufferp, __in size_t buffer_size, __in uint32_t offset, - __out uint32_t *endp - ) + __out uint32_t *endp) { const efx_lic_ops_t *elop = enp->en_elop; efx_rc_t rc; @@ -1545,7 +1514,8 @@ efx_lic_find_end( EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC); EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_LIC); - if ((rc = elop->elo_find_end(enp, bufferp, buffer_size, offset, endp)) != 0) + rc = elop->elo_find_end(enp, bufferp, buffer_size, offset, endp); + if (rc != 0) goto fail1; return (0); @@ -1564,8 +1534,7 @@ efx_lic_find_key( __in size_t buffer_size, __in uint32_t offset, __out uint32_t *startp, - __out uint32_t *lengthp - ) + __out uint32_t *lengthp) { const efx_lic_ops_t *elop = enp->en_elop; @@ -1581,15 +1550,15 @@ efx_lic_find_key( } -/* Validate that the buffer contains a single key in a recognised format. -** An empty or terminator buffer is not accepted as a valid key. -*/ +/* + * Validate that the buffer contains a single key in a recognised format. + * An empty or terminator buffer is not accepted as a valid key. + */ __checkReturn __success(return != B_FALSE) boolean_t efx_lic_validate_key( __in efx_nic_t *enp, __in_bcount(length) caddr_t keyp, - __in uint32_t length - ) + __in uint32_t length) { const efx_lic_ops_t *elop = enp->en_elop; boolean_t rc; @@ -1619,8 +1588,7 @@ efx_lic_read_key( __out_bcount_part(key_max_size, *lengthp) caddr_t keyp, __in size_t key_max_size, - __out uint32_t *lengthp - ) + __out uint32_t *lengthp) { const efx_lic_ops_t *elop = enp->en_elop; efx_rc_t rc; @@ -1649,8 +1617,7 @@ efx_lic_write_key( __in uint32_t offset, __in_bcount(length) caddr_t keyp, __in uint32_t length, - __out uint32_t *lengthp - ) + __out uint32_t *lengthp) { const efx_lic_ops_t *elop = enp->en_elop; efx_rc_t rc; @@ -1679,8 +1646,7 @@ efx_lic_delete_key( __in uint32_t offset, __in uint32_t length, __in uint32_t end, - __out uint32_t *deltap - ) + __out uint32_t *deltap) { const efx_lic_ops_t *elop = enp->en_elop; efx_rc_t rc; @@ -1705,8 +1671,7 @@ efx_lic_create_partition( __in efx_nic_t *enp, __in_bcount(buffer_size) caddr_t bufferp, - __in size_t buffer_size - ) + __in size_t buffer_size) { const efx_lic_ops_t *elop = enp->en_elop; efx_rc_t rc; @@ -1731,8 +1696,7 @@ efx_lic_finish_partition( __in efx_nic_t *enp, __in_bcount(buffer_size) caddr_t bufferp, - __in size_t buffer_size - ) + __in size_t buffer_size) { const efx_lic_ops_t *elop = enp->en_elop; efx_rc_t rc; Modified: head/sys/dev/sfxge/common/efx_mcdi.h ============================================================================== --- head/sys/dev/sfxge/common/efx_mcdi.h Sat Nov 24 15:24:35 2018 (r340879) +++ head/sys/dev/sfxge/common/efx_mcdi.h Sat Nov 24 15:24:47 2018 (r340880) @@ -55,7 +55,7 @@ struct efx_mcdi_req_s { unsigned int emr_cmd; uint8_t *emr_in_buf; size_t emr_in_length; - /* Outputs: retcode, buffer, length, and length used*/ + /* Outputs: retcode, buffer, length, and length used */ efx_rc_t emr_rc; uint8_t *emr_out_buf; size_t emr_out_length; Modified: head/sys/dev/sfxge/common/efx_nic.c ============================================================================== --- head/sys/dev/sfxge/common/efx_nic.c Sat Nov 24 15:24:35 2018 (r340879) +++ head/sys/dev/sfxge/common/efx_nic.c Sat Nov 24 15:24:47 2018 (r340880) @@ -642,9 +642,9 @@ efx_nic_get_fw_version( goto fail2; rc = efx_mcdi_get_capabilities(enp, NULL, - &enfip->enfi_rx_dpcpu_fw_id, - &enfip->enfi_tx_dpcpu_fw_id, - NULL, NULL); + &enfip->enfi_rx_dpcpu_fw_id, + &enfip->enfi_tx_dpcpu_fw_id, + NULL, NULL); if (rc == 0) { enfip->enfi_dpcpu_fw_ids_valid = B_TRUE; } else if (rc == ENOTSUP) { @@ -655,7 +655,8 @@ efx_nic_get_fw_version( goto fail3; } - memcpy(enfip->enfi_mc_fw_version, mc_fw_version, sizeof(mc_fw_version)); + memcpy(enfip->enfi_mc_fw_version, mc_fw_version, + sizeof (mc_fw_version)); return (0); Modified: head/sys/dev/sfxge/common/efx_types.h ============================================================================== --- head/sys/dev/sfxge/common/efx_types.h Sat Nov 24 15:24:35 2018 (r340879) +++ head/sys/dev/sfxge/common/efx_types.h Sat Nov 24 15:24:47 2018 (r340880) @@ -120,7 +120,8 @@ extern "C" { #define EFX_DWORD_3_LBN 96 #define EFX_DWORD_3_WIDTH 32 -/* There are intentionally no EFX_QWORD_0 or EFX_QWORD_1 field definitions +/* + * There are intentionally no EFX_QWORD_0 or EFX_QWORD_1 field definitions * here as the implementaion of EFX_QWORD_FIELD and EFX_OWORD_FIELD do not * support field widths larger than 32 bits. */ Modified: head/sys/dev/sfxge/common/medford_nic.c ============================================================================== --- head/sys/dev/sfxge/common/medford_nic.c Sat Nov 24 15:24:35 2018 (r340879) +++ head/sys/dev/sfxge/common/medford_nic.c Sat Nov 24 15:24:47 2018 (r340880) @@ -181,7 +181,8 @@ medford_board_cfg( if (EFX_PCI_FUNCTION_IS_PF(encp)) { rc = efx_mcdi_get_mac_address_pf(enp, mac_addr); #if EFSYS_OPT_ALLOW_UNCONFIGURED_NIC - /* Disable static config checking for Medford NICs, ONLY + /* + * Disable static config checking for Medford NICs, ONLY * for manufacturing test and setup at the factory, to * allow the static config to be installed. */ From owner-svn-src-all@freebsd.org Sat Nov 24 16:05:41 2018 Return-Path: Delivered-To: svn-src-all@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 862411152D97; Sat, 24 Nov 2018 16:05:41 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.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 29C417F102; Sat, 24 Nov 2018 16:05:41 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0C21010334; Sat, 24 Nov 2018 16:05:41 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAOG5eAp073576; Sat, 24 Nov 2018 16:05:40 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAOG5ejn073575; Sat, 24 Nov 2018 16:05:40 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201811241605.wAOG5ejn073575@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Sat, 24 Nov 2018 16:05:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340881 - head/lib/csu/tests X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: head/lib/csu/tests X-SVN-Commit-Revision: 340881 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 29C417F102 X-Spamd-Result: default: False [1.81 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.62)[0.625,0]; NEURAL_SPAM_SHORT(0.49)[0.490,0]; NEURAL_SPAM_MEDIUM(0.69)[0.693,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Nov 2018 16:05:41 -0000 Author: andrew Date: Sat Nov 24 16:05:40 2018 New Revision: 340881 URL: https://svnweb.freebsd.org/changeset/base/340881 Log: Disable the dynamiclib test until a failure can be debugged Modified: head/lib/csu/tests/Makefile Modified: head/lib/csu/tests/Makefile ============================================================================== --- head/lib/csu/tests/Makefile Sat Nov 24 15:24:47 2018 (r340880) +++ head/lib/csu/tests/Makefile Sat Nov 24 16:05:40 2018 (r340881) @@ -2,7 +2,7 @@ SUBDIR= dso TESTS_SUBDIRS= dynamic -TESTS_SUBDIRS+= dynamiclib +#TESTS_SUBDIRS+= dynamiclib TESTS_SUBDIRS+= static .include From owner-svn-src-all@freebsd.org Sat Nov 24 16:29:28 2018 Return-Path: Delivered-To: svn-src-all@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 1C2851102B7A; Sat, 24 Nov 2018 16:29:28 +0000 (UTC) (envelope-from arybchik@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 9C5FE8010A; Sat, 24 Nov 2018 16:29:27 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 784021067E; Sat, 24 Nov 2018 16:29:24 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAOGTOX6085444; Sat, 24 Nov 2018 16:29:24 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAOGTOSQ085443; Sat, 24 Nov 2018 16:29:24 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811241629.wAOGTOSQ085443@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Sat, 24 Nov 2018 16:29:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340884 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 340884 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 9C5FE8010A X-Spamd-Result: default: False [1.85 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.64)[0.643,0]; NEURAL_SPAM_MEDIUM(0.71)[0.712,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.50)[0.496,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Nov 2018 16:29:28 -0000 Author: arybchik Date: Sat Nov 24 16:29:23 2018 New Revision: 340884 URL: https://svnweb.freebsd.org/changeset/base/340884 Log: sfxge(4): fix probes in licensing support EFSYS_PROBE1 takes one typed value (in addition to the probe name), whereas EFSYS_PROBE has just the probe name. Which to use is determined by the probe name - "fail1" probes are expected to include the function result. Submitted by: Mark Spender Sponsored by: Solarflare Communications, Inc. MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D18118 Modified: head/sys/dev/sfxge/common/efx_lic.c Modified: head/sys/dev/sfxge/common/efx_lic.c ============================================================================== --- head/sys/dev/sfxge/common/efx_lic.c Sat Nov 24 16:29:11 2018 (r340883) +++ head/sys/dev/sfxge/common/efx_lic.c Sat Nov 24 16:29:23 2018 (r340884) @@ -501,7 +501,7 @@ efx_lic_v1v2_find_key( return (found); fail1: - EFSYS_PROBE(fail1); + EFSYS_PROBE1(fail1, boolean_t, B_FALSE); return (B_FALSE); } @@ -543,7 +543,7 @@ fail3: fail2: EFSYS_PROBE(fail2); fail1: - EFSYS_PROBE(fail1); + EFSYS_PROBE1(fail1, boolean_t, B_FALSE); return (B_FALSE); } @@ -1161,7 +1161,7 @@ fail3: fail2: EFSYS_PROBE(fail2); fail1: - EFSYS_PROBE(fail1); + EFSYS_PROBE1(fail1, boolean_t, B_FALSE); return (B_FALSE); } From owner-svn-src-all@freebsd.org Sat Nov 24 16:28:59 2018 Return-Path: Delivered-To: svn-src-all@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 DDE941102AFF; Sat, 24 Nov 2018 16:28:59 +0000 (UTC) (envelope-from arybchik@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 816027FEFA; Sat, 24 Nov 2018 16:28:59 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5E4271067B; Sat, 24 Nov 2018 16:28:59 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAOGSxF8085301; Sat, 24 Nov 2018 16:28:59 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAOGSxnL085300; Sat, 24 Nov 2018 16:28:59 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811241628.wAOGSxnL085300@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Sat, 24 Nov 2018 16:28:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340882 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 340882 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 816027FEFA X-Spamd-Result: default: False [1.85 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.64)[0.643,0]; NEURAL_SPAM_MEDIUM(0.71)[0.712,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.50)[0.496,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Nov 2018 16:29:00 -0000 Author: arybchik Date: Sat Nov 24 16:28:58 2018 New Revision: 340882 URL: https://svnweb.freebsd.org/changeset/base/340882 Log: sfxge(4): allow to use PHY stats on Huntington/Medford EFSYS_OPT_PHY_STATS can be used with Huntington or Medford, not just Siena. Submitted by: Mark Spender Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18116 Modified: head/sys/dev/sfxge/common/efx_check.h Modified: head/sys/dev/sfxge/common/efx_check.h ============================================================================== --- head/sys/dev/sfxge/common/efx_check.h Sat Nov 24 16:05:40 2018 (r340881) +++ head/sys/dev/sfxge/common/efx_check.h Sat Nov 24 16:28:58 2018 (r340882) @@ -261,8 +261,8 @@ /* Support PHY statistics */ #if EFSYS_OPT_PHY_STATS -# if !EFSYS_OPT_SIENA -# error "PHY_STATS requires SIENA" +# if !(EFSYS_OPT_SIENA || EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD) +# error "PHY_STATS requires SIENA or HUNTINGTON or MEDFORD" # endif #endif /* EFSYS_OPT_PHY_STATS */ From owner-svn-src-all@freebsd.org Sat Nov 24 16:29:13 2018 Return-Path: Delivered-To: svn-src-all@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 7DC9F1102B3E; Sat, 24 Nov 2018 16:29:13 +0000 (UTC) (envelope-from arybchik@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 08EE97FFE2; Sat, 24 Nov 2018 16:29:13 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DE4AC1067D; Sat, 24 Nov 2018 16:29:12 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAOGTC86085379; Sat, 24 Nov 2018 16:29:12 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAOGTCAC085376; Sat, 24 Nov 2018 16:29:12 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811241629.wAOGTCAC085376@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Sat, 24 Nov 2018 16:29:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340883 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 340883 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 08EE97FFE2 X-Spamd-Result: default: False [1.93 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.68)[0.678,0]; NEURAL_SPAM_MEDIUM(0.75)[0.746,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.51)[0.507,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Nov 2018 16:29:13 -0000 Author: arybchik Date: Sat Nov 24 16:29:11 2018 New Revision: 340883 URL: https://svnweb.freebsd.org/changeset/base/340883 Log: sfxge(4): fix diagnostics support build without Siena The compilation failed because __efx_sram_pattern_fns was used in efx_nic.c, but defined in efx_sram.c which is only needed when supporting Siena. To fix it move all the code using __efx_sram_pattern_fns into Siena-specific files (except for the definition in efx_sram.c itself, as that file only needs to be included in Siena-supporting builds anyway). The functions to test registers and tables are unlikely to apply to any new hardware and so can be moved into Siena files. Since Huntington such tests have been implemented in firmware. Submitted by: Mark Spender Sponsored by: Solarflare Communications, Inc. MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D18117 Modified: head/sys/dev/sfxge/common/efx_impl.h head/sys/dev/sfxge/common/efx_nic.c head/sys/dev/sfxge/common/siena_impl.h head/sys/dev/sfxge/common/siena_nic.c Modified: head/sys/dev/sfxge/common/efx_impl.h ============================================================================== --- head/sys/dev/sfxge/common/efx_impl.h Sat Nov 24 16:28:58 2018 (r340882) +++ head/sys/dev/sfxge/common/efx_impl.h Sat Nov 24 16:29:11 2018 (r340883) @@ -1141,32 +1141,6 @@ efx_vpd_hunk_set( #endif /* EFSYS_OPT_VPD */ -#if EFSYS_OPT_DIAG - -extern efx_sram_pattern_fn_t __efx_sram_pattern_fns[]; - -typedef struct efx_register_set_s { - unsigned int address; - unsigned int step; - unsigned int rows; - efx_oword_t mask; -} efx_register_set_t; - -extern __checkReturn efx_rc_t -efx_nic_test_registers( - __in efx_nic_t *enp, - __in efx_register_set_t *rsp, - __in size_t count); - -extern __checkReturn efx_rc_t -efx_nic_test_tables( - __in efx_nic_t *enp, - __in efx_register_set_t *rsp, - __in efx_pattern_type_t pattern, - __in size_t count); - -#endif /* EFSYS_OPT_DIAG */ - #if EFSYS_OPT_MCDI extern __checkReturn efx_rc_t Modified: head/sys/dev/sfxge/common/efx_nic.c ============================================================================== --- head/sys/dev/sfxge/common/efx_nic.c Sat Nov 24 16:28:58 2018 (r340882) +++ head/sys/dev/sfxge/common/efx_nic.c Sat Nov 24 16:29:11 2018 (r340883) @@ -694,139 +694,6 @@ fail1: return (rc); } - __checkReturn efx_rc_t -efx_nic_test_registers( - __in efx_nic_t *enp, - __in efx_register_set_t *rsp, - __in size_t count) -{ - unsigned int bit; - efx_oword_t original; - efx_oword_t reg; - efx_oword_t buf; - efx_rc_t rc; - - while (count > 0) { - /* This function is only suitable for registers */ - EFSYS_ASSERT(rsp->rows == 1); - - /* bit sweep on and off */ - EFSYS_BAR_READO(enp->en_esbp, rsp->address, &original, - B_TRUE); - for (bit = 0; bit < 128; bit++) { - /* Is this bit in the mask? */ - if (~(rsp->mask.eo_u32[bit >> 5]) & (1 << bit)) - continue; - - /* Test this bit can be set in isolation */ - reg = original; - EFX_AND_OWORD(reg, rsp->mask); - EFX_SET_OWORD_BIT(reg, bit); - - EFSYS_BAR_WRITEO(enp->en_esbp, rsp->address, ®, - B_TRUE); - EFSYS_BAR_READO(enp->en_esbp, rsp->address, &buf, - B_TRUE); - - EFX_AND_OWORD(buf, rsp->mask); - if (memcmp(®, &buf, sizeof (reg))) { - rc = EIO; - goto fail1; - } - - /* Test this bit can be cleared in isolation */ - EFX_OR_OWORD(reg, rsp->mask); - EFX_CLEAR_OWORD_BIT(reg, bit); - - EFSYS_BAR_WRITEO(enp->en_esbp, rsp->address, ®, - B_TRUE); - EFSYS_BAR_READO(enp->en_esbp, rsp->address, &buf, - B_TRUE); - - EFX_AND_OWORD(buf, rsp->mask); - if (memcmp(®, &buf, sizeof (reg))) { - rc = EIO; - goto fail2; - } - } - - /* Restore the old value */ - EFSYS_BAR_WRITEO(enp->en_esbp, rsp->address, &original, - B_TRUE); - - --count; - ++rsp; - } - - return (0); - -fail2: - EFSYS_PROBE(fail2); -fail1: - EFSYS_PROBE1(fail1, efx_rc_t, rc); - - /* Restore the old value */ - EFSYS_BAR_WRITEO(enp->en_esbp, rsp->address, &original, B_TRUE); - - return (rc); -} - - __checkReturn efx_rc_t -efx_nic_test_tables( - __in efx_nic_t *enp, - __in efx_register_set_t *rsp, - __in efx_pattern_type_t pattern, - __in size_t count) -{ - efx_sram_pattern_fn_t func; - unsigned int index; - unsigned int address; - efx_oword_t reg; - efx_oword_t buf; - efx_rc_t rc; - - EFSYS_ASSERT(pattern < EFX_PATTERN_NTYPES); - func = __efx_sram_pattern_fns[pattern]; - - while (count > 0) { - /* Write */ - address = rsp->address; - for (index = 0; index < rsp->rows; ++index) { - func(2 * index + 0, B_FALSE, ®.eo_qword[0]); - func(2 * index + 1, B_FALSE, ®.eo_qword[1]); - EFX_AND_OWORD(reg, rsp->mask); - EFSYS_BAR_WRITEO(enp->en_esbp, address, ®, B_TRUE); - - address += rsp->step; - } - - /* Read */ - address = rsp->address; - for (index = 0; index < rsp->rows; ++index) { - func(2 * index + 0, B_FALSE, ®.eo_qword[0]); - func(2 * index + 1, B_FALSE, ®.eo_qword[1]); - EFX_AND_OWORD(reg, rsp->mask); - EFSYS_BAR_READO(enp->en_esbp, address, &buf, B_TRUE); - if (memcmp(®, &buf, sizeof (reg))) { - rc = EIO; - goto fail1; - } - - address += rsp->step; - } - - ++rsp; - --count; - } - - return (0); - -fail1: - EFSYS_PROBE1(fail1, efx_rc_t, rc); - - return (rc); -} - #endif /* EFSYS_OPT_DIAG */ #if EFSYS_OPT_LOOPBACK Modified: head/sys/dev/sfxge/common/siena_impl.h ============================================================================== --- head/sys/dev/sfxge/common/siena_impl.h Sat Nov 24 16:28:58 2018 (r340882) +++ head/sys/dev/sfxge/common/siena_impl.h Sat Nov 24 16:29:11 2018 (r340883) @@ -69,6 +69,15 @@ siena_nic_init( #if EFSYS_OPT_DIAG +extern efx_sram_pattern_fn_t __efx_sram_pattern_fns[]; + +typedef struct siena_register_set_s { + unsigned int address; + unsigned int step; + unsigned int rows; + efx_oword_t mask; +} siena_register_set_t; + extern __checkReturn efx_rc_t siena_nic_register_test( __in efx_nic_t *enp); Modified: head/sys/dev/sfxge/common/siena_nic.c ============================================================================== --- head/sys/dev/sfxge/common/siena_nic.c Sat Nov 24 16:28:58 2018 (r340882) +++ head/sys/dev/sfxge/common/siena_nic.c Sat Nov 24 16:29:11 2018 (r340883) @@ -462,7 +462,7 @@ siena_nic_unprobe( #if EFSYS_OPT_DIAG -static efx_register_set_t __siena_registers[] = { +static siena_register_set_t __siena_registers[] = { { FR_AZ_ADR_REGION_REG_OFST, 0, 1 }, { FR_CZ_USR_EV_CFG_OFST, 0, 1 }, { FR_AZ_RX_CFG_REG_OFST, 0, 1 }, @@ -494,7 +494,7 @@ static const uint32_t __siena_register_masks[] = { 0xFFFFFFFF, 0xFFFFFFFF, 0x00000007, 0x00000000 }; -static efx_register_set_t __siena_tables[] = { +static siena_register_set_t __siena_tables[] = { { FR_AZ_RX_FILTER_TBL0_OFST, FR_AZ_RX_FILTER_TBL0_STEP, FR_AZ_RX_FILTER_TBL0_ROWS }, { FR_CZ_RX_MAC_FILTER_TBL0_OFST, FR_CZ_RX_MAC_FILTER_TBL0_STEP, @@ -521,10 +521,144 @@ static const uint32_t __siena_table_masks[] = { }; __checkReturn efx_rc_t +siena_nic_test_registers( + __in efx_nic_t *enp, + __in siena_register_set_t *rsp, + __in size_t count) +{ + unsigned int bit; + efx_oword_t original; + efx_oword_t reg; + efx_oword_t buf; + efx_rc_t rc; + + while (count > 0) { + /* This function is only suitable for registers */ + EFSYS_ASSERT(rsp->rows == 1); + + /* bit sweep on and off */ + EFSYS_BAR_READO(enp->en_esbp, rsp->address, &original, + B_TRUE); + for (bit = 0; bit < 128; bit++) { + /* Is this bit in the mask? */ + if (~(rsp->mask.eo_u32[bit >> 5]) & (1 << bit)) + continue; + + /* Test this bit can be set in isolation */ + reg = original; + EFX_AND_OWORD(reg, rsp->mask); + EFX_SET_OWORD_BIT(reg, bit); + + EFSYS_BAR_WRITEO(enp->en_esbp, rsp->address, ®, + B_TRUE); + EFSYS_BAR_READO(enp->en_esbp, rsp->address, &buf, + B_TRUE); + + EFX_AND_OWORD(buf, rsp->mask); + if (memcmp(®, &buf, sizeof (reg))) { + rc = EIO; + goto fail1; + } + + /* Test this bit can be cleared in isolation */ + EFX_OR_OWORD(reg, rsp->mask); + EFX_CLEAR_OWORD_BIT(reg, bit); + + EFSYS_BAR_WRITEO(enp->en_esbp, rsp->address, ®, + B_TRUE); + EFSYS_BAR_READO(enp->en_esbp, rsp->address, &buf, + B_TRUE); + + EFX_AND_OWORD(buf, rsp->mask); + if (memcmp(®, &buf, sizeof (reg))) { + rc = EIO; + goto fail2; + } + } + + /* Restore the old value */ + EFSYS_BAR_WRITEO(enp->en_esbp, rsp->address, &original, + B_TRUE); + + --count; + ++rsp; + } + + return (0); + +fail2: + EFSYS_PROBE(fail2); +fail1: + EFSYS_PROBE1(fail1, efx_rc_t, rc); + + /* Restore the old value */ + EFSYS_BAR_WRITEO(enp->en_esbp, rsp->address, &original, B_TRUE); + + return (rc); +} + + __checkReturn efx_rc_t +siena_nic_test_tables( + __in efx_nic_t *enp, + __in siena_register_set_t *rsp, + __in efx_pattern_type_t pattern, + __in size_t count) +{ + efx_sram_pattern_fn_t func; + unsigned int index; + unsigned int address; + efx_oword_t reg; + efx_oword_t buf; + efx_rc_t rc; + + EFSYS_ASSERT(pattern < EFX_PATTERN_NTYPES); + func = __efx_sram_pattern_fns[pattern]; + + while (count > 0) { + /* Write */ + address = rsp->address; + for (index = 0; index < rsp->rows; ++index) { + func(2 * index + 0, B_FALSE, ®.eo_qword[0]); + func(2 * index + 1, B_FALSE, ®.eo_qword[1]); + EFX_AND_OWORD(reg, rsp->mask); + EFSYS_BAR_WRITEO(enp->en_esbp, address, ®, B_TRUE); + + address += rsp->step; + } + + /* Read */ + address = rsp->address; + for (index = 0; index < rsp->rows; ++index) { + func(2 * index + 0, B_FALSE, ®.eo_qword[0]); + func(2 * index + 1, B_FALSE, ®.eo_qword[1]); + EFX_AND_OWORD(reg, rsp->mask); + EFSYS_BAR_READO(enp->en_esbp, address, &buf, B_TRUE); + if (memcmp(®, &buf, sizeof (reg))) { + rc = EIO; + goto fail1; + } + + address += rsp->step; + } + + ++rsp; + --count; + } + + return (0); + +fail1: + EFSYS_PROBE1(fail1, efx_rc_t, rc); + + return (rc); +} + + + __checkReturn efx_rc_t siena_nic_register_test( __in efx_nic_t *enp) { - efx_register_set_t *rsp; + siena_register_set_t *rsp; const uint32_t *dwordp; unsigned int nitems; unsigned int count; @@ -558,21 +692,21 @@ siena_nic_register_test( rsp->mask.eo_u32[3] = *dwordp++; } - if ((rc = efx_nic_test_registers(enp, __siena_registers, + if ((rc = siena_nic_test_registers(enp, __siena_registers, EFX_ARRAY_SIZE(__siena_registers))) != 0) goto fail1; - if ((rc = efx_nic_test_tables(enp, __siena_tables, + if ((rc = siena_nic_test_tables(enp, __siena_tables, EFX_PATTERN_BYTE_ALTERNATE, EFX_ARRAY_SIZE(__siena_tables))) != 0) goto fail2; - if ((rc = efx_nic_test_tables(enp, __siena_tables, + if ((rc = siena_nic_test_tables(enp, __siena_tables, EFX_PATTERN_BYTE_CHANGING, EFX_ARRAY_SIZE(__siena_tables))) != 0) goto fail3; - if ((rc = efx_nic_test_tables(enp, __siena_tables, + if ((rc = siena_nic_test_tables(enp, __siena_tables, EFX_PATTERN_BIT_SWEEP, EFX_ARRAY_SIZE(__siena_tables))) != 0) goto fail4; From owner-svn-src-all@freebsd.org Sat Nov 24 16:29:48 2018 Return-Path: Delivered-To: svn-src-all@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 971771102C0F; Sat, 24 Nov 2018 16:29:48 +0000 (UTC) (envelope-from arybchik@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 3812880282; Sat, 24 Nov 2018 16:29:48 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2ECA110681; Sat, 24 Nov 2018 16:29:47 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAOGTl7M085573; Sat, 24 Nov 2018 16:29:47 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAOGTl6H085572; Sat, 24 Nov 2018 16:29:47 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811241629.wAOGTl6H085572@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Sat, 24 Nov 2018 16:29:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340886 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 340886 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 3812880282 X-Spamd-Result: default: False [1.85 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.64)[0.643,0]; NEURAL_SPAM_MEDIUM(0.71)[0.712,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.50)[0.496,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Nov 2018 16:29:48 -0000 Author: arybchik Date: Sat Nov 24 16:29:46 2018 New Revision: 340886 URL: https://svnweb.freebsd.org/changeset/base/340886 Log: sfxge(4): fix warnings from VS2015 C compiler (C4244) Fix level 4 warning "C4244: '+=': conversion from 'unsigned int' to 'uint16_t', possible loss of data"; no functional changes. Submitted by: Andrew Lee Sponsored by: Solarflare Communications, Inc. MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D18120 Modified: head/sys/dev/sfxge/common/efx_vpd.c Modified: head/sys/dev/sfxge/common/efx_vpd.c ============================================================================== --- head/sys/dev/sfxge/common/efx_vpd.c Sat Nov 24 16:29:35 2018 (r340885) +++ head/sys/dev/sfxge/common/efx_vpd.c Sat Nov 24 16:29:46 2018 (r340886) @@ -933,7 +933,7 @@ efx_vpd_hunk_set( } /* Modify tag length (large resource type) */ - taglen += (dest - source); + taglen += (uint16_t)(dest - source); EFX_POPULATE_WORD_1(word, EFX_WORD_0, taglen); data[offset - 2] = EFX_WORD_FIELD(word, EFX_BYTE_0); data[offset - 1] = EFX_WORD_FIELD(word, EFX_BYTE_1); From owner-svn-src-all@freebsd.org Sat Nov 24 16:29:38 2018 Return-Path: Delivered-To: svn-src-all@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 415801102BB5; Sat, 24 Nov 2018 16:29:38 +0000 (UTC) (envelope-from arybchik@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 D8E53801B5; Sat, 24 Nov 2018 16:29:37 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B929E1067F; Sat, 24 Nov 2018 16:29:35 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAOGTZjB085510; Sat, 24 Nov 2018 16:29:35 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAOGTZKM085508; Sat, 24 Nov 2018 16:29:35 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811241629.wAOGTZKM085508@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Sat, 24 Nov 2018 16:29:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340885 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 340885 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D8E53801B5 X-Spamd-Result: default: False [1.85 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.64)[0.643,0]; NEURAL_SPAM_MEDIUM(0.71)[0.712,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.50)[0.496,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Nov 2018 16:29:38 -0000 Author: arybchik Date: Sat Nov 24 16:29:35 2018 New Revision: 340885 URL: https://svnweb.freebsd.org/changeset/base/340885 Log: sfxge(4): fix warnings from VS2015 C compiler (C4310) Fix level 4 warning "C4310: cast truncates constant value"; no functional changes. Submitted by: Andrew Lee Sponsored by: Solarflare Communications, Inc. MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D18119 Modified: head/sys/dev/sfxge/common/efx_bootcfg.c Modified: head/sys/dev/sfxge/common/efx_bootcfg.c ============================================================================== --- head/sys/dev/sfxge/common/efx_bootcfg.c Sat Nov 24 16:29:23 2018 (r340884) +++ head/sys/dev/sfxge/common/efx_bootcfg.c Sat Nov 24 16:29:35 2018 (r340885) @@ -361,7 +361,7 @@ efx_bootcfg_read( rc = efx_bootcfg_verify(enp, (caddr_t)payload, sector_length, &used_bytes); if (rc != 0 || used_bytes == 0) { - payload[0] = (uint8_t)~DHCP_END; + payload[0] = (uint8_t)(~DHCP_END & 0xff); payload[1] = DHCP_END; used_bytes = 2; } From owner-svn-src-all@freebsd.org Sat Nov 24 16:30:14 2018 Return-Path: Delivered-To: svn-src-all@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 DBB001102CB7; Sat, 24 Nov 2018 16:30:13 +0000 (UTC) (envelope-from arybchik@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 79A3780505; Sat, 24 Nov 2018 16:30:13 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 73F6210686; Sat, 24 Nov 2018 16:30:11 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAOGUBvk085746; Sat, 24 Nov 2018 16:30:11 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAOGUAl6085739; Sat, 24 Nov 2018 16:30:10 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811241630.wAOGUAl6085739@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Sat, 24 Nov 2018 16:30:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340888 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 340888 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 79A3780505 X-Spamd-Result: default: False [1.89 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.66)[0.661,0]; NEURAL_SPAM_MEDIUM(0.73)[0.730,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.50)[0.502,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Nov 2018 16:30:14 -0000 Author: arybchik Date: Sat Nov 24 16:30:09 2018 New Revision: 340888 URL: https://svnweb.freebsd.org/changeset/base/340888 Log: sfxge(4): fix warnings from VS2015 C compiler (C4100) Fix multiple level 4 warnings "C4100: 'xxx': unreferenced formal parameter" no functional changes. The _NOTE(ARGUNUSED(xxx)) annotations are being exposed to the Visual Studio 2015 C compiler with the following: #define _NOTE_ARGUNUSED(...) UNREFERENCED_PARAMETER((__VA_ARGS__)); #define _NOTE(_annotation) _NOTE_ ## _annotation Submitted by: Andrew Lee Sponsored by: Solarflare Communications, Inc. MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D18122 Modified: head/sys/dev/sfxge/common/ef10_nvram.c head/sys/dev/sfxge/common/ef10_rx.c head/sys/dev/sfxge/common/ef10_tx.c head/sys/dev/sfxge/common/efx_ev.c head/sys/dev/sfxge/common/efx_lic.c head/sys/dev/sfxge/common/efx_mcdi.c Modified: head/sys/dev/sfxge/common/ef10_nvram.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_nvram.c Sat Nov 24 16:29:58 2018 (r340887) +++ head/sys/dev/sfxge/common/ef10_nvram.c Sat Nov 24 16:30:09 2018 (r340888) @@ -675,6 +675,7 @@ ef10_nvram_buffer_validate( int pos; efx_rc_t rc; + _NOTE(ARGUNUSED(enp, partn)) EFX_STATIC_ASSERT(sizeof (*header) <= EF10_NVRAM_CHUNK); if ((partn_data == NULL) || (partn_size == 0)) { @@ -1284,6 +1285,8 @@ ef10_nvram_buf_read_tlv( size_t length; caddr_t value; efx_rc_t rc; + + _NOTE(ARGUNUSED(enp)) if ((seg_data == NULL) || (max_seg_size == 0)) { rc = EINVAL; Modified: head/sys/dev/sfxge/common/ef10_rx.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_rx.c Sat Nov 24 16:29:58 2018 (r340887) +++ head/sys/dev/sfxge/common/ef10_rx.c Sat Nov 24 16:30:09 2018 (r340888) @@ -752,6 +752,8 @@ ef10_rx_qpost( unsigned int offset; unsigned int id; + _NOTE(ARGUNUSED(completed)) + #if EFSYS_OPT_RX_PACKED_STREAM /* * Real size of the buffer does not fit into ESF_DZ_RX_KER_BYTE_CNT Modified: head/sys/dev/sfxge/common/ef10_tx.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_tx.c Sat Nov 24 16:29:58 2018 (r340887) +++ head/sys/dev/sfxge/common/ef10_tx.c Sat Nov 24 16:30:09 2018 (r340888) @@ -609,6 +609,8 @@ ef10_tx_qdesc_dma_create( __in boolean_t eop, __out efx_desc_t *edp) { + _NOTE(ARGUNUSED(etp)) + /* No limitations on boundary crossing */ EFSYS_ASSERT(size <= etp->et_enp->en_nic_cfg.enc_tx_dma_desc_size_max); @@ -632,6 +634,8 @@ ef10_tx_qdesc_tso_create( __in uint8_t tcp_flags, __out efx_desc_t *edp) { + _NOTE(ARGUNUSED(etp)) + EFSYS_PROBE4(tx_desc_tso_create, unsigned int, etp->et_index, uint16_t, ipv4_id, uint32_t, tcp_seq, uint8_t, tcp_flags); @@ -654,6 +658,8 @@ ef10_tx_qdesc_tso2_create( __out_ecount(count) efx_desc_t *edp, __in int count) { + _NOTE(ARGUNUSED(etp, count)) + EFSYS_PROBE4(tx_desc_tso2_create, unsigned int, etp->et_index, uint16_t, ipv4_id, uint32_t, tcp_seq, uint16_t, tcp_mss); @@ -683,6 +689,8 @@ ef10_tx_qdesc_vlantci_create( __in uint16_t tci, __out efx_desc_t *edp) { + _NOTE(ARGUNUSED(etp)) + EFSYS_PROBE2(tx_desc_vlantci_create, unsigned int, etp->et_index, uint16_t, tci); Modified: head/sys/dev/sfxge/common/efx_ev.c ============================================================================== --- head/sys/dev/sfxge/common/efx_ev.c Sat Nov 24 16:29:58 2018 (r340887) +++ head/sys/dev/sfxge/common/efx_ev.c Sat Nov 24 16:30:09 2018 (r340888) @@ -1422,6 +1422,8 @@ efx_ev_qstat_name( __in efx_nic_t *enp, __in unsigned int id) { + _NOTE(ARGUNUSED(enp)) + EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC); EFSYS_ASSERT3U(id, <, EV_NQSTATS); Modified: head/sys/dev/sfxge/common/efx_lic.c ============================================================================== --- head/sys/dev/sfxge/common/efx_lic.c Sat Nov 24 16:29:58 2018 (r340887) +++ head/sys/dev/sfxge/common/efx_lic.c Sat Nov 24 16:30:09 2018 (r340888) @@ -564,7 +564,7 @@ efx_lic_v1v2_read_key( { efx_rc_t rc; - _NOTE(ARGUNUSED(enp)) + _NOTE(ARGUNUSED(enp, buffer_size)) EFSYS_ASSERT(length <= (EFX_LICENSE_V1V2_PAYLOAD_LENGTH_MAX + EFX_LICENSE_V1V2_HEADER_LENGTH)); @@ -634,7 +634,7 @@ efx_lic_v1v2_delete_key( uint32_t move_start = offset + length; uint32_t move_length = end - move_start; - _NOTE(ARGUNUSED(enp)) + _NOTE(ARGUNUSED(enp, buffer_size)) EFSYS_ASSERT(end <= buffer_size); /* Shift everything after the key down */ @@ -652,7 +652,7 @@ efx_lic_v1v2_create_partition( caddr_t bufferp, __in size_t buffer_size) { - _NOTE(ARGUNUSED(enp)) + _NOTE(ARGUNUSED(enp, buffer_size)) EFSYS_ASSERT(EFX_LICENSE_V1V2_HEADER_LENGTH <= buffer_size); /* Write terminator */ Modified: head/sys/dev/sfxge/common/efx_mcdi.c ============================================================================== --- head/sys/dev/sfxge/common/efx_mcdi.c Sat Nov 24 16:29:58 2018 (r340887) +++ head/sys/dev/sfxge/common/efx_mcdi.c Sat Nov 24 16:30:09 2018 (r340888) @@ -814,6 +814,8 @@ efx_mcdi_get_proxy_handle( { efx_rc_t rc; + _NOTE(ARGUNUSED(enp)) + /* * Return proxy handle from MCDI request that returned with error * MC_MCD_ERR_PROXY_PENDING. This handle is used to wait for a matching From owner-svn-src-all@freebsd.org Sat Nov 24 16:30:26 2018 Return-Path: Delivered-To: svn-src-all@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 277FE1102D0E; Sat, 24 Nov 2018 16:30:26 +0000 (UTC) (envelope-from arybchik@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 C118E80627; Sat, 24 Nov 2018 16:30:25 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B3C8D10687; Sat, 24 Nov 2018 16:30:23 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAOGUNH7085819; Sat, 24 Nov 2018 16:30:23 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAOGUMQL085809; Sat, 24 Nov 2018 16:30:22 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811241630.wAOGUMQL085809@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Sat, 24 Nov 2018 16:30:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340889 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 340889 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C118E80627 X-Spamd-Result: default: False [1.89 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.66)[0.661,0]; NEURAL_SPAM_MEDIUM(0.73)[0.730,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.50)[0.502,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Nov 2018 16:30:26 -0000 Author: arybchik Date: Sat Nov 24 16:30:22 2018 New Revision: 340889 URL: https://svnweb.freebsd.org/changeset/base/340889 Log: sfxge(4): fix warnings from VS2015 C compiler (C4189) Fix multiple level 4 warnings "C4189: 'xxx': local variable is initialized but not referenced"; no functional changes. Submitted by: Andrew Lee Sponsored by: Solarflare Communications, Inc. MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D18123 Modified: head/sys/dev/sfxge/common/ef10_ev.c head/sys/dev/sfxge/common/efx_ev.c head/sys/dev/sfxge/common/efx_tx.c head/sys/dev/sfxge/common/mcdi_mon.c Modified: head/sys/dev/sfxge/common/ef10_ev.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_ev.c Sat Nov 24 16:30:09 2018 (r340888) +++ head/sys/dev/sfxge/common/ef10_ev.c Sat Nov 24 16:30:22 2018 (r340889) @@ -578,7 +578,7 @@ ef10_ev_qdestroy( EFSYS_ASSERT(enp->en_family == EFX_FAMILY_HUNTINGTON || enp->en_family == EFX_FAMILY_MEDFORD); - (void) efx_mcdi_fini_evq(eep->ee_enp, eep->ee_index); + (void) efx_mcdi_fini_evq(enp, eep->ee_index); } __checkReturn efx_rc_t @@ -1349,9 +1349,12 @@ ef10_ev_rxlabel_init( __in efx_rxq_type_t type) { efx_evq_rxq_state_t *eersp; +#if EFSYS_OPT_RX_PACKED_STREAM boolean_t packed_stream = (type >= EFX_RXQ_TYPE_PACKED_STREAM_1M) && (type <= EFX_RXQ_TYPE_PACKED_STREAM_64K); +#endif + _NOTE(ARGUNUSED(type)) EFSYS_ASSERT3U(label, <, EFX_ARRAY_SIZE(eep->ee_rxq_state)); eersp = &eep->ee_rxq_state[label]; @@ -1389,8 +1392,6 @@ ef10_ev_rxlabel_init( EFSYS_ASSERT3U(eersp->eers_rx_packed_stream_credits, <=, EFX_RX_PACKED_STREAM_MAX_CREDITS); } -#else - EFSYS_ASSERT(!packed_stream); #endif } Modified: head/sys/dev/sfxge/common/efx_ev.c ============================================================================== --- head/sys/dev/sfxge/common/efx_ev.c Sat Nov 24 16:30:09 2018 (r340888) +++ head/sys/dev/sfxge/common/efx_ev.c Sat Nov 24 16:30:22 2018 (r340889) @@ -228,14 +228,14 @@ efx_ev_qcreate( __deref_out efx_evq_t **eepp) { const efx_ev_ops_t *eevop = enp->en_eevop; - efx_nic_cfg_t *encp = &(enp->en_nic_cfg); efx_evq_t *eep; efx_rc_t rc; EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC); EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_EV); - EFSYS_ASSERT3U(enp->en_ev_qcount + 1, <, encp->enc_evq_limit); + EFSYS_ASSERT3U(enp->en_ev_qcount + 1, <, + enp->en_nic_cfg.enc_evq_limit); switch (flags & EFX_EVQ_FLAGS_NOTIFY_MASK) { case EFX_EVQ_FLAGS_NOTIFY_INTERRUPT: Modified: head/sys/dev/sfxge/common/efx_tx.c ============================================================================== --- head/sys/dev/sfxge/common/efx_tx.c Sat Nov 24 16:30:09 2018 (r340888) +++ head/sys/dev/sfxge/common/efx_tx.c Sat Nov 24 16:30:22 2018 (r340889) @@ -303,14 +303,14 @@ efx_tx_qcreate( __out unsigned int *addedp) { const efx_tx_ops_t *etxop = enp->en_etxop; - efx_nic_cfg_t *encp = &(enp->en_nic_cfg); efx_txq_t *etp; efx_rc_t rc; EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC); EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_TX); - EFSYS_ASSERT3U(enp->en_tx_qcount + 1, <, encp->enc_txq_limit); + EFSYS_ASSERT3U(enp->en_tx_qcount + 1, <, + enp->en_nic_cfg.enc_txq_limit); /* Allocate an TXQ object */ EFSYS_KMEM_ALLOC(enp->en_esip, sizeof (efx_txq_t), etp); Modified: head/sys/dev/sfxge/common/mcdi_mon.c ============================================================================== --- head/sys/dev/sfxge/common/mcdi_mon.c Sat Nov 24 16:30:09 2018 (r340888) +++ head/sys/dev/sfxge/common/mcdi_mon.c Sat Nov 24 16:30:22 2018 (r340889) @@ -267,7 +267,6 @@ mcdi_mon_ev( __out efx_mon_stat_value_t *valuep) { efx_mcdi_iface_t *emip = &(enp->en_mcdi.em_emip); - efx_nic_cfg_t *encp = &(enp->en_nic_cfg); uint16_t port_mask; uint16_t sensor; uint16_t state; @@ -283,11 +282,13 @@ mcdi_mon_ev( value = (uint16_t)MCDI_EV_FIELD(eqp, SENSOREVT_VALUE); /* Hardware must support this MCDI sensor */ - EFSYS_ASSERT3U(sensor, <, (8 * encp->enc_mcdi_sensor_mask_size)); + EFSYS_ASSERT3U(sensor, <, + (8 * enp->en_nic_cfg.enc_mcdi_sensor_mask_size)); EFSYS_ASSERT((sensor % MCDI_MON_PAGE_SIZE) != MC_CMD_SENSOR_PAGE0_NEXT); - EFSYS_ASSERT(encp->enc_mcdi_sensor_maskp != NULL); - EFSYS_ASSERT((encp->enc_mcdi_sensor_maskp[sensor / MCDI_MON_PAGE_SIZE] & - (1U << (sensor % MCDI_MON_PAGE_SIZE))) != 0); + EFSYS_ASSERT(enp->en_nic_cfg.enc_mcdi_sensor_maskp != NULL); + EFSYS_ASSERT( + (enp->en_nic_cfg.enc_mcdi_sensor_maskp[sensor/MCDI_MON_PAGE_SIZE] & + (1U << (sensor % MCDI_MON_PAGE_SIZE))) != 0); /* But we don't have to understand it */ if (sensor >= EFX_ARRAY_SIZE(mcdi_sensor_map)) { From owner-svn-src-all@freebsd.org Sat Nov 24 16:30:02 2018 Return-Path: Delivered-To: svn-src-all@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 CE8A81102C9D; Sat, 24 Nov 2018 16:30:02 +0000 (UTC) (envelope-from arybchik@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 6C969803FB; Sat, 24 Nov 2018 16:30:02 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CA8B110682; Sat, 24 Nov 2018 16:29:58 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAOGTwRa085643; Sat, 24 Nov 2018 16:29:58 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAOGTwQr085642; Sat, 24 Nov 2018 16:29:58 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811241629.wAOGTwQr085642@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Sat, 24 Nov 2018 16:29:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340887 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 340887 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 6C969803FB X-Spamd-Result: default: False [1.89 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.66)[0.661,0]; NEURAL_SPAM_MEDIUM(0.73)[0.730,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.50)[0.502,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Nov 2018 16:30:03 -0000 Author: arybchik Date: Sat Nov 24 16:29:58 2018 New Revision: 340887 URL: https://svnweb.freebsd.org/changeset/base/340887 Log: sfxge(4): fix warnings from VS2015 C compiler (C4245) Fix level 4 warning "C4245: 'initializing': conversion from 'int' to 'uint32_t', signed/unsigned mismatch" warning; no functional changes. Submitted by: Andrew Lee Sponsored by: Solarflare Communications, Inc. MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D18121 Modified: head/sys/dev/sfxge/common/ef10_filter.c head/sys/dev/sfxge/common/efx.h Modified: head/sys/dev/sfxge/common/ef10_filter.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_filter.c Sat Nov 24 16:29:46 2018 (r340886) +++ head/sys/dev/sfxge/common/ef10_filter.c Sat Nov 24 16:29:58 2018 (r340887) @@ -998,7 +998,7 @@ ef10_filter_supported_filters( size_t list_length; uint32_t i; efx_rc_t rc; - uint32_t all_filter_flags = + efx_filter_match_flags_t all_filter_flags = (EFX_FILTER_MATCH_REM_HOST | EFX_FILTER_MATCH_LOC_HOST | EFX_FILTER_MATCH_REM_MAC | EFX_FILTER_MATCH_REM_PORT | EFX_FILTER_MATCH_LOC_MAC | EFX_FILTER_MATCH_LOC_PORT | Modified: head/sys/dev/sfxge/common/efx.h ============================================================================== --- head/sys/dev/sfxge/common/efx.h Sat Nov 24 16:29:46 2018 (r340886) +++ head/sys/dev/sfxge/common/efx.h Sat Nov 24 16:29:58 2018 (r340887) @@ -2282,29 +2282,37 @@ typedef unsigned int efx_filter_flags_t; * Flags which specify the fields to match on. The values are the same as in the * MC_CMD_FILTER_OP/MC_CMD_FILTER_OP_EXT commands. */ -typedef enum efx_filter_match_flags_e { - EFX_FILTER_MATCH_REM_HOST = 0x0001, /* Match by remote IP host - * address */ - EFX_FILTER_MATCH_LOC_HOST = 0x0002, /* Match by local IP host - * address */ - EFX_FILTER_MATCH_REM_MAC = 0x0004, /* Match by remote MAC address */ - EFX_FILTER_MATCH_REM_PORT = 0x0008, /* Match by remote TCP/UDP port */ - EFX_FILTER_MATCH_LOC_MAC = 0x0010, /* Match by remote TCP/UDP port */ - EFX_FILTER_MATCH_LOC_PORT = 0x0020, /* Match by local TCP/UDP port */ - EFX_FILTER_MATCH_ETHER_TYPE = 0x0040, /* Match by Ether-type */ - EFX_FILTER_MATCH_INNER_VID = 0x0080, /* Match by inner VLAN ID */ - EFX_FILTER_MATCH_OUTER_VID = 0x0100, /* Match by outer VLAN ID */ - EFX_FILTER_MATCH_IP_PROTO = 0x0200, /* Match by IP transport - * protocol */ - /* For encapsulated packets, match all multicast inner frames */ - EFX_FILTER_MATCH_IFRM_UNKNOWN_MCAST_DST = 0x01000000, - /* For encapsulated packets, match all unicast inner frames */ - EFX_FILTER_MATCH_IFRM_UNKNOWN_UCAST_DST = 0x02000000, - /* Match otherwise-unmatched multicast and broadcast packets */ - EFX_FILTER_MATCH_UNKNOWN_MCAST_DST = 0x40000000, - /* Match otherwise-unmatched unicast packets */ - EFX_FILTER_MATCH_UNKNOWN_UCAST_DST = 0x80000000, -} efx_filter_match_flags_t; + +/* Match by remote IP host address */ +#define EFX_FILTER_MATCH_REM_HOST 0x00000001 +/* Match by local IP host address */ +#define EFX_FILTER_MATCH_LOC_HOST 0x00000002 +/* Match by remote MAC address */ +#define EFX_FILTER_MATCH_REM_MAC 0x00000004 +/* Match by remote TCP/UDP port */ +#define EFX_FILTER_MATCH_REM_PORT 0x00000008 +/* Match by remote TCP/UDP port */ +#define EFX_FILTER_MATCH_LOC_MAC 0x00000010 +/* Match by local TCP/UDP port */ +#define EFX_FILTER_MATCH_LOC_PORT 0x00000020 +/* Match by Ether-type */ +#define EFX_FILTER_MATCH_ETHER_TYPE 0x00000040 +/* Match by inner VLAN ID */ +#define EFX_FILTER_MATCH_INNER_VID 0x00000080 +/* Match by outer VLAN ID */ +#define EFX_FILTER_MATCH_OUTER_VID 0x00000100 +/* Match by IP transport protocol */ +#define EFX_FILTER_MATCH_IP_PROTO 0x00000200 +/* For encapsulated packets, match all multicast inner frames */ +#define EFX_FILTER_MATCH_IFRM_UNKNOWN_MCAST_DST 0x01000000 +/* For encapsulated packets, match all unicast inner frames */ +#define EFX_FILTER_MATCH_IFRM_UNKNOWN_UCAST_DST 0x02000000 +/* Match otherwise-unmatched multicast and broadcast packets */ +#define EFX_FILTER_MATCH_UNKNOWN_MCAST_DST 0x40000000 +/* Match otherwise-unmatched unicast packets */ +#define EFX_FILTER_MATCH_UNKNOWN_UCAST_DST 0x80000000 + +typedef uint32_t efx_filter_match_flags_t; typedef enum efx_filter_priority_s { EFX_FILTER_PRI_HINT = 0, /* Performance hint */ From owner-svn-src-all@freebsd.org Sat Nov 24 16:30:38 2018 Return-Path: Delivered-To: svn-src-all@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 8963D1102D9A; Sat, 24 Nov 2018 16:30:38 +0000 (UTC) (envelope-from arybchik@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 F2A7A80742; Sat, 24 Nov 2018 16:30:37 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4272A1068A; Sat, 24 Nov 2018 16:30:35 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAOGUZq4086673; Sat, 24 Nov 2018 16:30:35 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAOGUYSI086671; Sat, 24 Nov 2018 16:30:34 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811241630.wAOGUYSI086671@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Sat, 24 Nov 2018 16:30:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340890 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 340890 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: F2A7A80742 X-Spamd-Result: default: False [1.85 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.64)[0.643,0]; NEURAL_SPAM_MEDIUM(0.71)[0.712,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.50)[0.496,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Nov 2018 16:30:38 -0000 Author: arybchik Date: Sat Nov 24 16:30:34 2018 New Revision: 340890 URL: https://svnweb.freebsd.org/changeset/base/340890 Log: sfxge(4): fix warnings from VS2015 C compiler (C4057) Fix two level 4 warnings "C4057: 'function': 'const uint8_t *' differs in indirection to slightly different base types from 'caddr_t'"; no functional changes. Submitted by: Andrew Lee Sponsored by: Solarflare Communications, Inc. MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D18124 Modified: head/sys/dev/sfxge/common/efx.h head/sys/dev/sfxge/common/efx_bootcfg.c Modified: head/sys/dev/sfxge/common/efx.h ============================================================================== --- head/sys/dev/sfxge/common/efx.h Sat Nov 24 16:30:22 2018 (r340889) +++ head/sys/dev/sfxge/common/efx.h Sat Nov 24 16:30:34 2018 (r340890) @@ -1510,13 +1510,13 @@ efx_bootcfg_copy_sector( extern efx_rc_t efx_bootcfg_read( __in efx_nic_t *enp, - __out_bcount(size) caddr_t data, + __out_bcount(size) uint8_t *data, __in size_t size); extern efx_rc_t efx_bootcfg_write( __in efx_nic_t *enp, - __in_bcount(size) caddr_t data, + __in_bcount(size) uint8_t *data, __in size_t size); #endif /* EFSYS_OPT_BOOTCFG */ Modified: head/sys/dev/sfxge/common/efx_bootcfg.c ============================================================================== --- head/sys/dev/sfxge/common/efx_bootcfg.c Sat Nov 24 16:30:22 2018 (r340889) +++ head/sys/dev/sfxge/common/efx_bootcfg.c Sat Nov 24 16:30:34 2018 (r340890) @@ -295,7 +295,7 @@ fail1: efx_rc_t efx_bootcfg_read( __in efx_nic_t *enp, - __out_bcount(size) caddr_t data, + __out_bcount(size) uint8_t *data, __in size_t size) { uint8_t *payload = NULL; @@ -358,7 +358,7 @@ efx_bootcfg_read( goto fail7; /* Verify that the area is correctly formatted and checksummed */ - rc = efx_bootcfg_verify(enp, (caddr_t)payload, sector_length, + rc = efx_bootcfg_verify(enp, payload, sector_length, &used_bytes); if (rc != 0 || used_bytes == 0) { payload[0] = (uint8_t)(~DHCP_END & 0xff); @@ -435,7 +435,7 @@ fail1: efx_rc_t efx_bootcfg_write( __in efx_nic_t *enp, - __in_bcount(size) caddr_t data, + __in_bcount(size) uint8_t *data, __in size_t size) { uint8_t *partn_data; From owner-svn-src-all@freebsd.org Sat Nov 24 16:30:47 2018 Return-Path: Delivered-To: svn-src-all@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 3E2B61102E1A; Sat, 24 Nov 2018 16:30:47 +0000 (UTC) (envelope-from arybchik@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 DA14280812; Sat, 24 Nov 2018 16:30:46 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A271910696; Sat, 24 Nov 2018 16:30:46 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAOGUkuJ087441; Sat, 24 Nov 2018 16:30:46 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAOGUkfR087440; Sat, 24 Nov 2018 16:30:46 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811241630.wAOGUkfR087440@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Sat, 24 Nov 2018 16:30:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340891 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 340891 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: DA14280812 X-Spamd-Result: default: False [1.85 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.64)[0.643,0]; NEURAL_SPAM_MEDIUM(0.71)[0.712,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.50)[0.496,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Nov 2018 16:30:47 -0000 Author: arybchik Date: Sat Nov 24 16:30:46 2018 New Revision: 340891 URL: https://svnweb.freebsd.org/changeset/base/340891 Log: sfxge(4): fix warnings from VS2015 C compiler (C4214) Fix multiple level 4 warnings "C4214: nonstandard extension used: bit field types other than int"; no functional changes. Submitted by: Andrew Lee Sponsored by: Solarflare Communications, Inc. MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D18125 Modified: head/sys/dev/sfxge/common/efx.h Modified: head/sys/dev/sfxge/common/efx.h ============================================================================== --- head/sys/dev/sfxge/common/efx.h Sat Nov 24 16:30:34 2018 (r340890) +++ head/sys/dev/sfxge/common/efx.h Sat Nov 24 16:30:46 2018 (r340891) @@ -2276,7 +2276,7 @@ efx_tx_qdestroy( /* Filter is for TX */ #define EFX_FILTER_FLAG_TX 0x10 -typedef unsigned int efx_filter_flags_t; +typedef uint8_t efx_filter_flags_t; /* * Flags which specify the fields to match on. The values are the same as in the @@ -2333,22 +2333,22 @@ typedef enum efx_filter_priority_s { */ typedef struct efx_filter_spec_s { - uint32_t efs_match_flags; - uint32_t efs_priority:2; - uint32_t efs_flags:6; - uint32_t efs_dmaq_id:12; - uint32_t efs_rss_context; - uint16_t efs_outer_vid; - uint16_t efs_inner_vid; - uint8_t efs_loc_mac[EFX_MAC_ADDR_LEN]; - uint8_t efs_rem_mac[EFX_MAC_ADDR_LEN]; - uint16_t efs_ether_type; - uint8_t efs_ip_proto; - efx_tunnel_protocol_t efs_encap_type; - uint16_t efs_loc_port; - uint16_t efs_rem_port; - efx_oword_t efs_rem_host; - efx_oword_t efs_loc_host; + efx_filter_match_flags_t efs_match_flags; + uint8_t efs_priority; + efx_filter_flags_t efs_flags; + uint16_t efs_dmaq_id; + uint32_t efs_rss_context; + uint16_t efs_outer_vid; + uint16_t efs_inner_vid; + uint8_t efs_loc_mac[EFX_MAC_ADDR_LEN]; + uint8_t efs_rem_mac[EFX_MAC_ADDR_LEN]; + uint16_t efs_ether_type; + uint8_t efs_ip_proto; + efx_tunnel_protocol_t efs_encap_type; + uint16_t efs_loc_port; + uint16_t efs_rem_port; + efx_oword_t efs_rem_host; + efx_oword_t efs_loc_host; } efx_filter_spec_t; From owner-svn-src-all@freebsd.org Sat Nov 24 16:31:00 2018 Return-Path: Delivered-To: svn-src-all@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 0289A1102E70; Sat, 24 Nov 2018 16:31:00 +0000 (UTC) (envelope-from arybchik@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 96ACF8096C; Sat, 24 Nov 2018 16:30:59 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D3B9F106A7; Sat, 24 Nov 2018 16:30:57 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAOGUvHr088202; Sat, 24 Nov 2018 16:30:57 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAOGUvsI088201; Sat, 24 Nov 2018 16:30:57 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811241630.wAOGUvsI088201@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Sat, 24 Nov 2018 16:30:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340892 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 340892 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 96ACF8096C X-Spamd-Result: default: False [1.85 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.64)[0.643,0]; NEURAL_SPAM_MEDIUM(0.71)[0.712,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.50)[0.496,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Nov 2018 16:31:00 -0000 Author: arybchik Date: Sat Nov 24 16:30:57 2018 New Revision: 340892 URL: https://svnweb.freebsd.org/changeset/base/340892 Log: sfxge(4): remove obsolete check for pre-Siena hardware The fail4 label was used twice, so it doesn't need removing. Submitted by: Mark Spender Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18126 Modified: head/sys/dev/sfxge/common/efx_rx.c Modified: head/sys/dev/sfxge/common/efx_rx.c ============================================================================== --- head/sys/dev/sfxge/common/efx_rx.c Sat Nov 24 16:30:46 2018 (r340891) +++ head/sys/dev/sfxge/common/efx_rx.c Sat Nov 24 16:30:57 2018 (r340892) @@ -1355,10 +1355,6 @@ siena_rx_qcreate( #if EFSYS_OPT_RX_SCATTER case EFX_RXQ_TYPE_SCATTER: - if (enp->en_family < EFX_FAMILY_SIENA) { - rc = EINVAL; - goto fail4; - } jumbo = B_TRUE; break; #endif /* EFSYS_OPT_RX_SCATTER */ From owner-svn-src-all@freebsd.org Sat Nov 24 16:31:12 2018 Return-Path: Delivered-To: svn-src-all@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 682A91102ED9; Sat, 24 Nov 2018 16:31:12 +0000 (UTC) (envelope-from arybchik@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 0A93780AB9; Sat, 24 Nov 2018 16:31:12 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3E84D106B5; Sat, 24 Nov 2018 16:31:09 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAOGV98j088278; Sat, 24 Nov 2018 16:31:09 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAOGV90p088277; Sat, 24 Nov 2018 16:31:09 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811241631.wAOGV90p088277@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Sat, 24 Nov 2018 16:31:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340893 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 340893 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 0A93780AB9 X-Spamd-Result: default: False [1.85 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.64)[0.643,0]; NEURAL_SPAM_MEDIUM(0.71)[0.712,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.50)[0.496,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Nov 2018 16:31:12 -0000 Author: arybchik Date: Sat Nov 24 16:31:08 2018 New Revision: 340893 URL: https://svnweb.freebsd.org/changeset/base/340893 Log: sfxge(4): expand on comment on number of queues field Expand on comment on RSS_CONTEXT_ALLOC_IN_NUM_QUEUES field. Submitted by: Mark Spender Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18127 Modified: head/sys/dev/sfxge/common/ef10_rx.c Modified: head/sys/dev/sfxge/common/ef10_rx.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_rx.c Sat Nov 24 16:30:57 2018 (r340892) +++ head/sys/dev/sfxge/common/ef10_rx.c Sat Nov 24 16:31:08 2018 (r340893) @@ -220,7 +220,13 @@ efx_mcdi_rss_context_alloc( MCDI_IN_SET_DWORD(req, RSS_CONTEXT_ALLOC_IN_UPSTREAM_PORT_ID, EVB_PORT_ID_ASSIGNED); MCDI_IN_SET_DWORD(req, RSS_CONTEXT_ALLOC_IN_TYPE, context_type); - /* NUM_QUEUES is only used to validate indirection table offsets */ + + /* + * For exclusive contexts, NUM_QUEUES is only used to validate + * indirection table offsets. + * For shared contexts, the provided context will spread traffic over + * NUM_QUEUES many queues. + */ MCDI_IN_SET_DWORD(req, RSS_CONTEXT_ALLOC_IN_NUM_QUEUES, num_queues); efx_mcdi_execute(enp, &req); From owner-svn-src-all@freebsd.org Sat Nov 24 16:31:21 2018 Return-Path: Delivered-To: svn-src-all@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 13D961102F4B; Sat, 24 Nov 2018 16:31:21 +0000 (UTC) (envelope-from arybchik@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 ABE5C80B96; Sat, 24 Nov 2018 16:31:20 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8E40E106C4; Sat, 24 Nov 2018 16:31:20 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAOGVKN3088344; Sat, 24 Nov 2018 16:31:20 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAOGVKXm088343; Sat, 24 Nov 2018 16:31:20 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811241631.wAOGVKXm088343@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Sat, 24 Nov 2018 16:31:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340894 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 340894 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: ABE5C80B96 X-Spamd-Result: default: False [1.85 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.64)[0.643,0]; NEURAL_SPAM_MEDIUM(0.71)[0.712,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.50)[0.496,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Nov 2018 16:31:21 -0000 Author: arybchik Date: Sat Nov 24 16:31:20 2018 New Revision: 340894 URL: https://svnweb.freebsd.org/changeset/base/340894 Log: sfxge(4): fix PreFAST static analysis warning (C6001) Fix warning "C6001: Using uninitialized memory '*sensor_maskp'" which could occur when the npages argument to efx_mcdi_sensor_info() is less than or equal to zero. Submitted by: Andrew Lee Sponsored by: Solarflare Communications, Inc. MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D18128 Modified: head/sys/dev/sfxge/common/mcdi_mon.c Modified: head/sys/dev/sfxge/common/mcdi_mon.c ============================================================================== --- head/sys/dev/sfxge/common/mcdi_mon.c Sat Nov 24 16:31:08 2018 (r340893) +++ head/sys/dev/sfxge/common/mcdi_mon.c Sat Nov 24 16:31:20 2018 (r340894) @@ -399,6 +399,11 @@ efx_mcdi_sensor_info( EFSYS_ASSERT(sensor_maskp != NULL); + if (npages < 1) { + rc = EINVAL; + goto fail1; + } + for (page = 0; page < npages; page++) { uint32_t mask; @@ -415,7 +420,7 @@ efx_mcdi_sensor_info( if (req.emr_rc != 0) { rc = req.emr_rc; - goto fail1; + goto fail2; } mask = MCDI_OUT_DWORD(req, SENSOR_INFO_OUT_MASK); @@ -423,18 +428,20 @@ efx_mcdi_sensor_info( if ((page != (npages - 1)) && ((mask & (1U << MC_CMD_SENSOR_PAGE0_NEXT)) == 0)) { rc = EINVAL; - goto fail2; + goto fail3; } sensor_maskp[page] = mask; } if (sensor_maskp[npages - 1] & (1U << MC_CMD_SENSOR_PAGE0_NEXT)) { rc = EINVAL; - goto fail3; + goto fail4; } return (0); +fail4: + EFSYS_PROBE(fail4); fail3: EFSYS_PROBE(fail3); fail2: From owner-svn-src-all@freebsd.org Sat Nov 24 16:31:45 2018 Return-Path: Delivered-To: svn-src-all@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 074E311030F7; Sat, 24 Nov 2018 16:31:45 +0000 (UTC) (envelope-from arybchik@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 7834B80CEB; Sat, 24 Nov 2018 16:31:34 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6A66F106D5; Sat, 24 Nov 2018 16:31:32 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAOGVWhK088414; Sat, 24 Nov 2018 16:31:32 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAOGVVqM088411; Sat, 24 Nov 2018 16:31:31 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811241631.wAOGVVqM088411@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Sat, 24 Nov 2018 16:31:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340895 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 340895 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 7834B80CEB X-Spamd-Result: default: False [1.89 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.66)[0.661,0]; NEURAL_SPAM_MEDIUM(0.73)[0.730,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.50)[0.502,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Nov 2018 16:31:45 -0000 Author: arybchik Date: Sat Nov 24 16:31:31 2018 New Revision: 340895 URL: https://svnweb.freebsd.org/changeset/base/340895 Log: sfxge(4): move BIU test code into Siena-specific file Submitted by: Mark Spender Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18129 Modified: head/sys/dev/sfxge/common/efx_impl.h head/sys/dev/sfxge/common/efx_nic.c head/sys/dev/sfxge/common/siena_nic.c Modified: head/sys/dev/sfxge/common/efx_impl.h ============================================================================== --- head/sys/dev/sfxge/common/efx_impl.h Sat Nov 24 16:31:20 2018 (r340894) +++ head/sys/dev/sfxge/common/efx_impl.h Sat Nov 24 16:31:31 2018 (r340895) @@ -1070,10 +1070,6 @@ struct efx_txq_s { } while (B_FALSE) extern __checkReturn efx_rc_t -efx_nic_biu_test( - __in efx_nic_t *enp); - -extern __checkReturn efx_rc_t efx_mac_select( __in efx_nic_t *enp); Modified: head/sys/dev/sfxge/common/efx_nic.c ============================================================================== --- head/sys/dev/sfxge/common/efx_nic.c Sat Nov 24 16:31:20 2018 (r340894) +++ head/sys/dev/sfxge/common/efx_nic.c Sat Nov 24 16:31:31 2018 (r340895) @@ -107,78 +107,6 @@ efx_family( return (ENOTSUP); } - -#define EFX_BIU_MAGIC0 0x01234567 -#define EFX_BIU_MAGIC1 0xfedcba98 - - __checkReturn efx_rc_t -efx_nic_biu_test( - __in efx_nic_t *enp) -{ - efx_oword_t oword; - efx_rc_t rc; - - /* - * Write magic values to scratch registers 0 and 1, then - * verify that the values were written correctly. Interleave - * the accesses to ensure that the BIU is not just reading - * back the cached value that was last written. - */ - EFX_POPULATE_OWORD_1(oword, FRF_AZ_DRIVER_DW0, EFX_BIU_MAGIC0); - EFX_BAR_TBL_WRITEO(enp, FR_AZ_DRIVER_REG, 0, &oword, B_TRUE); - - EFX_POPULATE_OWORD_1(oword, FRF_AZ_DRIVER_DW0, EFX_BIU_MAGIC1); - EFX_BAR_TBL_WRITEO(enp, FR_AZ_DRIVER_REG, 1, &oword, B_TRUE); - - EFX_BAR_TBL_READO(enp, FR_AZ_DRIVER_REG, 0, &oword, B_TRUE); - if (EFX_OWORD_FIELD(oword, FRF_AZ_DRIVER_DW0) != EFX_BIU_MAGIC0) { - rc = EIO; - goto fail1; - } - - EFX_BAR_TBL_READO(enp, FR_AZ_DRIVER_REG, 1, &oword, B_TRUE); - if (EFX_OWORD_FIELD(oword, FRF_AZ_DRIVER_DW0) != EFX_BIU_MAGIC1) { - rc = EIO; - goto fail2; - } - - /* - * Perform the same test, with the values swapped. This - * ensures that subsequent tests don't start with the correct - * values already written into the scratch registers. - */ - EFX_POPULATE_OWORD_1(oword, FRF_AZ_DRIVER_DW0, EFX_BIU_MAGIC1); - EFX_BAR_TBL_WRITEO(enp, FR_AZ_DRIVER_REG, 0, &oword, B_TRUE); - - EFX_POPULATE_OWORD_1(oword, FRF_AZ_DRIVER_DW0, EFX_BIU_MAGIC0); - EFX_BAR_TBL_WRITEO(enp, FR_AZ_DRIVER_REG, 1, &oword, B_TRUE); - - EFX_BAR_TBL_READO(enp, FR_AZ_DRIVER_REG, 0, &oword, B_TRUE); - if (EFX_OWORD_FIELD(oword, FRF_AZ_DRIVER_DW0) != EFX_BIU_MAGIC1) { - rc = EIO; - goto fail3; - } - - EFX_BAR_TBL_READO(enp, FR_AZ_DRIVER_REG, 1, &oword, B_TRUE); - if (EFX_OWORD_FIELD(oword, FRF_AZ_DRIVER_DW0) != EFX_BIU_MAGIC0) { - rc = EIO; - goto fail4; - } - - return (0); - -fail4: - EFSYS_PROBE(fail4); -fail3: - EFSYS_PROBE(fail3); -fail2: - EFSYS_PROBE(fail2); -fail1: - EFSYS_PROBE1(fail1, efx_rc_t, rc); - - return (rc); -} - #if EFSYS_OPT_SIENA static const efx_nic_ops_t __efx_nic_siena_ops = { Modified: head/sys/dev/sfxge/common/siena_nic.c ============================================================================== --- head/sys/dev/sfxge/common/siena_nic.c Sat Nov 24 16:31:20 2018 (r340894) +++ head/sys/dev/sfxge/common/siena_nic.c Sat Nov 24 16:31:31 2018 (r340895) @@ -218,6 +218,77 @@ fail1: return (rc); } +#define SIENA_BIU_MAGIC0 0x01234567 +#define SIENA_BIU_MAGIC1 0xfedcba98 + +static __checkReturn efx_rc_t +siena_nic_biu_test( + __in efx_nic_t *enp) +{ + efx_oword_t oword; + efx_rc_t rc; + + /* + * Write magic values to scratch registers 0 and 1, then + * verify that the values were written correctly. Interleave + * the accesses to ensure that the BIU is not just reading + * back the cached value that was last written. + */ + EFX_POPULATE_OWORD_1(oword, FRF_AZ_DRIVER_DW0, SIENA_BIU_MAGIC0); + EFX_BAR_TBL_WRITEO(enp, FR_AZ_DRIVER_REG, 0, &oword, B_TRUE); + + EFX_POPULATE_OWORD_1(oword, FRF_AZ_DRIVER_DW0, SIENA_BIU_MAGIC1); + EFX_BAR_TBL_WRITEO(enp, FR_AZ_DRIVER_REG, 1, &oword, B_TRUE); + + EFX_BAR_TBL_READO(enp, FR_AZ_DRIVER_REG, 0, &oword, B_TRUE); + if (EFX_OWORD_FIELD(oword, FRF_AZ_DRIVER_DW0) != SIENA_BIU_MAGIC0) { + rc = EIO; + goto fail1; + } + + EFX_BAR_TBL_READO(enp, FR_AZ_DRIVER_REG, 1, &oword, B_TRUE); + if (EFX_OWORD_FIELD(oword, FRF_AZ_DRIVER_DW0) != SIENA_BIU_MAGIC1) { + rc = EIO; + goto fail2; + } + + /* + * Perform the same test, with the values swapped. This + * ensures that subsequent tests don't start with the correct + * values already written into the scratch registers. + */ + EFX_POPULATE_OWORD_1(oword, FRF_AZ_DRIVER_DW0, SIENA_BIU_MAGIC1); + EFX_BAR_TBL_WRITEO(enp, FR_AZ_DRIVER_REG, 0, &oword, B_TRUE); + + EFX_POPULATE_OWORD_1(oword, FRF_AZ_DRIVER_DW0, SIENA_BIU_MAGIC0); + EFX_BAR_TBL_WRITEO(enp, FR_AZ_DRIVER_REG, 1, &oword, B_TRUE); + + EFX_BAR_TBL_READO(enp, FR_AZ_DRIVER_REG, 0, &oword, B_TRUE); + if (EFX_OWORD_FIELD(oword, FRF_AZ_DRIVER_DW0) != SIENA_BIU_MAGIC1) { + rc = EIO; + goto fail3; + } + + EFX_BAR_TBL_READO(enp, FR_AZ_DRIVER_REG, 1, &oword, B_TRUE); + if (EFX_OWORD_FIELD(oword, FRF_AZ_DRIVER_DW0) != SIENA_BIU_MAGIC0) { + rc = EIO; + goto fail4; + } + + return (0); + +fail4: + EFSYS_PROBE(fail4); +fail3: + EFSYS_PROBE(fail3); +fail2: + EFSYS_PROBE(fail2); +fail1: + EFSYS_PROBE1(fail1, efx_rc_t, rc); + + return (rc); +} + __checkReturn efx_rc_t siena_nic_probe( __in efx_nic_t *enp) @@ -232,7 +303,7 @@ siena_nic_probe( EFSYS_ASSERT3U(enp->en_family, ==, EFX_FAMILY_SIENA); /* Test BIU */ - if ((rc = efx_nic_biu_test(enp)) != 0) + if ((rc = siena_nic_biu_test(enp)) != 0) goto fail1; /* Clear the region register */ From owner-svn-src-all@freebsd.org Sat Nov 24 16:31:47 2018 Return-Path: Delivered-To: svn-src-all@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 72F821103136; Sat, 24 Nov 2018 16:31:47 +0000 (UTC) (envelope-from arybchik@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 94E5680E09; Sat, 24 Nov 2018 16:31:44 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5DC1E107D5; Sat, 24 Nov 2018 16:31:44 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAOGVivY088481; Sat, 24 Nov 2018 16:31:44 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAOGVhSp088479; Sat, 24 Nov 2018 16:31:43 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811241631.wAOGVhSp088479@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Sat, 24 Nov 2018 16:31:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340896 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 340896 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 94E5680E09 X-Spamd-Result: default: False [1.89 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.66)[0.661,0]; NEURAL_SPAM_MEDIUM(0.73)[0.730,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.50)[0.502,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Nov 2018 16:31:47 -0000 Author: arybchik Date: Sat Nov 24 16:31:43 2018 New Revision: 340896 URL: https://svnweb.freebsd.org/changeset/base/340896 Log: sfxge(4): remove Falcon-specific concurrency check Falcon support has been withdrawn from libefx, however, there is still an obsolete Falcon-specific assertion that efx_mac_stats_upload() and efx_port_poll() aren't concurrent. To be consistent with an overall Falcon support revocation it's desirable to remove it. Fix debug build invalid assertion failure. Submitted by: Ivan Malov Sponsored by: Solarflare Communications, Inc. MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D18130 Modified: head/sys/dev/sfxge/common/efx_impl.h head/sys/dev/sfxge/common/efx_mac.c head/sys/dev/sfxge/common/efx_port.c Modified: head/sys/dev/sfxge/common/efx_impl.h ============================================================================== --- head/sys/dev/sfxge/common/efx_impl.h Sat Nov 24 16:31:31 2018 (r340895) +++ head/sys/dev/sfxge/common/efx_impl.h Sat Nov 24 16:31:43 2018 (r340896) @@ -300,7 +300,6 @@ typedef struct efx_port_s { uint32_t ep_default_adv_cap_mask; uint32_t ep_phy_cap_mask; boolean_t ep_mac_drain; - boolean_t ep_mac_stats_pending; #if EFSYS_OPT_BIST efx_bist_type_t ep_current_bist; #endif Modified: head/sys/dev/sfxge/common/efx_mac.c ============================================================================== --- head/sys/dev/sfxge/common/efx_mac.c Sat Nov 24 16:31:31 2018 (r340895) +++ head/sys/dev/sfxge/common/efx_mac.c Sat Nov 24 16:31:43 2018 (r340896) @@ -756,16 +756,9 @@ efx_mac_stats_upload( EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_PORT); EFSYS_ASSERT(emop != NULL); - /* - * Don't assert !ep_mac_stats_pending, because the client might - * have failed to finalise statistics when previously stopping - * the port. - */ if ((rc = emop->emo_stats_upload(enp, esmp)) != 0) goto fail1; - epp->ep_mac_stats_pending = B_TRUE; - return (0); fail1: @@ -825,8 +818,6 @@ efx_mac_stats_update( EFSYS_ASSERT(emop != NULL); rc = emop->emo_stats_update(enp, esmp, essp, generationp); - if (rc == 0) - epp->ep_mac_stats_pending = B_FALSE; return (rc); } Modified: head/sys/dev/sfxge/common/efx_port.c ============================================================================== --- head/sys/dev/sfxge/common/efx_port.c Sat Nov 24 16:31:31 2018 (r340895) +++ head/sys/dev/sfxge/common/efx_port.c Sat Nov 24 16:31:43 2018 (r340896) @@ -114,7 +114,6 @@ efx_port_poll( EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_PORT); EFSYS_ASSERT(emop != NULL); - EFSYS_ASSERT(!epp->ep_mac_stats_pending); if (link_modep == NULL) link_modep = &ignore_link_mode; From owner-svn-src-all@freebsd.org Sat Nov 24 16:41:30 2018 Return-Path: Delivered-To: svn-src-all@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 4A34311038EA; Sat, 24 Nov 2018 16:41:30 +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 E193681999; Sat, 24 Nov 2018 16:41:29 +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 C2A4C108A4; Sat, 24 Nov 2018 16:41:29 +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 wAOGfTqZ094571; Sat, 24 Nov 2018 16:41:29 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAOGfTQC094570; Sat, 24 Nov 2018 16:41:29 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201811241641.wAOGfTQC094570@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sat, 24 Nov 2018 16:41:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340897 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 340897 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E193681999 X-Spamd-Result: default: False [1.87 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.64)[0.643,0]; NEURAL_SPAM_MEDIUM(0.71)[0.712,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.52)[0.516,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Nov 2018 16:41:30 -0000 Author: markj Date: Sat Nov 24 16:41:29 2018 New Revision: 340897 URL: https://svnweb.freebsd.org/changeset/base/340897 Log: Lock the knlist before releasing the in-flux state in knote_fork(). Otherwise there is a window, before iteration is resumed, during which the knote may be freed. The in-flux state ensures that the knote will not be removed from the knlist while locks are dropped. PR: 228858 Reviewed by: kib Tested by: pho MFC after: 3 days Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D18316 Modified: head/sys/kern/kern_event.c Modified: head/sys/kern/kern_event.c ============================================================================== --- head/sys/kern/kern_event.c Sat Nov 24 16:31:43 2018 (r340896) +++ head/sys/kern/kern_event.c Sat Nov 24 16:41:29 2018 (r340897) @@ -600,10 +600,10 @@ knote_fork(struct knlist *list, int pid) kn->kn_fflags |= NOTE_TRACKERR; if (kn->kn_fop->f_event(kn, NOTE_FORK)) KNOTE_ACTIVATE(kn, 0); + list->kl_lock(list->kl_lockarg); KQ_LOCK(kq); kn_leave_flux(kn); KQ_UNLOCK_FLUX(kq); - list->kl_lock(list->kl_lockarg); } list->kl_unlock(list->kl_lockarg); } From owner-svn-src-all@freebsd.org Sat Nov 24 16:58:35 2018 Return-Path: Delivered-To: svn-src-all@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 6E1D61103DF2; Sat, 24 Nov 2018 16:58:35 +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 0F6B1827AD; Sat, 24 Nov 2018 16:58:35 +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 E08B210B9D; Sat, 24 Nov 2018 16:58:34 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAOGwYZW002452; Sat, 24 Nov 2018 16:58:34 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAOGwYdY002451; Sat, 24 Nov 2018 16:58:34 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201811241658.wAOGwYdY002451@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sat, 24 Nov 2018 16:58:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340898 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 340898 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 0F6B1827AD X-Spamd-Result: default: False [1.91 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.66)[0.661,0]; NEURAL_SPAM_MEDIUM(0.73)[0.730,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.52)[0.521,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Nov 2018 16:58:35 -0000 Author: markj Date: Sat Nov 24 16:58:34 2018 New Revision: 340898 URL: https://svnweb.freebsd.org/changeset/base/340898 Log: Ensure that knotes do not get registered when KQ_CLOSING is set. KQ_CLOSING is set before draining the knotes associated with a kqueue, so we must ensure that new knotes are not added after that point. In particular, some kernel facilities may register for events on behalf of a userspace process and race with a close of the kqueue. PR: 228858 Reviewed by: kib Tested by: pho MFC after: 3 days Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D18316 Modified: head/sys/kern/kern_event.c Modified: head/sys/kern/kern_event.c ============================================================================== --- head/sys/kern/kern_event.c Sat Nov 24 16:41:29 2018 (r340897) +++ head/sys/kern/kern_event.c Sat Nov 24 16:58:34 2018 (r340898) @@ -1460,8 +1460,11 @@ findkn: break; } } else { - if ((kev->flags & EV_ADD) == EV_ADD) - kqueue_expand(kq, fops, kev->ident, waitok); + if ((kev->flags & EV_ADD) == EV_ADD) { + error = kqueue_expand(kq, fops, kev->ident, waitok); + if (error != 0) + goto done; + } KQ_LOCK(kq); @@ -1693,12 +1696,12 @@ kqueue_expand(struct kqueue *kq, struct filterops *fop { struct klist *list, *tmp_knhash, *to_free; u_long tmp_knhashmask; - int size; - int fd; + int error, fd, size; int mflag = waitok ? M_WAITOK : M_NOWAIT; KQ_NOTOWNED(kq); + error = 0; to_free = NULL; if (fops->f_isfd) { fd = ident; @@ -1710,9 +1713,11 @@ kqueue_expand(struct kqueue *kq, struct filterops *fop if (list == NULL) return ENOMEM; KQ_LOCK(kq); - if (kq->kq_knlistsize > fd) { + if ((kq->kq_state & KQ_CLOSING) != 0) { to_free = list; - list = NULL; + error = EBADF; + } else if (kq->kq_knlistsize > fd) { + to_free = list; } else { if (kq->kq_knlist != NULL) { bcopy(kq->kq_knlist, list, @@ -1734,9 +1739,12 @@ kqueue_expand(struct kqueue *kq, struct filterops *fop &tmp_knhashmask, waitok ? HASH_WAITOK : HASH_NOWAIT); if (tmp_knhash == NULL) - return ENOMEM; + return (ENOMEM); KQ_LOCK(kq); - if (kq->kq_knhashmask == 0) { + if ((kq->kq_state & KQ_CLOSING) != 0) { + to_free = tmp_knhash; + error = EBADF; + } else if (kq->kq_knhashmask == 0) { kq->kq_knhash = tmp_knhash; kq->kq_knhashmask = tmp_knhashmask; } else { @@ -1748,7 +1756,7 @@ kqueue_expand(struct kqueue *kq, struct filterops *fop free(to_free, M_KQUEUE); KQ_NOTOWNED(kq); - return 0; + return (error); } static void @@ -2597,6 +2605,8 @@ knote_attach(struct knote *kn, struct kqueue *kq) KASSERT(kn_in_flux(kn), ("knote %p not marked influx", kn)); KQ_OWNED(kq); + if ((kq->kq_state & KQ_CLOSING) != 0) + return (EBADF); if (kn->kn_fop->f_isfd) { if (kn->kn_id >= kq->kq_knlistsize) return (ENOMEM); From owner-svn-src-all@freebsd.org Sat Nov 24 17:02:32 2018 Return-Path: Delivered-To: svn-src-all@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 498151104491; Sat, 24 Nov 2018 17:02:32 +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 E475082D47; Sat, 24 Nov 2018 17:02:31 +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 C4B3010D2E; Sat, 24 Nov 2018 17:02:31 +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 wAOH2Vn9007780; Sat, 24 Nov 2018 17:02:31 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAOH2Viv007776; Sat, 24 Nov 2018 17:02:31 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201811241702.wAOH2Viv007776@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sat, 24 Nov 2018 17:02:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340899 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 340899 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E475082D47 X-Spamd-Result: default: False [1.87 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.64)[0.643,0]; NEURAL_SPAM_MEDIUM(0.71)[0.712,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.52)[0.516,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Nov 2018 17:02:32 -0000 Author: markj Date: Sat Nov 24 17:02:31 2018 New Revision: 340899 URL: https://svnweb.freebsd.org/changeset/base/340899 Log: Plug some kernel memory disclosures via kevent(2). The kernel may register for events on behalf of a userspace process, in which case it must be careful to zero the kevent struct that will be copied out to userspace. Reviewed by: kib MFC after: 3 days Security: kernel stack memory disclosure Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D18317 Modified: head/sys/kern/kern_event.c head/sys/kern/vfs_aio.c Modified: head/sys/kern/kern_event.c ============================================================================== --- head/sys/kern/kern_event.c Sat Nov 24 16:58:34 2018 (r340898) +++ head/sys/kern/kern_event.c Sat Nov 24 17:02:31 2018 (r340899) @@ -535,8 +535,9 @@ knote_fork(struct knlist *list, int pid) if (list == NULL) return; - list->kl_lock(list->kl_lockarg); + memset(&kev, 0, sizeof(kev)); + list->kl_lock(list->kl_lockarg); SLIST_FOREACH(kn, &list->kl_list, kn_selnext) { kq = kn->kn_kq; KQ_LOCK(kq); Modified: head/sys/kern/vfs_aio.c ============================================================================== --- head/sys/kern/vfs_aio.c Sat Nov 24 16:58:34 2018 (r340898) +++ head/sys/kern/vfs_aio.c Sat Nov 24 17:02:31 2018 (r340899) @@ -1589,6 +1589,7 @@ aio_aqueue(struct thread *td, struct aiocb *ujob, stru goto aqueue_fail; } kqfd = job->uaiocb.aio_sigevent.sigev_notify_kqueue; + memset(&kev, 0, sizeof(kev)); kev.ident = (uintptr_t)job->ujob; kev.filter = EVFILT_AIO; kev.flags = EV_ADD | EV_ENABLE | EV_FLAG1 | evflags; @@ -2155,6 +2156,7 @@ kern_lio_listio(struct thread *td, int mode, struct ai bcopy(sig, &lj->lioj_signal, sizeof(lj->lioj_signal)); if (lj->lioj_signal.sigev_notify == SIGEV_KEVENT) { /* Assume only new style KEVENT */ + memset(&kev, 0, sizeof(kev)); kev.filter = EVFILT_LIO; kev.flags = EV_ADD | EV_ENABLE | EV_FLAG1; kev.ident = (uintptr_t)uacb_list; /* something unique */ From owner-svn-src-all@freebsd.org Sat Nov 24 17:06:03 2018 Return-Path: Delivered-To: svn-src-all@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 0FD5011046AF; Sat, 24 Nov 2018 17:06:03 +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 9057982FDF; Sat, 24 Nov 2018 17:06:02 +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 6C96F10D3A; Sat, 24 Nov 2018 17:06:02 +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 wAOH62Jf008142; Sat, 24 Nov 2018 17:06:02 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAOH61RG008138; Sat, 24 Nov 2018 17:06:01 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201811241706.wAOH61RG008138@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sat, 24 Nov 2018 17:06:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340900 - in head/sys: compat/linux kern sys X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in head/sys: compat/linux kern sys X-SVN-Commit-Revision: 340900 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 9057982FDF X-Spamd-Result: default: False [1.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.68)[0.678,0]; NEURAL_SPAM_MEDIUM(0.75)[0.746,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.52)[0.525,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Nov 2018 17:06:03 -0000 Author: markj Date: Sat Nov 24 17:06:01 2018 New Revision: 340900 URL: https://svnweb.freebsd.org/changeset/base/340900 Log: Pass malloc flags directly through kevent(2) subroutines. Some kevent functions have a boolean "waitok" parameter for use when calling malloc(9). Replace them with the corresponding malloc() flags: the desired behaviour is known at compile-time, so this eliminates a couple of conditional branches, and makes the code easier to read. No functional change intended. Reviewed by: kib MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D18318 Modified: head/sys/compat/linux/linux_event.c head/sys/kern/kern_event.c head/sys/kern/vfs_aio.c head/sys/sys/event.h Modified: head/sys/compat/linux/linux_event.c ============================================================================== --- head/sys/compat/linux/linux_event.c Sat Nov 24 17:02:31 2018 (r340899) +++ head/sys/compat/linux/linux_event.c Sat Nov 24 17:06:01 2018 (r340900) @@ -504,7 +504,7 @@ linux_epoll_ctl(struct thread *td, struct linux_epoll_ * and the EV_ADD flag is not set. */ kev[0].flags &= ~EV_ADD; - error = kqfd_register(args->epfd, &kev[0], td, 1); + error = kqfd_register(args->epfd, &kev[0], td, M_WAITOK); if (error != ENOENT) { error = EEXIST; goto leave0; Modified: head/sys/kern/kern_event.c ============================================================================== --- head/sys/kern/kern_event.c Sat Nov 24 17:02:31 2018 (r340899) +++ head/sys/kern/kern_event.c Sat Nov 24 17:06:01 2018 (r340900) @@ -102,13 +102,13 @@ TASKQUEUE_DEFINE_THREAD(kqueue_ctx); static int kevent_copyout(void *arg, struct kevent *kevp, int count); static int kevent_copyin(void *arg, struct kevent *kevp, int count); static int kqueue_register(struct kqueue *kq, struct kevent *kev, - struct thread *td, int waitok); + struct thread *td, int mflag); static int kqueue_acquire(struct file *fp, struct kqueue **kqp); static void kqueue_release(struct kqueue *kq, int locked); static void kqueue_destroy(struct kqueue *kq); static void kqueue_drain(struct kqueue *kq, struct thread *td); static int kqueue_expand(struct kqueue *kq, struct filterops *fops, - uintptr_t ident, int waitok); + uintptr_t ident, int mflag); static void kqueue_task(void *arg, int pending); static int kqueue_scan(struct kqueue *kq, int maxevents, struct kevent_copyops *k_ops, @@ -150,7 +150,7 @@ static void knote_drop_detached(struct knote *kn, str static void knote_enqueue(struct knote *kn); static void knote_dequeue(struct knote *kn); static void knote_init(void); -static struct knote *knote_alloc(int waitok); +static struct knote *knote_alloc(int mflag); static void knote_free(struct knote *kn); static void filt_kqdetach(struct knote *kn); @@ -582,7 +582,7 @@ knote_fork(struct knlist *list, int pid) kev.fflags = kn->kn_sfflags; kev.data = kn->kn_id; /* parent */ kev.udata = kn->kn_kevent.udata;/* preserve udata */ - error = kqueue_register(kq, &kev, NULL, 0); + error = kqueue_register(kq, &kev, NULL, M_NOWAIT); if (error) kn->kn_fflags |= NOTE_TRACKERR; @@ -596,7 +596,7 @@ knote_fork(struct knlist *list, int pid) kev.fflags = kn->kn_sfflags; kev.data = kn->kn_id; /* parent */ kev.udata = kn->kn_kevent.udata;/* preserve udata */ - error = kqueue_register(kq, &kev, NULL, 0); + error = kqueue_register(kq, &kev, NULL, M_NOWAIT); if (error) kn->kn_fflags |= NOTE_TRACKERR; if (kn->kn_fop->f_event(kn, NOTE_FORK)) @@ -1229,7 +1229,7 @@ kqueue_kevent(struct kqueue *kq, struct thread *td, in if (!kevp->filter) continue; kevp->flags &= ~EV_SYSFLAGS; - error = kqueue_register(kq, kevp, td, 1); + error = kqueue_register(kq, kevp, td, M_WAITOK); if (error || (kevp->flags & EV_RECEIPT)) { if (nevents == 0) return (error); @@ -1370,12 +1370,11 @@ kqueue_fo_release(int filt) } /* - * A ref to kq (obtained via kqueue_acquire) must be held. waitok will - * influence if memory allocation should wait. Make sure it is 0 if you - * hold any mutexes. + * A ref to kq (obtained via kqueue_acquire) must be held. */ static int -kqueue_register(struct kqueue *kq, struct kevent *kev, struct thread *td, int waitok) +kqueue_register(struct kqueue *kq, struct kevent *kev, struct thread *td, + int mflag) { struct filterops *fops; struct file *fp; @@ -1405,7 +1404,7 @@ kqueue_register(struct kqueue *kq, struct kevent *kev, * allocation failures are handled in the loop, only * if the spare knote appears to be actually required. */ - tkn = knote_alloc(waitok); + tkn = knote_alloc(mflag); } else { tkn = NULL; } @@ -1421,11 +1420,11 @@ findkn: goto done; if ((kev->flags & EV_ADD) == EV_ADD && kqueue_expand(kq, fops, - kev->ident, 0) != 0) { + kev->ident, M_NOWAIT) != 0) { /* try again */ fdrop(fp, td); fp = NULL; - error = kqueue_expand(kq, fops, kev->ident, waitok); + error = kqueue_expand(kq, fops, kev->ident, mflag); if (error) goto done; goto findkn; @@ -1462,7 +1461,7 @@ findkn: } } else { if ((kev->flags & EV_ADD) == EV_ADD) { - error = kqueue_expand(kq, fops, kev->ident, waitok); + error = kqueue_expand(kq, fops, kev->ident, mflag); if (error != 0) goto done; } @@ -1693,12 +1692,11 @@ kqueue_schedtask(struct kqueue *kq) */ static int kqueue_expand(struct kqueue *kq, struct filterops *fops, uintptr_t ident, - int waitok) + int mflag) { struct klist *list, *tmp_knhash, *to_free; u_long tmp_knhashmask; int error, fd, size; - int mflag = waitok ? M_WAITOK : M_NOWAIT; KQ_NOTOWNED(kq); @@ -1737,8 +1735,8 @@ kqueue_expand(struct kqueue *kq, struct filterops *fop } else { if (kq->kq_knhashmask == 0) { tmp_knhash = hashinit_flags(KN_HASHSIZE, M_KQUEUE, - &tmp_knhashmask, - waitok ? HASH_WAITOK : HASH_NOWAIT); + &tmp_knhashmask, (mflag & M_WAITOK) != 0 ? + HASH_WAITOK : HASH_NOWAIT); if (tmp_knhash == NULL) return (ENOMEM); KQ_LOCK(kq); @@ -1827,7 +1825,7 @@ kqueue_scan(struct kqueue *kq, int maxevents, struct k asbt = -1; } else asbt = 0; - marker = knote_alloc(1); + marker = knote_alloc(M_WAITOK); marker->kn_status = KN_MARKER; KQ_LOCK(kq); @@ -2703,11 +2701,10 @@ knote_init(void) SYSINIT(knote, SI_SUB_PSEUDO, SI_ORDER_ANY, knote_init, NULL); static struct knote * -knote_alloc(int waitok) +knote_alloc(int mflag) { - return (uma_zalloc(knote_zone, (waitok ? M_WAITOK : M_NOWAIT) | - M_ZERO)); + return (uma_zalloc(knote_zone, mflag | M_ZERO)); } static void @@ -2721,7 +2718,7 @@ knote_free(struct knote *kn) * Register the kev w/ the kq specified by fd. */ int -kqfd_register(int fd, struct kevent *kev, struct thread *td, int waitok) +kqfd_register(int fd, struct kevent *kev, struct thread *td, int mflag) { struct kqueue *kq; struct file *fp; @@ -2734,7 +2731,7 @@ kqfd_register(int fd, struct kevent *kev, struct threa if ((error = kqueue_acquire(fp, &kq)) != 0) goto noacquire; - error = kqueue_register(kq, kev, td, waitok); + error = kqueue_register(kq, kev, td, mflag); kqueue_release(kq, 0); noacquire: Modified: head/sys/kern/vfs_aio.c ============================================================================== --- head/sys/kern/vfs_aio.c Sat Nov 24 17:02:31 2018 (r340899) +++ head/sys/kern/vfs_aio.c Sat Nov 24 17:06:01 2018 (r340900) @@ -1595,7 +1595,7 @@ aio_aqueue(struct thread *td, struct aiocb *ujob, stru kev.flags = EV_ADD | EV_ENABLE | EV_FLAG1 | evflags; kev.data = (intptr_t)job; kev.udata = job->uaiocb.aio_sigevent.sigev_value.sival_ptr; - error = kqfd_register(kqfd, &kev, td, 1); + error = kqfd_register(kqfd, &kev, td, M_WAITOK); if (error) goto aqueue_fail; @@ -2164,7 +2164,8 @@ kern_lio_listio(struct thread *td, int mode, struct ai /* pass user defined sigval data */ kev.udata = lj->lioj_signal.sigev_value.sival_ptr; error = kqfd_register( - lj->lioj_signal.sigev_notify_kqueue, &kev, td, 1); + lj->lioj_signal.sigev_notify_kqueue, &kev, td, + M_WAITOK); if (error) { uma_zfree(aiolio_zone, lj); return (error); Modified: head/sys/sys/event.h ============================================================================== --- head/sys/sys/event.h Sat Nov 24 17:02:31 2018 (r340899) +++ head/sys/sys/event.h Sat Nov 24 17:06:01 2018 (r340900) @@ -348,7 +348,7 @@ void knlist_cleardel(struct knlist *knl, struct thread knlist_cleardel((knl), (td), (islocked), 1) void knote_fdclose(struct thread *p, int fd); int kqfd_register(int fd, struct kevent *kev, struct thread *p, - int waitok); + int mflag); int kqueue_add_filteropts(int filt, struct filterops *filtops); int kqueue_del_filteropts(int filt); From owner-svn-src-all@freebsd.org Sat Nov 24 17:08:13 2018 Return-Path: Delivered-To: svn-src-all@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 768B8110480F; Sat, 24 Nov 2018 17:08:13 +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 19199831FA; Sat, 24 Nov 2018 17:08:13 +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 EE33310D40; Sat, 24 Nov 2018 17:08: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 wAOH8Cl9008404; Sat, 24 Nov 2018 17:08:12 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAOH8Clj008401; Sat, 24 Nov 2018 17:08:12 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201811241708.wAOH8Clj008401@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sat, 24 Nov 2018 17:08:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r340901 - in stable/12: . tests/sys/netinet X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in stable/12: . tests/sys/netinet X-SVN-Commit-Revision: 340901 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 19199831FA X-Spamd-Result: default: False [1.88 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.65)[0.649,0]; NEURAL_SPAM_SHORT(0.50)[0.495,0]; NEURAL_SPAM_MEDIUM(0.73)[0.732,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Nov 2018 17:08:13 -0000 Author: markj Date: Sat Nov 24 17:08:12 2018 New Revision: 340901 URL: https://svnweb.freebsd.org/changeset/base/340901 Log: MFC r340484: Rename the SO_REUSEPORT_LB test file to be consistent with other tests. Added: stable/12/tests/sys/netinet/so_reuseport_lb_test.c - copied unchanged from r340484, head/tests/sys/netinet/so_reuseport_lb_test.c Deleted: stable/12/tests/sys/netinet/reuseport_lb.c Modified: stable/12/ObsoleteFiles.inc stable/12/tests/sys/netinet/Makefile Directory Properties: stable/12/ (props changed) Modified: stable/12/ObsoleteFiles.inc ============================================================================== --- stable/12/ObsoleteFiles.inc Sat Nov 24 17:06:01 2018 (r340900) +++ stable/12/ObsoleteFiles.inc Sat Nov 24 17:08:12 2018 (r340901) @@ -38,6 +38,8 @@ # xargs -n1 | sort | uniq -d; # done +# 20181116: Rename test file. +OLD_FILES+=usr/tests/sys/netinet/reuseport_lb # 20181030: malloc_domain(9) KPI change OLD_FILES+=usr/share/man/man9/malloc_domain.9.gz # 20181025: OpenSSL libraries version bump to avoid conflict with ports Modified: stable/12/tests/sys/netinet/Makefile ============================================================================== --- stable/12/tests/sys/netinet/Makefile Sat Nov 24 17:06:01 2018 (r340900) +++ stable/12/tests/sys/netinet/Makefile Sat Nov 24 17:08:12 2018 (r340901) @@ -3,7 +3,7 @@ TESTSDIR= ${TESTSBASE}/sys/netinet BINDIR= ${TESTSDIR} -ATF_TESTS_C= reuseport_lb +ATF_TESTS_C= so_reuseport_lb_test ATF_TESTS_SH= fibs_test Copied: stable/12/tests/sys/netinet/so_reuseport_lb_test.c (from r340484, head/tests/sys/netinet/so_reuseport_lb_test.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/12/tests/sys/netinet/so_reuseport_lb_test.c Sat Nov 24 17:08:12 2018 (r340901, copy of r340484, head/tests/sys/netinet/so_reuseport_lb_test.c) @@ -0,0 +1,242 @@ +/*- + * Copyright (c) 2018 The FreeBSD Foundation + * + * This software was developed by Mark Johnston under sponsorship from + * the FreeBSD Foundation. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include + +#include + +#include +#include +#include +#include + +#include + +/* + * Given an array of non-blocking listening sockets configured in a LB group + * for "addr", try connecting to "addr" in a loop and verify that connections + * are roughly balanced across the sockets. + */ +static void +lb_simple_accept_loop(int domain, const struct sockaddr *addr, int sds[], + size_t nsds, int nconns) +{ + size_t i; + int *acceptcnt; + int csd, error, excnt, sd; + + /* + * We expect each listening socket to accept roughly nconns/nsds + * connections, but allow for some error. + */ + excnt = nconns / nsds / 8; + acceptcnt = calloc(nsds, sizeof(*acceptcnt)); + ATF_REQUIRE_MSG(acceptcnt != NULL, "calloc() failed: %s", + strerror(errno)); + + while (nconns-- > 0) { + sd = socket(domain, SOCK_STREAM, 0); + ATF_REQUIRE_MSG(sd >= 0, "socket() failed: %s", + strerror(errno)); + + error = connect(sd, addr, addr->sa_len); + ATF_REQUIRE_MSG(error == 0, "connect() failed: %s", + strerror(errno)); + + /* + * Poll the listening sockets. + */ + do { + for (i = 0; i < nsds; i++) { + csd = accept(sds[i], NULL, NULL); + if (csd < 0) { + ATF_REQUIRE_MSG(errno == EWOULDBLOCK || + errno == EAGAIN, + "accept() failed: %s", + strerror(errno)); + continue; + } + + error = close(csd); + ATF_REQUIRE_MSG(error == 0, + "close() failed: %s", strerror(errno)); + + acceptcnt[i]++; + break; + } + } while (i == nsds); + + error = close(sd); + ATF_REQUIRE_MSG(error == 0, "close() failed: %s", + strerror(errno)); + } + + for (i = 0; i < nsds; i++) + ATF_REQUIRE_MSG(acceptcnt[i] > excnt, "uneven balancing"); +} + +static int +lb_listen_socket(int domain, int flags) +{ + size_t one; + int error, sd; + + sd = socket(domain, SOCK_STREAM | flags, 0); + ATF_REQUIRE_MSG(sd >= 0, "socket() failed: %s", strerror(errno)); + + one = 1; + error = setsockopt(sd, SOL_SOCKET, SO_REUSEPORT_LB, &one, sizeof(one)); + ATF_REQUIRE_MSG(error == 0, "setsockopt(SO_REUSEPORT_LB) failed: %s", + strerror(errno)); + + return (sd); +} + +ATF_TC_WITHOUT_HEAD(basic_ipv4); +ATF_TC_BODY(basic_ipv4, tc) +{ + struct sockaddr_in addr; + socklen_t slen; + size_t i; + const int nconns = 16384; + int error, sds[16]; + uint16_t port; + + sds[0] = lb_listen_socket(PF_INET, SOCK_NONBLOCK); + + memset(&addr, 0, sizeof(addr)); + addr.sin_len = sizeof(addr); + addr.sin_family = AF_INET; + addr.sin_port = htons(0); + addr.sin_addr.s_addr = htonl(INADDR_LOOPBACK); + error = bind(sds[0], (const struct sockaddr *)&addr, sizeof(addr)); + ATF_REQUIRE_MSG(error == 0, "bind() failed: %s", strerror(errno)); + error = listen(sds[0], 1); + ATF_REQUIRE_MSG(error == 0, "listen() failed: %s", strerror(errno)); + + slen = sizeof(addr); + error = getsockname(sds[0], (struct sockaddr *)&addr, &slen); + ATF_REQUIRE_MSG(error == 0, "getsockname() failed: %s", + strerror(errno)); + ATF_REQUIRE_MSG(slen == sizeof(addr), "sockaddr size changed"); + port = addr.sin_port; + + memset(&addr, 0, sizeof(addr)); + addr.sin_len = sizeof(addr); + addr.sin_family = AF_INET; + addr.sin_port = port; + addr.sin_addr.s_addr = htonl(INADDR_LOOPBACK); + for (i = 1; i < nitems(sds); i++) { + sds[i] = lb_listen_socket(PF_INET, SOCK_NONBLOCK); + + error = bind(sds[i], (const struct sockaddr *)&addr, + sizeof(addr)); + ATF_REQUIRE_MSG(error == 0, "bind() failed: %s", + strerror(errno)); + error = listen(sds[i], 1); + ATF_REQUIRE_MSG(error == 0, "listen() failed: %s", + strerror(errno)); + } + + lb_simple_accept_loop(PF_INET, (struct sockaddr *)&addr, sds, + nitems(sds), nconns); + for (i = 0; i < nitems(sds); i++) { + error = close(sds[i]); + ATF_REQUIRE_MSG(error == 0, "close() failed: %s", + strerror(errno)); + } +} + +ATF_TC_WITHOUT_HEAD(basic_ipv6); +ATF_TC_BODY(basic_ipv6, tc) +{ + const struct in6_addr loopback6 = IN6ADDR_LOOPBACK_INIT; + struct sockaddr_in6 addr; + socklen_t slen; + size_t i; + const int nconns = 16384; + int error, sds[16]; + uint16_t port; + + sds[0] = lb_listen_socket(PF_INET6, SOCK_NONBLOCK); + + memset(&addr, 0, sizeof(addr)); + addr.sin6_len = sizeof(addr); + addr.sin6_family = AF_INET6; + addr.sin6_port = htons(0); + addr.sin6_addr = loopback6; + error = bind(sds[0], (const struct sockaddr *)&addr, sizeof(addr)); + ATF_REQUIRE_MSG(error == 0, "bind() failed: %s", strerror(errno)); + error = listen(sds[0], 1); + ATF_REQUIRE_MSG(error == 0, "listen() failed: %s", strerror(errno)); + + slen = sizeof(addr); + error = getsockname(sds[0], (struct sockaddr *)&addr, &slen); + ATF_REQUIRE_MSG(error == 0, "getsockname() failed: %s", + strerror(errno)); + ATF_REQUIRE_MSG(slen == sizeof(addr), "sockaddr size changed"); + port = addr.sin6_port; + + memset(&addr, 0, sizeof(addr)); + addr.sin6_len = sizeof(addr); + addr.sin6_family = AF_INET6; + addr.sin6_port = port; + addr.sin6_addr = loopback6; + for (i = 1; i < nitems(sds); i++) { + sds[i] = lb_listen_socket(PF_INET6, SOCK_NONBLOCK); + + error = bind(sds[i], (const struct sockaddr *)&addr, + sizeof(addr)); + ATF_REQUIRE_MSG(error == 0, "bind() failed: %s", + strerror(errno)); + error = listen(sds[i], 1); + ATF_REQUIRE_MSG(error == 0, "listen() failed: %s", + strerror(errno)); + } + + lb_simple_accept_loop(PF_INET6, (struct sockaddr *)&addr, sds, + nitems(sds), nconns); + for (i = 0; i < nitems(sds); i++) { + error = close(sds[i]); + ATF_REQUIRE_MSG(error == 0, "close() failed: %s", + strerror(errno)); + } +} + +ATF_TP_ADD_TCS(tp) +{ + ATF_TP_ADD_TC(tp, basic_ipv4); + ATF_TP_ADD_TC(tp, basic_ipv6); + + return (atf_no_error()); +} From owner-svn-src-all@freebsd.org Sat Nov 24 17:08:50 2018 Return-Path: Delivered-To: svn-src-all@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 2CD5411048D1; Sat, 24 Nov 2018 17:08:50 +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 CA98A83351; Sat, 24 Nov 2018 17:08:49 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id ABB0C10D43; Sat, 24 Nov 2018 17:08:49 +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 wAOH8naO008514; Sat, 24 Nov 2018 17:08:49 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAOH8nTp008512; Sat, 24 Nov 2018 17:08:49 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201811241708.wAOH8nTp008512@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sat, 24 Nov 2018 17:08:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r340902 - stable/12/tests/sys/netinet X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/12/tests/sys/netinet X-SVN-Commit-Revision: 340902 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: CA98A83351 X-Spamd-Result: default: False [1.88 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.65)[0.649,0]; NEURAL_SPAM_MEDIUM(0.73)[0.732,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.50)[0.495,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Nov 2018 17:08:50 -0000 Author: markj Date: Sat Nov 24 17:08:49 2018 New Revision: 340902 URL: https://svnweb.freebsd.org/changeset/base/340902 Log: MFC r340485: Add regression tests for r340313 and r340483. Added: stable/12/tests/sys/netinet/ip_reass_test.c - copied unchanged from r340485, head/tests/sys/netinet/ip_reass_test.c Modified: stable/12/tests/sys/netinet/Makefile Directory Properties: stable/12/ (props changed) Modified: stable/12/tests/sys/netinet/Makefile ============================================================================== --- stable/12/tests/sys/netinet/Makefile Sat Nov 24 17:08:12 2018 (r340901) +++ stable/12/tests/sys/netinet/Makefile Sat Nov 24 17:08:49 2018 (r340902) @@ -3,7 +3,8 @@ TESTSDIR= ${TESTSBASE}/sys/netinet BINDIR= ${TESTSDIR} -ATF_TESTS_C= so_reuseport_lb_test +ATF_TESTS_C= ip_reass_test \ + so_reuseport_lb_test ATF_TESTS_SH= fibs_test Copied: stable/12/tests/sys/netinet/ip_reass_test.c (from r340485, head/tests/sys/netinet/ip_reass_test.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/12/tests/sys/netinet/ip_reass_test.c Sat Nov 24 17:08:49 2018 (r340902, copy of r340485, head/tests/sys/netinet/ip_reass_test.c) @@ -0,0 +1,381 @@ +/*- + * Copyright (c) 2018 The FreeBSD Foundation + * + * This software was developed by Mark Johnston under sponsorship from + * the FreeBSD Foundation. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +struct lopacket { + u_int family; + struct ip hdr; + char payload[]; +}; + +static void +update_cksum(struct ip *ip) +{ + size_t i; + uint32_t cksum; + uint16_t *cksump; + + ip->ip_sum = 0; + cksump = (uint16_t *)ip; + for (cksum = 0, i = 0; i < sizeof(*ip) / sizeof(*cksump); cksump++, i++) + cksum += ntohs(*cksump); + cksum = (cksum >> 16) + (cksum & 0xffff); + cksum = ~(cksum + (cksum >> 16)); + ip->ip_sum = htons((uint16_t)cksum); +} + +static struct lopacket * +alloc_lopacket(in_addr_t dstaddr, size_t payloadlen) +{ + struct ip *ip; + struct lopacket *packet; + size_t pktlen; + + pktlen = sizeof(*packet) + payloadlen; + packet = malloc(pktlen); + ATF_REQUIRE(packet != NULL); + + memset(packet, 0, pktlen); + packet->family = AF_INET; + + ip = &packet->hdr; + ip->ip_hl = sizeof(struct ip) >> 2; + ip->ip_v = 4; + ip->ip_tos = 0; + ip->ip_len = htons(sizeof(*ip) + payloadlen); + ip->ip_id = 0; + ip->ip_off = 0; + ip->ip_ttl = 1; + ip->ip_p = IPPROTO_IP; + ip->ip_sum = 0; + ip->ip_src.s_addr = dstaddr; + ip->ip_dst.s_addr = dstaddr; + update_cksum(ip); + + return (packet); +} + +static void +free_lopacket(struct lopacket *packet) +{ + + free(packet); +} + +static void +write_lopacket(int bpffd, struct lopacket *packet) +{ + struct timespec ts; + ssize_t n; + size_t len; + + len = sizeof(packet->family) + ntohs(packet->hdr.ip_len); + n = write(bpffd, packet, len); + ATF_REQUIRE_MSG(n >= 0, "packet write failed: %s", strerror(errno)); + ATF_REQUIRE_MSG((size_t)n == len, "wrote %zd bytes instead of %zu", + n, len); + + /* + * Loopback packets are dispatched asynchronously, give netisr some + * time. + */ + ts.tv_sec = 0; + ts.tv_nsec = 5000000; /* 5ms */ + (void)nanosleep(&ts, NULL); +} + +static int +open_lobpf(in_addr_t *addrp) +{ + struct ifreq ifr; + struct ifaddrs *ifa, *ifap; + int error, fd; + + fd = open("/dev/bpf0", O_RDWR); + if (fd < 0 && errno == ENOENT) + atf_tc_skip("no BPF device available"); + ATF_REQUIRE_MSG(fd >= 0, "open(/dev/bpf0): %s", strerror(errno)); + + error = getifaddrs(&ifap); + ATF_REQUIRE(error == 0); + for (ifa = ifap; ifa != NULL; ifa = ifa->ifa_next) + if ((ifa->ifa_flags & IFF_LOOPBACK) != 0 && + ifa->ifa_addr->sa_family == AF_INET) + break; + if (ifa == NULL) + atf_tc_skip("no loopback address found"); + + memset(&ifr, 0, sizeof(ifr)); + strlcpy(ifr.ifr_name, ifa->ifa_name, IFNAMSIZ); + error = ioctl(fd, BIOCSETIF, &ifr); + ATF_REQUIRE_MSG(error == 0, "ioctl(BIOCSETIF): %s", strerror(errno)); + + *addrp = ((struct sockaddr_in *)(void *)ifa->ifa_addr)->sin_addr.s_addr; + + freeifaddrs(ifap); + + return (fd); +} + +static void +get_ipstat(struct ipstat *stat) +{ + size_t len; + int error; + + memset(stat, 0, sizeof(*stat)); + len = sizeof(*stat); + error = sysctlbyname("net.inet.ip.stats", stat, &len, NULL, 0); + ATF_REQUIRE_MSG(error == 0, "sysctl(net.inet.ip.stats) failed: %s", + strerror(errno)); + ATF_REQUIRE(len == sizeof(*stat)); +} + +#define CHECK_IP_COUNTER(oldp, newp, counter) \ + ATF_REQUIRE_MSG((oldp)->ips_ ## counter < (newp)->ips_ ## counter, \ + "ips_" #counter " wasn't incremented (%ju vs. %ju)", \ + (uintmax_t)old.ips_ ## counter, (uintmax_t)new.ips_## counter); + +/* + * Make sure a fragment with MF set doesn't come after the last fragment of a + * packet. Make sure that multiple fragments with MF clear have the same offset + * and length. + */ +ATF_TC(ip_reass__multiple_last_fragments); +ATF_TC_HEAD(ip_reass__multiple_last_fragments, tc) +{ + atf_tc_set_md_var(tc, "require.user", "root"); +} +ATF_TC_BODY(ip_reass__multiple_last_fragments, tc) +{ + struct ipstat old, new; + struct ip *ip; + struct lopacket *packet1, *packet2, *packet3, *packet4; + in_addr_t addr; + int error, fd; + uint16_t ipid; + + fd = open_lobpf(&addr); + ipid = arc4random_uniform(UINT16_MAX + 1); + + packet1 = alloc_lopacket(addr, 16); + ip = &packet1->hdr; + ip->ip_id = ipid; + ip->ip_off = htons(0x10); + update_cksum(ip); + + packet2 = alloc_lopacket(addr, 16); + ip = &packet2->hdr; + ip->ip_id = ipid; + ip->ip_off = htons(0x20); + update_cksum(ip); + + packet3 = alloc_lopacket(addr, 16); + ip = &packet3->hdr; + ip->ip_id = ipid; + ip->ip_off = htons(0x8); + update_cksum(ip); + + packet4 = alloc_lopacket(addr, 32); + ip = &packet4->hdr; + ip->ip_id = ipid; + ip->ip_off = htons(0x10); + update_cksum(ip); + + write_lopacket(fd, packet1); + + /* packet2 comes after packet1. */ + get_ipstat(&old); + write_lopacket(fd, packet2); + get_ipstat(&new); + CHECK_IP_COUNTER(&old, &new, fragdropped); + + /* packet2 comes after packet1 and has MF set. */ + packet2->hdr.ip_off = htons(IP_MF | 0x20); + update_cksum(&packet2->hdr); + get_ipstat(&old); + write_lopacket(fd, packet2); + get_ipstat(&new); + CHECK_IP_COUNTER(&old, &new, fragdropped); + + /* packet3 comes before packet1 but overlaps. */ + get_ipstat(&old); + write_lopacket(fd, packet3); + get_ipstat(&new); + CHECK_IP_COUNTER(&old, &new, fragdropped); + + /* packet4 has the same offset as packet1 but is longer. */ + get_ipstat(&old); + write_lopacket(fd, packet4); + get_ipstat(&new); + CHECK_IP_COUNTER(&old, &new, fragdropped); + + error = close(fd); + ATF_REQUIRE(error == 0); + free_lopacket(packet1); + free_lopacket(packet2); +} + +/* + * Make sure that we reject zero-length fragments. + */ +ATF_TC(ip_reass__zero_length_fragment); +ATF_TC_HEAD(ip_reass__zero_length_fragment, tc) +{ + atf_tc_set_md_var(tc, "require.user", "root"); +} +ATF_TC_BODY(ip_reass__zero_length_fragment, tc) +{ + struct ipstat old, new; + struct ip *ip; + struct lopacket *packet1, *packet2; + in_addr_t addr; + int error, fd; + uint16_t ipid; + + fd = open_lobpf(&addr); + ipid = arc4random_uniform(UINT16_MAX + 1); + + /* + * Create two packets, one with MF set, one without. + */ + packet1 = alloc_lopacket(addr, 0); + ip = &packet1->hdr; + ip->ip_id = ipid; + ip->ip_off = htons(IP_MF | 0x10); + update_cksum(ip); + + packet2 = alloc_lopacket(addr, 0); + ip = &packet2->hdr; + ip->ip_id = ~ipid; + ip->ip_off = htons(0x10); + update_cksum(ip); + + get_ipstat(&old); + write_lopacket(fd, packet1); + get_ipstat(&new); + CHECK_IP_COUNTER(&old, &new, toosmall); + CHECK_IP_COUNTER(&old, &new, fragdropped); + + get_ipstat(&old); + write_lopacket(fd, packet2); + get_ipstat(&new); + CHECK_IP_COUNTER(&old, &new, toosmall); + CHECK_IP_COUNTER(&old, &new, fragdropped); + + error = close(fd); + ATF_REQUIRE(error == 0); + free_lopacket(packet1); + free_lopacket(packet2); +} + +ATF_TC(ip_reass__large_fragment); +ATF_TC_HEAD(ip_reass__large_fragment, tc) +{ + atf_tc_set_md_var(tc, "require.user", "root"); +} +ATF_TC_BODY(ip_reass__large_fragment, tc) +{ + struct ipstat old, new; + struct ip *ip; + struct lopacket *packet1, *packet2; + in_addr_t addr; + int error, fd; + uint16_t ipid; + + fd = open_lobpf(&addr); + ipid = arc4random_uniform(UINT16_MAX + 1); + + /* + * Create two packets, one with MF set, one without. + * + * 16 + (0x1fff << 3) > IP_MAXPACKET, so these should fail the check. + */ + packet1 = alloc_lopacket(addr, 16); + ip = &packet1->hdr; + ip->ip_id = ipid; + ip->ip_off = htons(IP_MF | 0x1fff); + update_cksum(ip); + + packet2 = alloc_lopacket(addr, 16); + ip = &packet2->hdr; + ip->ip_id = ipid; + ip->ip_off = htons(0x1fff); + update_cksum(ip); + + get_ipstat(&old); + write_lopacket(fd, packet1); + get_ipstat(&new); + CHECK_IP_COUNTER(&old, &new, toolong); + CHECK_IP_COUNTER(&old, &new, fragdropped); + + get_ipstat(&old); + write_lopacket(fd, packet2); + get_ipstat(&new); + CHECK_IP_COUNTER(&old, &new, toolong); + CHECK_IP_COUNTER(&old, &new, fragdropped); + + error = close(fd); + ATF_REQUIRE(error == 0); + free_lopacket(packet1); + free_lopacket(packet2); +} + +ATF_TP_ADD_TCS(tp) +{ + ATF_TP_ADD_TC(tp, ip_reass__multiple_last_fragments); + ATF_TP_ADD_TC(tp, ip_reass__zero_length_fragment); + ATF_TP_ADD_TC(tp, ip_reass__large_fragment); + + return (atf_no_error()); +} From owner-svn-src-all@freebsd.org Sat Nov 24 17:09:37 2018 Return-Path: Delivered-To: svn-src-all@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 CE3E41104980; Sat, 24 Nov 2018 17:09:36 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 722AE834D4; Sat, 24 Nov 2018 17:09:36 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 54CF910D45; Sat, 24 Nov 2018 17:09:36 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAOH9ap9008640; Sat, 24 Nov 2018 17:09:36 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAOH9avn008639; Sat, 24 Nov 2018 17:09:36 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201811241709.wAOH9avn008639@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sat, 24 Nov 2018 17:09:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r340903 - stable/12/sys/kern X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/12/sys/kern X-SVN-Commit-Revision: 340903 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 722AE834D4 X-Spamd-Result: default: False [1.79 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.61)[0.611,0]; NEURAL_SPAM_SHORT(0.49)[0.486,0]; NEURAL_SPAM_MEDIUM(0.70)[0.697,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Nov 2018 17:09:37 -0000 Author: markj Date: Sat Nov 24 17:09:35 2018 New Revision: 340903 URL: https://svnweb.freebsd.org/changeset/base/340903 Log: MFC r340734: Avoid unsynchronized updates to kn_status. Modified: stable/12/sys/kern/kern_event.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/kern/kern_event.c ============================================================================== --- stable/12/sys/kern/kern_event.c Sat Nov 24 17:08:49 2018 (r340902) +++ stable/12/sys/kern/kern_event.c Sat Nov 24 17:09:35 2018 (r340903) @@ -1535,6 +1535,8 @@ findkn: kn->kn_kevent.flags &= ~(EV_ADD | EV_DELETE | EV_ENABLE | EV_DISABLE | EV_FORCEONESHOT); kn->kn_status = KN_DETACHED; + if ((kev->flags & EV_DISABLE) != 0) + kn->kn_status |= KN_DISABLED; kn_enter_flux(kn); error = knote_attach(kn, kq); @@ -1570,6 +1572,11 @@ findkn: KNOTE_ACTIVATE(kn, 1); } + if ((kev->flags & EV_ENABLE) != 0) + kn->kn_status &= ~KN_DISABLED; + else if ((kev->flags & EV_DISABLE) != 0) + kn->kn_status |= KN_DISABLED; + /* * The user may change some filter values after the initial EV_ADD, * but doing so will not reset any filter which has already been @@ -1587,19 +1594,17 @@ findkn: kn->kn_sdata = kev->data; } +done_ev_add: /* * We can get here with kn->kn_knlist == NULL. This can happen when * the initial attach event decides that the event is "completed" - * already. i.e. filt_procattach is called on a zombie process. It - * will call filt_proc which will remove it from the list, and NULL + * already, e.g., filt_procattach() is called on a zombie process. It + * will call filt_proc() which will remove it from the list, and NULL * kn_knlist. + * + * KN_DISABLED will be stable while the knote is in flux, so the + * unlocked read will not race with an update. */ -done_ev_add: - if ((kev->flags & EV_ENABLE) != 0) - kn->kn_status &= ~KN_DISABLED; - else if ((kev->flags & EV_DISABLE) != 0) - kn->kn_status |= KN_DISABLED; - if ((kn->kn_status & KN_DISABLED) == 0) event = kn->kn_fop->f_event(kn, 0); else From owner-svn-src-all@freebsd.org Sat Nov 24 17:11:49 2018 Return-Path: Delivered-To: svn-src-all@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 D525B1104CAD; Sat, 24 Nov 2018 17:11: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 7D7EA83845; Sat, 24 Nov 2018 17:11: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 45CF810DA0; Sat, 24 Nov 2018 17:11: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 wAOHBmBm012642; Sat, 24 Nov 2018 17:11:48 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAOHBmMD012641; Sat, 24 Nov 2018 17:11:48 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201811241711.wAOHBmMD012641@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sat, 24 Nov 2018 17:11:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r340904 - stable/11/sys/kern X-SVN-Group: stable-11 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/11/sys/kern X-SVN-Commit-Revision: 340904 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 7D7EA83845 X-Spamd-Result: default: False [1.79 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.61)[0.611,0]; NEURAL_SPAM_MEDIUM(0.70)[0.697,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.49)[0.486,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Nov 2018 17:11:49 -0000 Author: markj Date: Sat Nov 24 17:11:47 2018 New Revision: 340904 URL: https://svnweb.freebsd.org/changeset/base/340904 Log: MFC r340734: Avoid unsynchronized updates to kn_status. Modified: stable/11/sys/kern/kern_event.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/kern/kern_event.c ============================================================================== --- stable/11/sys/kern/kern_event.c Sat Nov 24 17:09:35 2018 (r340903) +++ stable/11/sys/kern/kern_event.c Sat Nov 24 17:11:47 2018 (r340904) @@ -1391,6 +1391,8 @@ findkn: kn->kn_kevent.flags &= ~(EV_ADD | EV_DELETE | EV_ENABLE | EV_DISABLE | EV_FORCEONESHOT); kn->kn_status = KN_INFLUX|KN_DETACHED; + if ((kev->flags & EV_DISABLE) != 0) + kn->kn_status |= KN_DISABLED; error = knote_attach(kn, kq); KQ_UNLOCK(kq); @@ -1427,6 +1429,11 @@ findkn: KNOTE_ACTIVATE(kn, 1); } + if ((kev->flags & EV_ENABLE) != 0) + kn->kn_status &= ~KN_DISABLED; + else if ((kev->flags & EV_DISABLE) != 0) + kn->kn_status |= KN_DISABLED; + /* * The user may change some filter values after the initial EV_ADD, * but doing so will not reset any filter which has already been @@ -1443,19 +1450,17 @@ findkn: kn->kn_sdata = kev->data; } +done_ev_add: /* * We can get here with kn->kn_knlist == NULL. This can happen when * the initial attach event decides that the event is "completed" - * already. i.e. filt_procattach is called on a zombie process. It - * will call filt_proc which will remove it from the list, and NULL + * already, e.g., filt_procattach() is called on a zombie process. It + * will call filt_proc() which will remove it from the list, and NULL * kn_knlist. + * + * KN_DISABLED will be stable while the knote is in flux, so the + * unlocked read will not race with an update. */ -done_ev_add: - if ((kev->flags & EV_ENABLE) != 0) - kn->kn_status &= ~KN_DISABLED; - else if ((kev->flags & EV_DISABLE) != 0) - kn->kn_status |= KN_DISABLED; - if ((kn->kn_status & KN_DISABLED) == 0) event = kn->kn_fop->f_event(kn, 0); else From owner-svn-src-all@freebsd.org Sat Nov 24 17:47:54 2018 Return-Path: Delivered-To: svn-src-all@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 B42C4113302F; Sat, 24 Nov 2018 17:47:54 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.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 4C5C28498B; Sat, 24 Nov 2018 17:47:54 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2D612113D1; Sat, 24 Nov 2018 17:47:54 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAOHlscP029938; Sat, 24 Nov 2018 17:47:54 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAOHlr6W029937; Sat, 24 Nov 2018 17:47:53 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201811241747.wAOHlr6W029937@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Sat, 24 Nov 2018 17:47:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r340905 - in stable/12: release/pkg_repos usr.sbin/pkg X-SVN-Group: stable-12 X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: in stable/12: release/pkg_repos usr.sbin/pkg X-SVN-Commit-Revision: 340905 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4C5C28498B X-Spamd-Result: default: False [1.83 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.61)[0.611,0]; NEURAL_SPAM_MEDIUM(0.70)[0.697,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.52)[0.518,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Nov 2018 17:47:54 -0000 Author: gjb Date: Sat Nov 24 17:47:53 2018 New Revision: 340905 URL: https://svnweb.freebsd.org/changeset/base/340905 Log: Revert r340161 in stable/12, setting the default pkg(8) repository back to 'latest' from 'quarterly' prior to branching releng/12.0. Sponsored by: The FreeBSD Foundation Modified: stable/12/release/pkg_repos/release-dvd.conf stable/12/usr.sbin/pkg/FreeBSD.conf Modified: stable/12/release/pkg_repos/release-dvd.conf ============================================================================== --- stable/12/release/pkg_repos/release-dvd.conf Sat Nov 24 17:11:47 2018 (r340904) +++ stable/12/release/pkg_repos/release-dvd.conf Sat Nov 24 17:47:53 2018 (r340905) @@ -1,6 +1,6 @@ # $FreeBSD$ release: { - url: "pkg+http://pkg.FreeBSD.org/${ABI}/quarterly", + url: "pkg+http://pkg.FreeBSD.org/${ABI}/latest", mirror_type: "srv", signature_type: "fingerprints", fingerprints: "/usr/share/keys/pkg", Modified: stable/12/usr.sbin/pkg/FreeBSD.conf ============================================================================== --- stable/12/usr.sbin/pkg/FreeBSD.conf Sat Nov 24 17:11:47 2018 (r340904) +++ stable/12/usr.sbin/pkg/FreeBSD.conf Sat Nov 24 17:47:53 2018 (r340905) @@ -8,7 +8,7 @@ # FreeBSD: { - url: "pkg+http://pkg.FreeBSD.org/${ABI}/quarterly", + url: "pkg+http://pkg.FreeBSD.org/${ABI}/latest", mirror_type: "srv", signature_type: "fingerprints", fingerprints: "/usr/share/keys/pkg", From owner-svn-src-all@freebsd.org Sat Nov 24 18:13:10 2018 Return-Path: Delivered-To: svn-src-all@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 1F7851134253; Sat, 24 Nov 2018 18:13:10 +0000 (UTC) (envelope-from arybchik@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 B5FCA859D4; Sat, 24 Nov 2018 18:13:09 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 96343118B7; Sat, 24 Nov 2018 18:13:09 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAOID9Ro044907; Sat, 24 Nov 2018 18:13:09 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAOID8PY044901; Sat, 24 Nov 2018 18:13:08 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811241813.wAOID8PY044901@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Sat, 24 Nov 2018 18:13:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340906 - in head/sys/dev/sfxge: . common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: in head/sys/dev/sfxge: . common X-SVN-Commit-Revision: 340906 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B5FCA859D4 X-Spamd-Result: default: False [1.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.56)[0.560,0]; NEURAL_SPAM_MEDIUM(0.73)[0.730,0]; NEURAL_SPAM_LONG(0.66)[0.661,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Nov 2018 18:13:10 -0000 Author: arybchik Date: Sat Nov 24 18:13:07 2018 New Revision: 340906 URL: https://svnweb.freebsd.org/changeset/base/340906 Log: sfxge(4): control RxQ scatter using flag instead of type Rx scatter may be applicable to different Rx queue types. Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18131 Modified: head/sys/dev/sfxge/common/ef10_impl.h head/sys/dev/sfxge/common/ef10_rx.c head/sys/dev/sfxge/common/efx.h head/sys/dev/sfxge/common/efx_impl.h head/sys/dev/sfxge/common/efx_rx.c head/sys/dev/sfxge/sfxge_rx.c Modified: head/sys/dev/sfxge/common/ef10_impl.h ============================================================================== --- head/sys/dev/sfxge/common/ef10_impl.h Sat Nov 24 17:47:53 2018 (r340905) +++ head/sys/dev/sfxge/common/ef10_impl.h Sat Nov 24 18:13:07 2018 (r340906) @@ -982,6 +982,7 @@ ef10_rx_qcreate( __in efsys_mem_t *esmp, __in size_t ndescs, __in uint32_t id, + __in unsigned int flags, __in efx_evq_t *eep, __in efx_rxq_t *erp); Modified: head/sys/dev/sfxge/common/ef10_rx.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_rx.c Sat Nov 24 17:47:53 2018 (r340905) +++ head/sys/dev/sfxge/common/ef10_rx.c Sat Nov 24 18:13:07 2018 (r340906) @@ -954,6 +954,7 @@ ef10_rx_qcreate( __in efsys_mem_t *esmp, __in size_t ndescs, __in uint32_t id, + __in unsigned int flags, __in efx_evq_t *eep, __in efx_rxq_t *erp) { @@ -983,7 +984,6 @@ ef10_rx_qcreate( switch (type) { case EFX_RXQ_TYPE_DEFAULT: - case EFX_RXQ_TYPE_SCATTER: ps_buf_size = 0; break; #if EFSYS_OPT_RX_PACKED_STREAM @@ -1027,7 +1027,7 @@ ef10_rx_qcreate( #endif /* EFSYS_OPT_RX_PACKED_STREAM */ /* Scatter can only be disabled if the firmware supports doing so */ - if (type == EFX_RXQ_TYPE_SCATTER) + if (flags & EFX_RXQ_FLAG_SCATTER) disable_scatter = B_FALSE; else disable_scatter = encp->enc_rx_disable_scatter_supported; Modified: head/sys/dev/sfxge/common/efx.h ============================================================================== --- head/sys/dev/sfxge/common/efx.h Sat Nov 24 17:47:53 2018 (r340905) +++ head/sys/dev/sfxge/common/efx.h Sat Nov 24 18:13:07 2018 (r340906) @@ -2006,7 +2006,6 @@ efx_pseudo_hdr_pkt_length_get( typedef enum efx_rxq_type_e { EFX_RXQ_TYPE_DEFAULT, - EFX_RXQ_TYPE_SCATTER, EFX_RXQ_TYPE_PACKED_STREAM_1M, EFX_RXQ_TYPE_PACKED_STREAM_512K, EFX_RXQ_TYPE_PACKED_STREAM_256K, @@ -2015,6 +2014,13 @@ typedef enum efx_rxq_type_e { EFX_RXQ_NTYPES } efx_rxq_type_t; +/* + * Dummy flag to be used instead of 0 to make it clear that the argument + * is receive queue flags. + */ +#define EFX_RXQ_FLAG_NONE 0x0 +#define EFX_RXQ_FLAG_SCATTER 0x1 + extern __checkReturn efx_rc_t efx_rx_qcreate( __in efx_nic_t *enp, @@ -2024,6 +2030,7 @@ efx_rx_qcreate( __in efsys_mem_t *esmp, __in size_t ndescs, __in uint32_t id, + __in unsigned int flags, __in efx_evq_t *eep, __deref_out efx_rxq_t **erpp); Modified: head/sys/dev/sfxge/common/efx_impl.h ============================================================================== --- head/sys/dev/sfxge/common/efx_impl.h Sat Nov 24 17:47:53 2018 (r340905) +++ head/sys/dev/sfxge/common/efx_impl.h Sat Nov 24 18:13:07 2018 (r340906) @@ -187,6 +187,7 @@ typedef struct efx_rx_ops_s { efx_rc_t (*erxo_qcreate)(efx_nic_t *enp, unsigned int, unsigned int, efx_rxq_type_t, efsys_mem_t *, size_t, uint32_t, + unsigned int, efx_evq_t *, efx_rxq_t *); void (*erxo_qdestroy)(efx_rxq_t *); } efx_rx_ops_t; Modified: head/sys/dev/sfxge/common/efx_rx.c ============================================================================== --- head/sys/dev/sfxge/common/efx_rx.c Sat Nov 24 17:47:53 2018 (r340905) +++ head/sys/dev/sfxge/common/efx_rx.c Sat Nov 24 18:13:07 2018 (r340906) @@ -139,6 +139,7 @@ siena_rx_qcreate( __in efsys_mem_t *esmp, __in size_t ndescs, __in uint32_t id, + __in unsigned int flags, __in efx_evq_t *eep, __in efx_rxq_t *erp); @@ -624,6 +625,7 @@ efx_rx_qcreate( __in efsys_mem_t *esmp, __in size_t ndescs, __in uint32_t id, + __in unsigned int flags, __in efx_evq_t *eep, __deref_out efx_rxq_t **erpp) { @@ -649,7 +651,7 @@ efx_rx_qcreate( erp->er_esmp = esmp; if ((rc = erxop->erxo_qcreate(enp, index, label, type, esmp, ndescs, id, - eep, erp)) != 0) + flags, eep, erp)) != 0) goto fail2; enp->en_rx_qcount++; @@ -1311,13 +1313,14 @@ siena_rx_qcreate( __in efsys_mem_t *esmp, __in size_t ndescs, __in uint32_t id, + __in unsigned int flags, __in efx_evq_t *eep, __in efx_rxq_t *erp) { efx_nic_cfg_t *encp = &(enp->en_nic_cfg); efx_oword_t oword; uint32_t size; - boolean_t jumbo; + boolean_t jumbo = B_FALSE; efx_rc_t rc; _NOTE(ARGUNUSED(esmp)) @@ -1350,20 +1353,22 @@ siena_rx_qcreate( switch (type) { case EFX_RXQ_TYPE_DEFAULT: - jumbo = B_FALSE; break; -#if EFSYS_OPT_RX_SCATTER - case EFX_RXQ_TYPE_SCATTER: - jumbo = B_TRUE; - break; -#endif /* EFSYS_OPT_RX_SCATTER */ - default: rc = EINVAL; goto fail4; } + if (flags & EFX_RXQ_FLAG_SCATTER) { +#if EFSYS_OPT_RX_SCATTER + jumbo = B_TRUE; +#else + rc = EINVAL; + goto fail5; +#endif /* EFSYS_OPT_RX_SCATTER */ + } + /* Set up the new descriptor queue */ EFX_POPULATE_OWORD_7(oword, FRF_AZ_RX_DESCQ_BUF_BASE_ID, id, @@ -1379,6 +1384,10 @@ siena_rx_qcreate( return (0); +#if !EFSYS_OPT_RX_SCATTER +fail5: + EFSYS_PROBE(fail5); +#endif fail4: EFSYS_PROBE(fail4); fail3: Modified: head/sys/dev/sfxge/sfxge_rx.c ============================================================================== --- head/sys/dev/sfxge/sfxge_rx.c Sat Nov 24 17:47:53 2018 (r340905) +++ head/sys/dev/sfxge/sfxge_rx.c Sat Nov 24 18:13:07 2018 (r340906) @@ -1037,8 +1037,8 @@ sfxge_rx_qstart(struct sfxge_softc *sc, unsigned int i /* Create the common code receive queue. */ if ((rc = efx_rx_qcreate(sc->enp, index, 0, EFX_RXQ_TYPE_DEFAULT, - esmp, sc->rxq_entries, rxq->buf_base_id, evq->common, - &rxq->common)) != 0) + esmp, sc->rxq_entries, rxq->buf_base_id, EFX_RXQ_FLAG_NONE, + evq->common, &rxq->common)) != 0) goto fail; SFXGE_EVQ_LOCK(evq); From owner-svn-src-all@freebsd.org Sat Nov 24 18:13:23 2018 Return-Path: Delivered-To: svn-src-all@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 A94AB113428C; Sat, 24 Nov 2018 18:13:23 +0000 (UTC) (envelope-from arybchik@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 4C6E185AC4; Sat, 24 Nov 2018 18:13:23 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F10AD118B8; Sat, 24 Nov 2018 18:13:22 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAOIDMUG044974; Sat, 24 Nov 2018 18:13:22 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAOIDL0d044968; Sat, 24 Nov 2018 18:13:21 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811241813.wAOIDL0d044968@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Sat, 24 Nov 2018 18:13:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340907 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 340907 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4C6E185AC4 X-Spamd-Result: default: False [2.00 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.68)[0.678,0]; NEURAL_SPAM_MEDIUM(0.75)[0.746,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.58)[0.576,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Nov 2018 18:13:23 -0000 Author: arybchik Date: Sat Nov 24 18:13:21 2018 New Revision: 340907 URL: https://svnweb.freebsd.org/changeset/base/340907 Log: sfxge(4): add function to create packed stream RxQ Encoding packed stream buffer size in RxQ type is not a future-proof idea taking into account a new RxQ types with extra parameters. To be consistent make packet stream buffer size a separate parameter. In order to avoid blowing of the default RxQ create function prototype add a dedicated function to create packed stream RxQ without not applicable paramters. Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18132 Modified: head/sys/dev/sfxge/common/ef10_ev.c head/sys/dev/sfxge/common/ef10_impl.h head/sys/dev/sfxge/common/ef10_rx.c head/sys/dev/sfxge/common/efx.h head/sys/dev/sfxge/common/efx_impl.h head/sys/dev/sfxge/common/efx_rx.c Modified: head/sys/dev/sfxge/common/ef10_ev.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_ev.c Sat Nov 24 18:13:07 2018 (r340906) +++ head/sys/dev/sfxge/common/ef10_ev.c Sat Nov 24 18:13:21 2018 (r340907) @@ -1350,8 +1350,7 @@ ef10_ev_rxlabel_init( { efx_evq_rxq_state_t *eersp; #if EFSYS_OPT_RX_PACKED_STREAM - boolean_t packed_stream = (type >= EFX_RXQ_TYPE_PACKED_STREAM_1M) && - (type <= EFX_RXQ_TYPE_PACKED_STREAM_64K); + boolean_t packed_stream = (type == EFX_RXQ_TYPE_PACKED_STREAM); #endif _NOTE(ARGUNUSED(type)) Modified: head/sys/dev/sfxge/common/ef10_impl.h ============================================================================== --- head/sys/dev/sfxge/common/ef10_impl.h Sat Nov 24 18:13:07 2018 (r340906) +++ head/sys/dev/sfxge/common/ef10_impl.h Sat Nov 24 18:13:21 2018 (r340907) @@ -979,6 +979,7 @@ ef10_rx_qcreate( __in unsigned int index, __in unsigned int label, __in efx_rxq_type_t type, + __in uint32_t type_data, __in efsys_mem_t *esmp, __in size_t ndescs, __in uint32_t id, Modified: head/sys/dev/sfxge/common/ef10_rx.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_rx.c Sat Nov 24 18:13:07 2018 (r340906) +++ head/sys/dev/sfxge/common/ef10_rx.c Sat Nov 24 18:13:21 2018 (r340907) @@ -951,6 +951,7 @@ ef10_rx_qcreate( __in unsigned int index, __in unsigned int label, __in efx_rxq_type_t type, + __in uint32_t type_data, __in efsys_mem_t *esmp, __in size_t ndescs, __in uint32_t id, @@ -963,7 +964,7 @@ ef10_rx_qcreate( boolean_t disable_scatter; unsigned int ps_buf_size; - _NOTE(ARGUNUSED(id, erp)) + _NOTE(ARGUNUSED(id, erp, type_data)) EFX_STATIC_ASSERT(EFX_EV_RX_NLABELS == (1 << ESF_DZ_RX_QLABEL_WIDTH)); EFSYS_ASSERT3U(label, <, EFX_EV_RX_NLABELS); @@ -987,25 +988,32 @@ ef10_rx_qcreate( ps_buf_size = 0; break; #if EFSYS_OPT_RX_PACKED_STREAM - case EFX_RXQ_TYPE_PACKED_STREAM_1M: - ps_buf_size = MC_CMD_INIT_RXQ_EXT_IN_PS_BUFF_1M; + case EFX_RXQ_TYPE_PACKED_STREAM: + switch (type_data) { + case EFX_RXQ_PACKED_STREAM_BUF_SIZE_1M: + ps_buf_size = MC_CMD_INIT_RXQ_EXT_IN_PS_BUFF_1M; + break; + case EFX_RXQ_PACKED_STREAM_BUF_SIZE_512K: + ps_buf_size = MC_CMD_INIT_RXQ_EXT_IN_PS_BUFF_512K; + break; + case EFX_RXQ_PACKED_STREAM_BUF_SIZE_256K: + ps_buf_size = MC_CMD_INIT_RXQ_EXT_IN_PS_BUFF_256K; + break; + case EFX_RXQ_PACKED_STREAM_BUF_SIZE_128K: + ps_buf_size = MC_CMD_INIT_RXQ_EXT_IN_PS_BUFF_128K; + break; + case EFX_RXQ_PACKED_STREAM_BUF_SIZE_64K: + ps_buf_size = MC_CMD_INIT_RXQ_EXT_IN_PS_BUFF_64K; + break; + default: + rc = ENOTSUP; + goto fail3; + } break; - case EFX_RXQ_TYPE_PACKED_STREAM_512K: - ps_buf_size = MC_CMD_INIT_RXQ_EXT_IN_PS_BUFF_512K; - break; - case EFX_RXQ_TYPE_PACKED_STREAM_256K: - ps_buf_size = MC_CMD_INIT_RXQ_EXT_IN_PS_BUFF_256K; - break; - case EFX_RXQ_TYPE_PACKED_STREAM_128K: - ps_buf_size = MC_CMD_INIT_RXQ_EXT_IN_PS_BUFF_128K; - break; - case EFX_RXQ_TYPE_PACKED_STREAM_64K: - ps_buf_size = MC_CMD_INIT_RXQ_EXT_IN_PS_BUFF_64K; - break; #endif /* EFSYS_OPT_RX_PACKED_STREAM */ default: rc = ENOTSUP; - goto fail3; + goto fail4; } #if EFSYS_OPT_RX_PACKED_STREAM @@ -1013,13 +1021,13 @@ ef10_rx_qcreate( /* Check if datapath firmware supports packed stream mode */ if (encp->enc_rx_packed_stream_supported == B_FALSE) { rc = ENOTSUP; - goto fail4; + goto fail5; } /* Check if packed stream allows configurable buffer sizes */ - if ((type != EFX_RXQ_TYPE_PACKED_STREAM_1M) && + if ((ps_buf_size != MC_CMD_INIT_RXQ_EXT_IN_PS_BUFF_1M) && (encp->enc_rx_var_packed_stream_supported == B_FALSE)) { rc = ENOTSUP; - goto fail5; + goto fail6; } } #else /* EFSYS_OPT_RX_PACKED_STREAM */ @@ -1034,7 +1042,7 @@ ef10_rx_qcreate( if ((rc = efx_mcdi_init_rxq(enp, ndescs, eep->ee_index, label, index, esmp, disable_scatter, ps_buf_size)) != 0) - goto fail6; + goto fail7; erp->er_eep = eep; erp->er_label = label; @@ -1045,16 +1053,20 @@ ef10_rx_qcreate( return (0); +fail7: + EFSYS_PROBE(fail7); +#if EFSYS_OPT_RX_PACKED_STREAM fail6: EFSYS_PROBE(fail6); -#if EFSYS_OPT_RX_PACKED_STREAM fail5: EFSYS_PROBE(fail5); +#endif /* EFSYS_OPT_RX_PACKED_STREAM */ fail4: EFSYS_PROBE(fail4); -#endif /* EFSYS_OPT_RX_PACKED_STREAM */ +#if EFSYS_OPT_RX_PACKED_STREAM fail3: EFSYS_PROBE(fail3); +#endif /* EFSYS_OPT_RX_PACKED_STREAM */ fail2: EFSYS_PROBE(fail2); fail1: Modified: head/sys/dev/sfxge/common/efx.h ============================================================================== --- head/sys/dev/sfxge/common/efx.h Sat Nov 24 18:13:07 2018 (r340906) +++ head/sys/dev/sfxge/common/efx.h Sat Nov 24 18:13:21 2018 (r340907) @@ -2006,11 +2006,7 @@ efx_pseudo_hdr_pkt_length_get( typedef enum efx_rxq_type_e { EFX_RXQ_TYPE_DEFAULT, - EFX_RXQ_TYPE_PACKED_STREAM_1M, - EFX_RXQ_TYPE_PACKED_STREAM_512K, - EFX_RXQ_TYPE_PACKED_STREAM_256K, - EFX_RXQ_TYPE_PACKED_STREAM_128K, - EFX_RXQ_TYPE_PACKED_STREAM_64K, + EFX_RXQ_TYPE_PACKED_STREAM, EFX_RXQ_NTYPES } efx_rxq_type_t; @@ -2033,6 +2029,27 @@ efx_rx_qcreate( __in unsigned int flags, __in efx_evq_t *eep, __deref_out efx_rxq_t **erpp); + +#if EFSYS_OPT_RX_PACKED_STREAM + +#define EFX_RXQ_PACKED_STREAM_BUF_SIZE_1M (1U * 1024 * 1024) +#define EFX_RXQ_PACKED_STREAM_BUF_SIZE_512K (512U * 1024) +#define EFX_RXQ_PACKED_STREAM_BUF_SIZE_256K (256U * 1024) +#define EFX_RXQ_PACKED_STREAM_BUF_SIZE_128K (128U * 1024) +#define EFX_RXQ_PACKED_STREAM_BUF_SIZE_64K (64U * 1024) + +extern __checkReturn efx_rc_t +efx_rx_qcreate_packed_stream( + __in efx_nic_t *enp, + __in unsigned int index, + __in unsigned int label, + __in uint32_t ps_buf_size, + __in efsys_mem_t *esmp, + __in size_t ndescs, + __in efx_evq_t *eep, + __deref_out efx_rxq_t **erpp); + +#endif typedef struct efx_buffer_s { efsys_dma_addr_t eb_addr; Modified: head/sys/dev/sfxge/common/efx_impl.h ============================================================================== --- head/sys/dev/sfxge/common/efx_impl.h Sat Nov 24 18:13:07 2018 (r340906) +++ head/sys/dev/sfxge/common/efx_impl.h Sat Nov 24 18:13:21 2018 (r340907) @@ -185,7 +185,7 @@ typedef struct efx_rx_ops_s { efx_rc_t (*erxo_qflush)(efx_rxq_t *); void (*erxo_qenable)(efx_rxq_t *); efx_rc_t (*erxo_qcreate)(efx_nic_t *enp, unsigned int, - unsigned int, efx_rxq_type_t, + unsigned int, efx_rxq_type_t, uint32_t, efsys_mem_t *, size_t, uint32_t, unsigned int, efx_evq_t *, efx_rxq_t *); Modified: head/sys/dev/sfxge/common/efx_rx.c ============================================================================== --- head/sys/dev/sfxge/common/efx_rx.c Sat Nov 24 18:13:07 2018 (r340906) +++ head/sys/dev/sfxge/common/efx_rx.c Sat Nov 24 18:13:21 2018 (r340907) @@ -136,6 +136,7 @@ siena_rx_qcreate( __in unsigned int index, __in unsigned int label, __in efx_rxq_type_t type, + __in uint32_t type_data, __in efsys_mem_t *esmp, __in size_t ndescs, __in uint32_t id, @@ -616,12 +617,13 @@ efx_rx_qenable( erxop->erxo_qenable(erp); } - __checkReturn efx_rc_t -efx_rx_qcreate( +static __checkReturn efx_rc_t +efx_rx_qcreate_internal( __in efx_nic_t *enp, __in unsigned int index, __in unsigned int label, __in efx_rxq_type_t type, + __in uint32_t type_data, __in efsys_mem_t *esmp, __in size_t ndescs, __in uint32_t id, @@ -650,8 +652,8 @@ efx_rx_qcreate( erp->er_mask = ndescs - 1; erp->er_esmp = esmp; - if ((rc = erxop->erxo_qcreate(enp, index, label, type, esmp, ndescs, id, - flags, eep, erp)) != 0) + if ((rc = erxop->erxo_qcreate(enp, index, label, type, type_data, esmp, + ndescs, id, flags, eep, erp)) != 0) goto fail2; enp->en_rx_qcount++; @@ -669,6 +671,43 @@ fail1: return (rc); } + __checkReturn efx_rc_t +efx_rx_qcreate( + __in efx_nic_t *enp, + __in unsigned int index, + __in unsigned int label, + __in efx_rxq_type_t type, + __in efsys_mem_t *esmp, + __in size_t ndescs, + __in uint32_t id, + __in unsigned int flags, + __in efx_evq_t *eep, + __deref_out efx_rxq_t **erpp) +{ + return efx_rx_qcreate_internal(enp, index, label, type, 0, esmp, ndescs, + id, flags, eep, erpp); +} + +#if EFSYS_OPT_RX_PACKED_STREAM + + __checkReturn efx_rc_t +efx_rx_qcreate_packed_stream( + __in efx_nic_t *enp, + __in unsigned int index, + __in unsigned int label, + __in uint32_t ps_buf_size, + __in efsys_mem_t *esmp, + __in size_t ndescs, + __in efx_evq_t *eep, + __deref_out efx_rxq_t **erpp) +{ + return efx_rx_qcreate_internal(enp, index, label, + EFX_RXQ_TYPE_PACKED_STREAM, ps_buf_size, esmp, ndescs, + 0 /* id unused on EF10 */, EFX_RXQ_FLAG_NONE, eep, erpp); +} + +#endif + void efx_rx_qdestroy( __in efx_rxq_t *erp) @@ -1310,6 +1349,7 @@ siena_rx_qcreate( __in unsigned int index, __in unsigned int label, __in efx_rxq_type_t type, + __in uint32_t type_data, __in efsys_mem_t *esmp, __in size_t ndescs, __in uint32_t id, @@ -1324,6 +1364,7 @@ siena_rx_qcreate( efx_rc_t rc; _NOTE(ARGUNUSED(esmp)) + _NOTE(ARGUNUSED(type_data)) EFX_STATIC_ASSERT(EFX_EV_RX_NLABELS == (1 << FRF_AZ_RX_DESCQ_LABEL_WIDTH)); From owner-svn-src-all@freebsd.org Sat Nov 24 18:13:36 2018 Return-Path: Delivered-To: svn-src-all@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 1474611342CE; Sat, 24 Nov 2018 18:13:36 +0000 (UTC) (envelope-from arybchik@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 A828785BB3; Sat, 24 Nov 2018 18:13:35 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BB400118B9; Sat, 24 Nov 2018 18:13:34 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAOIDYhv045033; Sat, 24 Nov 2018 18:13:34 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAOIDY4h045031; Sat, 24 Nov 2018 18:13:34 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811241813.wAOIDY4h045031@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Sat, 24 Nov 2018 18:13:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340908 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 340908 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A828785BB3 X-Spamd-Result: default: False [1.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.66)[0.661,0]; NEURAL_SPAM_MEDIUM(0.73)[0.730,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.56)[0.560,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Nov 2018 18:13:36 -0000 Author: arybchik Date: Sat Nov 24 18:13:34 2018 New Revision: 340908 URL: https://svnweb.freebsd.org/changeset/base/340908 Log: sfxge(4): allow to request inner classes for Rx packets If HW/FW supports tunnel encapsulations, Rx event may contain either inner or outer packet classes. By default outer classes are requested. Make it possible to request inner classes to have more information about packet type and allow to interpret inner frame checksum validation results correctly. Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18133 Modified: head/sys/dev/sfxge/common/ef10_rx.c head/sys/dev/sfxge/common/efx.h Modified: head/sys/dev/sfxge/common/ef10_rx.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_rx.c Sat Nov 24 18:13:21 2018 (r340907) +++ head/sys/dev/sfxge/common/ef10_rx.c Sat Nov 24 18:13:34 2018 (r340908) @@ -47,6 +47,7 @@ efx_mcdi_init_rxq( __in uint32_t instance, __in efsys_mem_t *esmp, __in boolean_t disable_scatter, + __in boolean_t want_inner_classes, __in uint32_t ps_bufsize) { efx_nic_cfg_t *encp = &(enp->en_nic_cfg); @@ -68,7 +69,8 @@ efx_mcdi_init_rxq( else dma_mode = MC_CMD_INIT_RXQ_EXT_IN_SINGLE_PACKET; - if (encp->enc_tunnel_encapsulations_supported != 0) { + if (encp->enc_tunnel_encapsulations_supported != 0 && + !want_inner_classes) { /* * WANT_OUTER_CLASSES can only be specified on hardware which * supports tunnel encapsulation offloads, even though it is @@ -962,6 +964,7 @@ ef10_rx_qcreate( efx_nic_cfg_t *encp = &(enp->en_nic_cfg); efx_rc_t rc; boolean_t disable_scatter; + boolean_t want_inner_classes; unsigned int ps_buf_size; _NOTE(ARGUNUSED(id, erp, type_data)) @@ -1040,8 +1043,14 @@ ef10_rx_qcreate( else disable_scatter = encp->enc_rx_disable_scatter_supported; + if (flags & EFX_RXQ_FLAG_INNER_CLASSES) + want_inner_classes = B_TRUE; + else + want_inner_classes = B_FALSE; + if ((rc = efx_mcdi_init_rxq(enp, ndescs, eep->ee_index, label, index, - esmp, disable_scatter, ps_buf_size)) != 0) + esmp, disable_scatter, want_inner_classes, + ps_buf_size)) != 0) goto fail7; erp->er_eep = eep; Modified: head/sys/dev/sfxge/common/efx.h ============================================================================== --- head/sys/dev/sfxge/common/efx.h Sat Nov 24 18:13:21 2018 (r340907) +++ head/sys/dev/sfxge/common/efx.h Sat Nov 24 18:13:34 2018 (r340908) @@ -2016,6 +2016,15 @@ typedef enum efx_rxq_type_e { */ #define EFX_RXQ_FLAG_NONE 0x0 #define EFX_RXQ_FLAG_SCATTER 0x1 +/* + * If tunnels are supported and Rx event can provide information about + * either outer or inner packet classes (e.g. SFN8xxx adapters with + * full-feature firmware variant running), outer classes are requested by + * default. However, if the driver supports tunnels, the flag allows to + * request inner classes which are required to be able to interpret inner + * Rx checksum offload results. + */ +#define EFX_RXQ_FLAG_INNER_CLASSES 0x2 extern __checkReturn efx_rc_t efx_rx_qcreate( From owner-svn-src-all@freebsd.org Sat Nov 24 18:23:06 2018 Return-Path: Delivered-To: svn-src-all@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 ACF5511347D0; Sat, 24 Nov 2018 18:23:06 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.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 4BAE386247; Sat, 24 Nov 2018 18:23:06 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2706711A61; Sat, 24 Nov 2018 18:23:06 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAOIN6cZ050277; Sat, 24 Nov 2018 18:23:06 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAOIN6af050276; Sat, 24 Nov 2018 18:23:06 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201811241823.wAOIN6af050276@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Sat, 24 Nov 2018 18:23:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340909 - head/sys/contrib/ipfilter/netinet X-SVN-Group: head X-SVN-Commit-Author: cy X-SVN-Commit-Paths: head/sys/contrib/ipfilter/netinet X-SVN-Commit-Revision: 340909 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4BAE386247 X-Spamd-Result: default: False [1.90 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.54)[0.543,0]; NEURAL_SPAM_MEDIUM(0.71)[0.712,0]; NEURAL_SPAM_LONG(0.64)[0.643,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Nov 2018 18:23:06 -0000 Author: cy Date: Sat Nov 24 18:23:05 2018 New Revision: 340909 URL: https://svnweb.freebsd.org/changeset/base/340909 Log: Combine two lines into one following unifdef for r255332. MFC after: 1 week Modified: head/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c Modified: head/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c ============================================================================== --- head/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c Sat Nov 24 18:13:34 2018 (r340908) +++ head/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c Sat Nov 24 18:23:05 2018 (r340909) @@ -288,8 +288,7 @@ ipfdetach(softc) * Filter ioctl interface. */ int -ipfioctl(dev, cmd, data, mode -, p) +ipfioctl(dev, cmd, data, mode, p) struct thread *p; # define p_cred td_ucred # define p_uid td_ucred->cr_ruid From owner-svn-src-all@freebsd.org Sat Nov 24 18:23:54 2018 Return-Path: Delivered-To: svn-src-all@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 2C7461134833; Sat, 24 Nov 2018 18:23:54 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.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 C4C3586394; Sat, 24 Nov 2018 18:23:53 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A786011A62; Sat, 24 Nov 2018 18:23:53 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAOINrlC050352; Sat, 24 Nov 2018 18:23:53 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAOINrqF050351; Sat, 24 Nov 2018 18:23:53 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201811241823.wAOINrqF050351@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Sat, 24 Nov 2018 18:23:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340910 - head/lib/csu/common X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: head/lib/csu/common X-SVN-Commit-Revision: 340910 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C4C3586394 X-Spamd-Result: default: False [1.90 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.64)[0.643,0]; NEURAL_SPAM_SHORT(0.54)[0.543,0]; NEURAL_SPAM_MEDIUM(0.71)[0.712,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Nov 2018 18:23:54 -0000 Author: andrew Date: Sat Nov 24 18:23:53 2018 New Revision: 340910 URL: https://svnweb.freebsd.org/changeset/base/340910 Log: Add the missing 0 at the end of the .jcr section. Without this the dynamic library test was failing as it was calling _Jv_RegisterClasses multiple times. Modified: head/lib/csu/common/crtend.c Modified: head/lib/csu/common/crtend.c ============================================================================== --- head/lib/csu/common/crtend.c Sat Nov 24 18:23:05 2018 (r340909) +++ head/lib/csu/common/crtend.c Sat Nov 24 18:23:53 2018 (r340910) @@ -41,6 +41,9 @@ static crt_func __CTOR_END__[] __section(".ctors") __u static crt_func __DTOR_END__[] __section(".dtors") __used = { (crt_func)0 }; +static crt_func __JCR_LIST__[] __section(".jcr") __used = { + (crt_func)0 +}; static void __do_global_ctors_aux(void) From owner-svn-src-all@freebsd.org Sat Nov 24 18:25:01 2018 Return-Path: Delivered-To: svn-src-all@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 C1B1311348E8; Sat, 24 Nov 2018 18:25:01 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.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 695728650A; Sat, 24 Nov 2018 18:25:01 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4A67011A63; Sat, 24 Nov 2018 18:25:01 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAOIP1VU050452; Sat, 24 Nov 2018 18:25:01 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAOIP1Cp050451; Sat, 24 Nov 2018 18:25:01 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201811241825.wAOIP1Cp050451@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Sat, 24 Nov 2018 18:25:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340911 - head/lib/csu/tests X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: head/lib/csu/tests X-SVN-Commit-Revision: 340911 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 695728650A X-Spamd-Result: default: False [1.84 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.53)[0.525,0]; NEURAL_SPAM_MEDIUM(0.69)[0.693,0]; NEURAL_SPAM_LONG(0.62)[0.625,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Nov 2018 18:25:01 -0000 Author: andrew Date: Sat Nov 24 18:25:00 2018 New Revision: 340911 URL: https://svnweb.freebsd.org/changeset/base/340911 Log: Re-enable the dynamiclib tests. These should be fixed by r340910. Modified: head/lib/csu/tests/Makefile Modified: head/lib/csu/tests/Makefile ============================================================================== --- head/lib/csu/tests/Makefile Sat Nov 24 18:23:53 2018 (r340910) +++ head/lib/csu/tests/Makefile Sat Nov 24 18:25:00 2018 (r340911) @@ -2,7 +2,7 @@ SUBDIR= dso TESTS_SUBDIRS= dynamic -#TESTS_SUBDIRS+= dynamiclib +TESTS_SUBDIRS+= dynamiclib TESTS_SUBDIRS+= static .include From owner-svn-src-all@freebsd.org Sat Nov 24 21:17:52 2018 Return-Path: Delivered-To: svn-src-all@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 11F991139AA5; Sat, 24 Nov 2018 21:17:52 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.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 A9D828C6ED; Sat, 24 Nov 2018 21:17:51 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 851EE135E3; Sat, 24 Nov 2018 21:17:51 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAOLHp3a039480; Sat, 24 Nov 2018 21:17:51 GMT (envelope-from wulf@FreeBSD.org) Received: (from wulf@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAOLHpu2039479; Sat, 24 Nov 2018 21:17:51 GMT (envelope-from wulf@FreeBSD.org) Message-Id: <201811242117.wAOLHpu2039479@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: wulf set sender to wulf@FreeBSD.org using -f From: Vladimir Kondratyev Date: Sat, 24 Nov 2018 21:17:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340912 - head/sys/dev/atkbdc X-SVN-Group: head X-SVN-Commit-Author: wulf X-SVN-Commit-Paths: head/sys/dev/atkbdc X-SVN-Commit-Revision: 340912 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A9D828C6ED X-Spamd-Result: default: False [1.70 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.31)[0.308,0]; NEURAL_SPAM_MEDIUM(0.73)[0.730,0]; NEURAL_SPAM_LONG(0.66)[0.661,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Nov 2018 21:17:52 -0000 Author: wulf Date: Sat Nov 24 21:17:51 2018 New Revision: 340912 URL: https://svnweb.freebsd.org/changeset/base/340912 Log: Revert r328640: Add kludge for 0x46 identity middle byte Synaptics touchpads. It appeared that "0x46 identity middle byte" response is caused by so called "Active PS/2 multiplexing controller" presence. Support for it will be added in next commit. Modified: head/sys/dev/atkbdc/psm.c Modified: head/sys/dev/atkbdc/psm.c ============================================================================== --- head/sys/dev/atkbdc/psm.c Sat Nov 24 18:25:00 2018 (r340911) +++ head/sys/dev/atkbdc/psm.c Sat Nov 24 21:17:51 2018 (r340912) @@ -136,7 +136,6 @@ struct psmcpnp_softc { enum { PSMCPNP_GENERIC, PSMCPNP_FORCEPAD, - PSMCPNP_HPSYN81, } type; /* Based on PnP ID */ }; @@ -175,15 +174,6 @@ typedef struct packetbuf { #define PSM_PACKETQUEUE 128 #endif -/* - * Typical bezel limits. Taken from 'Synaptics - * PS/2 TouchPad Interfacing Guide' p.3.2.3. - */ -#define SYNAPTICS_DEFAULT_MAX_X 5472 -#define SYNAPTICS_DEFAULT_MAX_Y 4448 -#define SYNAPTICS_DEFAULT_MIN_X 1472 -#define SYNAPTICS_DEFAULT_MIN_Y 1408 - typedef struct synapticsinfo { struct sysctl_ctx_list sysctl_ctx; struct sysctl_oid *sysctl_tree; @@ -1109,7 +1099,7 @@ doopen(struct psm_softc *sc, int command_byte) mouse_ext_command(sc->kbdc, 1); get_mouse_status(sc->kbdc, stat, 0, 3); if ((SYNAPTICS_VERSION_GE(sc->synhw, 7, 5) || - stat[1] == 0x46 || stat[1] == 0x47) && + stat[1] == 0x47) && stat[2] == 0x40) { synaptics_set_mode(sc, synaptics_preferred_mode(sc)); VLOG(5, (LOG_DEBUG, "psm%d: Synaptis Absolute Mode " @@ -6047,7 +6037,7 @@ enable_synaptics(struct psm_softc *sc, enum probearg a KBDC kbdc = sc->kbdc; synapticshw_t synhw; int status[3]; - int buttons, middle_byte; + int buttons; VLOG(3, (LOG_DEBUG, "synaptics: BEGIN init\n")); @@ -6064,8 +6054,7 @@ enable_synaptics(struct psm_softc *sc, enum probearg a return (FALSE); if (get_mouse_status(kbdc, status, 0, 3) != 3) return (FALSE); - middle_byte = status[1]; - if (middle_byte != 0x46 && middle_byte != 0x47) + if (status[1] != 0x47) return (FALSE); bzero(&synhw, sizeof(synhw)); @@ -6076,15 +6065,7 @@ enable_synaptics(struct psm_softc *sc, enum probearg a printf("Synaptics Touchpad v%d.%d\n", synhw.infoMajor, synhw.infoMinor); - /* - * Most synaptics touchpads return 0x47 in middle byte in responce to - * identify command as stated in p.4.4 of "Synaptics PS/2 TouchPad - * Interfacing Guide" and we only support v4.0 or better. But some - * devices return 0x46 here and have a different numbering scheme. - * In the case of 0x46, we allow versions as low as v2.0 - */ - if ((middle_byte == 0x47 && synhw.infoMajor < 4) || - (middle_byte == 0x46 && synhw.infoMajor < 2)) { + if (synhw.infoMajor < 4) { printf(" Unsupported (pre-v4) Touchpad detected\n"); return (FALSE); } @@ -6125,7 +6106,7 @@ enable_synaptics(struct psm_softc *sc, enum probearg a return (FALSE); if (get_mouse_status(kbdc, status, 0, 3) != 3) return (FALSE); - if (!SYNAPTICS_VERSION_GE(synhw, 7, 5) && status[1] != middle_byte) { + if (!SYNAPTICS_VERSION_GE(synhw, 7, 5) && status[1] != 0x47) { printf(" Failed to read extended capability bits\n"); return (FALSE); } @@ -6134,29 +6115,10 @@ enable_synaptics(struct psm_softc *sc, enum probearg a sc->unit); psmcpnp_sc = (psmcpnp != NULL) ? device_get_softc(psmcpnp) : NULL; - /* - * Set conservative defaults for 0x46 middle byte touchpads - * as ExtendedQueries return bogus data. - */ - if (middle_byte == 0x46) { - synhw.capExtended = 1; - synhw.capPalmDetect = 1; - synhw.capPassthrough = 1; - synhw.capMultiFinger = 1; - synhw.maximumXCoord = SYNAPTICS_DEFAULT_MAX_X; - synhw.maximumYCoord = SYNAPTICS_DEFAULT_MAX_Y; - synhw.minimumXCoord = SYNAPTICS_DEFAULT_MIN_X; - synhw.minimumYCoord = SYNAPTICS_DEFAULT_MIN_Y; - /* Enable multitouch mode for HW v8.1 devices */ - if (psmcpnp_sc != NULL && - psmcpnp_sc->type == PSMCPNP_HPSYN81) - synhw.capReportsV = 1; - } else - synhw.capExtended = (status[0] & 0x80) != 0; - /* Set the different capabilities when they exist. */ buttons = 0; - if (synhw.capExtended && middle_byte == 0x47) { + synhw.capExtended = (status[0] & 0x80) != 0; + if (synhw.capExtended) { synhw.nExtendedQueries = (status[0] & 0x70) >> 4; synhw.capMiddle = (status[0] & 0x04) != 0; synhw.capPassthrough = (status[2] & 0x80) != 0; @@ -6278,8 +6240,12 @@ enable_synaptics(struct psm_softc *sc, enum probearg a synhw.maximumYCoord = (status[2] << 5) | ((status[1] & 0xf0) >> 3); } else { - synhw.maximumXCoord = SYNAPTICS_DEFAULT_MAX_X; - synhw.maximumYCoord = SYNAPTICS_DEFAULT_MAX_Y; + /* + * Typical bezel limits. Taken from 'Synaptics + * PS/2 * TouchPad Interfacing Guide' p.3.2.3. + */ + synhw.maximumXCoord = 5472; + synhw.maximumYCoord = 4448; } if (synhw.capReportsMin) { @@ -6295,8 +6261,12 @@ enable_synaptics(struct psm_softc *sc, enum probearg a synhw.minimumYCoord = (status[2] << 5) | ((status[1] & 0xf0) >> 3); } else { - synhw.minimumXCoord = SYNAPTICS_DEFAULT_MIN_X; - synhw.minimumYCoord = SYNAPTICS_DEFAULT_MIN_Y; + /* + * Typical bezel limits. Taken from 'Synaptics + * PS/2 * TouchPad Interfacing Guide' p.3.2.3. + */ + synhw.minimumXCoord = 1472; + synhw.minimumYCoord = 1408; } /* @@ -6382,7 +6352,7 @@ enable_synaptics(struct psm_softc *sc, enum probearg a return (FALSE); if (get_mouse_status(kbdc, status, 0, 3) != 3) return (FALSE); - if (!SYNAPTICS_VERSION_GE(synhw, 7, 5) && status[1] != middle_byte) { + if (!SYNAPTICS_VERSION_GE(synhw, 7, 5) && status[1] != 0x47) { printf(" Failed to read mode byte\n"); return (FALSE); } @@ -7205,12 +7175,6 @@ static struct isa_pnp_id forcepad_ids[] = { { 0 } }; -/* List of HW v8.1 synaptics touchpads erroneously detected as HW v2.0 */ -static struct isa_pnp_id hpsyn81_ids[] = { - { 0x9e012e4f, "HP PS/2 trackpad port" }, /* SYN019E, EB 9470 */ - { 0 } -}; - static int create_a_copy(device_t atkbdc, device_t me) { @@ -7244,8 +7208,6 @@ psmcpnp_probe(device_t dev) if (ISA_PNP_PROBE(device_get_parent(dev), dev, forcepad_ids) == 0) sc->type = PSMCPNP_FORCEPAD; - else if(ISA_PNP_PROBE(device_get_parent(dev), dev, hpsyn81_ids) == 0) - sc->type = PSMCPNP_HPSYN81; else if (ISA_PNP_PROBE(device_get_parent(dev), dev, psmcpnp_ids) == 0) sc->type = PSMCPNP_GENERIC; else From owner-svn-src-all@freebsd.org Sat Nov 24 21:23:14 2018 Return-Path: Delivered-To: svn-src-all@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 21C301139EB4; Sat, 24 Nov 2018 21:23:14 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.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 C1CFF8CD17; Sat, 24 Nov 2018 21:23:13 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A163F13780; Sat, 24 Nov 2018 21:23:13 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAOLNDEp044770; Sat, 24 Nov 2018 21:23:13 GMT (envelope-from wulf@FreeBSD.org) Received: (from wulf@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAOLND6V044767; Sat, 24 Nov 2018 21:23:13 GMT (envelope-from wulf@FreeBSD.org) Message-Id: <201811242123.wAOLND6V044767@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: wulf set sender to wulf@FreeBSD.org using -f From: Vladimir Kondratyev Date: Sat, 24 Nov 2018 21:23:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340913 - head/sys/dev/atkbdc X-SVN-Group: head X-SVN-Commit-Author: wulf X-SVN-Commit-Paths: head/sys/dev/atkbdc X-SVN-Commit-Revision: 340913 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C1CFF8CD17 X-Spamd-Result: default: False [1.74 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.32)[0.316,0]; NEURAL_SPAM_MEDIUM(0.75)[0.746,0]; NEURAL_SPAM_LONG(0.68)[0.678,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Nov 2018 21:23:14 -0000 Author: wulf Date: Sat Nov 24 21:23:12 2018 New Revision: 340913 URL: https://svnweb.freebsd.org/changeset/base/340913 Log: psm(4): Add minimal support for active AUX port multiplexers Active PS/2 multiplexing is a method for attaching up to four PS/2 pointing devices to a computer. Enabling of multiplexed mode allows commands to be directed to individual devices using routing prefixes. Multiplexed mode reports input with each byte tagged to identify its source. This method differs from one currently supported by psm(4) where so called guest device (trackpoint) is attached to special interface located on the host device (touchpad) and latter performs guest protocol conversion to special encapsulation packet format. At present time active PS/2 multiplexing is used in some models of HP laptops e.g. EliteBook 8560w, 9470m. Enabling of absolute operation mode on such touchpads is connected with following problems: 1. Touchpad's port priority is lower than trackpoint's. That blocks information queries thus prevents touchpad detection and configuration. 2. Touchpad and trackpoint have different protocol packet sizes and sync bytes. As PS/2 usage is on decline only minimal possible set of changes to support Synaptics touchpad and generic mouses is implemented. Active multiplexing mode is enabled only at probe stage to scan through attached PS/2 devices to query and configure Synaptics touchpad. After touchpad has been configured, mux is switched back to legacy (hidden multiplexing) mode to perform normal interrupt-driven input data processing. Overflow bit values rather than tags are used to separate packets produced by different devices. Switching back to legacy mode allows to avoid psm(4) and atkbd(4) rework to support 4 instances of mouse driver. Note: While in hidden multiplexing mode KBC does some editing of the packet stream. It remembers the button bits from the last packet received from each device, and replaces the button bits of every packet with the logical OR of all devices’ most recent button bits. This sort of button crosstalk results in spurious button events which are inhibitted with various tricks. E.g. trackpoint middle button events are suppressed while trackpad surface is touched and touchpad left and right button events are suppressed if corresponding trackpoint buttons are pressed. PR: 231058 Reported by: Michael Figiel Tested by: Michael Figiel MFC after: 2 weeks Modified: head/sys/dev/atkbdc/atkbdc.c head/sys/dev/atkbdc/atkbdcreg.h head/sys/dev/atkbdc/psm.c Modified: head/sys/dev/atkbdc/atkbdc.c ============================================================================== --- head/sys/dev/atkbdc/atkbdc.c Sat Nov 24 21:17:51 2018 (r340912) +++ head/sys/dev/atkbdc/atkbdc.c Sat Nov 24 21:23:12 2018 (r340913) @@ -296,6 +296,7 @@ atkbdc_setup(atkbdc_softc_t *sc, bus_space_tag_t tag, sc->lock = FALSE; sc->kbd.head = sc->kbd.tail = 0; sc->aux.head = sc->aux.tail = 0; + sc->aux_mux_enabled = FALSE; #if KBDIO_DEBUG >= 2 sc->kbd.call_count = 0; sc->kbd.qcount = sc->kbd.max_qcount = 0; @@ -639,7 +640,12 @@ write_kbd_command(KBDC p, int c) int write_aux_command(KBDC p, int c) { - if (!write_controller_command(p, KBDC_WRITE_TO_AUX)) + int f; + + f = aux_mux_is_enabled(p) ? + KBDC_WRITE_TO_AUX_MUX + kbdcp(p)->aux_mux_port : KBDC_WRITE_TO_AUX; + + if (!write_controller_command(p, f)) return FALSE; return write_controller_data(p, c); } @@ -1200,4 +1206,79 @@ set_controller_command_byte(KBDC p, int mask, int comm command); return TRUE; +} + +/* + * Rudimentary support for active PS/2 AUX port multiplexing. + * Only write commands can be routed to a selected AUX port. + * Source port of data processed by read commands is totally ignored. + */ +static int +set_aux_mux_state(KBDC p, int enabled) +{ + int command, version; + + if (write_controller_command(p, KBDC_FORCE_AUX_OUTPUT) == 0 || + write_controller_data(p, 0xF0) == 0 || + read_controller_data(p) != 0xF0) + return (-1); + + if (write_controller_command(p, KBDC_FORCE_AUX_OUTPUT) == 0 || + write_controller_data(p, 0x56) == 0 || + read_controller_data(p) != 0x56) + return (-1); + + command = enabled ? 0xa4 : 0xa5; + if (write_controller_command(p, KBDC_FORCE_AUX_OUTPUT) == 0 || + write_controller_data(p, command) == 0 || + (version = read_controller_data(p)) == command) + return (-1); + + return (version); +} + +int +set_active_aux_mux_port(KBDC p, int port) +{ + + if (!aux_mux_is_enabled(p)) + return (FALSE); + + if (port < 0 || port >= KBDC_AUX_MUX_NUM_PORTS) + return (FALSE); + + kbdcp(p)->aux_mux_port = port; + + return (TRUE); +} + +/* Checks for active multiplexing support and enables it */ +int +enable_aux_mux(KBDC p) +{ + int version; + + version = set_aux_mux_state(p, TRUE); + if (version >= 0) { + kbdcp(p)->aux_mux_enabled = TRUE; + set_active_aux_mux_port(p, 0); + } + + return (version); +} + +int +disable_aux_mux(KBDC p) +{ + + kbdcp(p)->aux_mux_enabled = FALSE; + + return (set_aux_mux_state(p, FALSE)); +} + +int +aux_mux_is_enabled(KBDC p) +{ + + return (kbdcp(p)->aux_mux_enabled); } Modified: head/sys/dev/atkbdc/atkbdcreg.h ============================================================================== --- head/sys/dev/atkbdc/atkbdcreg.h Sat Nov 24 21:17:51 2018 (r340912) +++ head/sys/dev/atkbdc/atkbdcreg.h Sat Nov 24 21:23:12 2018 (r340913) @@ -51,6 +51,8 @@ /* controller commands (sent to KBD_COMMAND_PORT) */ #define KBDC_SET_COMMAND_BYTE 0x0060 #define KBDC_GET_COMMAND_BYTE 0x0020 +#define KBDC_WRITE_TO_AUX_MUX 0x0090 +#define KBDC_FORCE_AUX_OUTPUT 0x00d3 #define KBDC_WRITE_TO_AUX 0x00d4 #define KBDC_DISABLE_AUX_PORT 0x00a7 #define KBDC_ENABLE_AUX_PORT 0x00a8 @@ -209,6 +211,8 @@ typedef struct atkbdc_softc { #define KBDC_QUIRK_IGNORE_PROBE_RESULT (1 << 1) #define KBDC_QUIRK_RESET_AFTER_PROBE (1 << 2) #define KBDC_QUIRK_SETLEDS_ON_INIT (1 << 3) + int aux_mux_enabled; /* active PS/2 multiplexing is enabled */ + int aux_mux_port; /* current aux mux port */ } atkbdc_softc_t; enum kbdc_device_ivar { @@ -223,6 +227,8 @@ typedef caddr_t KBDC; #define KBDC_RID_KBD 0 #define KBDC_RID_AUX 1 +#define KBDC_AUX_MUX_NUM_PORTS 4 + /* function prototypes */ atkbdc_softc_t *atkbdc_get_softc(int unit); @@ -267,6 +273,11 @@ void kbdc_set_device_mask(KBDC kbdc, int mask); int get_controller_command_byte(KBDC kbdc); int set_controller_command_byte(KBDC kbdc, int command, int flag); + +int set_active_aux_mux_port(KBDC p, int port); +int enable_aux_mux(KBDC p); +int disable_aux_mux(KBDC p); +int aux_mux_is_enabled(KBDC p); #endif /* _KERNEL */ Modified: head/sys/dev/atkbdc/psm.c ============================================================================== --- head/sys/dev/atkbdc/psm.c Sat Nov 24 21:17:51 2018 (r340912) +++ head/sys/dev/atkbdc/psm.c Sat Nov 24 21:23:12 2018 (r340913) @@ -150,6 +150,9 @@ struct psmcpnp_softc { #define PSM_LEVEL_MIN PSM_LEVEL_BASE #define PSM_LEVEL_MAX PSM_LEVEL_NATIVE +/* Active PS/2 multiplexing */ +#define PSM_NOMUX (-1) + /* Logitech PS2++ protocol */ #define MOUSE_PS2PLUS_CHECKBITS(b) \ ((((b[2] & 0x03) << 2) | 0x02) == (b[1] & 0x0f)) @@ -438,6 +441,11 @@ struct psm_softc { /* Driver status information */ int cmdcount; struct sigio *async; /* Processes waiting for SIGIO */ int extended_buttons; + int muxport; /* MUX port with attached Synaptics */ + u_char muxsave[3]; /* 3->6 byte proto conversion buffer */ + int muxtpbuttons; /* Touchpad button state */ + int muxmsbuttons; /* Mouse (trackpoint) button state */ + struct timeval muxmidtimeout; /* middle button supression timeout */ #ifdef EVDEV_SUPPORT struct evdev_dev *evdev_a; /* Absolute reporting device */ struct evdev_dev *evdev_r; /* Relative reporting device */ @@ -603,6 +611,7 @@ static void proc_mmanplus(struct psm_softc *, packetbu mousestatus_t *, int *, int *, int *); static int proc_synaptics(struct psm_softc *, packetbuf_t *, mousestatus_t *, int *, int *, int *); +static int proc_synaptics_mux(struct psm_softc *, packetbuf_t *); static void proc_versapad(struct psm_softc *, packetbuf_t *, mousestatus_t *, int *, int *, int *); static int proc_elantech(struct psm_softc *, packetbuf_t *, @@ -632,6 +641,7 @@ static probefunc_t enable_4dmouse; static probefunc_t enable_4dplus; static probefunc_t enable_mmanplus; static probefunc_t enable_synaptics; +static probefunc_t enable_synaptics_mux; static probefunc_t enable_trackpoint; static probefunc_t enable_versapad; static probefunc_t enable_elantech; @@ -652,6 +662,8 @@ static struct { * WARNING: the order of probe is very important. Don't mess it * unless you know what you are doing. */ + { MOUSE_MODEL_SYNAPTICS, /* Synaptics Touchpad on Active Mux */ + 0x00, MOUSE_PS2_PACKETSIZE, enable_synaptics_mux }, { MOUSE_MODEL_NET, /* Genius NetMouse */ 0x08, MOUSE_PS2INTELLI_PACKETSIZE, enable_gmouse }, { MOUSE_MODEL_NETSCROLL, /* Genius NetScroll */ @@ -1082,6 +1094,7 @@ static int doopen(struct psm_softc *sc, int command_byte) { int stat[3]; + int mux_enabled = FALSE; /* * FIXME: Synaptics TouchPad seems to go back to Relative Mode with @@ -1096,6 +1109,15 @@ doopen(struct psm_softc *sc, int command_byte) * doesn't show any evidence of such a command. */ if (sc->hw.model == MOUSE_MODEL_SYNAPTICS) { + if (sc->muxport != PSM_NOMUX) { + mux_enabled = enable_aux_mux(sc->kbdc) >= 0; + if (mux_enabled) + set_active_aux_mux_port(sc->kbdc, sc->muxport); + else + log(LOG_ERR, "psm%d: failed to enable " + "active multiplexing mode.\n", + sc->unit); + } mouse_ext_command(sc->kbdc, 1); get_mouse_status(sc->kbdc, stat, 0, 3); if ((SYNAPTICS_VERSION_GE(sc->synhw, 7, 5) || @@ -1106,6 +1128,8 @@ doopen(struct psm_softc *sc, int command_byte) "hopefully restored\n", sc->unit)); } + if (mux_enabled) + disable_aux_mux(sc->kbdc); } /* @@ -1354,6 +1378,7 @@ psmprobe(device_t dev) #endif #endif /* PSM_HOOKRESUME | PSM_HOOKAPM */ sc->flags = 0; + sc->muxport = PSM_NOMUX; if (bootverbose) ++verbose; @@ -1823,7 +1848,7 @@ psm_register_synaptics(device_t dev) evdev_support_key(evdev_a, BTN_0 + i); error = evdev_register_mtx(evdev_a, &Giant); - if (!error && sc->synhw.capPassthrough) { + if (!error && (sc->synhw.capPassthrough || sc->muxport != PSM_NOMUX)) { guest_model = sc->tpinfo.sysctl_tree != NULL ? MOUSE_MODEL_TRACKPOINT : MOUSE_MODEL_GENERIC; error = psm_register(dev, guest_model); @@ -2931,6 +2956,9 @@ psmintr(void *arg) int c; packetbuf_t *pb; + if (aux_mux_is_enabled(sc->kbdc)) + VLOG(2, (LOG_DEBUG, "psmintr: active multiplexing mode is not " + "supported!\n")); /* read until there is nothing to read */ while((c = read_aux_data_no_wait(sc->kbdc)) != -1) { @@ -3282,7 +3310,7 @@ proc_synaptics(struct psm_softc *sc, packetbuf_t *pb, * Handle packets from the guest device. See: * Synaptics PS/2 TouchPad Interfacing Guide, Section 5.1 */ - if (sc->synhw.capPassthrough) { + if (sc->synhw.capPassthrough || sc->muxport != PSM_NOMUX) { *x = ((pb->ipacket[1] & 0x10) ? pb->ipacket[4] - 256 : pb->ipacket[4]); *y = ((pb->ipacket[1] & 0x20) ? @@ -3582,6 +3610,83 @@ SYNAPTICS_END: } static int +proc_synaptics_mux(struct psm_softc *sc, packetbuf_t *pb) +{ + int butt; + + /* + * Convert 3-byte interleaved mixture of Synaptics and generic mouse + * packets into plain 6-byte Synaptics packet protocol. + * While in hidden multiplexing mode KBC does some editing of the + * packet stream. It remembers the button bits from the last packet + * received from each device, and replaces the button bits of every + * packet with the logical OR of all devices’ most recent button bits. + * This button crosstalk should be filtered out as Synaptics and + * generic mouse encode middle button presses in a different way. + */ + switch (pb->ipacket[0] & 0xc0) { + case 0x80: /* First 3 bytes of Synaptics packet */ + bcopy(pb->ipacket, sc->muxsave, 3); + /* Compute middle mouse button supression timeout. */ + sc->muxmidtimeout.tv_sec = 0; + sc->muxmidtimeout.tv_usec = 50000; /* ~2-3 ints */ + timevaladd(&sc->muxmidtimeout, &sc->lastsoftintr); + return (1); + + case 0xc0: /* Second 3 bytes of Synaptics packet */ + /* Join two 3-bytes absolute packets */ + bcopy(pb->ipacket, pb->ipacket + 3, 3); + bcopy(sc->muxsave, pb->ipacket, 3); + /* Prefer trackpoint buttons over touchpad's */ + pb->ipacket[0] &= ~(0x08 | sc->muxmsbuttons); + pb->ipacket[3] &= ~(0x08 | sc->muxmsbuttons); + butt = (pb->ipacket[3] & 0x03) << 2 | (pb->ipacket[0] & 0x03); + /* Add hysteresis to remove spurious middle button events */ + if (butt != sc->muxtpbuttons && sc->fpcount < 1) { + pb->ipacket[0] &= 0xfc; + pb->ipacket[0] |= sc->muxtpbuttons & 0x03; + pb->ipacket[3] &= 0xfc; + pb->ipacket[3] |= sc->muxtpbuttons >> 2 & 0x03; + ++sc->fpcount; + } else { + sc->fpcount = 0; + sc->muxtpbuttons = butt; + } + /* Filter out impossible w induced by middle trackpoint btn */ + if (sc->synhw.capExtended && !sc->synhw.capPassthrough && + (pb->ipacket[0] & 0x34) == 0x04 && + (pb->ipacket[3] & 0x04) == 0x04) { + pb->ipacket[0] &= 0xfb; + pb->ipacket[3] &= 0xfb; + } + sc->muxsave[0] &= 0x30; + break; + + default: /* Generic mouse (Trackpoint) packet */ + /* Filter out middle button events induced by some w values */ + if (sc->muxmsbuttons & 0x03 || pb->ipacket[0] & 0x03 || + (timevalcmp(&sc->lastsoftintr, &sc->muxmidtimeout, <=) && + (sc->muxsave[0] & 0x30 || sc->muxsave[2] > 8))) + pb->ipacket[0] &= 0xfb; + sc->muxmsbuttons = pb->ipacket[0] & 0x07; + /* Convert to Synaptics pass-through protocol */ + pb->ipacket[4] = pb->ipacket[1]; + pb->ipacket[5] = pb->ipacket[2]; + pb->ipacket[1] = pb->ipacket[0]; + pb->ipacket[2] = 0; + pb->ipacket[0] = 0x84 | (sc->muxtpbuttons & 0x03); + pb->ipacket[3] = 0xc4 | (sc->muxtpbuttons >> 2 & 0x03); + } + + VLOG(4, (LOG_DEBUG, "synaptics: %02x %02x %02x %02x %02x %02x\n", + pb->ipacket[0], pb->ipacket[1], pb->ipacket[2], + pb->ipacket[3], pb->ipacket[4], pb->ipacket[5])); + + pb->inputbytes = MOUSE_SYNAPTICS_PACKETSIZE; + return (0); +} + +static int psmpalmdetect(struct psm_softc *sc, finger_t *f, int nfingers) { if (!( @@ -4919,6 +5024,10 @@ psmsoftintr(void *arg) break; case MOUSE_MODEL_SYNAPTICS: + if (pb->inputbytes == MOUSE_PS2_PACKETSIZE) + if (proc_synaptics_mux(sc, pb)) + goto next; + if (proc_synaptics(sc, pb, &ms, &x, &y, &z) != 0) { VLOG(3, (LOG_DEBUG, "synaptics: " "packet rejected\n")); @@ -6027,6 +6136,60 @@ synaptics_set_mode(struct psm_softc *sc, int mode_byte mouse_ext_command(sc->kbdc, 3); set_mouse_sampling_rate(sc->kbdc, 0xc8); } +} + +/* + * AUX MUX detection code should be placed at very beginning of probe sequence + * at least before 4-byte protocol mouse probes e.g. MS IntelliMouse probe as + * latter can trigger switching the MUX to incompatible state. + */ +static int +enable_synaptics_mux(struct psm_softc *sc, enum probearg arg) +{ + KBDC kbdc = sc->kbdc; + int port, version; + int probe = FALSE; + int active_ports_count = 0; + int active_ports_mask = 0; + + version = enable_aux_mux(kbdc); + if (version == -1) + return (FALSE); + + for (port = 0; port < KBDC_AUX_MUX_NUM_PORTS; port++) { + VLOG(3, (LOG_DEBUG, "aux_mux: ping port %d\n", port)); + set_active_aux_mux_port(kbdc, port); + if (enable_aux_dev(kbdc) && disable_aux_dev(kbdc)) { + active_ports_count++; + active_ports_mask |= 1 << port; + } + } + + if (verbose >= 2) + printf("Active Multiplexing PS/2 controller v%d.%d with %d " + "active port(s)\n", version >> 4 & 0x0f, version & 0x0f, + active_ports_count); + + /* psm has a special support for GenMouse + SynTouchpad combination */ + if (active_ports_count >= 2) { + for (port = 0; port < KBDC_AUX_MUX_NUM_PORTS; port++) { + if ((active_ports_mask & 1 << port) == 0) + continue; + VLOG(3, (LOG_DEBUG, "aux_mux: probe port %d\n", port)); + set_active_aux_mux_port(kbdc, port); + probe = enable_synaptics(sc, arg); + if (probe) { + if (arg == PROBE) + sc->muxport = port; + break; + } + } + } + + /* IRQ handler does not support active multiplexing mode */ + disable_aux_mux(kbdc); + + return (probe); } static int From owner-svn-src-all@freebsd.org Sat Nov 24 21:52:11 2018 Return-Path: Delivered-To: svn-src-all@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 9F9CF113AE8B; Sat, 24 Nov 2018 21:52:11 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.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 456088DEDA; Sat, 24 Nov 2018 21:52:11 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 27EB113B6A; Sat, 24 Nov 2018 21:52:11 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAOLqAsu060245; Sat, 24 Nov 2018 21:52:10 GMT (envelope-from alc@FreeBSD.org) Received: (from alc@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAOLqAD6060244; Sat, 24 Nov 2018 21:52:10 GMT (envelope-from alc@FreeBSD.org) Message-Id: <201811242152.wAOLqAD6060244@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: alc set sender to alc@FreeBSD.org using -f From: Alan Cox Date: Sat, 24 Nov 2018 21:52:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340914 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: alc X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 340914 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 456088DEDA X-Spamd-Result: default: False [1.65 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.64)[0.643,0]; NEURAL_SPAM_MEDIUM(0.71)[0.712,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.30)[0.299,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Nov 2018 21:52:11 -0000 Author: alc Date: Sat Nov 24 21:52:10 2018 New Revision: 340914 URL: https://svnweb.freebsd.org/changeset/base/340914 Log: blist_meta_alloc assumes that mask=scan->bm_bitmap is nonzero. But if the cursor lies in the middle of the space that the meta node represents, then blanking the low bits of mask may make it zero, and break later code that expects a nonzero value. Add a test that returns failure if the mask has been cleared. Submitted by: Doug Moore Reported by: pho Tested by: pho X-MFC with: r340402 Differential Revision: https://reviews.freebsd.org/D18058 Modified: head/sys/kern/subr_blist.c Modified: head/sys/kern/subr_blist.c ============================================================================== --- head/sys/kern/subr_blist.c Sat Nov 24 21:23:12 2018 (r340913) +++ head/sys/kern/subr_blist.c Sat Nov 24 21:52:10 2018 (r340914) @@ -764,6 +764,8 @@ blst_meta_alloc(blmeta_t *scan, daddr_t cursor, daddr_ /* Discard any candidates that appear before cursor. */ digit = (cursor / radix) & BLIST_META_MASK; mask &= (u_daddr_t)-1 << digit; + if (mask == 0) + return (SWAPBLK_NONE); /* * If the first try is for a block that includes the cursor, pre-undo