CVS commit: src/sys/arch/x86/x86
Module Name:src Committed By: christos Date: Thu Apr 9 02:07:01 UTC 2020 Modified Files: src/sys/arch/x86/x86: identcpu.c Log Message: flip the comparison again To generate a diff of this commit: cvs rdiff -u -r1.104 -r1.105 src/sys/arch/x86/x86/identcpu.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/x86/x86/identcpu.c diff -u src/sys/arch/x86/x86/identcpu.c:1.104 src/sys/arch/x86/x86/identcpu.c:1.105 --- src/sys/arch/x86/x86/identcpu.c:1.104 Wed Apr 8 21:55:58 2020 +++ src/sys/arch/x86/x86/identcpu.c Wed Apr 8 22:07:01 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: identcpu.c,v 1.104 2020/04/09 01:55:58 christos Exp $ */ +/* $NetBSD: identcpu.c,v 1.105 2020/04/09 02:07:01 christos Exp $ */ /*- * Copyright (c) 1999, 2000, 2001, 2006, 2007, 2008 The NetBSD Foundation, Inc. @@ -30,7 +30,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: identcpu.c,v 1.104 2020/04/09 01:55:58 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: identcpu.c,v 1.105 2020/04/09 02:07:01 christos Exp $"); #include "opt_xen.h" @@ -750,7 +750,7 @@ cpu_probe_vortex86(struct cpu_info *ci) static const char *cpu_vortex86_flavor[] = { "??", "SX", "DX", "MX", "DX2", "MX+", "DX3", "EX", "EX2", }; - idx = __arraycount(cpu_vortex86_flavor) < idx ? idx : 0; + idx = idx < __arraycount(cpu_vortex86_flavor) ? idx : 0; snprintf(cpu_brand_string, sizeof(cpu_brand_string), "Vortex86%s", cpu_vortex86_flavor[idx]);
CVS commit: src/sys/arch/x86/x86
Module Name:src Committed By: christos Date: Thu Apr 9 01:55:58 UTC 2020 Modified Files: src/sys/arch/x86/x86: identcpu.c Log Message: use __arraycount, and fix comparison To generate a diff of this commit: cvs rdiff -u -r1.103 -r1.104 src/sys/arch/x86/x86/identcpu.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/x86/x86/identcpu.c diff -u src/sys/arch/x86/x86/identcpu.c:1.103 src/sys/arch/x86/x86/identcpu.c:1.104 --- src/sys/arch/x86/x86/identcpu.c:1.103 Wed Apr 8 21:49:26 2020 +++ src/sys/arch/x86/x86/identcpu.c Wed Apr 8 21:55:58 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: identcpu.c,v 1.103 2020/04/09 01:49:26 christos Exp $ */ +/* $NetBSD: identcpu.c,v 1.104 2020/04/09 01:55:58 christos Exp $ */ /*- * Copyright (c) 1999, 2000, 2001, 2006, 2007, 2008 The NetBSD Foundation, Inc. @@ -30,7 +30,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: identcpu.c,v 1.103 2020/04/09 01:49:26 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: identcpu.c,v 1.104 2020/04/09 01:55:58 christos Exp $"); #include "opt_xen.h" @@ -750,7 +750,7 @@ cpu_probe_vortex86(struct cpu_info *ci) static const char *cpu_vortex86_flavor[] = { "??", "SX", "DX", "MX", "DX2", "MX+", "DX3", "EX", "EX2", }; - idx = sizeof(cpu_vortex86_flavor) > idx ? idx : 0; + idx = __arraycount(cpu_vortex86_flavor) < idx ? idx : 0; snprintf(cpu_brand_string, sizeof(cpu_brand_string), "Vortex86%s", cpu_vortex86_flavor[idx]);
CVS commit: src/sys/arch/x86/x86
Module Name:src Committed By: christos Date: Thu Apr 9 01:49:26 UTC 2020 Modified Files: src/sys/arch/x86/x86: identcpu.c Log Message: Add EX2 for Vortex86 SoCs (Andrius V) To generate a diff of this commit: cvs rdiff -u -r1.102 -r1.103 src/sys/arch/x86/x86/identcpu.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/x86/x86/identcpu.c diff -u src/sys/arch/x86/x86/identcpu.c:1.102 src/sys/arch/x86/x86/identcpu.c:1.103 --- src/sys/arch/x86/x86/identcpu.c:1.102 Sat Apr 4 10:49:35 2020 +++ src/sys/arch/x86/x86/identcpu.c Wed Apr 8 21:49:26 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: identcpu.c,v 1.102 2020/04/04 14:49:35 ad Exp $ */ +/* $NetBSD: identcpu.c,v 1.103 2020/04/09 01:49:26 christos Exp $ */ /*- * Copyright (c) 1999, 2000, 2001, 2006, 2007, 2008 The NetBSD Foundation, Inc. @@ -30,7 +30,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: identcpu.c,v 1.102 2020/04/04 14:49:35 ad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: identcpu.c,v 1.103 2020/04/09 01:49:26 christos Exp $"); #include "opt_xen.h" @@ -727,7 +727,7 @@ cpu_probe_vortex86(struct cpu_info *ci) #define PCI_MODE1_DATA_REG 0x0cfc #define PCI_MODE1_ENABLE 0x8000UL - uint32_t reg; + uint32_t reg, idx; if (cpu_vendor != CPUVENDOR_VORTEX86) return; @@ -741,17 +741,18 @@ cpu_probe_vortex86(struct cpu_info *ci) outl(PCI_MODE1_ADDRESS_REG, PCI_MODE1_ENABLE | 0x90); reg = inl(PCI_MODE1_DATA_REG); - if ((reg & 0xf8ff) != 0x30504d44) { - reg = 0; + if ((reg & 0xf0ff) != 0x30504d44) { + idx = 0; } else { - reg = (reg >> 24) & 7; + idx = (reg >> 24) & 0xf; } static const char *cpu_vortex86_flavor[] = { - "??", "SX", "DX", "MX", "DX2", "MX+", "DX3", "EX", + "??", "SX", "DX", "MX", "DX2", "MX+", "DX3", "EX", "EX2", }; + idx = sizeof(cpu_vortex86_flavor) > idx ? idx : 0; snprintf(cpu_brand_string, sizeof(cpu_brand_string), "Vortex86%s", - cpu_vortex86_flavor[reg]); + cpu_vortex86_flavor[idx]); #undef PCI_MODE1_ENABLE #undef PCI_MODE1_ADDRESS_REG
CVS commit: src/share/man/man4
Module Name:src Committed By: jdolecek Date: Wed Apr 8 23:01:52 UTC 2020 Modified Files: src/share/man/man4: wm.4 Log Message: add a warning in checksum offload that hardware TCP segmentation might be slow on I219 I observe about 35% transmit performance drop when tso4 enabled To generate a diff of this commit: cvs rdiff -u -r1.40 -r1.41 src/share/man/man4/wm.4 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/share/man/man4/wm.4 diff -u src/share/man/man4/wm.4:1.40 src/share/man/man4/wm.4:1.41 --- src/share/man/man4/wm.4:1.40 Fri Apr 13 06:04:12 2018 +++ src/share/man/man4/wm.4 Wed Apr 8 23:01:51 2020 @@ -1,4 +1,4 @@ -.\" $NetBSD: wm.4,v 1.40 2018/04/13 06:04:12 msaitoh Exp $ +.\" $NetBSD: wm.4,v 1.41 2020/04/08 23:01:51 jdolecek Exp $ .\" .\" Copyright 2002, 2003 Wasabi Systems, Inc. .\" All rights reserved. @@ -33,7 +33,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.Dd April 13, 2018 +.Dd April 9, 2020 .Dt WM 4 .Os .Sh NAME @@ -167,6 +167,8 @@ in hardware. The .Nm driver supports these features of the chip. +At least for some chips (e.g. I219) hardware TCP segmentation is slow, +and slows down transmit performance when turned on. See .Xr ifconfig 8 for information on how to enable this feature.
CVS commit: src/sys/dev/pci
Module Name:src Committed By: jdolecek Date: Wed Apr 8 21:57:24 UTC 2020 Modified Files: src/sys/dev/pci: if_wm.c Log Message: wm_tx_offload() and wm_nq_tx_offload() actually always return 0, make them return void and remove the check for their return value To generate a diff of this commit: cvs rdiff -u -r1.672 -r1.673 src/sys/dev/pci/if_wm.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/pci/if_wm.c diff -u src/sys/dev/pci/if_wm.c:1.672 src/sys/dev/pci/if_wm.c:1.673 --- src/sys/dev/pci/if_wm.c:1.672 Wed Apr 8 21:56:01 2020 +++ src/sys/dev/pci/if_wm.c Wed Apr 8 21:57:24 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: if_wm.c,v 1.672 2020/04/08 21:56:01 jdolecek Exp $ */ +/* $NetBSD: if_wm.c,v 1.673 2020/04/08 21:57:24 jdolecek Exp $ */ /* * Copyright (c) 2001, 2002, 2003, 2004 Wasabi Systems, Inc. @@ -82,7 +82,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.672 2020/04/08 21:56:01 jdolecek Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.673 2020/04/08 21:57:24 jdolecek Exp $"); #ifdef _KERNEL_OPT #include "opt_net_mpsafe.h" @@ -795,7 +795,7 @@ static int wm_alloc_txrx_queues(struct w static void wm_free_txrx_queues(struct wm_softc *); static int wm_init_txrx_queues(struct wm_softc *); /* Start */ -static int wm_tx_offload(struct wm_softc *, struct wm_txqueue *, +static void wm_tx_offload(struct wm_softc *, struct wm_txqueue *, struct wm_txsoft *, uint32_t *, uint8_t *); static inline int wm_select_txqueue(struct ifnet *, struct mbuf *); static void wm_start(struct ifnet *); @@ -804,7 +804,7 @@ static int wm_transmit(struct ifnet *, s static void wm_transmit_locked(struct ifnet *, struct wm_txqueue *); static void wm_send_common_locked(struct ifnet *, struct wm_txqueue *, bool); -static int wm_nq_tx_offload(struct wm_softc *, struct wm_txqueue *, +static void wm_nq_tx_offload(struct wm_softc *, struct wm_txqueue *, struct wm_txsoft *, uint32_t *, uint32_t *, bool *); static void wm_nq_start(struct ifnet *); static void wm_nq_start_locked(struct ifnet *); @@ -7373,7 +7373,7 @@ wm_init_txrx_queues(struct wm_softc *sc) * Set up TCP/IP checksumming parameters for the * specified packet. */ -static int +static void wm_tx_offload(struct wm_softc *sc, struct wm_txqueue *txq, struct wm_txsoft *txs, uint32_t *cmdp, uint8_t *fieldsp) { @@ -7408,7 +7408,7 @@ wm_tx_offload(struct wm_softc *sc, struc txq->txq_last_hw_tucs = 0; *fieldsp = 0; *cmdp = 0; - return 0; + return; } if ((m0->m_pkthdr.csum_flags & @@ -7577,7 +7577,7 @@ wm_tx_offload(struct wm_softc *sc, struc txq->txq_last_hw_ipcs == (ipcs & 0x) && txq->txq_last_hw_tucs == (tucs & 0x)) { WM_Q_EVCNT_INCR(txq, skipcontext); - return 0; + return; } } @@ -7597,8 +7597,6 @@ wm_tx_offload(struct wm_softc *sc, struc txq->txq_next = WM_NEXTTX(txq, txq->txq_next); txs->txs_ndesc++; - - return 0; } static inline int @@ -7875,12 +7873,7 @@ retry: (M_CSUM_TSOv4 | M_CSUM_TSOv6 | M_CSUM_IPv4 | M_CSUM_TCPv4 | M_CSUM_UDPv4 | M_CSUM_TCPv6 | M_CSUM_UDPv6)) { - if (wm_tx_offload(sc, txq, txs, , - ) != 0) { -/* Error message already displayed. */ -bus_dmamap_unload(sc->sc_dmat, dmamap); -continue; - } + wm_tx_offload(sc, txq, txs, , ); } else { txq->txq_last_hw_cmd = txq->txq_last_hw_fields = 0; txq->txq_last_hw_ipcs = txq->txq_last_hw_tucs = 0; @@ -8014,7 +8007,7 @@ retry: * Set up TCP/IP checksumming parameters for the * specified packet, for NEWQUEUE devices */ -static int +static void wm_nq_tx_offload(struct wm_softc *sc, struct wm_txqueue *txq, struct wm_txsoft *txs, uint32_t *cmdlenp, uint32_t *fieldsp, bool *do_csum) { @@ -8044,7 +8037,7 @@ wm_nq_tx_offload(struct wm_softc *sc, st default: /* Don't support this protocol or encapsulation. */ *do_csum = false; - return 0; + return; } *do_csum = true; *cmdlenp = NQTX_DTYP_D | NQTX_CMD_DEXT | NQTX_CMD_IFCS; @@ -8210,7 +8203,6 @@ wm_nq_tx_offload(struct wm_softc *sc, st DPRINTF(WM_DEBUG_TX, ("\t0x%08x%08x\n", mssidx, cmdc)); txq->txq_next = WM_NEXTTX(txq, txq->txq_next); txs->txs_ndesc++; - return 0; } /* @@ -8444,12 +8436,8 @@ retry: (M_CSUM_TSOv4 | M_CSUM_TSOv6 | M_CSUM_IPv4 | M_CSUM_TCPv4 | M_CSUM_UDPv4 | M_CSUM_TCPv6 | M_CSUM_UDPv6)) { - if (wm_nq_tx_offload(sc, txq, txs, , , - _csum) != 0) { -/* Error message already displayed. */ -bus_dmamap_unload(sc->sc_dmat, dmamap); -continue; - } + wm_nq_tx_offload(sc, txq, txs, , , + _csum); } else { do_csum = false; cmdlen = 0;
CVS commit: src/sys/dev/pci
Module Name:src Committed By: jdolecek Date: Wed Apr 8 21:56:02 UTC 2020 Modified Files: src/sys/dev/pci: if_wm.c Log Message: fixup field names in previous To generate a diff of this commit: cvs rdiff -u -r1.671 -r1.672 src/sys/dev/pci/if_wm.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/pci/if_wm.c diff -u src/sys/dev/pci/if_wm.c:1.671 src/sys/dev/pci/if_wm.c:1.672 --- src/sys/dev/pci/if_wm.c:1.671 Wed Apr 8 21:51:42 2020 +++ src/sys/dev/pci/if_wm.c Wed Apr 8 21:56:01 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: if_wm.c,v 1.671 2020/04/08 21:51:42 jdolecek Exp $ */ +/* $NetBSD: if_wm.c,v 1.672 2020/04/08 21:56:01 jdolecek Exp $ */ /* * Copyright (c) 2001, 2002, 2003, 2004 Wasabi Systems, Inc. @@ -82,7 +82,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.671 2020/04/08 21:51:42 jdolecek Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.672 2020/04/08 21:56:01 jdolecek Exp $"); #ifdef _KERNEL_OPT #include "opt_net_mpsafe.h" @@ -7403,7 +7403,7 @@ wm_tx_offload(struct wm_softc *sc, struc default: /* Don't support this protocol or encapsulation. */ - txq->txq_last_hw_cmd = txq->last_hw_fields = 0; + txq->txq_last_hw_cmd = txq->txq_last_hw_fields = 0; txq->txq_last_hw_ipcs = 0; txq->txq_last_hw_tucs = 0; *fieldsp = 0; @@ -7882,8 +7882,8 @@ retry: continue; } } else { - txq->txq_last_hw_cmd = txq->last_hw_fields = 0; - txq->txq_last_hw_ipcs = txq->last_hw_tucs = 0; + txq->txq_last_hw_cmd = txq->txq_last_hw_fields = 0; + txq->txq_last_hw_ipcs = txq->txq_last_hw_tucs = 0; cksumcmd = 0; cksumfields = 0; }
CVS commit: src/sys/dev/pci
Module Name:src Committed By: jdolecek Date: Wed Apr 8 21:51:43 UTC 2020 Modified Files: src/sys/dev/pci: if_wm.c Log Message: actually writing always the checksum offload context descriptor makes the hw do extra processing, avoid doing that if possible - on my computer with I219 this results in about 2% speedup in Tx performance change adoped from FreeBSD XXX should be also done for multiqueue case, but I don't have hw to test it To generate a diff of this commit: cvs rdiff -u -r1.670 -r1.671 src/sys/dev/pci/if_wm.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/pci/if_wm.c diff -u src/sys/dev/pci/if_wm.c:1.670 src/sys/dev/pci/if_wm.c:1.671 --- src/sys/dev/pci/if_wm.c:1.670 Sat Mar 21 16:47:05 2020 +++ src/sys/dev/pci/if_wm.c Wed Apr 8 21:51:42 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: if_wm.c,v 1.670 2020/03/21 16:47:05 thorpej Exp $ */ +/* $NetBSD: if_wm.c,v 1.671 2020/04/08 21:51:42 jdolecek Exp $ */ /* * Copyright (c) 2001, 2002, 2003, 2004 Wasabi Systems, Inc. @@ -82,7 +82,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.670 2020/03/21 16:47:05 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.671 2020/04/08 21:51:42 jdolecek Exp $"); #ifdef _KERNEL_OPT #include "opt_net_mpsafe.h" @@ -379,6 +379,12 @@ struct wm_txqueue { bool txq_sending; time_t txq_lastsent; + /* Checksum flags used for previous packet */ + uint32_t txq_last_hw_cmd; + uint8_t txq_last_hw_fields; + uint16_t txq_last_hw_ipcs; + uint16_t txq_last_hw_tucs; + uint32_t txq_packets; /* for AIM */ uint32_t txq_bytes; /* for AIM */ #ifdef WM_EVENT_COUNTERS @@ -403,6 +409,7 @@ struct wm_txqueue { WM_Q_EVCNT_DEFINE(txq, toomanyseg) /* Pkt dropped(toomany DMA segs) */ WM_Q_EVCNT_DEFINE(txq, defrag) /* m_defrag() */ WM_Q_EVCNT_DEFINE(txq, underrun)/* Tx underrun */ + WM_Q_EVCNT_DEFINE(txq, skipcontext) /* Tx skip wring cksum context */ char txq_txseg_evcnt_names[WM_NTXSEGS][sizeof("txqXXtxsegXXX")]; struct evcnt txq_ev_txseg[WM_NTXSEGS]; /* Tx packets w/ N segments */ @@ -6947,6 +6954,7 @@ wm_alloc_txrx_queues(struct wm_softc *sc WM_Q_MISC_EVCNT_ATTACH(txq, toomanyseg, txq, i, xname); WM_Q_MISC_EVCNT_ATTACH(txq, defrag, txq, i, xname); WM_Q_MISC_EVCNT_ATTACH(txq, underrun, txq, i, xname); + WM_Q_MISC_EVCNT_ATTACH(txq, skipcontext, txq, i, xname); #endif /* WM_EVENT_COUNTERS */ tx_done++; @@ -7079,6 +7087,7 @@ wm_free_txrx_queues(struct wm_softc *sc) WM_Q_EVCNT_DETACH(txq, toomanyseg, txq, i); WM_Q_EVCNT_DETACH(txq, defrag, txq, i); WM_Q_EVCNT_DETACH(txq, underrun, txq, i); + WM_Q_EVCNT_DETACH(txq, skipcontext, txq, i); #endif /* WM_EVENT_COUNTERS */ /* Drain txq_interq */ @@ -7394,6 +7403,9 @@ wm_tx_offload(struct wm_softc *sc, struc default: /* Don't support this protocol or encapsulation. */ + txq->txq_last_hw_cmd = txq->last_hw_fields = 0; + txq->txq_last_hw_ipcs = 0; + txq->txq_last_hw_tucs = 0; *fieldsp = 0; *cmdp = 0; return 0; @@ -7533,13 +7545,47 @@ wm_tx_offload(struct wm_softc *sc, struc WTX_TCPIP_TUCSE(0) /* Rest of packet */; } + *cmdp = cmd; + *fieldsp = fields; + /* * We don't have to write context descriptor for every packet * except for 82574. For 82574, we must write context descriptor * for every packet when we use two descriptor queues. - * It would be overhead to write context descriptor for every packet, - * however it does not cause problems. - */ + * + * The 82574L can only remember the *last* context used + * regardless of queue that it was use for. We cannot reuse + * contexts on this hardware platform and must generate a new + * context every time. 82574L hardware spec, section 7.2.6, + * second note. + * + * Setting up new checksum offload context for every + * frames takes a lot of processing time for hardware. + * This also reduces performance a lot for small sized + * frames so avoid it if driver can use previously + * configured checksum offload context. + * For TSO, in theory we can use the same TSO context if and only if + * frame is the same type(IP/TCP) and the same MSS. However + * checking whether a frame has the same IP/TCP structure is + * hard thing so just ignore that and always restablish a + * new TSO context. + */ + KASSERT(!wm_is_using_multiqueue(sc)); + if ((m0->m_pkthdr.csum_flags & (M_CSUM_TSOv4 | M_CSUM_TSOv6)) == 0) { + if (txq->txq_last_hw_cmd == cmd && + txq->txq_last_hw_fields == fields && + txq->txq_last_hw_ipcs == (ipcs & 0x) && + txq->txq_last_hw_tucs == (tucs & 0x)) { + WM_Q_EVCNT_INCR(txq, skipcontext); + return 0; + } + } + + txq->txq_last_hw_cmd = cmd; + txq->txq_last_hw_fields = fields; + txq->txq_last_hw_ipcs = (ipcs & 0x); + txq->txq_last_hw_tucs = (tucs & 0x); + /* Fill in the context descriptor. */ t = (struct livengood_tcpip_ctxdesc *)
CVS commit: [bouyer-xenpvh] src/sys/arch
Module Name:src Committed By: bouyer Date: Wed Apr 8 17:59:17 UTC 2020 Modified Files: src/sys/arch/amd64/amd64 [bouyer-xenpvh]: genassym.cf locore.S src/sys/arch/i386/i386 [bouyer-xenpvh]: genassym.cf locore.S src/sys/arch/x86/include [bouyer-xenpvh]: cpu.h src/sys/arch/x86/x86 [bouyer-xenpvh]: identcpu.c lapic.c x86_machdep.c src/sys/arch/xen/x86 [bouyer-xenpvh]: autoconf.c src/sys/arch/xen/xen [bouyer-xenpvh]: hypervisor.c Log Message: Remove VM_GUEST_XEN and define only Xen subtypes: VM_GUEST_XENPV VM_GUEST_XENPVH VM_GUEST_XENHVM VM_GUEST_XENPVHVM Set vm_guest in the start routine, if it is hypervisor-specific (e.g Xen PV). If vm_guest was not set early and we detect Xen in identify_hypervisor(), assume it is VM_GUEST_XENHVM. Refine to VM_GUEST_PVXENHVM in hypervisor_match(). To generate a diff of this commit: cvs rdiff -u -r1.82 -r1.82.4.1 src/sys/arch/amd64/amd64/genassym.cf cvs rdiff -u -r1.200 -r1.200.4.1 src/sys/arch/amd64/amd64/locore.S cvs rdiff -u -r1.119 -r1.119.4.1 src/sys/arch/i386/i386/genassym.cf cvs rdiff -u -r1.179 -r1.179.2.1 src/sys/arch/i386/i386/locore.S cvs rdiff -u -r1.117 -r1.117.4.1 src/sys/arch/x86/include/cpu.h cvs rdiff -u -r1.102 -r1.102.2.1 src/sys/arch/x86/x86/identcpu.c cvs rdiff -u -r1.76 -r1.76.6.1 src/sys/arch/x86/x86/lapic.c cvs rdiff -u -r1.137 -r1.137.2.1 src/sys/arch/x86/x86/x86_machdep.c cvs rdiff -u -r1.23 -r1.23.8.1 src/sys/arch/xen/x86/autoconf.c cvs rdiff -u -r1.73 -r1.73.2.1 src/sys/arch/xen/xen/hypervisor.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/amd64/amd64/genassym.cf diff -u src/sys/arch/amd64/amd64/genassym.cf:1.82 src/sys/arch/amd64/amd64/genassym.cf:1.82.4.1 --- src/sys/arch/amd64/amd64/genassym.cf:1.82 Mon Feb 17 09:09:48 2020 +++ src/sys/arch/amd64/amd64/genassym.cf Wed Apr 8 17:59:16 2020 @@ -1,4 +1,4 @@ -# $NetBSD: genassym.cf,v 1.82 2020/02/17 09:09:48 skrll Exp $ +# $NetBSD: genassym.cf,v 1.82.4.1 2020/04/08 17:59:16 bouyer Exp $ # # Copyright (c) 1998, 2006, 2007, 2008 The NetBSD Foundation, Inc. @@ -360,6 +360,8 @@ define X86_BUS_SPACE_IO X86_BUS_SPACE_IO define BST_TYPE offsetof(struct bus_space_tag, bst_type) +define VM_GUEST_XENPV VM_GUEST_XENPV + ifdef XEN define CPU_INFO_VCPU offsetof(struct cpu_info, ci_vcpu) define CPU_INFO_XPENDING offsetof(struct cpu_info, ci_xpending) Index: src/sys/arch/amd64/amd64/locore.S diff -u src/sys/arch/amd64/amd64/locore.S:1.200 src/sys/arch/amd64/amd64/locore.S:1.200.4.1 --- src/sys/arch/amd64/amd64/locore.S:1.200 Wed Jan 15 18:47:23 2020 +++ src/sys/arch/amd64/amd64/locore.S Wed Apr 8 17:59:16 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: locore.S,v 1.200 2020/01/15 18:47:23 ad Exp $ */ +/* $NetBSD: locore.S,v 1.200.4.1 2020/04/08 17:59:16 bouyer Exp $ */ /* * Copyright-o-rama! @@ -942,6 +942,8 @@ longmode_hi: cpuid movl %eax,_C_LABEL(cpuid_level) + movl $VM_GUEST_XENPV, _C_LABEL(vm_guest) + movq $cpu_info_primary,%rdi movq %rdi,CPU_INFO_SELF(%rdi) /* ci->ci_self = ci */ movq $1,%rsi Index: src/sys/arch/i386/i386/genassym.cf diff -u src/sys/arch/i386/i386/genassym.cf:1.119 src/sys/arch/i386/i386/genassym.cf:1.119.4.1 --- src/sys/arch/i386/i386/genassym.cf:1.119 Mon Feb 17 09:09:48 2020 +++ src/sys/arch/i386/i386/genassym.cf Wed Apr 8 17:59:16 2020 @@ -1,4 +1,4 @@ -# $NetBSD: genassym.cf,v 1.119 2020/02/17 09:09:48 skrll Exp $ +# $NetBSD: genassym.cf,v 1.119.4.1 2020/04/08 17:59:16 bouyer Exp $ # # Copyright (c) 1998, 2006, 2007, 2008 The NetBSD Foundation, Inc. @@ -374,6 +374,8 @@ define L2_FRAME L2_FRAME define PGOFSET PGOFSET define PGSHIFT PGSHIFT +define VM_GUEST_XENPV VM_GUEST_XENPV + ifdef XEN define CPU_INFO_VCPU offsetof(struct cpu_info, ci_vcpu) define CPU_INFO_XPENDING offsetof(struct cpu_info, ci_xpending) Index: src/sys/arch/i386/i386/locore.S diff -u src/sys/arch/i386/i386/locore.S:1.179 src/sys/arch/i386/i386/locore.S:1.179.2.1 --- src/sys/arch/i386/i386/locore.S:1.179 Fri Mar 27 21:05:03 2020 +++ src/sys/arch/i386/i386/locore.S Wed Apr 8 17:59:16 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: locore.S,v 1.179 2020/03/27 21:05:03 ad Exp $ */ +/* $NetBSD: locore.S,v 1.179.2.1 2020/04/08 17:59:16 bouyer Exp $ */ /* * Copyright-o-rama! @@ -128,7 +128,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: locore.S,v 1.179 2020/03/27 21:05:03 ad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: locore.S,v 1.179.2.1 2020/04/08 17:59:16 bouyer Exp $"); #include "opt_copy_symtab.h" #include "opt_ddb.h" @@ -1115,6 +1115,8 @@ begin: cpuid movl %eax,RELOC(cpuid_level) + movl$VM_GUEST_XENPV, RELOC(vm_guest) + /* * Use a temporary GDT page. We'll re-add it to uvm(9) once we're done * using it. Index: src/sys/arch/x86/include/cpu.h diff -u src/sys/arch/x86/include/cpu.h:1.117 src/sys/arch/x86/include/cpu.h:1.117.4.1 --- src/sys/arch/x86/include/cpu.h:1.117 Wed Jan 15 13:22:03 2020 +++
CVS commit: [bouyer-xenpvh] src/sys/arch
Module Name:src Committed By: bouyer Date: Wed Apr 8 17:56:08 UTC 2020 Modified Files: src/sys/arch/amd64/conf [bouyer-xenpvh]: XEN3_DOMU XEN3_PVHVM src/sys/arch/i386/conf [bouyer-xenpvh]: XEN3PAE_DOM0 XEN3PAE_DOMU XEN3PAE_PVHVM Log Message: Turn on -g by default on the branch To generate a diff of this commit: cvs rdiff -u -r1.90 -r1.90.6.1 src/sys/arch/amd64/conf/XEN3_DOMU cvs rdiff -u -r1.3 -r1.3.2.1 src/sys/arch/amd64/conf/XEN3_PVHVM cvs rdiff -u -r1.21 -r1.21.2.1 src/sys/arch/i386/conf/XEN3PAE_DOM0 cvs rdiff -u -r1.8 -r1.8.2.1 src/sys/arch/i386/conf/XEN3PAE_DOMU cvs rdiff -u -r1.3 -r1.3.2.1 src/sys/arch/i386/conf/XEN3PAE_PVHVM Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/amd64/conf/XEN3_DOMU diff -u src/sys/arch/amd64/conf/XEN3_DOMU:1.90 src/sys/arch/amd64/conf/XEN3_DOMU:1.90.6.1 --- src/sys/arch/amd64/conf/XEN3_DOMU:1.90 Wed Aug 21 12:16:07 2019 +++ src/sys/arch/amd64/conf/XEN3_DOMU Wed Apr 8 17:56:08 2020 @@ -1,4 +1,4 @@ -# $NetBSD: XEN3_DOMU,v 1.90 2019/08/21 12:16:07 maxv Exp $ +# $NetBSD: XEN3_DOMU,v 1.90.6.1 2020/04/08 17:56:08 bouyer Exp $ include "arch/amd64/conf/std.xen" @@ -11,7 +11,7 @@ options INCLUDE_CONFIG_FILE # embed con #options UVMHIST_PRINT #options SYSCALL_DEBUG -#ident "XEN3_DOMU-$Revision: 1.90 $" +#ident "XEN3_DOMU-$Revision: 1.90.6.1 $" maxusers 32 # estimated number of users @@ -52,7 +52,7 @@ options DDB_ONPANIC=1 # see also sysctl options DDB_HISTORY_SIZE=512 # enable history editing in DDB #options KGDB # remote debugger #options KGDB_DEVNAME="\"com\"",KGDB_DEVADDR=0x2f8,KGDB_DEVRATE=57600 -#makeoptions DEBUG="-g" # compile full symbol table +makeoptions DEBUG="-g" # compile full symbol table makeoptions COPTS="-O2 -fno-omit-frame-pointer" options DDB_COMMANDONENTER="trace;show registers" Index: src/sys/arch/amd64/conf/XEN3_PVHVM diff -u src/sys/arch/amd64/conf/XEN3_PVHVM:1.3 src/sys/arch/amd64/conf/XEN3_PVHVM:1.3.2.1 --- src/sys/arch/amd64/conf/XEN3_PVHVM:1.3 Mon Apr 6 19:28:21 2020 +++ src/sys/arch/amd64/conf/XEN3_PVHVM Wed Apr 8 17:56:08 2020 @@ -1,4 +1,4 @@ -# $NetBSD: XEN3_PVHVM,v 1.3 2020/04/06 19:28:21 bouyer Exp $ +# $NetBSD: XEN3_PVHVM,v 1.3.2.1 2020/04/08 17:56:08 bouyer Exp $ include "arch/amd64/conf/std.xen" @@ -12,7 +12,7 @@ options INCLUDE_CONFIG_FILE # embed con #options UVMHIST_PRINT #options SYSCALL_DEBUG -#ident "XEN3_PVHVM-$Revision: 1.3 $" +#ident "XEN3_PVHVM-$Revision: 1.3.2.1 $" maxusers 32 # estimated number of users options MAXPHYS=32768 #xbd doesn't handle 64k transfers @@ -52,7 +52,7 @@ options DDB_ONPANIC=1 # see also sysctl options DDB_HISTORY_SIZE=512 # enable history editing in DDB #options KGDB # remote debugger #options KGDB_DEVNAME="\"com\"",KGDB_DEVADDR=0x2f8,KGDB_DEVRATE=57600 -#makeoptions DEBUG="-g" # compile full symbol table +makeoptions DEBUG="-g" # compile full symbol table makeoptions COPTS="-O2 -fno-omit-frame-pointer" options DDB_COMMANDONENTER="show registers" Index: src/sys/arch/i386/conf/XEN3PAE_DOM0 diff -u src/sys/arch/i386/conf/XEN3PAE_DOM0:1.21 src/sys/arch/i386/conf/XEN3PAE_DOM0:1.21.2.1 --- src/sys/arch/i386/conf/XEN3PAE_DOM0:1.21 Wed Mar 25 17:06:19 2020 +++ src/sys/arch/i386/conf/XEN3PAE_DOM0 Wed Apr 8 17:56:08 2020 @@ -1,4 +1,4 @@ -# $NetBSD: XEN3PAE_DOM0,v 1.21 2020/03/25 17:06:19 jdolecek Exp $ +# $NetBSD: XEN3PAE_DOM0,v 1.21.2.1 2020/04/08 17:56:08 bouyer Exp $ # # XEN3_0: Xen 3.0 domain0 kernel @@ -74,7 +74,7 @@ options DDB_ONPANIC=1 # see also sysctl options DDB_HISTORY_SIZE=512 # enable history editing in DDB #options KGDB # remote debugger #options KGDB_DEVNAME="\"com\"",KGDB_DEVADDR=0x2f8,KGDB_DEVRATE=57600 -#makeoptions DEBUG="-g" # compile full symbol table +makeoptions DEBUG="-g" # compile full symbol table options DDB_COMMANDONENTER="show registers" # Compatibility options Index: src/sys/arch/i386/conf/XEN3PAE_DOMU diff -u src/sys/arch/i386/conf/XEN3PAE_DOMU:1.8 src/sys/arch/i386/conf/XEN3PAE_DOMU:1.8.2.1 --- src/sys/arch/i386/conf/XEN3PAE_DOMU:1.8 Wed Mar 25 17:06:19 2020 +++ src/sys/arch/i386/conf/XEN3PAE_DOMU Wed Apr 8 17:56:08 2020 @@ -1,4 +1,4 @@ -# $NetBSD: XEN3PAE_DOMU,v 1.8 2020/03/25 17:06:19 jdolecek Exp $ +# $NetBSD: XEN3PAE_DOMU,v 1.8.2.1 2020/04/08 17:56:08 bouyer Exp $ include "arch/xen/conf/std.xen" @@ -58,7 +58,7 @@ options DDB_ONPANIC=1 # see also sysctl options DDB_HISTORY_SIZE=512 # enable history editing in DDB #options KGDB # remote debugger #options KGDB_DEVNAME="\"com\"",KGDB_DEVADDR=0x2f8,KGDB_DEVRATE=57600 -#makeoptions DEBUG="-g" # compile full symbol table +makeoptions DEBUG="-g" # compile full symbol table options DDB_COMMANDONENTER="trace;show registers" # Compatibility options Index: src/sys/arch/i386/conf/XEN3PAE_PVHVM diff -u src/sys/arch/i386/conf/XEN3PAE_PVHVM:1.3 src/sys/arch/i386/conf/XEN3PAE_PVHVM:1.3.2.1 ---
CVS commit: src/sys/opencrypto
Module Name:src Committed By: pgoyette Date: Wed Apr 8 15:27:18 UTC 2020 Modified Files: src/sys/opencrypto: crypto.c Log Message: Revert previous change to use SYSCTL_SETUP since it breaks on macppc. For some reason, the crypto module fails to link, and this results in opencrypto sysctl failures. Should resolve PR kern/55154 To generate a diff of this commit: cvs rdiff -u -r1.113 -r1.114 src/sys/opencrypto/crypto.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/opencrypto/crypto.c diff -u src/sys/opencrypto/crypto.c:1.113 src/sys/opencrypto/crypto.c:1.114 --- src/sys/opencrypto/crypto.c:1.113 Mon Mar 16 21:20:12 2020 +++ src/sys/opencrypto/crypto.c Wed Apr 8 15:27:18 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: crypto.c,v 1.113 2020/03/16 21:20:12 pgoyette Exp $ */ +/* $NetBSD: crypto.c,v 1.114 2020/04/08 15:27:18 pgoyette Exp $ */ /* $FreeBSD: src/sys/opencrypto/crypto.c,v 1.4.2.5 2003/02/26 00:14:05 sam Exp $ */ /* $OpenBSD: crypto.c,v 1.41 2002/07/17 23:52:38 art Exp $ */ @@ -53,7 +53,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: crypto.c,v 1.113 2020/03/16 21:20:12 pgoyette Exp $"); +__KERNEL_RCSID(0, "$NetBSD: crypto.c,v 1.114 2020/04/08 15:27:18 pgoyette Exp $"); #include #include @@ -383,7 +383,8 @@ int crypto_userasymcrypto = 1; /* userla */ int crypto_devallowsoft = 1; /* only use hardware crypto */ -SYSCTL_SETUP(sysctl_opencrypto_setup, "opencrypto sysctl") +static void +sysctl_opencrypto_setup(struct sysctllog **clog) { const struct sysctlnode *ocnode; const struct sysctlnode *retqnode, *retkqnode; @@ -518,6 +519,8 @@ static struct cryptostats cryptostats; static int crypto_timing = 0; #endif +static struct sysctllog *sysctl_opencrypto_clog; + static void crypto_crp_ret_qs_init(void) { @@ -584,6 +587,8 @@ crypto_init0(void) return crypto_destroy(false); } + sysctl_opencrypto_setup(_opencrypto_clog); + return 0; } @@ -650,6 +655,9 @@ crypto_destroy(bool exit_kthread) } } + if (sysctl_opencrypto_clog != NULL) + sysctl_teardown(_opencrypto_clog); + if (crypto_ret_si != NULL) softint_disestablish(crypto_ret_si);
CVS commit: src/sys/arch/powerpc/include/booke
Module Name:src Committed By: skrll Date: Wed Apr 8 10:57:16 UTC 2020 Modified Files: src/sys/arch/powerpc/include/booke: pmap.h Log Message: Simplify #ifdefs To generate a diff of this commit: cvs rdiff -u -r1.20 -r1.21 src/sys/arch/powerpc/include/booke/pmap.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/powerpc/include/booke/pmap.h diff -u src/sys/arch/powerpc/include/booke/pmap.h:1.20 src/sys/arch/powerpc/include/booke/pmap.h:1.21 --- src/sys/arch/powerpc/include/booke/pmap.h:1.20 Thu Mar 12 23:09:59 2020 +++ src/sys/arch/powerpc/include/booke/pmap.h Wed Apr 8 10:57:16 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: pmap.h,v 1.20 2020/03/12 23:09:59 thorpej Exp $ */ +/* $NetBSD: pmap.h,v 1.21 2020/04/08 10:57:16 skrll Exp $ */ /*- * Copyright (c) 2010, 2011 The NetBSD Foundation, Inc. * All rights reserved. @@ -140,9 +140,7 @@ static __inline void pmap_md_vca_clean(struct vm_page *pg, vaddr_t va, int op) { } -#endif -#ifdef __PMAP_PRIVATE static __inline size_t pmap_md_tlb_asid_max(void) {
CVS commit: src/sys/uvm
Module Name:src Committed By: skrll Date: Wed Apr 8 07:56:34 UTC 2020 Modified Files: src/sys/uvm: uvm_stat.h Log Message: Provide UVMHIST_CALLARGS To generate a diff of this commit: cvs rdiff -u -r1.52 -r1.53 src/sys/uvm/uvm_stat.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/uvm/uvm_stat.h diff -u src/sys/uvm/uvm_stat.h:1.52 src/sys/uvm/uvm_stat.h:1.53 --- src/sys/uvm/uvm_stat.h:1.52 Wed Mar 5 05:35:55 2014 +++ src/sys/uvm/uvm_stat.h Wed Apr 8 07:56:34 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: uvm_stat.h,v 1.52 2014/03/05 05:35:55 matt Exp $ */ +/* $NetBSD: uvm_stat.h,v 1.53 2020/04/08 07:56:34 skrll Exp $ */ /* * Copyright (c) 2011 Matthew R. Green @@ -51,15 +51,16 @@ #ifdef UVMHIST -#define UVMHIST_DECL(NAME) KERNHIST_DECL(NAME) -#define UVMHIST_DEFINE(NAME) KERNHIST_DEFINE(NAME) -#define UVMHIST_INIT(NAME,N) KERNHIST_INIT(NAME,N) -#define UVMHIST_INIT_STATIC(NAME,BUF) KERNHIST_INIT_STATIC(NAME,BUF) -#define UVMHIST_INITIALIZER(NAME,BUF) KERNHIST_INITIALIZER(NAME,BUF) -#define UVMHIST_LINK_STATIC(NAME) KERNHIST_LINK_STATIC(NAME) -#define UVMHIST_LOG(NAME,FMT,A,B,C,D) KERNHIST_LOG(NAME,FMT,A,B,C,D) -#define UVMHIST_CALLED(NAME) KERNHIST_CALLED(NAME) -#define UVMHIST_FUNC(FNAME) KERNHIST_FUNC(FNAME) +#define UVMHIST_DECL(NAME) KERNHIST_DECL(NAME) +#define UVMHIST_DEFINE(NAME) KERNHIST_DEFINE(NAME) +#define UVMHIST_INIT(NAME,N) KERNHIST_INIT(NAME,N) +#define UVMHIST_INIT_STATIC(NAME,BUF) KERNHIST_INIT_STATIC(NAME,BUF) +#define UVMHIST_INITIALIZER(NAME,BUF) KERNHIST_INITIALIZER(NAME,BUF) +#define UVMHIST_LINK_STATIC(NAME) KERNHIST_LINK_STATIC(NAME) +#define UVMHIST_LOG(NAME,FMT,A,B,C,D) KERNHIST_LOG(NAME,FMT,A,B,C,D) +#define UVMHIST_CALLED(NAME) KERNHIST_CALLED(NAME) +#define UVMHIST_CALLARGS(NAME,FMT,A,B,C,D) KERNHIST_CALLARGS(NAME,FMT,A,B,C,D) +#define UVMHIST_FUNC(FNAME) KERNHIST_FUNC(FNAME) #else
CVS commit: src/external/gpl3/gcc/dist/gcc
Module Name:src Committed By: wiz Date: Wed Apr 8 06:49:28 UTC 2020 Modified Files: src/external/gpl3/gcc/dist/gcc: gimplify.c Log Message: Pull in https://gcc.gnu.org/g:3d947f1f27188e3a61ba7f42399b1c348469fe13 middle-end/94479 - fix gimplification of address When gimplifying an address operand we may expose an indirect ref via DECL_VALUE_EXPR for example. This is dealt with in the code already but it fails to consider that INDIRECT_REFs get gimplified to MEM_REFs. Fixed which makes the ICE observed on x86_64-netbsd go away. 2020-04-07 Richard Biener PR middle-end/94479 * gimplify.c (gimplify_addr_expr): Also consider generated MEM_REFs. * gcc.dg/torture/pr94479.c: New testcase. Fixes -fstack-check ICE when building devel/git-base. To generate a diff of this commit: cvs rdiff -u -r1.1.1.12 -r1.2 src/external/gpl3/gcc/dist/gcc/gimplify.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/external/gpl3/gcc/dist/gcc/gimplify.c diff -u src/external/gpl3/gcc/dist/gcc/gimplify.c:1.1.1.12 src/external/gpl3/gcc/dist/gcc/gimplify.c:1.2 --- src/external/gpl3/gcc/dist/gcc/gimplify.c:1.1.1.12 Wed Mar 11 08:16:14 2020 +++ src/external/gpl3/gcc/dist/gcc/gimplify.c Wed Apr 8 06:49:28 2020 @@ -6072,7 +6072,9 @@ gimplify_addr_expr (tree *expr_p, gimple /* For various reasons, the gimplification of the expression may have made a new INDIRECT_REF. */ - if (TREE_CODE (op0) == INDIRECT_REF) + if (TREE_CODE (op0) == INDIRECT_REF + || (TREE_CODE (op0) == MEM_REF + && integer_zerop (TREE_OPERAND (op0, 1 goto do_indirect_ref; mark_addressable (TREE_OPERAND (expr, 0));