Module Name:    src
Committed By:   martin
Date:           Tue Sep 24 18:14:59 UTC 2019

Modified Files:
        src/sys/dev/nvmm/x86 [netbsd-9]: nvmm_x86_vmx.c

Log Message:
Pull up following revision(s) (requested by maxv in ticket #239):

        sys/dev/nvmm/x86/nvmm_x86_vmx.c: revision 1.37

Always set hwcode on error. Useful for debugging.


To generate a diff of this commit:
cvs rdiff -u -r1.36 -r1.36.2.1 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.36 src/sys/dev/nvmm/x86/nvmm_x86_vmx.c:1.36.2.1
--- src/sys/dev/nvmm/x86/nvmm_x86_vmx.c:1.36	Sun Jun 16 18:30:31 2019
+++ src/sys/dev/nvmm/x86/nvmm_x86_vmx.c	Tue Sep 24 18:14:59 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: nvmm_x86_vmx.c,v 1.36 2019/06/16 18:30:31 maxv Exp $	*/
+/*	$NetBSD: nvmm_x86_vmx.c,v 1.36.2.1 2019/09/24 18:14:59 martin Exp $	*/
 
 /*
  * Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: nvmm_x86_vmx.c,v 1.36 2019/06/16 18:30:31 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nvmm_x86_vmx.c,v 1.36.2.1 2019/09/24 18:14:59 martin Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -1106,6 +1106,13 @@ vmx_inkernel_advance(void)
 }
 
 static void
+vmx_exit_invalid(struct nvmm_exit *exit, uint64_t code)
+{
+	exit->u.inv.hwcode = code;
+	exit->reason = NVMM_EXIT_INVALID;
+}
+
+static void
 vmx_exit_exc_nmi(struct nvmm_machine *mach, struct nvmm_cpu *vcpu,
     struct nvmm_exit *exit)
 {
@@ -1124,7 +1131,7 @@ vmx_exit_exc_nmi(struct nvmm_machine *ma
 	return;
 
 error:
-	exit->reason = NVMM_EXIT_INVALID;
+	vmx_exit_invalid(exit, VMCS_EXITCODE_EXC_NMI);
 }
 
 static void
@@ -1689,13 +1696,6 @@ vmx_exit_epf(struct nvmm_machine *mach, 
 	    NVMM_X64_STATE_CRS | NVMM_X64_STATE_MSRS);
 }
 
-static void
-vmx_exit_invalid(struct nvmm_exit *exit, uint64_t code)
-{
-	exit->u.inv.hwcode = code;
-	exit->reason = NVMM_EXIT_INVALID;
-}
-
 /* -------------------------------------------------------------------------- */
 
 static void
@@ -1940,7 +1940,7 @@ vmx_vcpu_run(struct nvmm_machine *mach, 
 		splx(s);
 
 		if (__predict_false(ret != 0)) {
-			exit->reason = NVMM_EXIT_INVALID;
+			vmx_exit_invalid(exit, -1);
 			break;
 		}
 		vmx_exit_evt(cpudata);

Reply via email to