CVS commit: src/sys/arch/x86/x86

2019-05-15 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu May 16 04:26:13 UTC 2019

Modified Files:
src/sys/arch/x86/x86: procfs_machdep.c

Log Message:
 Revert rev. 1.29. Use current cpuid 7 edx value to print.


To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.31 src/sys/arch/x86/x86/procfs_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/x86/x86/procfs_machdep.c
diff -u src/sys/arch/x86/x86/procfs_machdep.c:1.30 src/sys/arch/x86/x86/procfs_machdep.c:1.31
--- src/sys/arch/x86/x86/procfs_machdep.c:1.30	Thu May 16 02:42:19 2019
+++ src/sys/arch/x86/x86/procfs_machdep.c	Thu May 16 04:26:13 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: procfs_machdep.c,v 1.30 2019/05/16 02:42:19 msaitoh Exp $ */
+/*	$NetBSD: procfs_machdep.c,v 1.31 2019/05/16 04:26:13 msaitoh Exp $ */
 
 /*
  * Copyright (c) 2001 Wasabi Systems, Inc.
@@ -42,7 +42,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: procfs_machdep.c,v 1.30 2019/05/16 02:42:19 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: procfs_machdep.c,v 1.31 2019/05/16 04:26:13 msaitoh Exp $");
 
 #include 
 #include 
@@ -345,9 +345,11 @@ procfs_getonecpufeatures(struct cpu_info
 		diff = last - *left;
 	}
 
-	if (cpu_vendor == CPUVENDOR_INTEL) {
-		procfs_getonefeatreg(ci->ci_feat_val[7], x86_features[18],
-		p + diff, left);
+	if ((cpu_vendor == CPUVENDOR_INTEL)
+	&& (ci->ci_max_cpuid >= 0x0007)) {
+		x86_cpuid(0x0007, descs);
+		procfs_getonefeatreg(descs[3], x86_features[18], p + diff,
+		left);
 		diff = last - *left;
 	}
 



CVS commit: src/sys/arch/x86/x86

2019-05-15 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu May 16 04:26:13 UTC 2019

Modified Files:
src/sys/arch/x86/x86: procfs_machdep.c

Log Message:
 Revert rev. 1.29. Use current cpuid 7 edx value to print.


To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.31 src/sys/arch/x86/x86/procfs_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/x86/x86

2019-05-15 Thread Masanobu SAITOH
On 2019/05/16 13:19, Maxime Villard wrote:
> Le 16/05/2019 à 04:36, SAITOH Masanobu a écrit :
>> Module Name:    src
>> Committed By:    msaitoh
>> Date:    Thu May 16 02:36:30 UTC 2019
>>
>> Modified Files:
>> src/sys/arch/x86/x86: procfs_machdep.c
>>
>> Log Message:
>>   Use ci_feat_val[7] instead of directly getting cpuid 7 edx.
>>
>>
>> To generate a diff of this commit:
>> cvs rdiff -u -r1.28 -r1.29 src/sys/arch/x86/x86/procfs_machdep.c
>>
>> Please note that diffs are not public domain; they are subject to the
>> copyright notices on the relevant files.
> 
> The microcode updates CPUID7, if you read ci_feat_val you have the
> initial value, not the updated value. So reading CPUID7 was the right
> thing to do.

 We have no callback or something like it to reflect the change
to ci_feat_val, so you're right.

I'll revert it.

-- 
---
SAITOH Masanobu (msai...@execsw.org
 msai...@netbsd.org)


Re: CVS commit: src/sys/arch/x86/x86

2019-05-15 Thread Jason Thorpe



> On May 15, 2019, at 9:19 PM, Maxime Villard  wrote:
> 
> Le 16/05/2019 à 04:36, SAITOH Masanobu a écrit :
>> Module Name: src
>> Committed By:msaitoh
>> Date:Thu May 16 02:36:30 UTC 2019
>> Modified Files:
>>  src/sys/arch/x86/x86: procfs_machdep.c
>> Log Message:
>>  Use ci_feat_val[7] instead of directly getting cpuid 7 edx.
>> To generate a diff of this commit:
>> cvs rdiff -u -r1.28 -r1.29 src/sys/arch/x86/x86/procfs_machdep.c
>> Please note that diffs are not public domain; they are subject to the
>> copyright notices on the relevant files.
> 
> The microcode updates CPUID7, if you read ci_feat_val you have the
> initial value, not the updated value. So reading CPUID7 was the right
> thing to do.

Should the microcode update procedure fix up the cached copy?

-- thorpej



Re: CVS commit: src/sys/arch/x86/x86

2019-05-15 Thread Maxime Villard

Le 16/05/2019 à 04:36, SAITOH Masanobu a écrit :

Module Name:src
Committed By:   msaitoh
Date:   Thu May 16 02:36:30 UTC 2019

Modified Files:
src/sys/arch/x86/x86: procfs_machdep.c

Log Message:
  Use ci_feat_val[7] instead of directly getting cpuid 7 edx.


To generate a diff of this commit:
cvs rdiff -u -r1.28 -r1.29 src/sys/arch/x86/x86/procfs_machdep.c

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


The microcode updates CPUID7, if you read ci_feat_val you have the
initial value, not the updated value. So reading CPUID7 was the right
thing to do.


CVS commit: src/sys/arch/x86/x86

2019-05-15 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu May 16 02:42:19 UTC 2019

Modified Files:
src/sys/arch/x86/x86: procfs_machdep.c

Log Message:
 Add md_clear.


To generate a diff of this commit:
cvs rdiff -u -r1.29 -r1.30 src/sys/arch/x86/x86/procfs_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/x86/x86/procfs_machdep.c
diff -u src/sys/arch/x86/x86/procfs_machdep.c:1.29 src/sys/arch/x86/x86/procfs_machdep.c:1.30
--- src/sys/arch/x86/x86/procfs_machdep.c:1.29	Thu May 16 02:36:30 2019
+++ src/sys/arch/x86/x86/procfs_machdep.c	Thu May 16 02:42:19 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: procfs_machdep.c,v 1.29 2019/05/16 02:36:30 msaitoh Exp $ */
+/*	$NetBSD: procfs_machdep.c,v 1.30 2019/05/16 02:42:19 msaitoh Exp $ */
 
 /*
  * Copyright (c) 2001 Wasabi Systems, Inc.
@@ -42,7 +42,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: procfs_machdep.c,v 1.29 2019/05/16 02:36:30 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: procfs_machdep.c,v 1.30 2019/05/16 02:42:19 msaitoh Exp $");
 
 #include 
 #include 
@@ -188,7 +188,7 @@ static const char * const x86_features[]
 
 	{ /* (18) Intel 0x0007 edx */
 	NULL, NULL, "avx512_4vnniw", "avx512_4fmaps", NULL, NULL, NULL, NULL,
