CVS commit: src/distrib/sets/lists

2019-03-14 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Fri Mar 15 04:26:13 UTC 2019

Modified Files:
src/distrib/sets/lists/xdebug: shl.mi
src/distrib/sets/lists/xserver: mi

Log Message:
libmesa_dri.so is obsolete in mesa18 for x86 as well.


To generate a diff of this commit:
cvs rdiff -u -r1.44 -r1.45 src/distrib/sets/lists/xdebug/shl.mi
cvs rdiff -u -r1.38 -r1.39 src/distrib/sets/lists/xserver/mi

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/distrib/sets/lists

2019-03-14 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Fri Mar 15 04:26:13 UTC 2019

Modified Files:
src/distrib/sets/lists/xdebug: shl.mi
src/distrib/sets/lists/xserver: mi

Log Message:
libmesa_dri.so is obsolete in mesa18 for x86 as well.


To generate a diff of this commit:
cvs rdiff -u -r1.44 -r1.45 src/distrib/sets/lists/xdebug/shl.mi
cvs rdiff -u -r1.38 -r1.39 src/distrib/sets/lists/xserver/mi

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/distrib/sets/lists/xdebug/shl.mi
diff -u src/distrib/sets/lists/xdebug/shl.mi:1.44 src/distrib/sets/lists/xdebug/shl.mi:1.45
--- src/distrib/sets/lists/xdebug/shl.mi:1.44	Wed Jun  6 03:09:12 2018
+++ src/distrib/sets/lists/xdebug/shl.mi	Fri Mar 15 04:26:13 2019
@@ -1,4 +1,4 @@
-# $NetBSD: shl.mi,v 1.44 2018/06/06 03:09:12 snj Exp $
+# $NetBSD: shl.mi,v 1.45 2019/03/15 04:26:13 mrg Exp $
 ./usr/libdata/debug/usr/X11R7/lib	-unknown-		xorg,debug,compatx11dir
 ./usr/libdata/debug/usr/X11R7/lib/X11/locale/lib/common/libximcp.so.2.0.debug	obsolete		xorg,obsolete
 ./usr/libdata/debug/usr/X11R7/lib/X11/locale/lib/common/libxlcDef.so.2.0.debug	obsolete		xorg,obsolete
@@ -106,8 +106,8 @@
 ./usr/libdata/debug/usr/X11R7/lib/libxshmfence.so.1.0.debug	-unknown-		xorg,debug,compatx11file
 ./usr/libdata/debug/usr/X11R7/lib/modules/dri/gallium_dri.so.0.debug	-unknown-	xorg,debug
 ./usr/libdata/debug/usr/X11R7/lib/modules/dri/kms_swrast_dri.so.0.debug	-unknown-	xorg,debug
-./usr/libdata/debug/usr/X11R7/lib/modules/dri/libmesa_dri.so.0.debug	-unknown-	xorg,debug,machine=amd64
-./usr/libdata/debug/usr/X11R7/lib/modules/dri/libmesa_dri.so.0.debug	-unknown-	xorg,debug,machine=i386
+./usr/libdata/debug/usr/X11R7/lib/modules/dri/libmesa_dri.so.0.debug	-unknown-	xorg,debug,machine=amd64,mesa_ver=10
+./usr/libdata/debug/usr/X11R7/lib/modules/dri/libmesa_dri.so.0.debug	-unknown-	xorg,debug,machine=i386,mesa_ver=10
 ./usr/libdata/debug/usr/X11R7/lib/modules/dri/libmesa_dri.so.0.debug	obsolete	obsolete,xorg,debug,!machine=i386,!machine=amd64
 ./usr/libdata/debug/usr/X11R7/lib/modules/dri/libswrast_dri.so.0.debug	obsolete	obsolete,xorg,debug
 ./usr/libdata/debug/usr/X11R7/lib/modules/dri/nouveau_dri.so.0.debug	-unknown-	xorg,debug,machine=amd64

Index: src/distrib/sets/lists/xserver/mi
diff -u src/distrib/sets/lists/xserver/mi:1.38 src/distrib/sets/lists/xserver/mi:1.39
--- src/distrib/sets/lists/xserver/mi:1.38	Thu Dec 15 12:56:52 2016
+++ src/distrib/sets/lists/xserver/mi	Fri Mar 15 04:26:13 2019
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.38 2016/12/15 12:56:52 kre Exp $
+# $NetBSD: mi,v 1.39 2019/03/15 04:26:13 mrg Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -10,11 +10,11 @@
 ./usr/X11R7/lib/modules/dri/kms_swrast_dri.so		-unknown-	xorg
 ./usr/X11R7/lib/modules/dri/kms_swrast_dri.so.0		-unknown-	xorg
 ./usr/X11R7/lib/modules/dri/libmesa_dri.so		-unknown-	obsolete,xorg,!machine=amd64,!machine=i386
-./usr/X11R7/lib/modules/dri/libmesa_dri.so		-unknown-	xorg,machine=amd64
-./usr/X11R7/lib/modules/dri/libmesa_dri.so		-unknown-	xorg,machine=i386
+./usr/X11R7/lib/modules/dri/libmesa_dri.so		-unknown-	xorg,machine=amd64,mesa_ver=10
+./usr/X11R7/lib/modules/dri/libmesa_dri.so		-unknown-	xorg,machine=i386,mesa_ver=10
 ./usr/X11R7/lib/modules/dri/libmesa_dri.so.0		-unknown-	obsolete,xorg,!machine=amd64,!machine=i386
-./usr/X11R7/lib/modules/dri/libmesa_dri.so.0		-unknown-	xorg,machine=amd64
-./usr/X11R7/lib/modules/dri/libmesa_dri.so.0		-unknown-	xorg,machine=i386
+./usr/X11R7/lib/modules/dri/libmesa_dri.so.0		-unknown-	xorg,machine=amd64,mesa_ver=10
+./usr/X11R7/lib/modules/dri/libmesa_dri.so.0		-unknown-	xorg,machine=i386,mesa_ver=10
 ./usr/X11R7/lib/modules/dri/swrast_dri.so		-unknown-	xorg
 ./usr/X11R7/lib/modules/dri/swrast_dri.so.0		-unknown-	xorg
 ./usr/X11R7/man/cat1/Xmark.0-unknown-	.cat,xorg



CVS commit: src/sys/dev/mii

2019-03-14 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Fri Mar 15 04:00:29 UTC 2019

Modified Files:
src/sys/dev/mii: miidevs.h miidevs_data.h

Log Message:
Regen.


To generate a diff of this commit:
cvs rdiff -u -r1.146 -r1.147 src/sys/dev/mii/miidevs.h
cvs rdiff -u -r1.134 -r1.135 src/sys/dev/mii/miidevs_data.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/dev/mii/miidevs.h
diff -u src/sys/dev/mii/miidevs.h:1.146 src/sys/dev/mii/miidevs.h:1.147
--- src/sys/dev/mii/miidevs.h:1.146	Fri Mar  8 07:10:54 2019
+++ src/sys/dev/mii/miidevs.h	Fri Mar 15 04:00:29 2019
@@ -1,10 +1,10 @@
-/*	$NetBSD: miidevs.h,v 1.146 2019/03/08 07:10:54 msaitoh Exp $	*/
+/*	$NetBSD: miidevs.h,v 1.147 2019/03/15 04:00:29 msaitoh Exp $	*/
 
 /*
  * THIS FILE AUTOMATICALLY GENERATED.  DO NOT EDIT.
  *
  * generated from:
- *	NetBSD: miidevs,v 1.148 2019/03/08 07:10:26 msaitoh Exp
+ *	NetBSD: miidevs,v 1.149 2019/03/15 04:00:06 msaitoh Exp
  */
 
 /*-
@@ -317,6 +317,14 @@
 #define	MII_STR_xxDAVICOM_DM9101	"DM9101 (AMD Am79C873) 10/100 media interface"
 #define	MII_MODEL_xxDAVICOM_DM9102	0x0004
 #define	MII_STR_xxDAVICOM_DM9102	"DM9102 10/100 media interface"
+#define	MII_MODEL_xxDAVICOM_DM9161	0x0008
+#define	MII_STR_xxDAVICOM_DM9161	"DM9161 10/100 media interface"
+#define	MII_MODEL_xxDAVICOM_DM9161A	0x000a
+#define	MII_STR_xxDAVICOM_DM9161A	"DM9161A 10/100 media interface"
+#define	MII_MODEL_xxDAVICOM_DM9161B	0x000b
+#define	MII_STR_xxDAVICOM_DM9161B	"DM9161[BC] 10/100 media interface"
+#define	MII_MODEL_xxDAVICOM_DM9601	0x000c
+#define	MII_STR_xxDAVICOM_DM9601	"DM9601 internal 10/100 media interface"
 
 /* IC Plus Corp. PHYs */
 #define	MII_MODEL_ICPLUS_IP100	0x0004

Index: src/sys/dev/mii/miidevs_data.h
diff -u src/sys/dev/mii/miidevs_data.h:1.134 src/sys/dev/mii/miidevs_data.h:1.135
--- src/sys/dev/mii/miidevs_data.h:1.134	Fri Mar  8 07:10:54 2019
+++ src/sys/dev/mii/miidevs_data.h	Fri Mar 15 04:00:29 2019
@@ -1,10 +1,10 @@
-/*	$NetBSD: miidevs_data.h,v 1.134 2019/03/08 07:10:54 msaitoh Exp $	*/
+/*	$NetBSD: miidevs_data.h,v 1.135 2019/03/15 04:00:29 msaitoh Exp $	*/
 
 /*
  * THIS FILE AUTOMATICALLY GENERATED.  DO NOT EDIT.
  *
  * generated from:
- *	NetBSD: miidevs,v 1.148 2019/03/08 07:10:26 msaitoh Exp
+ *	NetBSD: miidevs,v 1.149 2019/03/15 04:00:06 msaitoh Exp
  */
 
 /*-
@@ -122,6 +122,10 @@ struct mii_knowndev mii_knowndevs[] = {
  { MII_OUI_DAVICOM, MII_MODEL_DAVICOM_DM9101, MII_STR_DAVICOM_DM9101 },
  { MII_OUI_xxDAVICOM, MII_MODEL_xxDAVICOM_DM9101, MII_STR_xxDAVICOM_DM9101 },
  { MII_OUI_xxDAVICOM, MII_MODEL_xxDAVICOM_DM9102, MII_STR_xxDAVICOM_DM9102 },
+ { MII_OUI_xxDAVICOM, MII_MODEL_xxDAVICOM_DM9161, MII_STR_xxDAVICOM_DM9161 },
+ { MII_OUI_xxDAVICOM, MII_MODEL_xxDAVICOM_DM9161A, MII_STR_xxDAVICOM_DM9161A },
+ { MII_OUI_xxDAVICOM, MII_MODEL_xxDAVICOM_DM9161B, MII_STR_xxDAVICOM_DM9161B },
+ { MII_OUI_xxDAVICOM, MII_MODEL_xxDAVICOM_DM9601, MII_STR_xxDAVICOM_DM9601 },
  { MII_OUI_ICPLUS, MII_MODEL_ICPLUS_IP100, MII_STR_ICPLUS_IP100 },
  { MII_OUI_ICPLUS, MII_MODEL_ICPLUS_IP101, MII_STR_ICPLUS_IP101 },
  { MII_OUI_ICPLUS, MII_MODEL_ICPLUS_IP1000A, MII_STR_ICPLUS_IP1000A },



CVS commit: src/sys/dev/mii

2019-03-14 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Fri Mar 15 04:00:29 UTC 2019

Modified Files:
src/sys/dev/mii: miidevs.h miidevs_data.h

Log Message:
Regen.


To generate a diff of this commit:
cvs rdiff -u -r1.146 -r1.147 src/sys/dev/mii/miidevs.h
cvs rdiff -u -r1.134 -r1.135 src/sys/dev/mii/miidevs_data.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/dev/mii

2019-03-14 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Fri Mar 15 04:00:06 UTC 2019

Modified Files:
src/sys/dev/mii: miidevs

Log Message:
 Add Davicom DM9161, DM9161[ABC] and DM9601.


To generate a diff of this commit:
cvs rdiff -u -r1.148 -r1.149 src/sys/dev/mii/miidevs

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/mii/miidevs
diff -u src/sys/dev/mii/miidevs:1.148 src/sys/dev/mii/miidevs:1.149
--- src/sys/dev/mii/miidevs:1.148	Fri Mar  8 07:10:26 2019
+++ src/sys/dev/mii/miidevs	Fri Mar 15 04:00:06 2019
@@ -1,4 +1,4 @@
-$NetBSD: miidevs,v 1.148 2019/03/08 07:10:26 msaitoh Exp $
+$NetBSD: miidevs,v 1.149 2019/03/15 04:00:06 msaitoh Exp $
 
 /*-
  * Copyright (c) 1998, 1999 The NetBSD Foundation, Inc.
@@ -225,6 +225,10 @@ model xxCICADA CS8201B		0x0021 Cicada CS
 model DAVICOM DM9101		0x DM9101 (AMD Am79C873) 10/100 media interface
 model xxDAVICOM DM9101		0x DM9101 (AMD Am79C873) 10/100 media interface
 model xxDAVICOM DM9102		0x0004 DM9102 10/100 media interface
+model xxDAVICOM DM9161		0x0008 DM9161 10/100 media interface
+model xxDAVICOM DM9161A		0x000a DM9161A 10/100 media interface
+model xxDAVICOM DM9161B		0x000b DM9161[BC] 10/100 media interface
+model xxDAVICOM DM9601		0x000c DM9601 internal 10/100 media interface
 
 /* IC Plus Corp. PHYs */
 model ICPLUS IP100		0x0004 IP100 10/100 PHY



