CVS commit: [bouyer-xenpvh] src/sys/arch/amd64/amd64

2020-04-11 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sat Apr 11 11:56:51 UTC 2020

Modified Files:
src/sys/arch/amd64/amd64 [bouyer-xenpvh]: vector.S

Log Message:
Merge back hypervisor_callback and hypervisor_pvhvm_callback, there's no
issues calling Xdoreti in the PV case.


To generate a diff of this commit:
cvs rdiff -u -r1.73.6.1 -r1.73.6.2 src/sys/arch/amd64/amd64/vector.S

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/vector.S
diff -u src/sys/arch/amd64/amd64/vector.S:1.73.6.1 src/sys/arch/amd64/amd64/vector.S:1.73.6.2
--- src/sys/arch/amd64/amd64/vector.S:1.73.6.1	Fri Apr 10 14:41:59 2020
+++ src/sys/arch/amd64/amd64/vector.S	Sat Apr 11 11:56:51 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: vector.S,v 1.73.6.1 2020/04/10 14:41:59 bouyer Exp $	*/
+/*	$NetBSD: vector.S,v 1.73.6.2 2020/04/11 11:56:51 bouyer Exp $	*/
 
 /*
  * Copyright (c) 1998, 2007, 2008 The NetBSD Foundation, Inc.
@@ -811,36 +811,23 @@ END(xenev_stubs)
  */
 
 /* Hypervisor callback */
+
 ENTRY(hypervisor_callback)
 	movq	(%rsp),%rcx
 	movq	8(%rsp),%r11
 	addq	$16,%rsp
-	pushq	$0		/* Dummy error code */
-	pushq	$T_ASTFLT
-	INTRENTRY
-	/* sti?? */
-	movq	%rsp,%rdi
-	subq	$8,%rdi;	/* don't forget if_ppl */
-	call	do_hypervisor_callback
-	testb	$SEL_RPL,TF_CS(%rsp)
-	jnz	doreti_checkast
-1:
-	INTRFASTEXIT
-END(hypervisor_callback)
-
 IDTVEC(hypervisor_pvhvm_callback)
 	pushq	$0		/* Dummy error code */
 	pushq	$T_ASTFLT
 	INTRENTRY
 	movlCPUVAR(ILEVEL),%edi
 	pushq   %rdi /* for Xdoreti */
-	/* sti?? */
 	movq	%rsp,%rdi
-	subq	$8,%rdi;	/* don't forget if_ppl */
 	call	do_hypervisor_callback
 	incl	CPUVAR(IDEPTH)
 	jmp 	_C_LABEL(Xdoreti)
 IDTVEC_END(hypervisor_pvhvm_callback)
+END(hypervisor_callback)
 #endif /* XEN */
 
 #ifdef XENPV



CVS commit: [bouyer-xenpvh] src/sys/arch/amd64/amd64

2020-04-09 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Thu Apr  9 21:01:33 UTC 2020

Modified Files:
src/sys/arch/amd64/amd64 [bouyer-xenpvh]: spl.S

Log Message:
Fix a second place where %eax is used with the wrong value.


To generate a diff of this commit:
cvs rdiff -u -r1.43.4.1 -r1.43.4.2 src/sys/arch/amd64/amd64/spl.S

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/spl.S
diff -u src/sys/arch/amd64/amd64/spl.S:1.43.4.1 src/sys/arch/amd64/amd64/spl.S:1.43.4.2
--- src/sys/arch/amd64/amd64/spl.S:1.43.4.1	Thu Apr  9 16:51:00 2020
+++ src/sys/arch/amd64/amd64/spl.S	Thu Apr  9 21:01:33 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: spl.S,v 1.43.4.1 2020/04/09 16:51:00 bouyer Exp $	*/
+/*	$NetBSD: spl.S,v 1.43.4.2 2020/04/09 21:01:33 bouyer Exp $	*/
 
 /*
  * Copyright (c) 2003 Wasabi Systems, Inc.
@@ -322,8 +322,9 @@ IDTVEC(spllower)
 	pushq	%r12
 	movl	%edi,%ebx
 	leaq	1f(%rip),%r13		/* address to resume loop at */
-1:	movl	%ebx,%eax		/* get cpl */
+1:
 #if !defined(XENPV)
+	movl	%ebx,%eax		/* get cpl */
 	movl	CPUVAR(IUNMASK)(,%rax,4),%eax
 	CLI(si)
 	andl	CPUVAR(IPENDING),%eax	/* any non-masked bits left? */
@@ -335,6 +336,7 @@ IDTVEC(spllower)
 #endif
 2:
 #if defined(XEN)
+	movl	%ebx,%eax		/* get cpl */
 	movl	CPUVAR(XUNMASK)(,%rax,4),%eax
 	CLI(si)
 	andl	CPUVAR(XPENDING),%eax	/* any non-masked bits left? */



CVS commit: [bouyer-xenpvh] src/sys/arch/amd64/amd64

2020-04-09 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Thu Apr  9 16:51:00 UTC 2020

Modified Files:
src/sys/arch/amd64/amd64 [bouyer-xenpvh]: spl.S

Log Message:
restore %eax before using it. This bug caused event handlers to be called
spuriously at high spl or in a reentrant manner.
Now a amd64 PVHVM domU can checkout pkgsrc and build packages without panic.


To generate a diff of this commit:
cvs rdiff -u -r1.43 -r1.43.4.1 src/sys/arch/amd64/amd64/spl.S

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/spl.S
diff -u src/sys/arch/amd64/amd64/spl.S:1.43 src/sys/arch/amd64/amd64/spl.S:1.43.4.1
--- src/sys/arch/amd64/amd64/spl.S:1.43	Wed Jan  8 17:38:41 2020
+++ src/sys/arch/amd64/amd64/spl.S	Thu Apr  9 16:51:00 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: spl.S,v 1.43 2020/01/08 17:38:41 ad Exp $	*/
+/*	$NetBSD: spl.S,v 1.43.4.1 2020/04/09 16:51:00 bouyer Exp $	*/
 
 /*
  * Copyright (c) 2003 Wasabi Systems, Inc.
@@ -366,8 +366,9 @@ IDTVEC(doreti)
 	popq	%rbx			/* get previous priority */
 	decl	CPUVAR(IDEPTH)
 	leaq	1f(%rip),%r13
-1:	movl	%ebx,%eax
+1:
 #if !defined(XENPV)
+	movl%ebx,%eax
 	movl	CPUVAR(IUNMASK)(,%rax,4),%eax
 	CLI(si)
 	andl	CPUVAR(IPENDING),%eax
@@ -379,6 +380,7 @@ IDTVEC(doreti)
 #endif
 2:
 #if defined(XEN)
+	movl%ebx,%eax
 	movl	CPUVAR(XUNMASK)(,%rax,4),%eax
 	CLI(si)
 	andl	CPUVAR(XPENDING),%eax