-	NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+	NULL, NULL, "md_clear", NULL, NULL, NULL, NULL, NULL,
 	NULL, NULL, "pconfig", NULL, NULL, NULL, NULL, NULL,
 	NULL, NULL, NULL, NULL,
 	"flush_l1d", "arch_capabilities", NULL, "ssbd"},



CVS commit: src/sys/arch/x86/x86

2019-05-15 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu May 16 02:42:19 UTC 2019

Modified Files:
src/sys/arch/x86/x86: procfs_machdep.c

Log Message:
 Add md_clear.


To generate a diff of this commit:
cvs rdiff -u -r1.29 -r1.30 src/sys/arch/x86/x86/procfs_machdep.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/x86/x86

2019-05-15 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu May 16 02:36:30 UTC 2019

Modified Files:
src/sys/arch/x86/x86: procfs_machdep.c

Log Message:
 Use ci_feat_val[7] instead of directly getting cpuid 7 edx.


To generate a diff of this commit:
cvs rdiff -u -r1.28 -r1.29 src/sys/arch/x86/x86/procfs_machdep.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/x86/x86

2019-05-15 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu May 16 02:36:30 UTC 2019

Modified Files:
src/sys/arch/x86/x86: procfs_machdep.c

Log Message:
 Use ci_feat_val[7] instead of directly getting cpuid 7 edx.