CVS commit: src/sys/dev/mii

2019-03-14 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Fri Mar 15 04:00:06 UTC 2019

Modified Files:
src/sys/dev/mii: miidevs

Log Message:
 Add Davicom DM9161, DM9161[ABC] and DM9601.


To generate a diff of this commit:
cvs rdiff -u -r1.148 -r1.149 src/sys/dev/mii/miidevs

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/external/mit/xorg/lib

2019-03-14 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Fri Mar 15 03:10:25 UTC 2019

Modified Files:
src/external/mit/xorg/lib: libmesa.mk

Log Message:
remove INCLUDES.all setting and it's processing.  already done elsewhere.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/external/mit/xorg/lib/libmesa.mk

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/external/mit/xorg/lib

2019-03-14 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Fri Mar 15 03:10:25 UTC 2019

Modified Files:
src/external/mit/xorg/lib: libmesa.mk

Log Message:
remove INCLUDES.all setting and it's processing.  already done elsewhere.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/external/mit/xorg/lib/libmesa.mk

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/mit/xorg/lib/libmesa.mk
diff -u src/external/mit/xorg/lib/libmesa.mk:1.4 src/external/mit/xorg/lib/libmesa.mk:1.5
--- src/external/mit/xorg/lib/libmesa.mk:1.4	Sun Mar 10 10:51:58 2019
+++ src/external/mit/xorg/lib/libmesa.mk	Fri Mar 15 03:10:25 2019
@@ -1,9 +1,7 @@
-#	$NetBSD: libmesa.mk,v 1.4 2019/03/10 10:51:58 mrg Exp $
+#	$NetBSD: libmesa.mk,v 1.5 2019/03/15 03:10:25 mrg Exp $
 #
 # Consumer of this Makefile should set MESA_SRC_MODULES.
 
-INCLUDES.all=	mapi mesa
-
 CPPFLAGS.ac_surface.c+=	${${ACTIVE_CC} == "clang":? -Wno-error=enum-conversion :}
 
 # The source file lists derived from src/mesa/Makefile.sources.
@@ -467,10 +465,6 @@ CPPFLAGS.${_s}+=	-I${X11SRCDIR.Mesa}/src
 
 .endfor
 
-.for _path_ in ${INCLUDES.all}
-CPPFLAGS+=	-I${X11SRCDIR.Mesa}/src/${_path_}
-.endfor
-
 CPPFLAGS+=	-I${X11SRCDIR.Mesa}/include
 CPPFLAGS+=	-I${X11SRCDIR.Mesa}/src
 CPPFLAGS+=	-I${X11SRCDIR.Mesa}/src/mesa



CVS commit: src/sys/dev/pci/ixgbe

2019-03-14 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Fri Mar 15 02:38:20 UTC 2019

Modified Files:
src/sys/dev/pci/ixgbe: ixgbe.c ixv.c

Log Message:
- Simplily. Suggested by knakahara.
- Modify comment. Per queue VLAN enable flags is on 82599 and later.
- Fix typo in comment.


To generate a diff of this commit:
cvs rdiff -u -r1.177 -r1.178 src/sys/dev/pci/ixgbe/ixgbe.c
cvs rdiff -u -r1.110 -r1.111 src/sys/dev/pci/ixgbe/ixv.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/dev/pci/ixgbe

2019-03-14 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Fri Mar 15 02:38:20 UTC 2019

Modified Files:
src/sys/dev/pci/ixgbe: ixgbe.c ixv.c

Log Message:
- Simplily. Suggested by knakahara.
- Modify comment. Per queue VLAN enable flags is on 82599 and later.
- Fix typo in comment.


To generate a diff of this commit:
cvs rdiff -u -r1.177 -r1.178 src/sys/dev/pci/ixgbe/ixgbe.c
cvs rdiff -u -r1.110 -r1.111 src/sys/dev/pci/ixgbe/ixv.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/ixgbe/ixgbe.c
diff -u src/sys/dev/pci/ixgbe/ixgbe.c:1.177 src/sys/dev/pci/ixgbe/ixgbe.c:1.178
--- src/sys/dev/pci/ixgbe/ixgbe.c:1.177	Wed Mar 13 10:02:13 2019
+++ src/sys/dev/pci/ixgbe/ixgbe.c	Fri Mar 15 02:38:20 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: ixgbe.c,v 1.177 2019/03/13 10:02:13 msaitoh Exp $ */
+/* $NetBSD: ixgbe.c,v 1.178 2019/03/15 02:38:20 msaitoh Exp $ */
 
 /**
 
@@ -2376,14 +2376,16 @@ ixgbe_setup_vlan_hw_support(struct adapt
 	 * on NetBSD.
 	 */
 
-	/* Enalble HW tagging only if any vlan is attached */
+	/* Enable HW tagging only if any vlan is attached */
 	hwtagging = (ec->ec_capenable & ETHERCAP_VLAN_HWTAGGING)
