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 Registering the host's CR0 is done outside ...



details:   https://anonhg.NetBSD.org/src/rev/01a90ac285b0
branches:  trunk
changeset: 847909:01a90ac285b0
user:      maxv <maxv%NetBSD.org@localhost>
date:      Thu Jan 09 16:27:57 2020 +0000

description:
Registering the host's CR0 is done outside of the VCPU loop, so it must be
cleared because it is also cleared inside the loop.

Not clearing it could trigger DNAs on VMEXITs, because STTS/CLTS are still
here as part of debugging since my FPU overhaul.

diffstat:

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

diffs (27 lines):

diff -r c6d1e57fcc7a -r 01a90ac285b0 sys/dev/nvmm/x86/nvmm_x86_vmx.c
--- a/sys/dev/nvmm/x86/nvmm_x86_vmx.c   Thu Jan 09 16:23:41 2020 +0000
+++ b/sys/dev/nvmm/x86/nvmm_x86_vmx.c   Thu Jan 09 16:27:57 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: nvmm_x86_vmx.c,v 1.47 2020/01/09 16:20:12 maxv Exp $   */
+/*     $NetBSD: nvmm_x86_vmx.c,v 1.48 2020/01/09 16:27:57 maxv Exp $   */
 
 /*
  * Copyright (c) 2018-2019 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: nvmm_x86_vmx.c,v 1.47 2020/01/09 16:20:12 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nvmm_x86_vmx.c,v 1.48 2020/01/09 16:27:57 maxv Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -2664,7 +2664,7 @@
        vmx_vmwrite(VMCS_HOST_IDTR_BASE, (uint64_t)idt);
        vmx_vmwrite(VMCS_HOST_IA32_PAT, rdmsr(MSR_CR_PAT));
        vmx_vmwrite(VMCS_HOST_IA32_EFER, rdmsr(MSR_EFER));
-       vmx_vmwrite(VMCS_HOST_CR0, rcr0());
+       vmx_vmwrite(VMCS_HOST_CR0, rcr0() & ~CR0_TS);
 
        /* Generate ASID. */
        vmx_asid_alloc(vcpu);



Home | Main Index | Thread Index | Old Index