To generate a diff of this commit:
cvs rdiff -u -r1.28 -r1.29 src/sys/arch/x86/x86/procfs_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/x86/x86/procfs_machdep.c
diff -u src/sys/arch/x86/x86/procfs_machdep.c:1.28 src/sys/arch/x86/x86/procfs_machdep.c:1.29
--- src/sys/arch/x86/x86/procfs_machdep.c:1.28	Mon Feb 18 05:41:20 2019
+++ src/sys/arch/x86/x86/procfs_machdep.c	Thu May 16 02:36:30 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: procfs_machdep.c,v 1.28 2019/02/18 05:41:20 msaitoh Exp $ */
+/*	$NetBSD: procfs_machdep.c,v 1.29 2019/05/16 02:36:30 msaitoh Exp $ */
 
 /*
  * Copyright (c) 2001 Wasabi Systems, Inc.
@@ -42,7 +42,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: procfs_machdep.c,v 1.28 2019/02/18 05:41:20 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: procfs_machdep.c,v 1.29 2019/05/16 02:36:30 msaitoh Exp $");
 
 #include 
 #include 
@@ -345,11 +345,9 @@ procfs_getonecpufeatures(struct cpu_info
 		diff = last - *left;
 	}
 
-	if ((cpu_vendor == CPUVENDOR_INTEL)
-	&& (ci->ci_max_cpuid >= 0x0007)) {
-		x86_cpuid(0x0007, descs);
-		procfs_getonefeatreg(descs[3], x86_features[18], p + diff,
-		left);
+	if (cpu_vendor == CPUVENDOR_INTEL) {
+		procfs_getonefeatreg(ci->ci_feat_val[7], x86_features[18],
+		p + diff, left);
 		diff = last - *left;
 	}
 



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

2019-05-15 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu May 16 01:22:36 UTC 2019

Modified Files:
src/external/mit/xorg/lib: asm.mk
src/external/mit/xorg/lib/gallium: Makefile
src/external/mit/xorg/lib/libGL: Makefile
src/external/mit/xorg/lib/libpciaccess: Makefile

Log Message:
Fix MKCOMPATX11 build


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/external/mit/xorg/lib/asm.mk
cvs rdiff -u -r1.26 -r1.27 src/external/mit/xorg/lib/gallium/Makefile
cvs rdiff -u -r1.26 -r1.27 src/external/mit/xorg/lib/libGL/Makefile
cvs rdiff -u -r1.8 -r1.9 src/external/mit/xorg/lib/libpciaccess/Makefile

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-05-15 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu May 16 01:22:36 UTC 2019

Modified Files:
src/external/mit/xorg/lib: asm.mk
src/external/mit/xorg/lib/gallium: Makefile
src/external/mit/xorg/lib/libGL: Makefile
src/external/mit/xorg/lib/libpciaccess: Makefile

Log Message:
Fix MKCOMPATX11 build


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/external/mit/xorg/lib/asm.mk
cvs rdiff -u -r1.26 -r1.27 src/external/mit/xorg/lib/gallium/Makefile
cvs rdiff -u -r1.26 -r1.27 src/external/mit/xorg/lib/libGL/Makefile
cvs rdiff -u -r1.8 -r1.9 src/external/mit/xorg/lib/libpciaccess/Makefile

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/asm.mk
diff -u src/external/mit/xorg/lib/asm.mk:1.2 src/external/mit/xorg/lib/asm.mk:1.3
--- src/external/mit/xorg/lib/asm.mk:1.2	Fri Apr  5 06:31:53 2019
+++ src/external/mit/xorg/lib/asm.mk	Wed May 15 21:22:35 2019
@@ -1,17 +1,16 @@
-#	$NetBSD: asm.mk,v 1.2 2019/04/05 10:31:53 maya Exp $
+#	$NetBSD: asm.mk,v 1.3 2019/05/16 01:22:35 christos Exp $
 
 # Shared with libmesa.mk / libGL / libglapi
 
-.if ${MACHINE} == "amd64"
-CPPFLAGS+=	\
+X11ASM_CPPFLAGS.x86_64+=	\
 	-DUSE_SSE41 \
 	-DUSE_X86_64_ASM
-.elif ${MACHINE} == "i386"
-CPPFLAGS+=	\
+
+X11ASM_CPPFLAGS.i386+=	\
 	-DUSE_X86_ASM \
 	-DUSE_MMX_ASM \
 	-DUSE_3DNOW_ASM \
 	-DUSE_SSE_ASM \
 	-DGLX_X86_READONLY_TEXT
-.elif ${MACHINE} == "sparc" || ${MACHINE} == "sparc64"
-.endif
+
+CPPFLAGS+= ${X11ASM_CPPFLAGS.${XORG_MACHINE_ARCH:U${MACHINE_ARCH}}}

Index: src/external/mit/xorg/lib/gallium/Makefile
diff -u src/external/mit/xorg/lib/gallium/Makefile:1.26 src/external/mit/xorg/lib/gallium/Makefile:1.27
--- src/external/mit/xorg/lib/gallium/Makefile:1.26	Sat May 11 13:44:16 2019
+++ src/external/mit/xorg/lib/gallium/Makefile	Wed May 15 21:22:35 2019
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.26 2019/05/11 17:44:16 christos Exp $
+# $NetBSD: Makefile,v 1.27 2019/05/16 01:22:35 christos Exp $
 
 # Link the gallium mega driver.
 
@@ -1045,9 +1045,8 @@ CPPFLAGS.streaming-load-memcpy.c+= -msse
 .endif
 
 # Needs 64bit atomics
-.if ${MACHINE} == "i386"
-CPPFLAGS+=	-march=i586
-.endif
+CPPFLAGS.i386+= -march=i586
+CPPFLAGS+=	${CPPFLAGS.${XORG_MACHINE_ARCH:U${MACHINE_ARCH}}}
 
 .include "../driver.mk"
 

Index: src/external/mit/xorg/lib/libGL/Makefile
diff -u src/external/mit/xorg/lib/libGL/Makefile:1.26 src/external/mit/xorg/lib/libGL/Makefile:1.27
--- src/external/mit/xorg/lib/libGL/Makefile:1.26	Thu Apr 18 18:49:08 2019
+++ src/external/mit/xorg/lib/libGL/Makefile	Wed May 15 21:22:36 2019
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.26 2019/04/18 22:49:08 mrg Exp $
+#	$NetBSD: Makefile,v 1.27 2019/05/16 01:22:36 christos Exp $
 
 .include 
 
@@ -60,12 +60,13 @@ BUILDSYMLINKS+=	${X11SRCDIR.Mesa}/src/ut
 SRCS.glapi=	glapi_gentable.c
 
 .PATH:		${X11SRCDIR.Mesa}/src/mapi/glapi
-.if ${MACHINE_ARCH} == "i386"
-SRCS.glx+=			glapi_x86.S
-.elif ${MACHINE_ARCH} == "x86_64"
-SRCS.glx+=			glapi_x86-64.S
-.elif ${MACHINE_ARCH} == "sparc"
-SRCS.glx+=			glapi_sparc.S
+
+SRCS.i386.glx=		glapi_x86.S
+SRCS.x86_64.glx=	glapi_x86-64.S
+SRCS.sparc.glx=		glapi_sparc.S
+
+.if !empty(SRCS.${MACHINE_ARCH}.glx)
+SRCS.glx += ${SRCS.${XORG_MACHINE_ARCH:U${MACHINE_ARCH}}.glx}
 .else
 SRCS.glapi+=			entry.c
 .endif

Index: src/external/mit/xorg/lib/libpciaccess/Makefile
diff -u src/external/mit/xorg/lib/libpciaccess/Makefile:1.8 src/external/mit/xorg/lib/libpciaccess/Makefile:1.9
--- src/external/mit/xorg/lib/libpciaccess/Makefile:1.8	Tue Jan  5 08:07:47 2016
+++ src/external/mit/xorg/lib/libpciaccess/Makefile	Wed May 15 21:22:36 2019
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.8 2016/01/05 13:07:47 christos Exp $
+#	$NetBSD: Makefile,v 1.9 2019/05/16 01:22:36 christos Exp $
 
 .include 
 
@@ -6,8 +6,6 @@ LIB=	pciaccess
 .PATH:	${X11SRCDIR.${LIB}}/src
 .PATH:	${X11SRCDIR.${LIB}}/include
 
-XORG_MACHINE_ARCH?=${MACHINE_ARCH}
-
 SRCS=	common_bridge.c \
 	common_io.c \
 	common_iterator.c \
@@ -33,16 +31,9 @@ PKGDIST=	${LIB}
 LIBDPLIBS+=	pci	${NETBSDSRCDIR}/lib/libpci \
 		z	${NETBSDSRCDIR}/lib/libz
 
-.if ${XORG_MACHINE_ARCH} == "i386" || ${XORG_MACHINE_ARCH} == "x86_64"
+.if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "x86_64"
 CPPFLAGS+=	-DHAVE_MTRR
-.endif
-
-.if ${XORG_MACHINE_ARCH} == "i386"
-LIBDPLIBS+=	i386 ${NETBSDSRCDIR}/lib/libarch
-.endif
-
-.if ${XORG_MACHINE_ARCH} == "x86_64"
-LIBDPLIBS+=	x86_64 ${NETBSDSRCDIR}/lib/libarch
+LIBDPLIBS+=	${XORG_MACHINE_ARCH:U${MACHINE_ARCH}} ${NETBSDSRCDIR}/lib/libarch
 .endif
 
 .include 



CVS commit: xsrc/external/mit/xorg-server/dist/os

2019-05-15 Thread Christos Zoulas
Module Name:xsrc
Committed By:   christos
Date:   Wed May 15 18:29:21 UTC 2019

Modified Files:
xsrc/external/mit/xorg-server/dist/os: backtrace.c

Log Message:
fix variable stack allocation for ssp


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.5 -r1.2 \
xsrc/external/mit/xorg-server/dist/os/backtrace.c

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

Modified files:

Index: xsrc/external/mit/xorg-server/dist/os/backtrace.c
diff -u xsrc/external/mit/xorg-server/dist/os/backtrace.c:1.1.1.5 xsrc/external/mit/xorg-server/dist/os/backtrace.c:1.2
--- xsrc/external/mit/xorg-server/dist/os/backtrace.c:1.1.1.5	Mon Dec 31 04:36:12 2018
+++ xsrc/external/mit/xorg-server/dist/os/backtrace.c	Wed May 15 14:29:21 2019
@@ -115,7 +115,7 @@ xorg_backtrace(void)
 void
 xorg_backtrace(void)
 {
-const int BT_SIZE = 64;
+#define BT_SIZE 64
 void *array[BT_SIZE];
 const char *mod;
 int size, i;



CVS commit: src/sys/arch

2019-05-15 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Wed May 15 18:27:51 UTC 2019

Modified Files:
src/sys/arch/amd64/amd64: locore.S
src/sys/arch/i386/i386: locore.S
src/sys/arch/x86/x86: identcpu.c

Log Message:
Enable EagerFPU on Xen PV. Should work as-is. Sent on port-amd64@.


To generate a diff of this commit:
cvs rdiff -u -r1.182 -r1.183 src/sys/arch/amd64/amd64/locore.S
cvs rdiff -u -r1.166 -r1.167 src/sys/arch/i386/i386/locore.S
cvs rdiff -u -r1.88 -r1.89 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/amd64/amd64/locore.S
diff -u src/sys/arch/amd64/amd64/locore.S:1.182 src/sys/arch/amd64/amd64/locore.S:1.183
--- src/sys/arch/amd64/amd64/locore.S:1.182	Wed May 15 17:31:41 2019
+++ src/sys/arch/amd64/amd64/locore.S	Wed May 15 18:27:51 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: locore.S,v 1.182 2019/05/15 17:31:41 maxv Exp $	*/
+/*	$NetBSD: locore.S,v 1.183 2019/05/15 18:27:51 maxv Exp $	*/
 
 /*
  * Copyright-o-rama!
@@ -1147,7 +1147,6 @@ ENTRY(cpu_switchto)
 	movq	%r12,%rsi
 	callq	_C_LABEL(x86_dbregs_switch)
 
-#ifndef XENPV
 	movb	_C_LABEL(x86_fpu_eager),%dl
 	testb	%dl,%dl
 	jz	.Lno_eagerfpu
@@ -1155,7 +1154,6 @@ ENTRY(cpu_switchto)
 	movq	%r12,%rsi
 	callq	_C_LABEL(fpu_eagerswitch)
 .Lno_eagerfpu:
-#endif
 
 	/* Don't bother with the rest if switching to a system process. */
 	testl	$LW_SYSTEM,L_FLAG(%r12)