-	&& VLAN_ATTACHED(>osdep.ec);
+	&& VLAN_ATTACHED(ec);
 
 	/* Setup the queues for vlans */
 	for (i = 0; i < adapter->num_queues; i++) {
 		rxr = >rx_rings[i];
-		/* On 82599 the VLAN enable is per/queue in RXDCTL */
+		/*
+		 * On 82599 and later, the VLAN enable is per/queue in RXDCTL.
+		 */
 		if (hw->mac.type != ixgbe_mac_82598EB) {
 			ctrl = IXGBE_READ_REG(hw, IXGBE_RXDCTL(rxr->me));
 			if (hwtagging)

Index: src/sys/dev/pci/ixgbe/ixv.c
diff -u src/sys/dev/pci/ixgbe/ixv.c:1.110 src/sys/dev/pci/ixgbe/ixv.c:1.111
--- src/sys/dev/pci/ixgbe/ixv.c:1.110	Wed Mar 13 10:08:02 2019
+++ src/sys/dev/pci/ixgbe/ixv.c	Fri Mar 15 02:38:20 2019
@@ -1,4 +1,4 @@
-/*$NetBSD: ixv.c,v 1.110 2019/03/13 10:08:02 msaitoh Exp $*/
+/*$NetBSD: ixv.c,v 1.111 2019/03/15 02:38:20 msaitoh Exp $*/
 
 /**
 
@@ -1979,9 +1979,9 @@ ixv_setup_vlan_support(struct adapter *a
 	 * on NetBSD.
 	 */
 
-	/* Enalble HW tagging only if any vlan is attached */
+	/* Enable HW tagging only if any vlan is attached */
 	hwtagging = (ec->ec_capenable & ETHERCAP_VLAN_HWTAGGING)
-	&& VLAN_ATTACHED(>osdep.ec);
+	&& VLAN_ATTACHED(ec);
 
 	/* Enable the queues */
 	for (int i = 0; i < adapter->num_queues; i++) {



CVS commit: src/sys/arch/vax

2019-03-14 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Thu Mar 14 23:49:38 UTC 2019

Modified Files:
src/sys/arch/vax/uba: qv.c
src/sys/arch/vax/vsa: smg.c

Log Message:
Use copyin(), not fusword().


To generate a diff of this commit:
cvs rdiff -u -r1.33 -r1.34 src/sys/arch/vax/uba/qv.c
cvs rdiff -u -r1.57 -r1.58 src/sys/arch/vax/vsa/smg.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/arch/vax

2019-03-14 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Thu Mar 14 23:49:38 UTC 2019

Modified Files:
src/sys/arch/vax/uba: qv.c
src/sys/arch/vax/vsa: smg.c

Log Message:
Use copyin(), not fusword().


To generate a diff of this commit:
cvs rdiff -u -r1.33 -r1.34 src/sys/arch/vax/uba/qv.c
cvs rdiff -u -r1.57 -r1.58 src/sys/arch/vax/vsa/smg.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/vax/uba/qv.c
diff -u src/sys/arch/vax/uba/qv.c:1.33 src/sys/arch/vax/uba/qv.c:1.34
--- src/sys/arch/vax/uba/qv.c:1.33	Mon May 22 17:15:45 2017
+++ src/sys/arch/vax/uba/qv.c	Thu Mar 14 23:49:38 2019
@@ -1,4 +1,4 @@
-/*$Header: /cvsroot/src/sys/arch/vax/uba/qv.c,v 1.33 2017/05/22 17:15:45 ragge Exp $*/
+/*$Header: /cvsroot/src/sys/arch/vax/uba/qv.c,v 1.34 2019/03/14 23:49:38 thorpej Exp $*/
 /*
  * Copyright (c) 2015 Charles H. Dickman. All rights reserved.
  * Derived from smg.c
@@ -31,7 +31,7 @@
 /*3456789012345678901234567890123456789012345678901234567890123456789012345678*/
 
 #include 
-__KERNEL_RCSID(0, "$Header: /cvsroot/src/sys/arch/vax/uba/qv.c,v 1.33 2017/05/22 17:15:45 ragge Exp $");
+__KERNEL_RCSID(0, "$Header: /cvsroot/src/sys/arch/vax/uba/qv.c,v 1.34 2019/03/14 23:49:38 thorpej Exp $");
 
 #include 
 #include 
@@ -785,16 +785,18 @@ qv_setcursor(struct qv_softc *sc, struct
 	}
 	if (v->which & WSDISPLAY_CURSOR_DOCMAP) {
 		/* First background */
-		red = fusword(v->cmap.red);
-		green = fusword(v->cmap.green);
-		blue = fusword(v->cmap.blue);
-		bgmask = (((30L * red + 59L * green + 11L * blue) >> 8) >=
-		(((1<<8)-1)*50)) ? ~0 : 0;
-		red = fusword(v->cmap.red+2);
-		green = fusword(v->cmap.green+2);
-		blue = fusword(v->cmap.blue+2);
-		fgmask = (((30L * red + 59L * green + 11L * blue) >> 8) >=
-		(((1<<8)-1)*50)) ? ~0 : 0;
+		if (copyin(v->cmap.red, , sizeof(red)) == 0 &&
+		copyin(v->cmap.green, , sizeof(green)) == 0 &&
+		copyin(v->cmap.blue, , sizeof(blue)) == 0) {
+			bgmask = (((30L * red + 59L * green + 11L * blue) >> 8)
+			>= (((1<<8)-1)*50)) ? ~0 : 0;
+		}
+		if (copyin(v->cmap.red + 2, , sizeof(red)) == 0 &&
+		copyin(v->cmap.green + 2, , sizeof(green)) == 0 &&
+		copyin(v->cmap.blue + 2, , sizeof(blue)) == 0) {
+			fgmask = (((30L * red + 59L * green + 11L * blue) >> 8)
+			>= (((1<<8)-1)*50)) ? ~0 : 0;
+		}
 	}
 	if (v->which & WSDISPLAY_CURSOR_DOSHAPE) {
 		copyin(v->image, curfg, sizeof(curfg));

Index: src/sys/arch/vax/vsa/smg.c
diff -u src/sys/arch/vax/vsa/smg.c:1.57 src/sys/arch/vax/vsa/smg.c:1.58
--- src/sys/arch/vax/vsa/smg.c:1.57	Mon May 22 17:17:25 2017
+++ src/sys/arch/vax/vsa/smg.c	Thu Mar 14 23:49:38 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: smg.c,v 1.57 2017/05/22 17:17:25 ragge Exp $ */
+/*	$NetBSD: smg.c,v 1.58 2019/03/14 23:49:38 thorpej Exp $ */
 /*
  * Copyright (c) 1998 Ludd, University of Lule}, Sweden.
  * All rights reserved.
@@ -25,7 +25,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: smg.c,v 1.57 2017/05/22 17:17:25 ragge Exp $");
+__KERNEL_RCSID(0, "$NetBSD: smg.c,v 1.58 2019/03/14 23:49:38 thorpej Exp $");
 
 #include 
 #include 
@@ -430,16 +430,18 @@ setcursor(struct wsdisplay_cursor *v)
 	}
 	if (v->which & WSDISPLAY_CURSOR_DOCMAP) {
 		/* First background */
-		red = fusword(v->cmap.red);
-		green = fusword(v->cmap.green);
-		blue = fusword(v->cmap.blue);
-		bgmask = (((30L * red + 59L * green + 11L * blue) >> 8) >=
-		(((1<<8)-1)*50)) ? ~0 : 0;
-		red = fusword(v->cmap.red+2);
-		green = fusword(v->cmap.green+2);
-		blue = fusword(v->cmap.blue+2);
-		fgmask = (((30L * red + 59L * green + 11L * blue) >> 8) >=
-		(((1<<8)-1)*50)) ? ~0 : 0;
+		if (copyin(v->cmap.red, , sizeof(red)) == 0 &&
+		copyin(v->cmap.green, , sizeof(green)) == 0 &&
+		copyin(v->cmap.blue, , sizeof(blue)) == 0) {
+			bgmask = (((30L * red + 59L * green + 11L * blue) >> 8)
+			>= (((1<<8)-1)*50)) ? ~0 : 0;
+		}
+		if (copyin(v->cmap.red + 2, , sizeof(red)) == 0 &&
+		copyin(v->cmap.green + 2, , sizeof(green)) == 0 &&
+		copyin(v->cmap.blue + 2, , sizeof(blue)) == 0) {
+			fgmask = (((30L * red + 59L * green + 11L * blue) >> 8)
+			>= (((1<<8)-1)*50)) ? ~0 : 0;
+		}
 	}
 	if (v->which & WSDISPLAY_CURSOR_DOSHAPE) {
 		WRITECUR(CUR_CMD, curcmd | CUR_CMD_LODSA);



CVS commit: src/external/bsd/jemalloc/dist/src

2019-03-14 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Mar 14 21:49:32 UTC 2019

Modified Files:
src/external/bsd/jemalloc/dist/src: jemalloc.c

Log Message:
revert previous sshd hack (from Rin Okuyama)


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/external/bsd/jemalloc/dist/src/jemalloc.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/external/bsd/jemalloc/dist/src

2019-03-14 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Mar 14 21:49:32 UTC 2019

Modified Files:
src/external/bsd/jemalloc/dist/src: jemalloc.c

Log Message:
revert previous sshd hack (from Rin Okuyama)


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/external/bsd/jemalloc/dist/src/jemalloc.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/bsd/jemalloc/dist/src/jemalloc.c
diff -u src/external/bsd/jemalloc/dist/src/jemalloc.c:1.6 src/external/bsd/jemalloc/dist/src/jemalloc.c:1.7
--- src/external/bsd/jemalloc/dist/src/jemalloc.c:1.6	Tue Mar 12 11:13:25 2019
+++ src/external/bsd/jemalloc/dist/src/jemalloc.c	Thu Mar 14 17:49:32 2019
@@ -2339,14 +2339,9 @@ je_realloc(void *ptr, size_t size) {
 tcache = NULL;
 			}
 			ifree(tsd, ptr, tcache, true);
-#ifdef notyet
-			/*
-			 * sshd depends on realloc(p, 0) returning non-NULL
-			 * disable for compatibility for now
-			 */
+
 			LOG("core.realloc.exit", "result: %p", NULL);
 			return NULL;
-#endif
 		}
 		size = 1;
 	}



Re: CVS commit: src/sys/kern

2019-03-14 Thread Christos Zoulas
In article <20190314195150.27756f...@cvs.netbsd.org>,
Palle Lyckegaard  wrote:
>-=-=-=-=-=-
>
>Module Name:   src
>Committed By:  palle
>Date:  Thu Mar 14 19:51:50 UTC 2019
>
>Modified Files:
>   src/sys/kern: kern_scdebug.c
>
>Log Message:
>syscall debug - fix build when SYSCALL_DEBUG option is present in kernel
>config file

Should this use __nothing?

christos



CVS commit: src/external/bsd/jemalloc/dist/src

2019-03-14 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Mar 14 21:10:33 UTC 2019

Modified Files:
src/external/bsd/jemalloc/dist/src: arena.c

Log Message:
Grr, disable the "time goes backwards" test here since this breaks too
frequently. We need a real fix.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/external/bsd/jemalloc/dist/src/arena.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/bsd/jemalloc/dist/src/arena.c
diff -u src/external/bsd/jemalloc/dist/src/arena.c:1.2 src/external/bsd/jemalloc/dist/src/arena.c:1.3
--- src/external/bsd/jemalloc/dist/src/arena.c:1.2	Mon Mar 11 14:06:28 2019
+++ src/external/bsd/jemalloc/dist/src/arena.c	Thu Mar 14 17:10:33 2019
@@ -642,9 +642,11 @@ arena_maybe_decay(tsdn_t *tsdn, arena_t 
 		 */
 		nstime_copy(>epoch, );
 		arena_decay_deadline_init(decay);
+#ifndef __NetBSD__
 	} else {
 		/* Verify that time does not go backwards. */
 		assert(nstime_compare(>epoch, ) <= 0);
+#endif
 	}
 
 	/*



CVS commit: src/external/bsd/jemalloc/dist/src

2019-03-14 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Mar 14 21:10:33 UTC 2019

Modified Files:
src/external/bsd/jemalloc/dist/src: arena.c

Log Message:
Grr, disable the "time goes backwards" test here since this breaks too
frequently. We need a real fix.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/external/bsd/jemalloc/dist/src/arena.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/uvm

2019-03-14 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Mar 14 21:09:03 UTC 2019

Modified Files:
src/sys/uvm: uvm_mmap.c

Log Message:
unify rounding and range checking.


To generate a diff of this commit:
cvs rdiff -u -r1.170 -r1.171 src/sys/uvm/uvm_mmap.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/uvm/uvm_mmap.c
diff -u src/sys/uvm/uvm_mmap.c:1.170 src/sys/uvm/uvm_mmap.c:1.171
--- src/sys/uvm/uvm_mmap.c:1.170	Thu Mar 14 15:10:04 2019
+++ src/sys/uvm/uvm_mmap.c	Thu Mar 14 17:09:03 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: uvm_mmap.c,v 1.170 2019/03/14 19:10:04 kre Exp $	*/
+/*	$NetBSD: uvm_mmap.c,v 1.171 2019/03/14 21:09:03 christos Exp $	*/
 
 /*
  * Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -46,7 +46,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: uvm_mmap.c,v 1.170 2019/03/14 19:10:04 kre Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uvm_mmap.c,v 1.171 2019/03/14 21:09:03 christos Exp $");
 
 #include "opt_compat_netbsd.h"
 #include "opt_pax.h"
@@ -67,7 +67,7 @@ static int uvm_mmap(struct vm_map *, vad
 int, int, struct uvm_object *, voff_t, vsize_t);
 
 static int
-range_test(struct vm_map *map, vaddr_t addr, vsize_t size, bool ismmap)
+range_test(const struct vm_map *map, vaddr_t addr, vsize_t size, bool ismmap)
 {
 	vaddr_t vm_min_address = vm_map_min(map);
 	vaddr_t vm_max_address = vm_map_max(map);
@@ -89,6 +89,26 @@ range_test(struct vm_map *map, vaddr_t a
 }
 
 /*
+ * align the address to a page boundary, and adjust the size accordingly
+ */
+static int
+round_and_check(const struct vm_map *map, vaddr_t *addr, vsize_t *size)
+{
+	const vsize_t pageoff = (vsize_t)(*addr & PAGE_MASK);
+
+	*addr -= pageoff;
+
+	if (*size != 0) {
+		*size += pageoff;
+		*size = (vsize_t)round_page(*size);
+	} else if (*addr + *size < *addr) {
+		return ENOMEM;
+	}
+
+	return range_test(map, *addr, *size, false);
+}
+
+/*
  * sys_mincore: determine if pages are in core or not.
  */
 
@@ -405,7 +425,7 @@ sys___msync13(struct lwp *l, const struc
 	} */
 	struct proc *p = l->l_proc;
 	vaddr_t addr;
-	vsize_t size, pageoff;
+	vsize_t size;
 	struct vm_map *map;
 	int error, flags, uvmflags;
 	bool rv;
@@ -427,22 +447,11 @@ sys___msync13(struct lwp *l, const struc
 		flags |= MS_SYNC;
 
 	/*
-	 * align the address to a page boundary and adjust the size accordingly.
-	 */
-
-	pageoff = (addr & PAGE_MASK);
-	addr -= pageoff;
-	size += pageoff;
-	size = (vsize_t)round_page(size);
-
-
-	/*
 	 * get map
 	 */
 	map = >p_vmspace->vm_map;
 
-	error = range_test(map, addr, size, false);
-	if (error)
+	if (round_and_check(map, , ))
 		return ENOMEM;
 
 	/*
@@ -497,10 +506,9 @@ sys_munmap(struct lwp *l, const struct s
 	} */
 	struct proc *p = l->l_proc;
 	vaddr_t addr;
-	vsize_t size, pageoff;
+	vsize_t size;
 	struct vm_map *map;
 	struct vm_map_entry *dead_entries;
-	int error;
 
 	/*
 	 * get syscall args.
@@ -509,24 +517,14 @@ sys_munmap(struct lwp *l, const struct s
 	addr = (vaddr_t)SCARG(uap, addr);
 	size = (vsize_t)SCARG(uap, len);
 
-	/*
-	 * align the address to a page boundary and adjust the size accordingly.
-	 */
+	map = >p_vmspace->vm_map;
 
-	pageoff = (addr & PAGE_MASK);
-	addr -= pageoff;
-	size += pageoff;
-	size = (vsize_t)round_page(size);
+	if (round_and_check(map, , ))
+		return EINVAL;
 
 	if (size == 0)
 		return 0;
 
-	map = >p_vmspace->vm_map;
-
-	error = range_test(map, addr, size, false);
-	if (error)
-		return EINVAL;
-
 	vm_map_lock(map);
 #if 0
 	/*
@@ -560,7 +558,7 @@ sys_mprotect(struct lwp *l, const struct
 	} */
 	struct proc *p = l->l_proc;
 	vaddr_t addr;
-	vsize_t size, pageoff;
+	vsize_t size;
 	vm_prot_t prot;
 	int error;
 
@@ -572,17 +570,7 @@ sys_mprotect(struct lwp *l, const struct
 	size = (vsize_t)SCARG(uap, len);
 	prot = SCARG(uap, prot) & VM_PROT_ALL;
 
-	/*
-	 * align the address to a page boundary and adjust the size accordingly.
-	 */
-
-	pageoff = (addr & PAGE_MASK);
-	addr -= pageoff;
-	size += pageoff;
-	size = round_page(size);
-
-	error = range_test(>p_vmspace->vm_map, addr, size, false);
-	if (error)
+	if (round_and_check(>p_vmspace->vm_map, , ))
 		return EINVAL;
 
 	error = uvm_map_protect_user(l, addr, addr + size, prot);
@@ -604,7 +592,7 @@ sys_minherit(struct lwp *l, const struct
 	} */
 	struct proc *p = l->l_proc;
 	vaddr_t addr;
-	vsize_t size, pageoff;
+	vsize_t size;
 	vm_inherit_t inherit;
 	int error;
 
@@ -612,17 +600,7 @@ sys_minherit(struct lwp *l, const struct
 	size = (vsize_t)SCARG(uap, len);
 	inherit = SCARG(uap, inherit);
 
-	/*
-	 * align the address to a page boundary and adjust the size accordingly.
-	 */
-
-	pageoff = (addr & PAGE_MASK);
-	addr -= pageoff;
-	size += pageoff;
-	size = (vsize_t)round_page(size);
-
-	error = range_test(>p_vmspace->vm_map, addr, size, false);
-	if (error)
+	if (round_and_check(>p_vmspace->vm_map, , ))
 		return EINVAL;
 
 	error = uvm_map_inherit(>p_vmspace->vm_map, addr, addr + 

CVS commit: src/sys/uvm

2019-03-14 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Mar 14 21:09:03 UTC 2019

Modified Files:
src/sys/uvm: uvm_mmap.c

Log Message:
unify rounding and range checking.


To generate a diff of this commit:
cvs rdiff -u -r1.170 -r1.171 src/sys/uvm/uvm_mmap.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/dev/nvmm/x86

2019-03-14 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Thu Mar 14 20:29:53 UTC 2019

Modified Files:
src/sys/dev/nvmm/x86: nvmm_x86_vmx.c

Log Message:
Optimize NVMM-Intel: keep the VMCS active on the host CPU, and lazy-switch
it on demand only when needed. This allows the CPU to use the cached
version of the guest state, rather than the in-memory copy of it. This is
much more performant.

A VMCS must be active on only one CPU, but one CPU can have several active
VMCSs at the same time.

We keep track of which CPU each VMCS is active on. When we want to execute
a VCPU, we determine whether its VMCS is loaded on another CPU, and if so
send an IPI to ask it to unbusy that VMCS. In most cases the VMCS is
already active on the current CPU, so we don't have to do anything and can
proceed with a fast VMRESUME.

We send IPIs with kpreemption enabled but with a bound LWP, because we
don't want to get context-switched to the CPU we just sent an IPI to.

Overall, with this in place, I see a ~15% performance increase in the
guests on NVMM-Intel.


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 src/sys/dev/nvmm/x86/nvmm_x86_vmx.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/nvmm/x86/nvmm_x86_vmx.c
diff -u src/sys/dev/nvmm/x86/nvmm_x86_vmx.c:1.18 src/sys/dev/nvmm/x86/nvmm_x86_vmx.c:1.19
--- src/sys/dev/nvmm/x86/nvmm_x86_vmx.c:1.18	Thu Mar 14 19:26:44 2019
+++ src/sys/dev/nvmm/x86/nvmm_x86_vmx.c	Thu Mar 14 20:29:53 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: nvmm_x86_vmx.c,v 1.18 2019/03/14 19:26:44 maxv Exp $	*/
+/*	$NetBSD: nvmm_x86_vmx.c,v 1.19 2019/03/14 20:29:53 maxv Exp $	*/
 
 /*
  * Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: nvmm_x86_vmx.c,v 1.18 2019/03/14 19:26:44 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nvmm_x86_vmx.c,v 1.19 2019/03/14 20:29:53 maxv Exp $");
 
 #include 
 #include 
@@ -648,6 +648,8 @@ struct vmx_cpudata {
 	struct vmcs *vmcs;
 	paddr_t vmcs_pa;
 	size_t vmcs_refcnt;
+	struct cpu_info *vmcs_ci;
+	bool vmcs_launched;
 
 	/* MSR bitmap */
 	uint8_t *msrbm;
@@ -762,9 +764,35 @@ vmx_get_revision(void)
 }
 
 static void
+vmx_vmclear_ipi(void *arg1, void *arg2)
+{
+	paddr_t vmcs_pa = (paddr_t)arg1;
+	vmx_vmclear(_pa);
+}
+
+static void
+vmx_vmclear_remote(struct cpu_info *ci, paddr_t vmcs_pa)
+{
+	uint64_t xc;
+	int bound;
+
+	KASSERT(kpreempt_disabled());
+
+	bound = curlwp_bind();
+	kpreempt_enable();
+
+	xc = xc_unicast(XC_HIGHPRI, vmx_vmclear_ipi, (void *)vmcs_pa, NULL, ci);
+	xc_wait(xc);
+
+	kpreempt_disable();
+	curlwp_bindx(bound);
+}
+
+static void
 vmx_vmcs_enter(struct nvmm_cpu *vcpu)
 {
 	struct vmx_cpudata *cpudata = vcpu->cpudata;
+	struct cpu_info *vmcs_ci;
 	paddr_t oldpa __diagused;
 
 	cpudata->vmcs_refcnt++;
@@ -777,12 +805,22 @@ vmx_vmcs_enter(struct nvmm_cpu *vcpu)
 		return;
 	}
 
+	vmcs_ci = cpudata->vmcs_ci;
+	cpudata->vmcs_ci = (void *)0x00FF; /* clobber */
+
 	kpreempt_disable();
 
-#ifdef DIAGNOSTIC
-	vmx_vmptrst();
-	KASSERT(oldpa == 0x);
-#endif
+	if (vmcs_ci == NULL) {
+		/* This VMCS is loaded for the first time. */
+		vmx_vmclear(>vmcs_pa);
+		cpudata->vmcs_launched = false;
+	} else if (vmcs_ci != curcpu()) {
+		/* This VMCS is active on a remote CPU. */
+		vmx_vmclear_remote(vmcs_ci, cpudata->vmcs_pa);
+		cpudata->vmcs_launched = false;
+	} else {
+		/* This VMCS is active on curcpu, nothing to do. */
+	}
 
 	vmx_vmptrld(>vmcs_pa);
 }
@@ -805,6 +843,24 @@ vmx_vmcs_leave(struct nvmm_cpu *vcpu)
 		return;
 	}
 
+	cpudata->vmcs_ci = curcpu();
+	kpreempt_enable();
+}
+
+static void
+vmx_vmcs_destroy(struct nvmm_cpu *vcpu)
+{
+	struct vmx_cpudata *cpudata = vcpu->cpudata;
+	paddr_t oldpa __diagused;
+
+	KASSERT(kpreempt_disabled());
+#ifdef DIAGNOSTIC
+	vmx_vmptrst();
+	KASSERT(oldpa == cpudata->vmcs_pa);
+#endif
+	KASSERT(cpudata->vmcs_refcnt == 1);
+	cpudata->vmcs_refcnt--;
+
 	vmx_vmclear(>vmcs_pa);
 	kpreempt_enable();
 }
@@ -1721,11 +1777,12 @@ vmx_vcpu_run(struct nvmm_machine *mach, 
 	uint64_t intstate;
 	uint64_t machgen;
 	int hcpu, s, ret;
-	bool launched = false;
+	bool launched;
 
 	vmx_vmcs_enter(vcpu);
 	ci = curcpu();
 	hcpu = cpu_number();
+	launched = cpudata->vmcs_launched;
 
 	vmx_gtlb_catchup(vcpu, hcpu);
 	vmx_htlb_catchup(vcpu, hcpu);
@@ -1860,6 +1917,8 @@ vmx_vcpu_run(struct nvmm_machine *mach, 
 		}
 	}
 
+	cpudata->vmcs_launched = launched;
+
 	vmx_vcpu_guest_misc_leave(vcpu);
 	vmx_vcpu_guest_dbregs_leave(vcpu);
 
@@ -2515,7 +2574,7 @@ vmx_vcpu_destroy(struct nvmm_machine *ma
 
 	vmx_vmcs_enter(vcpu);
 	vmx_asid_free(vcpu);
-	vmx_vmcs_leave(vcpu);
+	vmx_vmcs_destroy(vcpu);
 
 	kcpuset_destroy(cpudata->htlb_want_flush);
 



CVS commit: src/sys/dev/nvmm/x86

2019-03-14 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Thu Mar 14 20:29:53 UTC 2019

Modified Files:
src/sys/dev/nvmm/x86: nvmm_x86_vmx.c

Log Message:
Optimize NVMM-Intel: keep the VMCS active on the host CPU, and lazy-switch
it on demand only when needed. This allows the CPU to use the cached
version of the guest state, rather than the in-memory copy of it. This is
much more performant.

A VMCS must be active on only one CPU, but one CPU can have several active
VMCSs at the same time.

We keep track of which CPU each VMCS is active on. When we want to execute
a VCPU, we determine whether its VMCS is loaded on another CPU, and if so
send an IPI to ask it to unbusy that VMCS. In most cases the VMCS is
already active on the current CPU, so we don't have to do anything and can
proceed with a fast VMRESUME.

We send IPIs with kpreemption enabled but with a bound LWP, because we
don't want to get context-switched to the CPU we just sent an IPI to.

Overall, with this in place, I see a ~15% performance increase in the
guests on NVMM-Intel.


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 src/sys/dev/nvmm/x86/nvmm_x86_vmx.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/kern

2019-03-14 Thread Palle Lyckegaard
Module Name:src
Committed By:   palle
Date:   Thu Mar 14 19:51:50 UTC 2019

Modified Files:
src/sys/kern: kern_scdebug.c

Log Message:
syscall debug - fix build when SYSCALL_DEBUG option is present in kernel config 
file


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/kern/kern_scdebug.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/kern/kern_scdebug.c
diff -u src/sys/kern/kern_scdebug.c:1.1 src/sys/kern/kern_scdebug.c:1.2
--- src/sys/kern/kern_scdebug.c:1.1	Fri Sep 14 01:55:19 2018
+++ src/sys/kern/kern_scdebug.c	Thu Mar 14 19:51:49 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_scdebug.c,v 1.1 2018/09/14 01:55:19 mrg Exp $	*/
+/*	$NetBSD: kern_scdebug.c,v 1.2 2019/03/14 19:51:49 palle Exp $	*/
 
 /*
  * Copyright (c) 2015 Matthew R. Green
@@ -59,7 +59,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: kern_scdebug.c,v 1.1 2018/09/14 01:55:19 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_scdebug.c,v 1.2 2019/03/14 19:51:49 palle Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_syscall_debug.h"
@@ -112,9 +112,9 @@ KERNHIST_DEFINE(scdebughist);
 #define SCDEBUG_KERNHIST_CALLED(a)		KERNHIST_CALLED(a)
 #define SCDEBUG_KERNHIST_LOG(a,b,c,d,e,f)	KERNHIST_LOG(a,b,c,d,e,f)
 #else
-#define SCDEBUG_KERNHIST_FUNC(a)		/* nothing */
-#define SCDEBUG_KERNHIST_CALLED(a)		/* nothing */
-#define SCDEBUG_KERNHIST_LOG(a,b,c,d,e,f)	/* nothing */
+#define SCDEBUG_KERNHIST_FUNC(a)		{} /* nothing */
+#define SCDEBUG_KERNHIST_CALLED(a)		{} /* nothing */
+#define SCDEBUG_KERNHIST_LOG(a,b,c,d,e,f)	{} /* nothing */
 /* The non-kernhist support version can elide all this code easily. */
 #undef	SCDEBUG_KERNHIST
 #define	SCDEBUG_KERNHIST 0



CVS commit: src/sys/kern

2019-03-14 Thread Palle Lyckegaard
Module Name:src
Committed By:   palle
Date:   Thu Mar 14 19:51:50 UTC 2019

Modified Files:
src/sys/kern: kern_scdebug.c

Log Message:
syscall debug - fix build when SYSCALL_DEBUG option is present in kernel config 
file


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/kern/kern_scdebug.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/dev/nvmm/x86

2019-03-14 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Thu Mar 14 19:26:44 UTC 2019

Modified Files:
src/sys/dev/nvmm/x86: nvmm_x86_vmx.c

Log Message:
Move a KASSERT, applies to all branches.


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 src/sys/dev/nvmm/x86/nvmm_x86_vmx.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/nvmm/x86/nvmm_x86_vmx.c
diff -u src/sys/dev/nvmm/x86/nvmm_x86_vmx.c:1.17 src/sys/dev/nvmm/x86/nvmm_x86_vmx.c:1.18
--- src/sys/dev/nvmm/x86/nvmm_x86_vmx.c:1.17	Thu Mar  7 15:06:37 2019
+++ src/sys/dev/nvmm/x86/nvmm_x86_vmx.c	Thu Mar 14 19:26:44 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: nvmm_x86_vmx.c,v 1.17 2019/03/07 15:06:37 maxv Exp $	*/
+/*	$NetBSD: nvmm_x86_vmx.c,v 1.18 2019/03/14 19:26:44 maxv Exp $	*/
 
 /*
  * Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: nvmm_x86_vmx.c,v 1.17 2019/03/07 15:06:37 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nvmm_x86_vmx.c,v 1.18 2019/03/14 19:26:44 maxv Exp $");
 
 #include 
 #include 
@@ -794,14 +794,14 @@ vmx_vmcs_leave(struct nvmm_cpu *vcpu)
 	paddr_t oldpa __diagused;
 
 	KASSERT(kpreempt_disabled());
+#ifdef DIAGNOSTIC
+	vmx_vmptrst();
+	KASSERT(oldpa == cpudata->vmcs_pa);
+#endif
 	KASSERT(cpudata->vmcs_refcnt > 0);
 	cpudata->vmcs_refcnt--;
 
 	if (cpudata->vmcs_refcnt > 0) {
-#ifdef DIAGNOSTIC
-		vmx_vmptrst();
-		KASSERT(oldpa == cpudata->vmcs_pa);
-#endif
 		return;
 	}
 



CVS commit: src/sys/dev/nvmm/x86

2019-03-14 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Thu Mar 14 19:26:44 UTC 2019

Modified Files:
src/sys/dev/nvmm/x86: nvmm_x86_vmx.c

Log Message:
Move a KASSERT, applies to all branches.


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 src/sys/dev/nvmm/x86/nvmm_x86_vmx.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/dev/nvmm/x86

2019-03-14 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Thu Mar 14 19:15:26 UTC 2019

Modified Files:
src/sys/dev/nvmm/x86: nvmm_x86_svm.c

Log Message:
Reduce the mask of the VTPR, only the first four bits matter.


To generate a diff of this commit:
cvs rdiff -u -r1.33 -r1.34 src/sys/dev/nvmm/x86/nvmm_x86_svm.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/nvmm/x86/nvmm_x86_svm.c
diff -u src/sys/dev/nvmm/x86/nvmm_x86_svm.c:1.33 src/sys/dev/nvmm/x86/nvmm_x86_svm.c:1.34
--- src/sys/dev/nvmm/x86/nvmm_x86_svm.c:1.33	Sun Mar  3 07:01:09 2019
+++ src/sys/dev/nvmm/x86/nvmm_x86_svm.c	Thu Mar 14 19:15:26 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: nvmm_x86_svm.c,v 1.33 2019/03/03 07:01:09 maxv Exp $	*/
+/*	$NetBSD: nvmm_x86_svm.c,v 1.34 2019/03/14 19:15:26 maxv Exp $	*/
 
 /*
  * Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: nvmm_x86_svm.c,v 1.33 2019/03/03 07:01:09 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nvmm_x86_svm.c,v 1.34 2019/03/14 19:15:26 maxv Exp $");
 
 #include 
 #include 
@@ -303,7 +303,7 @@ struct vmcb_ctrl {
 #define VMCB_CTRL_TLB_CTRL_FLUSH_GUEST_NONGLOBAL	0x07
 
 	uint64_t v;
-#define VMCB_CTRL_V_TPR			__BITS(7,0)
+#define VMCB_CTRL_V_TPR			__BITS(3,0)
 #define VMCB_CTRL_V_IRQ			__BIT(8)
 #define VMCB_CTRL_V_VGIF		__BIT(9)
 #define VMCB_CTRL_V_INTR_PRIO		__BITS(19,16)



CVS commit: src/sys/dev/nvmm/x86

2019-03-14 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Thu Mar 14 19:15:26 UTC 2019

Modified Files:
src/sys/dev/nvmm/x86: nvmm_x86_svm.c

Log Message:
Reduce the mask of the VTPR, only the first four bits matter.


To generate a diff of this commit:
cvs rdiff -u -r1.33 -r1.34 src/sys/dev/nvmm/x86/nvmm_x86_svm.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/dev/nvmm

2019-03-14 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Thu Mar 14 19:10:28 UTC 2019

Modified Files:
src/sys/dev/nvmm: nvmm.c

Log Message:
Fail early if we're beyond the guest max ram.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/dev/nvmm/nvmm.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/uvm

2019-03-14 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Thu Mar 14 19:10:04 UTC 2019

Modified Files:
src/sys/uvm: uvm_map.c uvm_mmap.c uvm_page.c

Log Message:
Avoid a panic from the sequence

mlock(buf, 0);
munlock(buf, 0);
mlock(buf, page);
munlock(buf, page);

where buf is page aligned, and page is actually anything > 0
(but not too big) which will get rounded up to the next multiple
of the page size.

In that sequence, it is possible that the 1st munlock() is optional.

Add a KASSERT() (or two) to detect the first effects of the problem
(without that, or in !DIAGNOSTIC kernels) the problem eventually
causes some kind of problem or other (most often still a panic.)

After this, mlock(anything, 0) (or munlock) validates "anything"
but is otherwise a no-op (regardless of the alignment of anything).

Also, don't treat mlock(buf, verybig) as equivalent to mlock(buf, 0)
which is (more or less) what we had been doing.

XXX pullup -8 (maybe -7 as well, need to check).


To generate a diff of this commit:
cvs rdiff -u -r1.358 -r1.359 src/sys/uvm/uvm_map.c
cvs rdiff -u -r1.169 -r1.170 src/sys/uvm/uvm_mmap.c
cvs rdiff -u -r1.198 -r1.199 src/sys/uvm/uvm_page.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/dev/nvmm

2019-03-14 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Thu Mar 14 19:10:28 UTC 2019

Modified Files:
src/sys/dev/nvmm: nvmm.c

Log Message:
Fail early if we're beyond the guest max ram.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/dev/nvmm/nvmm.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/nvmm/nvmm.c
diff -u src/sys/dev/nvmm/nvmm.c:1.9 src/sys/dev/nvmm/nvmm.c:1.10
--- src/sys/dev/nvmm/nvmm.c:1.9	Thu Mar  7 15:22:21 2019
+++ src/sys/dev/nvmm/nvmm.c	Thu Mar 14 19:10:27 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: nvmm.c,v 1.9 2019/03/07 15:22:21 maxv Exp $	*/
+/*	$NetBSD: nvmm.c,v 1.10 2019/03/14 19:10:27 maxv Exp $	*/
 
 /*
  * Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: nvmm.c,v 1.9 2019/03/07 15:22:21 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nvmm.c,v 1.10 2019/03/14 19:10:27 maxv Exp $");
 
 #include 
 #include 
@@ -490,6 +490,9 @@ nvmm_do_vcpu_run(struct nvmm_machine *ma
 		if (__predict_true(exit->reason != NVMM_EXIT_MEMORY)) {
 			break;
 		}
+		if (exit->u.mem.gpa >= mach->gpa_end) {
+			break;
+		}
 		if (uvm_fault(>vm_map, exit->u.mem.gpa, VM_PROT_ALL)) {
 			break;
 		}



CVS commit: src/sys/uvm

2019-03-14 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Thu Mar 14 19:10:04 UTC 2019

Modified Files:
src/sys/uvm: uvm_map.c uvm_mmap.c uvm_page.c

Log Message:
Avoid a panic from the sequence

mlock(buf, 0);
munlock(buf, 0);
mlock(buf, page);
munlock(buf, page);

where buf is page aligned, and page is actually anything > 0
(but not too big) which will get rounded up to the next multiple
of the page size.

In that sequence, it is possible that the 1st munlock() is optional.

Add a KASSERT() (or two) to detect the first effects of the problem
(without that, or in !DIAGNOSTIC kernels) the problem eventually
causes some kind of problem or other (most often still a panic.)

After this, mlock(anything, 0) (or munlock) validates "anything"
but is otherwise a no-op (regardless of the alignment of anything).

Also, don't treat mlock(buf, verybig) as equivalent to mlock(buf, 0)
which is (more or less) what we had been doing.

XXX pullup -8 (maybe -7 as well, need to check).


To generate a diff of this commit:
cvs rdiff -u -r1.358 -r1.359 src/sys/uvm/uvm_map.c
cvs rdiff -u -r1.169 -r1.170 src/sys/uvm/uvm_mmap.c
cvs rdiff -u -r1.198 -r1.199 src/sys/uvm/uvm_page.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/uvm/uvm_map.c
diff -u src/sys/uvm/uvm_map.c:1.358 src/sys/uvm/uvm_map.c:1.359
--- src/sys/uvm/uvm_map.c:1.358	Sun Mar  3 17:37:36 2019
+++ src/sys/uvm/uvm_map.c	Thu Mar 14 19:10:04 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: uvm_map.c,v 1.358 2019/03/03 17:37:36 maxv Exp $	*/
+/*	$NetBSD: uvm_map.c,v 1.359 2019/03/14 19:10:04 kre Exp $	*/
 
 /*
  * Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -66,7 +66,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: uvm_map.c,v 1.358 2019/03/03 17:37:36 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uvm_map.c,v 1.359 2019/03/14 19:10:04 kre Exp $");
 
 #include "opt_ddb.h"
 #include "opt_pax.h"
@@ -3359,6 +3359,14 @@ uvm_map_pageable(struct vm_map *map, vad
 	}
 	entry = start_entry;
 
+	if (start == end) {		/* nothing required */
+		if ((lockflags & UVM_LK_EXIT) == 0)
+			vm_map_unlock(map);
+
+		UVMHIST_LOG(maphist,"<- done (nothing)",0,0,0,0);
+		return 0;
+	}
+
 	/*
 	 * handle wiring and unwiring separately.
 	 */

Index: src/sys/uvm/uvm_mmap.c
diff -u src/sys/uvm/uvm_mmap.c:1.169 src/sys/uvm/uvm_mmap.c:1.170
--- src/sys/uvm/uvm_mmap.c:1.169	Tue Dec 19 18:34:47 2017
+++ src/sys/uvm/uvm_mmap.c	Thu Mar 14 19:10:04 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: uvm_mmap.c,v 1.169 2017/12/19 18:34:47 kamil Exp $	*/
+/*	$NetBSD: uvm_mmap.c,v 1.170 2019/03/14 19:10:04 kre Exp $	*/
 
 /*
  * Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -46,7 +46,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: uvm_mmap.c,v 1.169 2017/12/19 18:34:47 kamil Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uvm_mmap.c,v 1.170 2019/03/14 19:10:04 kre Exp $");
 
 #include "opt_compat_netbsd.h"
 #include "opt_pax.h"
@@ -759,8 +759,12 @@ sys_mlock(struct lwp *l, const struct sy
 
 	pageoff = (addr & PAGE_MASK);
 	addr -= pageoff;
-	size += pageoff;
-	size = (vsize_t)round_page(size);
+	if (size != 0) {
+		size += pageoff;
+		size = (vsize_t)round_page(size);
+	}
+	if (addr + size < addr)
+		return ENOMEM;
 
 	error = range_test(>p_vmspace->vm_map, addr, size, false);
 	if (error)
@@ -810,8 +814,12 @@ sys_munlock(struct lwp *l, const struct 
 
 	pageoff = (addr & PAGE_MASK);
 	addr -= pageoff;
-	size += pageoff;
-	size = (vsize_t)round_page(size);
+	if (size != 0) {
+		size += pageoff;
+		size = (vsize_t)round_page(size);
+	}
+	if (addr + size < addr)
+		return ENOMEM;
 
 	error = range_test(>p_vmspace->vm_map, addr, size, false);
 	if (error)

Index: src/sys/uvm/uvm_page.c
diff -u src/sys/uvm/uvm_page.c:1.198 src/sys/uvm/uvm_page.c:1.199
--- src/sys/uvm/uvm_page.c:1.198	Sat May 19 15:03:26 2018
+++ src/sys/uvm/uvm_page.c	Thu Mar 14 19:10:04 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: uvm_page.c,v 1.198 2018/05/19 15:03:26 jdolecek Exp $	*/
+/*	$NetBSD: uvm_page.c,v 1.199 2019/03/14 19:10:04 kre Exp $	*/
 
 /*
  * Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -66,7 +66,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: uvm_page.c,v 1.198 2018/05/19 15:03:26 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uvm_page.c,v 1.199 2019/03/14 19:10:04 kre Exp $");
 
 #include "opt_ddb.h"
 #include "opt_uvm.h"
@@ -1605,9 +1605,11 @@ void
 uvm_pageunwire(struct vm_page *pg)
 {
 	KASSERT(mutex_owned(_pageqlock));
+	KASSERT(pg->wire_count != 0);
 	pg->wire_count--;
 	if (pg->wire_count == 0) {
 		uvm_pageactivate(pg);
+		KASSERT(uvmexp.wired != 0);
 		uvmexp.wired--;
 	}
 }



CVS commit: src/external/bsd/jemalloc/dist/include/jemalloc/internal

2019-03-14 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Mar 14 18:59:37 UTC 2019

Modified Files:
src/external/bsd/jemalloc/dist/include/jemalloc/internal:
arena_externs.h arena_inlines_a.h arena_inlines_b.h
atomic_gcc_atomic.h prof_inlines_a.h prof_inlines_b.h

Log Message:
Sync with installed versions.


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r1.2 \
src/external/bsd/jemalloc/dist/include/jemalloc/internal/arena_externs.h \
src/external/bsd/jemalloc/dist/include/jemalloc/internal/arena_inlines_a.h \
src/external/bsd/jemalloc/dist/include/jemalloc/internal/arena_inlines_b.h \

src/external/bsd/jemalloc/dist/include/jemalloc/internal/atomic_gcc_atomic.h \
src/external/bsd/jemalloc/dist/include/jemalloc/internal/prof_inlines_a.h
cvs rdiff -u -r1.2 -r1.3 \
src/external/bsd/jemalloc/dist/include/jemalloc/internal/prof_inlines_b.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/jemalloc/dist/include/jemalloc/internal/arena_externs.h
diff -u src/external/bsd/jemalloc/dist/include/jemalloc/internal/arena_externs.h:1.1.1.1 src/external/bsd/jemalloc/dist/include/jemalloc/internal/arena_externs.h:1.2
--- src/external/bsd/jemalloc/dist/include/jemalloc/internal/arena_externs.h:1.1.1.1	Mon Mar  4 12:10:22 2019
+++ src/external/bsd/jemalloc/dist/include/jemalloc/internal/arena_externs.h	Thu Mar 14 14:59:37 2019
@@ -56,8 +56,8 @@ void *arena_malloc_hard(tsdn_t *tsdn, ar
 szind_t ind, bool zero);
 void *arena_palloc(tsdn_t *tsdn, arena_t *arena, size_t usize,
 size_t alignment, bool zero, tcache_t *tcache);
-void arena_prof_promote(tsdn_t *tsdn, const void *ptr, size_t usize);
-void arena_dalloc_promoted(tsdn_t *tsdn, void *ptr, tcache_t *tcache,
+JEMALLOC_NORETURN void arena_prof_promote(tsdn_t *tsdn, const void *ptr, size_t usize);
+JEMALLOC_NORETURN void arena_dalloc_promoted(tsdn_t *tsdn, void *ptr, tcache_t *tcache,
 bool slow_path);
 void arena_dalloc_bin_junked_locked(tsdn_t *tsdn, arena_t *arena,
 extent_t *extent, void *ptr);
Index: src/external/bsd/jemalloc/dist/include/jemalloc/internal/arena_inlines_a.h
diff -u src/external/bsd/jemalloc/dist/include/jemalloc/internal/arena_inlines_a.h:1.1.1.1 src/external/bsd/jemalloc/dist/include/jemalloc/internal/arena_inlines_a.h:1.2
--- src/external/bsd/jemalloc/dist/include/jemalloc/internal/arena_inlines_a.h:1.1.1.1	Mon Mar  4 12:10:22 2019
+++ src/external/bsd/jemalloc/dist/include/jemalloc/internal/arena_inlines_a.h	Thu Mar 14 14:59:37 2019
@@ -32,7 +32,7 @@ arena_prof_accum(tsdn_t *tsdn, arena_t *
 	return prof_accum_add(tsdn, >prof_accum, accumbytes);
 }
 
-static inline void
+static JEMALLOC_NORETURN inline void
 percpu_arena_update(tsd_t *tsd, unsigned cpu) {
 	assert(have_percpu_arena);
 	arena_t *oldarena = tsd_arena_get(tsd);
Index: src/external/bsd/jemalloc/dist/include/jemalloc/internal/arena_inlines_b.h
diff -u src/external/bsd/jemalloc/dist/include/jemalloc/internal/arena_inlines_b.h:1.1.1.1 src/external/bsd/jemalloc/dist/include/jemalloc/internal/arena_inlines_b.h:1.2
--- src/external/bsd/jemalloc/dist/include/jemalloc/internal/arena_inlines_b.h:1.1.1.1	Mon Mar  4 12:10:22 2019
+++ src/external/bsd/jemalloc/dist/include/jemalloc/internal/arena_inlines_b.h	Thu Mar 14 14:59:37 2019
@@ -27,7 +27,7 @@ arena_prof_tctx_get(tsdn_t *tsdn, const 
 	return (prof_tctx_t *)(uintptr_t)1U;
 }
 
-JEMALLOC_ALWAYS_INLINE void
+JEMALLOC_NORETURN JEMALLOC_ALWAYS_INLINE void
 arena_prof_tctx_set(tsdn_t *tsdn, const void *ptr, UNUSED size_t usize,
 alloc_ctx_t *alloc_ctx, prof_tctx_t *tctx) {
 	cassert(config_prof);
@@ -46,7 +46,7 @@ arena_prof_tctx_set(tsdn_t *tsdn, const 
 	}
 }
 
-static inline void
+static JEMALLOC_NORETURN inline void
 arena_prof_tctx_reset(tsdn_t *tsdn, const void *ptr, UNUSED prof_tctx_t *tctx) {
 	cassert(config_prof);
 	assert(ptr != NULL);
Index: src/external/bsd/jemalloc/dist/include/jemalloc/internal/atomic_gcc_atomic.h
diff -u src/external/bsd/jemalloc/dist/include/jemalloc/internal/atomic_gcc_atomic.h:1.1.1.1 src/external/bsd/jemalloc/dist/include/jemalloc/internal/atomic_gcc_atomic.h:1.2
--- src/external/bsd/jemalloc/dist/include/jemalloc/internal/atomic_gcc_atomic.h:1.1.1.1	Mon Mar  4 12:10:23 2019
+++ src/external/bsd/jemalloc/dist/include/jemalloc/internal/atomic_gcc_atomic.h	Thu Mar 14 14:59:37 2019
@@ -36,8 +36,7 @@ atomic_fence(atomic_memory_order_t mo) {
 	__atomic_thread_fence(atomic_enum_to_builtin(mo));
 }
 
-#define JEMALLOC_GENERATE_ATOMICS(type, short_type,			\
-/* unused */ lg_size)		\
+#define JEMALLOC_GENERATE_ATOMICS(type, short_type, lg_size)		\
 typedef struct {			\
 	type repr;			\
 } atomic_##short_type##_t;		\
@@ -85,8 +84,7 @@ atomic_compare_exchange_strong_##short_t
 }
 
 
