VMM: Exit on mwait
authorBarret Rhoden <brho@cs.berkeley.edu>
Mon, 20 Jun 2016 20:36:11 +0000 (16:36 -0400)
committerBarret Rhoden <brho@cs.berkeley.edu>
Fri, 24 Jun 2016 18:24:06 +0000 (14:24 -0400)
Mwait can be used for power management.  Linux will use mwait instead of
halt in some circumstances.  See Linux's arch/x86/kernel/process.c
prefer_mwait_c1_over_halt() for more info.

Signed-off-by: Barret Rhoden <brho@cs.berkeley.edu>
kern/arch/x86/vmm/intel/vmx.c

index 5fc9bb9..1ea4666 100644 (file)
@@ -513,8 +513,9 @@ static const struct vmxec cbec = {
        .msr = MSR_IA32_VMX_PROCBASED_CTLS,
        .truemsr = MSR_IA32_VMX_TRUE_PROCBASED_CTLS,
 
-       .must_be_1 = (//CPU_BASED_MWAIT_EXITING |
-                       CPU_BASED_HLT_EXITING |
+       .must_be_1 = (
+                CPU_BASED_MWAIT_EXITING |
+                CPU_BASED_HLT_EXITING |
                     CPU_BASED_TPR_SHADOW |
                     CPU_BASED_RDPMC_EXITING |
                     CPU_BASED_CR8_LOAD_EXITING |
@@ -524,8 +525,7 @@ static const struct vmxec cbec = {
                     CPU_BASED_ACTIVATE_SECONDARY_CONTROLS),
 
        .must_be_0 = (
-                       CPU_BASED_MWAIT_EXITING |
-                       CPU_BASED_VIRTUAL_INTR_PENDING |
+                CPU_BASED_VIRTUAL_INTR_PENDING |
                     CPU_BASED_INVLPG_EXITING |
                     CPU_BASED_USE_TSC_OFFSETING |
                     CPU_BASED_RDTSC_EXITING |