Index: src/sys/arch/i386/i386/locore.S
diff -u src/sys/arch/i386/i386/locore.S:1.166 src/sys/arch/i386/i386/locore.S:1.167
--- src/sys/arch/i386/i386/locore.S:1.166	Sat Mar  9 08:42:25 2019
+++ src/sys/arch/i386/i386/locore.S	Wed May 15 18:27:51 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: locore.S,v 1.166 2019/03/09 08:42:25 maxv Exp $	*/
+/*	$NetBSD: locore.S,v 1.167 2019/05/15 18:27:51 maxv Exp $	*/
 
 /*
  * Copyright-o-rama!
@@ -128,7 +128,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: locore.S,v 1.166 2019/03/09 08:42:25 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: locore.S,v 1.167 2019/05/15 18:27:51 maxv Exp $");
 
 #include "opt_copy_symtab.h"
 #include "opt_ddb.h"
@@ -1137,7 +1137,6 @@ skip_save:
 	call	_C_LABEL(x86_dbregs_switch)
 	addl	$8,%esp
 
-#ifndef XENPV
 	pushl	%edx
 	movb	_C_LABEL(x86_fpu_eager),%dl
 	testb	%dl,%dl
@@ -1148,7 +1147,6 @@ skip_save:
 	addl	$8,%esp
 .Lno_eagerfpu:
 	popl	%edx
-#endif
 
 	/* Don't bother with the rest if switching to a system process. */
 	testl	$LW_SYSTEM,L_FLAG(%edi)

