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 Make sure VMX-outside-SMX is allowed. It ma...



details:   https://anonhg.NetBSD.org/src/rev/d6fe4e9a011a
branches:  trunk
changeset: 842091:d6fe4e9a011a
user:      maxv <maxv%NetBSD.org@localhost>
date:      Sun Jun 16 18:30:31 2019 +0000

description:
Make sure VMX-outside-SMX is allowed. It may not be if the BIOS decided to
disable VMX. Seen on an HP laptop, where NVMM would panic because of that.

diffstat:

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

diffs (28 lines):

diff -r 02150b462dca -r d6fe4e9a011a sys/dev/nvmm/x86/nvmm_x86_vmx.c
--- a/sys/dev/nvmm/x86/nvmm_x86_vmx.c   Sun Jun 16 16:01:44 2019 +0000
+++ b/sys/dev/nvmm/x86/nvmm_x86_vmx.c   Sun Jun 16 18:30:31 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: nvmm_x86_vmx.c,v 1.35 2019/05/18 08:55:59 maxv Exp $   */
+/*     $NetBSD: nvmm_x86_vmx.c,v 1.36 2019/06/16 18:30:31 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.35 2019/05/18 08:55:59 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nvmm_x86_vmx.c,v 1.36 2019/06/16 18:30:31 maxv Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -2894,6 +2894,9 @@
        if ((msr & IA32_FEATURE_CONTROL_LOCK) == 0) {
                return false;
        }
+       if ((msr & IA32_FEATURE_CONTROL_OUT_SMX) == 0) {
+               return false;
+       }
 
        msr = rdmsr(MSR_IA32_VMX_BASIC);
        if ((msr & IA32_VMX_BASIC_IO_REPORT) == 0) {



Home | Main Index | Thread Index | Old Index