Module Name:    src
Committed By:   maxv
Date:           Sat May 18 08:55:59 UTC 2019

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

Log Message:
Now that SVS cannot be disabled at run time, MSR_LSTAR is static, so no
need to save it on each VM enter.


To generate a diff of this commit:
cvs rdiff -u -r1.34 -r1.35 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.34 src/sys/dev/nvmm/x86/nvmm_x86_vmx.c:1.35
--- src/sys/dev/nvmm/x86/nvmm_x86_vmx.c:1.34	Sat May 11 07:31:56 2019
+++ src/sys/dev/nvmm/x86/nvmm_x86_vmx.c	Sat May 18 08:55:59 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: nvmm_x86_vmx.c,v 1.34 2019/05/11 07:31:56 maxv Exp $	*/
+/*	$NetBSD: nvmm_x86_vmx.c,v 1.35 2019/05/18 08:55:59 maxv 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.34 2019/05/11 07:31:56 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nvmm_x86_vmx.c,v 1.35 2019/05/18 08:55:59 maxv Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -1772,8 +1772,6 @@ vmx_vcpu_guest_misc_enter(struct nvmm_cp
 	vmx_vmwrite(VMCS_HOST_CR3, rcr3());
 	vmx_vmwrite(VMCS_HOST_CR4, rcr4());
 
-	/* Note: MSR_LSTAR is not static, because of SVS. */
-	cpudata->lstar = rdmsr(MSR_LSTAR);
 	cpudata->kernelgsbase = rdmsr(MSR_KERNELGSBASE);
 }
 
@@ -2655,6 +2653,7 @@ vmx_vcpu_init(struct nvmm_machine *mach,
 
 	/* These MSRs are static. */
 	cpudata->star = rdmsr(MSR_STAR);
+	cpudata->lstar = rdmsr(MSR_LSTAR);
 	cpudata->cstar = rdmsr(MSR_CSTAR);
 	cpudata->sfmask = rdmsr(MSR_SFMASK);
 

Reply via email to