Index: src/sys/arch/x86/x86/identcpu.c
diff -u src/sys/arch/x86/x86/identcpu.c:1.88 src/sys/arch/x86/x86/identcpu.c:1.89
--- src/sys/arch/x86/x86/identcpu.c:1.88	Mon Feb 11 18:50:15 2019
+++ src/sys/arch/x86/x86/identcpu.c	Wed May 15 18:27:51 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: identcpu.c,v 1.88 2019/02/11 18:50:15 cherry Exp $	*/
+/*	$NetBSD: identcpu.c,v 1.89 2019/05/15 18:27:51 maxv 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.88 2019/02/11 18:50:15 cherry Exp $");
+__KERNEL_RCSID(0, "$NetBSD: identcpu.c,v 1.89 2019/05/15 18:27:51 maxv Exp $");
 
 #include "opt_xen.h"
 
@@ -744,7 +744,6 @@ cpu_probe_old_fpu(struct cpu_info *ci)
 #endif
 }
 
-#ifndef XENPV
 static void
 cpu_probe_fpu_leak(struct cpu_info *ci)
 {
@@ -786,16 +785,13 @@ cpu_probe_fpu_leak(struct cpu_info *ci)
 		break;
 	}
 }
-#endif
 
 static void
 cpu_probe_fpu(struct cpu_info *ci)
 {
 	u_int descs[4];
 
-#ifndef XENPV
 	cpu_probe_fpu_leak(ci);
-#endif
 
 	x86_fpu_save = FPU_SAVE_FSAVE;
 



CVS commit: src/sys/arch

2019-05-15 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Wed May 15 18:27:51 UTC 2019

Modified Files:
src/sys/arch/amd64/amd64: locore.S
src/sys/arch/i386/i386: locore.S
src/sys/arch/x86/x86: identcpu.c

Log Message:
Enable EagerFPU on Xen PV. Should work as-is. Sent on port-amd64@.


To generate a diff of this commit:
cvs rdiff -u -r1.182 -r1.183 src/sys/arch/amd64/amd64/locore.S
cvs rdiff -u -r1.166 -r1.167 src/sys/arch/i386/i386/locore.S
cvs rdiff -u -r1.88 -r1.89 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.



CVS commit: src/share/man/man8/man8.x86

2019-05-15 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Wed May 15 17:35:03 UTC 2019

Modified Files:
src/share/man/man8/man8.x86: boot.8

Log Message:
RB_MD3 now disables SVS.


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/share/man/man8/man8.x86/boot.8

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/man8/man8.x86/boot.8
diff -u src/share/man/man8/man8.x86/boot.8:1.14 src/share/man/man8/man8.x86/boot.8:1.15
--- src/share/man/man8/man8.x86/boot.8:1.14	Tue Nov 27 10:35:03 2018
+++ src/share/man/man8/man8.x86/boot.8	Wed May 15 17:35:02 2019
@@ -1,4 +1,4 @@
-.\"	$NetBSD: boot.8,v 1.14 2018/11/27 10:35:03 wiz Exp $
+.\"	$NetBSD: boot.8,v 1.15 2019/05/15 17:35:02 maxv Exp $
 .\"
 .\" Copyright (c) 1991, 1993
 .\"	The Regents of the University of California.  All rights reserved.
@@ -32,7 +32,7 @@
 .\"
 .\" @(#)boot_i386.8	8.2 (Berkeley) 4/19/94
 .\"
-.Dd November 25, 2018
+.Dd May 15, 2019
 .Dt BOOT 8 x86
 .Os
 .Sh NAME
@@ -245,8 +245,8 @@ Sets the machine-dependent flag
 in
 .Va boothowto .
 In
-.Nx Ns /x86 ,
-this has no effect.
+.Nx Ns /amd64 ,
+this disables SVS.
 .It Fl 4
 Sets the machine-dependent flag
 .Sy RB_MD4



CVS commit: src/share/man/man8/man8.x86

2019-05-15 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Wed May 15 17:35:03 UTC 2019

Modified Files:
src/share/man/man8/man8.x86: boot.8

Log Message:
RB_MD3 now disables SVS.


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/share/man/man8/man8.x86/boot.8

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-05-15 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Wed May 15 17:31:41 UTC 2019

Modified Files:
src/sys/arch/amd64/amd64: locore.S
src/sys/arch/x86/x86: svs.c x86_machdep.c

Log Message:
Change the way SVS is disabled. Now you have to pass "boot -3" from the
bootloader. The machdep.svs.enabled sysctl becomes read-only, and just
indicates whether SVS is enabled.

Sent on port-amd64@.


To generate a diff of this commit:
cvs rdiff -u -r1.181 -r1.182 src/sys/arch/amd64/amd64/locore.S
cvs rdiff -u -r1.25 -r1.26 src/sys/arch/x86/x86/svs.c
cvs rdiff -u -r1.124 -r1.125 src/sys/arch/x86/x86/x86_machdep.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

2019-05-15 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Wed May 15 17:31:41 UTC 2019

Modified Files:
src/sys/arch/amd64/amd64: locore.S
src/sys/arch/x86/x86: svs.c x86_machdep.c

Log Message:
Change the way SVS is disabled. Now you have to pass "boot -3" from the
bootloader. The machdep.svs.enabled sysctl becomes read-only, and just
indicates whether SVS is enabled.

Sent on port-amd64@.


To generate a diff of this commit:
cvs rdiff -u -r1.181 -r1.182 src/sys/arch/amd64/amd64/locore.S
cvs rdiff -u -r1.25 -r1.26 src/sys/arch/x86/x86/svs.c
cvs rdiff -u -r1.124 -r1.125 src/sys/arch/x86/x86/x86_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/amd64/amd64/locore.S
diff -u src/sys/arch/amd64/amd64/locore.S:1.181 src/sys/arch/amd64/amd64/locore.S:1.182
--- src/sys/arch/amd64/amd64/locore.S:1.181	Tue May 14 16:59:25 2019
+++ src/sys/arch/amd64/amd64/locore.S	Wed May 15 17:31:41 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: locore.S,v 1.181 2019/05/14 16:59:25 maxv Exp $	*/
+/*	$NetBSD: locore.S,v 1.182 2019/05/15 17:31:41 maxv Exp $	*/
 
 /*
  * Copyright-o-rama!
@@ -1621,10 +1621,6 @@ END(intrfastexit)
 	.globl	svs_enter_altstack, svs_enter_altstack_end
 	.globl	svs_leave, svs_leave_end
 	.globl	svs_leave_altstack, svs_leave_altstack_end
-	.globl	nosvs_enter, nosvs_enter_end
-	.globl	nosvs_enter_altstack, nosvs_enter_altstack_end
-	.globl	nosvs_leave, nosvs_leave_end
-	.globl	nosvs_leave_altstack, nosvs_leave_altstack_end
 
 LABEL(svs_enter)
 	movabs	SVS_UTLS+UTLS_KPDIRPA,%rax
@@ -1668,30 +1664,6 @@ LABEL(svs_leave_nmi)
 	movq	(FRAMESIZE+1*8)(%rsp),%rax	/* nmistore->scratch */
 	movq	%rax,%cr3
 LABEL(svs_leave_nmi_end)