-#define JEMALLOC_GENERATE_INT_ATOMICS(type, short_type,			\
-/* unused */ lg_size)		\
+#define 

CVS commit: src/external/bsd/jemalloc/dist/include/jemalloc/internal

2019-03-14 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Mar 14 18:59:37 UTC 2019

Modified Files:
src/external/bsd/jemalloc/dist/include/jemalloc/internal:
arena_externs.h arena_inlines_a.h arena_inlines_b.h
atomic_gcc_atomic.h prof_inlines_a.h prof_inlines_b.h

Log Message:
Sync with installed versions.


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r1.2 \
src/external/bsd/jemalloc/dist/include/jemalloc/internal/arena_externs.h \
src/external/bsd/jemalloc/dist/include/jemalloc/internal/arena_inlines_a.h \
src/external/bsd/jemalloc/dist/include/jemalloc/internal/arena_inlines_b.h \

src/external/bsd/jemalloc/dist/include/jemalloc/internal/atomic_gcc_atomic.h \
src/external/bsd/jemalloc/dist/include/jemalloc/internal/prof_inlines_a.h
cvs rdiff -u -r1.2 -r1.3 \
src/external/bsd/jemalloc/dist/include/jemalloc/internal/prof_inlines_b.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/external/bsd/jemalloc

