KVM: nVMX: Fix returned value of MSR_IA32_VMX_PROCBASED_CTLS
authorJan Kiszka <jan.kiszka@siemens.com>
Mon, 16 Jun 2014 11:59:42 +0000 (13:59 +0200)
committerPaolo Bonzini <pbonzini@redhat.com>
Thu, 19 Jun 2014 10:52:12 +0000 (12:52 +0200)
SDM says bits 1, 4-6, 8, 13-16, and 26 have to be set.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/include/asm/vmx.h
arch/x86/kvm/vmx.c

index d989829d33043de7cf737ecf3a87e7d4f68edb61..bcbfade26d8d587835124db66c968a09fd5b7d5b 100644 (file)
@@ -51,6 +51,9 @@
 #define CPU_BASED_MONITOR_EXITING               0x20000000
 #define CPU_BASED_PAUSE_EXITING                 0x40000000
 #define CPU_BASED_ACTIVATE_SECONDARY_CONTROLS   0x80000000
+
+#define CPU_BASED_ALWAYSON_WITHOUT_TRUE_MSR    0x0401e172
+
 /*
  * Definitions of Secondary Processor-Based VM-Execution Controls.
  */
index e55e404b5dba0e9351b04499b0ad90bcba7346af..66365a009cff77573e48c4d5e6ab69342c287f88 100644 (file)
@@ -2306,7 +2306,7 @@ static __init void nested_vmx_setup_ctls_msrs(void)
        /* cpu-based controls */
        rdmsr(MSR_IA32_VMX_PROCBASED_CTLS,
                nested_vmx_procbased_ctls_low, nested_vmx_procbased_ctls_high);
-       nested_vmx_procbased_ctls_low = 0;
+       nested_vmx_procbased_ctls_low = CPU_BASED_ALWAYSON_WITHOUT_TRUE_MSR;
        nested_vmx_procbased_ctls_high &=
                CPU_BASED_VIRTUAL_INTR_PENDING |
                CPU_BASED_VIRTUAL_NMI_PENDING | CPU_BASED_USE_TSC_OFFSETING |
@@ -2327,7 +2327,8 @@ static __init void nested_vmx_setup_ctls_msrs(void)
         * can use it to avoid exits to L1 - even when L0 runs L2
         * without MSR bitmaps.
         */
-       nested_vmx_procbased_ctls_high |= CPU_BASED_USE_MSR_BITMAPS;
+       nested_vmx_procbased_ctls_high |= CPU_BASED_ALWAYSON_WITHOUT_TRUE_MSR |
+               CPU_BASED_USE_MSR_BITMAPS;
 
        /* We support free control of CR3 access interception. */
        nested_vmx_true_procbased_ctls_low = nested_vmx_procbased_ctls_low &