-
-LABEL(nosvs_enter)
-	NOSVS_ENTER
-LABEL(nosvs_enter_end)
-
-LABEL(nosvs_enter_altstack)
-	NOSVS_ENTER_ALTSTACK
-LABEL(nosvs_enter_altstack_end)
-
-LABEL(nosvs_enter_nmi)
-	NOSVS_ENTER_NMI
-LABEL(nosvs_enter_nmi_end)
-
-LABEL(nosvs_leave)
-	NOSVS_LEAVE
-LABEL(nosvs_leave_end)
-
-LABEL(nosvs_leave_altstack)
-	NOSVS_LEAVE_ALTSTACK
-LABEL(nosvs_leave_altstack_end)
-
-LABEL(nosvs_leave_nmi)
-	NOSVS_LEAVE_NMI
-LABEL(nosvs_leave_nmi_end)
 #endif
 
 	.globl	ibrs_enter, ibrs_enter_end

Index: src/sys/arch/x86/x86/svs.c
diff -u src/sys/arch/x86/x86/svs.c:1.25 src/sys/arch/x86/x86/svs.c:1.26
--- src/sys/arch/x86/x86/svs.c:1.25	Sun Apr 21 06:37:21 2019
+++ src/sys/arch/x86/x86/svs.c	Wed May 15 17:31:41 2019
@@ -1,7 +1,7 @@
-/*	$NetBSD: svs.c,v 1.25 2019/04/21 06:37:21 maxv Exp $	*/
+/*	$NetBSD: svs.c,v 1.26 2019/05/15 17:31:41 maxv Exp $	*/
 
 /*
- * Copyright (c) 2018 The NetBSD Foundation, Inc.
+ * Copyright (c) 2018-2019 The NetBSD Foundation, Inc.
  * All rights reserved.
  *
  * This code is derived from software contributed to The NetBSD Foundation
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: svs.c,v 1.25 2019/04/21 06:37:21 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: svs.c,v 1.26 2019/05/15 17:31:41 maxv Exp $");
 
 #include "opt_svs.h"
 
@@ -41,6 +41,7 @@ __KERNEL_RCSID(0, "$NetBSD: svs.c,v 1.25
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -611,147 +612,6 @@ svs_enable(void)
 	x86_patch_window_close(psl, cr0);
 }
 
-static void
-svs_disable_hotpatch(void)
-{
-	extern uint8_t nosvs_enter, nosvs_enter_end;
-	extern uint8_t nosvs_enter_altstack, nosvs_enter_altstack_end;
-	extern uint8_t nosvs_enter_nmi, nosvs_enter_nmi_end;
-	extern uint8_t nosvs_leave, nosvs_leave_end;
-	extern uint8_t nosvs_leave_altstack, nosvs_leave_altstack_end;
-	extern uint8_t nosvs_leave_nmi, nosvs_leave_nmi_end;
-	u_long psl, cr0;
-	uint8_t *bytes;
-	size_t size;
-
-	x86_patch_window_open(, );
-
-	bytes = _enter;
-	size = (size_t)_enter_end - (size_t)_enter;
-	x86_hotpatch(HP_NAME_SVS_ENTER, bytes, size);
-
-	bytes = _enter_altstack;
-	size = (size_t)_enter_altstack_end -
-	(size_t)_enter_altstack;
-	x86_hotpatch(HP_NAME_SVS_ENTER_ALT, bytes, size);
-
-	bytes = _enter_nmi;
-	size = (size_t)_enter_nmi_end -
-	(size_t)_enter_nmi;
-	x86_hotpatch(HP_NAME_SVS_ENTER_NMI, bytes, size);
-
-	bytes = _leave;
-	size = (size_t)_leave_end - (size_t)_leave;
-	x86_hotpatch(HP_NAME_SVS_LEAVE, bytes, size);
-
-	bytes = _leave_altstack;
-	size = (size_t)_leave_altstack_end -
-	(size_t)_leave_altstack;
-	x86_hotpatch(HP_NAME_SVS_LEAVE_ALT, bytes, size);
-
-	bytes = _leave_nmi;
-	size = (size_t)_leave_nmi_end -
-	(size_t)_leave_nmi;
-	x86_hotpatch(HP_NAME_SVS_LEAVE_NMI, bytes, size);
-
-	x86_patch_window_close(psl, cr0);
-}
-
-static volatile unsigned long svs_cpu_barrier1 __cacheline_aligned;
-static volatile unsigned long svs_cpu_barrier2 __cacheline_aligned;
-typedef void (vector)(void);
-
-static void
-svs_disable_cpu(void *arg1, void *arg2)
-{
-	struct cpu_info *ci = curcpu();
-	extern vector Xsyscall;
-	u_long psl;
-
-	psl = x86_read_psl();
-	x86_disable_intr();
-
-	atomic_dec_ulong(_cpu_barrier1);
-	while (atomic_cas_ulong(_cpu_barrier1, 0, 0) != 0) {
-		

CVS commit: src/sys/arch

2019-05-15 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed May 15 16:59:10 UTC 2019

Modified Files:
src/sys/arch/sparc/include: param.h
src/sys/arch/sparc64/include: param.h

Log Message:
From: Tobias Ulmer. Unbreak zfs module build on sparc{,64} by hiding DELAY.
ZFS has a conflicting definition of delay() and tries to hide it by
defining __HIDE_DELAY.


To generate a diff of this commit:
cvs rdiff -u -r1.72 -r1.73 src/sys/arch/sparc/include/param.h
cvs rdiff -u -r1.59 -r1.60 src/sys/arch/sparc64/include/param.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-05-15 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed May 15 16:59:10 UTC 2019

Modified Files:
src/sys/arch/sparc/include: param.h
src/sys/arch/sparc64/include: param.h

Log Message:
From: Tobias Ulmer. Unbreak zfs module build on sparc{,64} by hiding DELAY.
ZFS has a conflicting definition of delay() and tries to hide it by
defining __HIDE_DELAY.


To generate a diff of this commit:
cvs rdiff -u -r1.72 -r1.73 src/sys/arch/sparc/include/param.h
cvs rdiff -u -r1.59 -r1.60 src/sys/arch/sparc64/include/param.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/sparc/include/param.h
diff -u src/sys/arch/sparc/include/param.h:1.72 src/sys/arch/sparc/include/param.h:1.73
--- src/sys/arch/sparc/include/param.h:1.72	Mon Jan  7 17:00:32 2019
+++ src/sys/arch/sparc/include/param.h	Wed May 15 12:59:10 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: param.h,v 1.72 2019/01/07 22:00:32 jdolecek Exp $ */
+/*	$NetBSD: param.h,v 1.73 2019/05/15 16:59:10 christos Exp $ */
 
 /*
  * Copyright (c) 1992, 1993
@@ -112,8 +112,12 @@ extern int nbpg, pgofset, pgshift;
 
 #if defined(_KERNEL) || defined(_STANDALONE)
 #ifndef _LOCORE
+
+#ifndef __HIDE_DELAY
 extern void	delay(unsigned int);
 #define	DELAY(n)	delay(n)
+#endif /* __HIDE_DELAY */
+
 #endif /* _LOCORE */
 
 /*

Index: src/sys/arch/sparc64/include/param.h
diff -u src/sys/arch/sparc64/include/param.h:1.59 src/sys/arch/sparc64/include/param.h:1.60
--- src/sys/arch/sparc64/include/param.h:1.59	Mon Jan  7 17:00:32 2019
+++ src/sys/arch/sparc64/include/param.h	Wed May 15 12:59:10 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: param.h,v 1.59 2019/01/07 22:00:32 jdolecek Exp $ */
+/*	$NetBSD: param.h,v 1.60 2019/05/15 16:59:10 christos Exp $ */
 
 /*
  * Copyright (c) 1992, 1993
@@ -224,8 +224,10 @@ extern int nbpg, pgofset, pgshift;
 #ifdef _KERNEL
 #ifndef _LOCORE
 
+#ifndef __HIDE_DELAY
 extern void	delay(unsigned int);
 #define	DELAY(n)	delay(n)
+#endif /* __HIDE_DELAY */
 
 #ifdef	__arch64__
 /* If we're using a 64-bit kernel use 64-bit math */