2019-03-14 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Mar 14 18:56:12 UTC 2019

Modified Files:
src/external/bsd/jemalloc/dist/src: prof.c
src/external/bsd/jemalloc/include/jemalloc/internal:
jemalloc_preamble.h

Log Message:
Remove __clang___ hacks for noreturn, reduce footprint when we don't compile
with JEMALLOC_PROF. More to do here.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/external/bsd/jemalloc/dist/src/prof.c
cvs rdiff -u -r1.1 -r1.2 \
src/external/bsd/jemalloc/include/jemalloc/internal/jemalloc_preamble.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/jemalloc/dist/src/prof.c
diff -u src/external/bsd/jemalloc/dist/src/prof.c:1.3 src/external/bsd/jemalloc/dist/src/prof.c:1.4
--- src/external/bsd/jemalloc/dist/src/prof.c:1.3	Sun Mar 10 15:34:30 2019
+++ src/external/bsd/jemalloc/dist/src/prof.c	Thu Mar 14 14:56:12 2019
@@ -78,7 +78,9 @@ size_t		lg_prof_sample;
  * creating/destroying mutexes.
  */
 static malloc_mutex_t	*gctx_locks;
+#ifdef JEMALLOC_PROF
 static atomic_u_t	cum_gctxs; /* Atomic counter. */
