Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/nvmm/x86 Now that SVS cannot be disabled at run time...



details:   https://anonhg.NetBSD.org/src/rev/ff02168addc0
branches:  trunk
changeset: 456607:ff02168addc0
user:      maxv <maxv%NetBSD.org@localhost>
date:      Sat May 18 08:55:59 2019 +0000

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

diffstat:

 sys/dev/nvmm/x86/nvmm_x86_vmx.c |  7 +++----
 1 files changed, 3 insertions(+), 4 deletions(-)

diffs (35 lines):

diff -r 52908ca904a5 -r ff02168addc0 sys/dev/nvmm/x86/nvmm_x86_vmx.c
--- a/sys/dev/nvmm/x86/nvmm_x86_vmx.c   Sat May 18 08:54:38 2019 +0000
+++ b/sys/dev/nvmm/x86/nvmm_x86_vmx.c   Sat May 18 08:55:59 2019 +0000
@@ -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_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 @@
 
        /* These MSRs are static. */
        cpudata->star = rdmsr(MSR_STAR);
+       cpudata->lstar = rdmsr(MSR_LSTAR);
        cpudata->cstar = rdmsr(MSR_CSTAR);
        cpudata->sfmask = rdmsr(MSR_SFMASK);
 



Home | Main Index | Thread Index | Old Index