CVS commit: src/sys/arch/amd64/amd64

2019-05-15 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed May 15 13:49:10 UTC 2019

Modified Files:
src/sys/arch/amd64/amd64: trap.c

Log Message:
print also ksi_code.


To generate a diff of this commit:
cvs rdiff -u -r1.119 -r1.120 src/sys/arch/amd64/amd64/trap.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/trap.c
diff -u src/sys/arch/amd64/amd64/trap.c:1.119 src/sys/arch/amd64/amd64/trap.c:1.120
--- src/sys/arch/amd64/amd64/trap.c:1.119	Fri Apr  5 23:06:24 2019
+++ src/sys/arch/amd64/amd64/trap.c	Wed May 15 09:49:10 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: trap.c,v 1.119 2019/04/06 03:06:24 thorpej Exp $	*/
+/*	$NetBSD: trap.c,v 1.120 2019/05/15 13:49:10 christos Exp $	*/
 
 /*
  * Copyright (c) 1998, 2000, 2017 The NetBSD Foundation, Inc.
@@ -64,7 +64,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.119 2019/04/06 03:06:24 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.120 2019/05/15 13:49:10 christos Exp $");
 
 #include "opt_ddb.h"
 #include "opt_kgdb.h"
@@ -751,10 +751,10 @@ sigdebug(const struct trapframe *tf, con
 	struct lwp *l = curlwp;
 	struct proc *p = l->l_proc;
 
-	printf("pid %d.%d (%s): signal %d (trap %#lx) "
+	printf("pid %d.%d (%s): signal %d code=%d (trap %#lx) "
 	"@rip %#lx addr %#lx error=%d\n",
-	p->p_pid, l->l_lid, p->p_comm, ksi->ksi_signo, tf->tf_trapno,
-	tf->tf_rip, rcr2(), e);
+	p->p_pid, l->l_lid, p->p_comm, ksi->ksi_signo, ksi->ksi_code,
+	tf->tf_trapno, tf->tf_rip, rcr2(), e);
 	frame_dump(tf, lwp_getpcb(l));
 }
 #endif



CVS commit: src/sys/arch/amd64/amd64

2019-05-15 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed May 15 13:49:10 UTC 2019

Modified Files:
src/sys/arch/amd64/amd64: trap.c

Log Message:
print also ksi_code.


To generate a diff of this commit:
cvs rdiff -u -r1.119 -r1.120 src/sys/arch/amd64/amd64/trap.c

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



CVS commit: src/distrib/amd64/cdroms/bootcd-com

2019-05-15 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed May 15 13:47:41 UTC 2019

Modified Files:
src/distrib/amd64/cdroms/bootcd-com: Makefile

Log Message:
Add a comment about iLO


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/distrib/amd64/cdroms/bootcd-com/Makefile

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



CVS commit: src/tests/usr.bin/c++

2019-05-15 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed May 15 13:43:45 UTC 2019

Modified Files:
src/tests/usr.bin/c++: t_call_once2.sh

Log Message:
Add explanatory text


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/tests/usr.bin/c++/t_call_once2.sh

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



CVS commit: src/tests/usr.bin/c++

2019-05-15 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed May 15 13:43:45 UTC 2019

Modified Files:
src/tests/usr.bin/c++: t_call_once2.sh

Log Message:
Add explanatory text


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/tests/usr.bin/c++/t_call_once2.sh

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

Modified files:

Index: src/tests/usr.bin/c++/t_call_once2.sh
diff -u src/tests/usr.bin/c++/t_call_once2.sh:1.1 src/tests/usr.bin/c++/t_call_once2.sh:1.2
--- src/tests/usr.bin/c++/t_call_once2.sh:1.1	Fri Mar 23 20:26:51 2018
+++ src/tests/usr.bin/c++/t_call_once2.sh	Wed May 15 09:43:45 2019
@@ -1,4 +1,4 @@
-#	$NetBSD: t_call_once2.sh,v 1.1 2018/03/24 00:26:51 kamil Exp $
+#	$NetBSD: t_call_once2.sh,v 1.2 2019/05/15 13:43:45 christos Exp $
 #
 # Copyright (c) 2018 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -117,7 +117,7 @@ EOF
 }
 
 call_once2_profile_body() {
-	atf_expect_fail "profiling option doesn't work now"
+	atf_expect_fail "profiling option doesn't work with shared libraries"
 	cat > test.cpp << EOF
 #include 
 #include 
@@ -290,7 +290,7 @@ EOF
 }
 
 call_once2_pic_profile_body() {
-	atf_expect_fail "profiling option doesn't work now"
+	atf_expect_fail "profiling option doesn't work with pic"
 	cat > test.cpp << EOF
 #include 
 int callpic(void);
@@ -333,7 +333,7 @@ EOF
 }
 
 call_once2_pic_profile_32_body() {
-	atf_expect_fail "profiling option doesn't work now"
+	atf_expect_fail "profiling option doesn't work with shared libraries"
 	# check whether this arch is 64bit
 	if ! c++ -dM -E - < /dev/null | fgrep -q _LP64; then
 		atf_skip "this is not a 64 bit architecture"