+#endif
 
 /*
  * Table of mutexes that are shared among tdata's.  No operations require
@@ -103,14 +105,18 @@ malloc_mutex_t		bt2gctx_mtx;
 static prof_tdata_tree_t	tdatas;
 static malloc_mutex_t	tdatas_mtx;
 
+#ifdef JEMALLOC_PROF
 static uint64_t		next_thr_uid;
+#endif
 static malloc_mutex_t	next_thr_uid_mtx;
 
 static malloc_mutex_t	prof_dump_seq_mtx;
+#ifdef JEMALLOC_PROF
 static uint64_t		prof_dump_seq;
 static uint64_t		prof_dump_iseq;
 static uint64_t		prof_dump_mseq;
 static uint64_t		prof_dump_useq;
+#endif
 
 /*
  * This buffer is rather large for stack allocation, so use a single buffer for
@@ -128,8 +134,10 @@ static char		prof_dump_buf[
 static size_t		prof_dump_buf_end;
 static int		prof_dump_fd;
 
+#ifdef JEMALLOC_PROF
 /* Do not dump any profiles until bootstrapping is complete. */
 static bool		prof_booted = false;
+#endif
 
 /**/
 /*
@@ -143,7 +151,9 @@ static bool	prof_tdata_should_destroy(ts
 bool even_if_attached);
 static void	prof_tdata_destroy(tsd_t *tsd, prof_tdata_t *tdata,
 bool even_if_attached);
+#ifdef JEMALLOC_PROF
 static char	*prof_thread_name_alloc(tsdn_t *tsdn, const char *thread_name);
+#endif
 
 /**/
 /* Red-black trees. */
@@ -207,7 +217,7 @@ rb_gen(static UNUSED, tdata_tree_, prof_
 
 /**/
 
-JEMALLOC_NORETURN void
+JEMALLOC_PROF_NORETURN void
 prof_alloc_rollback(tsd_t *tsd, prof_tctx_t *tctx, bool updated) {
 	prof_tdata_t *tdata;
 
@@ -237,7 +247,7 @@ prof_alloc_rollback(tsd_t *tsd, prof_tct
 	}
 }
 
-JEMALLOC_NORETURN void
+JEMALLOC_PROF_NORETURN void
 prof_malloc_sample_object(tsdn_t *tsdn, const void *ptr, size_t usize,
 prof_tctx_t *tctx) {
 	prof_tctx_set(tsdn, ptr, usize, NULL, tctx);
@@ -268,7 +278,7 @@ prof_free_sampled_object(tsd_t *tsd, siz
 	}
 }
 
-JEMALLOC_NORETURN void
+JEMALLOC_PROF_NORETURN void
 bt_init(prof_bt_t *bt, void **vec) {
 	cassert(config_prof);
 
@@ -276,7 +286,7 @@ bt_init(prof_bt_t *bt, void **vec) {
 	bt->len = 0;
 }
 
-static JEMALLOC_NORETURN void
+static JEMALLOC_PROF_NORETURN void
 prof_enter(tsd_t *tsd, prof_tdata_t *tdata) {
 	cassert(config_prof);
 	assert(tdata == prof_tdata_get(tsd, false));
@@ -289,7 +299,7 @@ prof_enter(tsd_t *tsd, prof_tdata_t *tda
 	malloc_mutex_lock(tsd_tsdn(tsd), _mtx);
 }
 
-static JEMALLOC_NORETURN void
+static JEMALLOC_PROF_NORETURN void
 prof_leave(tsd_t *tsd, prof_tdata_t *tdata) {
 	cassert(config_prof);
 	assert(tdata == prof_tdata_get(tsd, false));
@@ -537,6 +547,7 @@ prof_backtrace(prof_bt_t *bt) {
 }
 #endif
 
+#ifdef JEMALLOC_PROF
 static malloc_mutex_t *
 prof_gctx_mutex_choose(void) {
 	unsigned ngctxs = atomic_fetch_add_u(_gctxs, 1, ATOMIC_RELAXED);
@@ -574,8 +585,9 @@ prof_gctx_create(tsdn_t *tsdn, prof_bt_t
 	gctx->bt.len = bt->len;
 	return gctx;
 }
+#endif
 
-static JEMALLOC_NORETURN void
+static JEMALLOC_PROF_NORETURN void
 prof_gctx_try_destroy(tsd_t *tsd, prof_tdata_t *tdata_self, prof_gctx_t *gctx,
 prof_tdata_t *tdata) {
 	cassert(config_prof);
@@ -716,6 +728,7 @@ prof_tctx_destroy(tsd_t *tsd, prof_tctx_
 	}
 }
 
+#ifdef JEMALLOC_PROF
 static bool
 prof_lookup_global(tsd_t *tsd, prof_bt_t *bt, prof_tdata_t *tdata,
 void **p_btkey, prof_gctx_t **p_gctx, bool *p_new_gctx) {
@@ -780,9 +793,12 @@ prof_lookup_global(tsd_t *tsd, prof_bt_t
 	*p_new_gctx = new_gctx;
 	return false;
 }
+#endif
 
-prof_tctx_t *
+JEMALLOC_PROF_NORETURN prof_tctx_t *
 prof_lookup(tsd_t *tsd, prof_bt_t *bt) {
+	cassert(config_prof);
+#ifdef JEMALLOC_PROF
 	union {
 		prof_tctx_t	*p;
 		void		*v;
@@ -790,8 +806,6 @@ prof_lookup(tsd_t *tsd, prof_bt_t *bt) {
 	prof_tdata_t *tdata;
 	bool 

CVS commit: src/external/bsd/jemalloc

2019-03-14 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Mar 14 18:56:12 UTC 2019

Modified Files:
src/external/bsd/jemalloc/dist/src: prof.c
src/external/bsd/jemalloc/include/jemalloc/internal:
jemalloc_preamble.h

Log Message:
Remove __clang___ hacks for noreturn, reduce footprint when we don't compile
with JEMALLOC_PROF. More to do here.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/external/bsd/jemalloc/dist/src/prof.c
cvs rdiff -u -r1.1 -r1.2 \
src/external/bsd/jemalloc/include/jemalloc/internal/jemalloc_preamble.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/arch

2019-03-14 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Thu Mar 14 16:59:10 UTC 2019

Modified Files:
src/sys/arch/cesfic/conf: GENERIC
src/sys/arch/hp300/conf: GENERIC INSTALL
src/sys/arch/hp300/hp300: machdep.c
src/sys/arch/m68k/conf: files.m68k
src/sys/arch/m68k/include: m68k.h
src/sys/arch/m68k/m68k: copy.s
src/sys/arch/mvme68k/mvme68k: machdep.c
src/sys/arch/news68k/news68k: machdep.c
src/sys/arch/next68k/next68k: machdep.c
src/sys/arch/x68k/conf: GENERIC INSTALL
src/sys/arch/x68k/x68k: machdep.c
Removed Files:
src/sys/arch/m68k/m68k: mappedcopy.c

Log Message:
G/C "MAPPECOPY".  It is the deadest of wood, and never actually worked in
NetBSD.


To generate a diff of this commit:
cvs rdiff -u -r1.70 -r1.71 src/sys/arch/cesfic/conf/GENERIC
cvs rdiff -u -r1.200 -r1.201 src/sys/arch/hp300/conf/GENERIC
cvs rdiff -u -r1.63 -r1.64 src/sys/arch/hp300/conf/INSTALL
cvs rdiff -u -r1.229 -r1.230 src/sys/arch/hp300/hp300/machdep.c
cvs rdiff -u -r1.48 -r1.49 src/sys/arch/m68k/conf/files.m68k
cvs rdiff -u -r1.22 -r1.23 src/sys/arch/m68k/include/m68k.h
cvs rdiff -u -r1.45 -r1.46 src/sys/arch/m68k/m68k/copy.s
cvs rdiff -u -r1.27 -r0 src/sys/arch/m68k/m68k/mappedcopy.c
cvs rdiff -u -r1.154 -r1.155 src/sys/arch/mvme68k/mvme68k/machdep.c
cvs rdiff -u -r1.103 -r1.104 src/sys/arch/news68k/news68k/machdep.c
cvs rdiff -u -r1.111 -r1.112 src/sys/arch/next68k/next68k/machdep.c
cvs rdiff -u -r1.193 -r1.194 src/sys/arch/x68k/conf/GENERIC
cvs rdiff -u -r1.117 -r1.118 src/sys/arch/x68k/conf/INSTALL
cvs rdiff -u -r1.197 -r1.198 src/sys/arch/x68k/x68k/machdep.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/cesfic/conf/GENERIC
diff -u src/sys/arch/cesfic/conf/GENERIC:1.70 src/sys/arch/cesfic/conf/GENERIC:1.71
--- src/sys/arch/cesfic/conf/GENERIC:1.70	Wed Aug  1 20:04:10 2018
+++ src/sys/arch/cesfic/conf/GENERIC	Thu Mar 14 16:59:09 2019
@@ -1,4 +1,4 @@
-# $NetBSD: GENERIC,v 1.70 2018/08/01 20:04:10 maxv Exp $
+# $NetBSD: GENERIC,v 1.71 2019/03/14 16:59:09 thorpej Exp $
 #
 # GENERIC machine description file
 # 
@@ -90,10 +90,6 @@ options 	INET		# Internet protocols
 #options 	ALTQ_RIO	# RED with IN/OUT
 #options 	ALTQ_WFQ	# Weighted Fair Queueing
 
-# This option enables a different copyin/copyout that uses page
-# mapping for large copies.
-#options 	MAPPEDCOPY	# different copyin/copyout for large copies
-
 options 	COMPAT_M68K4K	# compat. with NetBSD/m68k4k binaries
 options 	COMPAT_AOUT_M68K # support for NetBSD a.out executables
 

Index: src/sys/arch/hp300/conf/GENERIC
diff -u src/sys/arch/hp300/conf/GENERIC:1.200 src/sys/arch/hp300/conf/GENERIC:1.201
--- src/sys/arch/hp300/conf/GENERIC:1.200	Wed Dec 19 13:57:47 2018
+++ src/sys/arch/hp300/conf/GENERIC	Thu Mar 14 16:59:09 2019
@@ -1,4 +1,4 @@
-# $NetBSD: GENERIC,v 1.200 2018/12/19 13:57:47 maxv Exp $
+# $NetBSD: GENERIC,v 1.201 2019/03/14 16:59:09 thorpej Exp $
 #
 # GENERIC machine description file
 #
@@ -22,7 +22,7 @@ include 	"arch/hp300/conf/std.hp300"
 
 options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
-#ident 		"GENERIC-$Revision: 1.200 $"
+#ident 		"GENERIC-$Revision: 1.201 $"
 
 makeoptions	COPTS="-O2 -fno-reorder-blocks"	# see share/mk/sys.mk
 
@@ -149,7 +149,6 @@ options 	NFS_BOOT_DHCP	# use dhcp for NF
 options 	USELEDS		# make the lights twinkle
 #options 	PANICBUTTON	# two fast s on HIL dump kernel
 #options 	CONSCODE=9	# force console at this select code
-#options 	MAPPEDCOPY	# different copyin/copyout for large copies
 
 # These options enable verbose messages for several subsystems.
 # Warning, these may compile large string tables into the kernel!

Index: src/sys/arch/hp300/conf/INSTALL
diff -u src/sys/arch/hp300/conf/INSTALL:1.63 src/sys/arch/hp300/conf/INSTALL:1.64
--- src/sys/arch/hp300/conf/INSTALL:1.63	Wed Aug  1 20:04:11 2018
+++ src/sys/arch/hp300/conf/INSTALL	Thu Mar 14 16:59:09 2019
@@ -1,4 +1,4 @@
-# $NetBSD: INSTALL,v 1.63 2018/08/01 20:04:11 maxv Exp $
+# $NetBSD: INSTALL,v 1.64 2019/03/14 16:59:09 thorpej Exp $
 #
 # INSTALL machine description file
 #
@@ -89,10 +89,6 @@ options 	INET		# Internet protocols
 #options 	PANICBUTTON	# two fast s on HIL dump kernel
 #options 	CONSCODE=9	# force console at this select code
 
-# This option enables a different copyin/copyout that uses page
-# mapping for large copies.
-#options 	MAPPEDCOPY	# different copyin/copyout for large copies
-
 # Debugging options
 #options 	DIAGNOSTIC	# Extra kernel sanity checks
 #options 	DEBUG		# Enable misc. kernel debugging code

Index: src/sys/arch/hp300/hp300/machdep.c
diff -u src/sys/arch/hp300/hp300/machdep.c:1.229 src/sys/arch/hp300/hp300/machdep.c:1.230
--- src/sys/arch/hp300/hp300/machdep.c:1.229	Sun Apr 20 04:12:54 2014
+++ src/sys/arch/hp300/hp300/machdep.c	Thu Mar 14 16:59:09 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: machdep.c,v 1.229 2014/04/20 04:12:54 

CVS commit: src/sys/arch

2019-03-14 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Thu Mar 14 16:59:10 UTC 2019

Modified Files:
src/sys/arch/cesfic/conf: GENERIC
src/sys/arch/hp300/conf: GENERIC INSTALL
src/sys/arch/hp300/hp300: machdep.c
src/sys/arch/m68k/conf: files.m68k
src/sys/arch/m68k/include: m68k.h
src/sys/arch/m68k/m68k: copy.s
src/sys/arch/mvme68k/mvme68k: machdep.c
src/sys/arch/news68k/news68k: machdep.c
src/sys/arch/next68k/next68k: machdep.c
src/sys/arch/x68k/conf: GENERIC INSTALL
src/sys/arch/x68k/x68k: machdep.c
Removed Files:
src/sys/arch/m68k/m68k: mappedcopy.c

Log Message:
G/C "MAPPECOPY".  It is the deadest of wood, and never actually worked in
NetBSD.


To generate a diff of this commit:
cvs rdiff -u -r1.70 -r1.71 src/sys/arch/cesfic/conf/GENERIC
cvs rdiff -u -r1.200 -r1.201 src/sys/arch/hp300/conf/GENERIC
cvs rdiff -u -r1.63 -r1.64 src/sys/arch/hp300/conf/INSTALL
cvs rdiff -u -r1.229 -r1.230 src/sys/arch/hp300/hp300/machdep.c
cvs rdiff -u -r1.48 -r1.49 src/sys/arch/m68k/conf/files.m68k
cvs rdiff -u -r1.22 -r1.23 src/sys/arch/m68k/include/m68k.h
cvs rdiff -u -r1.45 -r1.46 src/sys/arch/m68k/m68k/copy.s
cvs rdiff -u -r1.27 -r0 src/sys/arch/m68k/m68k/mappedcopy.c
cvs rdiff -u -r1.154 -r1.155 src/sys/arch/mvme68k/mvme68k/machdep.c
cvs rdiff -u -r1.103 -r1.104 src/sys/arch/news68k/news68k/machdep.c
cvs rdiff -u -r1.111 -r1.112 src/sys/arch/next68k/next68k/machdep.c
cvs rdiff -u -r1.193 -r1.194 src/sys/arch/x68k/conf/GENERIC
cvs rdiff -u -r1.117 -r1.118 src/sys/arch/x68k/conf/INSTALL
cvs rdiff -u -r1.197 -r1.198 src/sys/arch/x68k/x68k/machdep.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



Re: CVS commit: src/sys/arch/evbarm/conf

2019-03-14 Thread Jared McNeill
Because we are using image type "kernel_noload" instead of "kernel" for 
GENERIC. The header on "kernel" type images contains a load address, and 
U-Boot will uncompress the kernel there. For "kernel_noload" type images 
there is no load address specified, with the expectation that the kernel 
will be executed in place.


It's probably not very hard to fix U-Boot to handle this case..


On Thu, 14 Mar 2019, Manuel Bouyer wrote:


On Thu, Mar 14, 2019 at 10:22:43AM +, Jared D. McNeill wrote:

Module Name:src
Committed By:   jmcneill
Date:   Thu Mar 14 10:22:43 UTC 2019

Modified Files:
src/sys/arch/evbarm/conf: mk.generic

Log Message:
U-Boot fails to boot a compressed kernel_noload image, so stop emitting
them.


Any idea why it doesn't work any more ?

--
Manuel Bouyer 
NetBSD: 26 ans d'experience feront toujours la difference
--




Re: CVS commit: src/sys/arch/evbarm/conf

2019-03-14 Thread Manuel Bouyer
On Thu, Mar 14, 2019 at 10:22:43AM +, Jared D. McNeill wrote:
> Module Name:  src
> Committed By: jmcneill
> Date: Thu Mar 14 10:22:43 UTC 2019
> 
> Modified Files:
>   src/sys/arch/evbarm/conf: mk.generic
> 
> Log Message:
> U-Boot fails to boot a compressed kernel_noload image, so stop emitting
> them.

Any idea why it doesn't work any more ?

-- 
Manuel Bouyer 
 NetBSD: 26 ans d'experience feront toujours la difference
--


CVS commit: src/sbin/gpt

2019-03-14 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Thu Mar 14 10:26:10 UTC 2019

Modified Files:
src/sbin/gpt: header.c

Log Message:
print little-endian header fields correctly.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sbin/gpt/header.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sbin/gpt/header.c
diff -u src/sbin/gpt/header.c:1.9 src/sbin/gpt/header.c:1.10
--- src/sbin/gpt/header.c:1.9	Tue May  1 08:17:13 2018
+++ src/sbin/gpt/header.c	Thu Mar 14 10:26:10 2019
@@ -33,7 +33,7 @@
 
 #include 
 #ifdef __RCSID
-__RCSID("$NetBSD: header.c,v 1.9 2018/05/01 08:17:13 martin Exp $");
+__RCSID("$NetBSD: header.c,v 1.10 2019/03/14 10:26:10 mlelstv Exp $");
 #endif
 
 #include 
@@ -90,11 +90,11 @@ header(gpt_t gpt)
 	revision = le32toh(hdr->hdr_revision);
 	printf("- GPT Header Revision: %u.%u\n", revision >> 16,
 	 revision & 0x);
-	gpt_show_num("- First Data Sector", hdr->hdr_lba_start);
-	gpt_show_num("- Last Data Sector", hdr->hdr_lba_end);
+	gpt_show_num("- First Data Sector", le64toh(hdr->hdr_lba_start));
+	gpt_show_num("- Last Data Sector", le64toh(hdr->hdr_lba_end));
 	gpt_uuid_snprintf(buf, sizeof(buf), "%d", hdr->hdr_guid);
 	printf("- Media GUID: %s\n", buf);
-	printf("- Number of GPT Entries: %u\n", hdr->hdr_entries);
+	printf("- Number of GPT Entries: %u\n", le32toh(hdr->hdr_entries));
 	return 0;
 }
 



CVS commit: src/sbin/gpt

2019-03-14 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Thu Mar 14 10:26:10 UTC 2019

Modified Files:
src/sbin/gpt: header.c

Log Message:
print little-endian header fields correctly.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sbin/gpt/header.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/arch/evbarm/conf

2019-03-14 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Thu Mar 14 10:22:43 UTC 2019

Modified Files:
src/sys/arch/evbarm/conf: mk.generic

Log Message:
U-Boot fails to boot a compressed kernel_noload image, so stop emitting
them.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/evbarm/conf/mk.generic

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/evbarm/conf/mk.generic
diff -u src/sys/arch/evbarm/conf/mk.generic:1.5 src/sys/arch/evbarm/conf/mk.generic:1.6
--- src/sys/arch/evbarm/conf/mk.generic:1.5	Tue Oct 30 09:06:07 2018
+++ src/sys/arch/evbarm/conf/mk.generic	Thu Mar 14 10:22:43 2019
@@ -1,4 +1,4 @@
-#	$NetBSD: mk.generic,v 1.5 2018/10/30 09:06:07 martin Exp $
+#	$NetBSD: mk.generic,v 1.6 2019/03/14 10:22:43 jmcneill Exp $
 
 .include "$S/arch/arm/nvidia/tegra_xusb-fw.mk"
 
@@ -11,23 +11,15 @@ SYSTEM_FIRST_SFILE=	${ARM}/arm/armv6_sta
 
 _OSRELEASE!=		${HOST_SH} $S/conf/osrelease.sh
 
-MKUBOOTIMAGEARGS=	-A arm -T kernel_noload -O linux
+MKUBOOTIMAGEARGS=	-A arm -T kernel_noload -O linux -C none
 MKUBOOTIMAGEARGS+=	-e 0
 MKUBOOTIMAGEARGS+=	-n "NetBSD/${BOARDTYPE:U${MACHINE_ARCH}} ${_OSRELEASE}"
-MKUBOOTIMAGEARGS_NONE=	${MKUBOOTIMAGEARGS} -C none
-MKUBOOTIMAGEARGS_GZ=	${MKUBOOTIMAGEARGS} -C gz
 
 SYSTEM_LD_TAIL_EXTRA+=; \
 	echo ${OBJCOPY} -S -O binary $@ $@.bin; \
 	${OBJCOPY} -S -O binary $@ $@.bin; \
-	echo ${TOOL_MKUBOOTIMAGE} ${MKUBOOTIMAGEARGS_NONE} $@.bin $@.ub; \
-	${TOOL_MKUBOOTIMAGE} ${MKUBOOTIMAGEARGS_NONE} $@.bin $@.ub; \
-	echo ${TOOL_GZIP} -c $@.bin > $@.bin.gz; \
-	${TOOL_GZIP} -c $@.bin > $@.bin.gz; \
-	echo ${TOOL_MKUBOOTIMAGE} ${MKUBOOTIMAGEARGS_GZ} $@.bin.gz $@.gz.ub; \
-	${TOOL_MKUBOOTIMAGE} ${MKUBOOTIMAGEARGS_GZ} $@.bin.gz $@.gz.ub
+	echo ${TOOL_MKUBOOTIMAGE} ${MKUBOOTIMAGEARGS} $@.bin $@.ub; \
+	${TOOL_MKUBOOTIMAGE} ${MKUBOOTIMAGEARGS} $@.bin $@.ub;
 
 EXTRA_KERNELS+= ${KERNELS:@.KERNEL.@${.KERNEL.}.bin@}
 EXTRA_KERNELS+= ${KERNELS:@.KERNEL.@${.KERNEL.}.ub@}
-EXTRA_KERNELS+= ${KERNELS:@.KERNEL.@${.KERNEL.}.bin.gz@}
-EXTRA_KERNELS+= ${KERNELS:@.KERNEL.@${.KERNEL.}.gz.ub@}



CVS commit: src/sys/arch/evbarm/conf

2019-03-14 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Thu Mar 14 10:22:43 UTC 2019

Modified Files:
src/sys/arch/evbarm/conf: mk.generic

Log Message:
U-Boot fails to boot a compressed kernel_noload image, so stop emitting
them.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/evbarm/conf/mk.generic

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/netinet

2019-03-14 Thread Ryota Ozaki
Module Name:src
Committed By:   ozaki-r
Date:   Thu Mar 14 07:05:07 UTC 2019

Modified Files:
src/sys/netinet: ip_carp.c

Log Message:
carp: don't skip pserialize_read_enter and ifa_release


To generate a diff of this commit:
cvs rdiff -u -r1.101 -r1.102 src/sys/netinet/ip_carp.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/netinet/ip_carp.c
diff -u src/sys/netinet/ip_carp.c:1.101 src/sys/netinet/ip_carp.c:1.102
--- src/sys/netinet/ip_carp.c:1.101	Sat Dec 22 14:28:57 2018
+++ src/sys/netinet/ip_carp.c	Thu Mar 14 07:05:07 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: ip_carp.c,v 1.101 2018/12/22 14:28:57 maxv Exp $	*/
+/*	$NetBSD: ip_carp.c,v 1.102 2019/03/14 07:05:07 ozaki-r Exp $	*/
 /*	$OpenBSD: ip_carp.c,v 1.113 2005/11/04 08:11:54 mcbride Exp $	*/
 
 /*
@@ -33,7 +33,7 @@
 #endif
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ip_carp.c,v 1.101 2018/12/22 14:28:57 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ip_carp.c,v 1.102 2019/03/14 07:05:07 ozaki-r Exp $");
 
 /*
  * TODO:
@@ -410,7 +410,7 @@ carp_setroute(struct carp_softc *sc, int
 ifatoia(ifa), CARP_COUNT_MASTER);
 if ((cmd == RTM_ADD && count != 1) ||
 (cmd == RTM_DELETE && count != 0))
-	continue;
+	goto next;
 			}
 
 			/* Remove the existing host route, if any */
@@ -485,6 +485,7 @@ carp_setroute(struct carp_softc *sc, int
 		default:
 			break;
 		}
+	next:
 		s = pserialize_read_enter();
 		ifa_release(ifa, );
 	}



CVS commit: src/sys/netinet

2019-03-14 Thread Ryota Ozaki
Module Name:src
Committed By:   ozaki-r
Date:   Thu Mar 14 07:05:07 UTC 2019

Modified Files:
src/sys/netinet: ip_carp.c

Log Message:
carp: don't skip pserialize_read_enter and ifa_release


To generate a diff of this commit:
cvs rdiff -u -r1.101 -r1.102 src/sys/netinet/ip_carp.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.