aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJan Kiszka <jan.kiszka@siemens.com>2014-06-16 07:59:42 -0400
committerPaolo Bonzini <pbonzini@redhat.com>2014-06-19 06:52:12 -0400
commit560b7ee12ca5e1ebc1675d7eb4008bb22708277a (patch)
tree20bb81961140e6c33206ef97acb82f31534c3511
parent3dcdf3ec6e48d918741ea11349d4436d0c5aac93 (diff)
KVM: nVMX: Fix returned value of MSR_IA32_VMX_PROCBASED_CTLS
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>
-rw-r--r--arch/x86/include/asm/vmx.h3
-rw-r--r--arch/x86/kvm/vmx.c5
2 files changed, 6 insertions, 2 deletions
diff --git a/arch/x86/include/asm/vmx.h b/arch/x86/include/asm/vmx.h
index d989829d3304..bcbfade26d8d 100644
--- a/arch/x86/include/asm/vmx.h
+++ b/arch/x86/include/asm/vmx.h
@@ -51,6 +51,9 @@
51#define CPU_BASED_MONITOR_EXITING 0x20000000 51#define CPU_BASED_MONITOR_EXITING 0x20000000
52#define CPU_BASED_PAUSE_EXITING 0x40000000 52#define CPU_BASED_PAUSE_EXITING 0x40000000
53#define CPU_BASED_ACTIVATE_SECONDARY_CONTROLS 0x80000000 53#define CPU_BASED_ACTIVATE_SECONDARY_CONTROLS 0x80000000
54
55#define CPU_BASED_ALWAYSON_WITHOUT_TRUE_MSR 0x0401e172
56
54/* 57/*
55 * Definitions of Secondary Processor-Based VM-Execution Controls. 58 * Definitions of Secondary Processor-Based VM-Execution Controls.
56 */ 59 */
diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
index e55e404b5dba..66365a009cff 100644
--- a/arch/x86/kvm/vmx.c
+++ b/arch/x86/kvm/vmx.c
@@ -2306,7 +2306,7 @@ static __init void nested_vmx_setup_ctls_msrs(void)
2306 /* cpu-based controls */ 2306 /* cpu-based controls */
2307 rdmsr(MSR_IA32_VMX_PROCBASED_CTLS, 2307 rdmsr(MSR_IA32_VMX_PROCBASED_CTLS,
2308 nested_vmx_procbased_ctls_low, nested_vmx_procbased_ctls_high); 2308 nested_vmx_procbased_ctls_low, nested_vmx_procbased_ctls_high);
2309 nested_vmx_procbased_ctls_low = 0; 2309 nested_vmx_procbased_ctls_low = CPU_BASED_ALWAYSON_WITHOUT_TRUE_MSR;
2310 nested_vmx_procbased_ctls_high &= 2310 nested_vmx_procbased_ctls_high &=
2311 CPU_BASED_VIRTUAL_INTR_PENDING | 2311 CPU_BASED_VIRTUAL_INTR_PENDING |
2312 CPU_BASED_VIRTUAL_NMI_PENDING | CPU_BASED_USE_TSC_OFFSETING | 2312 CPU_BASED_VIRTUAL_NMI_PENDING | CPU_BASED_USE_TSC_OFFSETING |
@@ -2327,7 +2327,8 @@ static __init void nested_vmx_setup_ctls_msrs(void)
2327 * can use it to avoid exits to L1 - even when L0 runs L2 2327 * can use it to avoid exits to L1 - even when L0 runs L2
2328 * without MSR bitmaps. 2328 * without MSR bitmaps.
2329 */ 2329 */
2330 nested_vmx_procbased_ctls_high |= CPU_BASED_USE_MSR_BITMAPS; 2330 nested_vmx_procbased_ctls_high |= CPU_BASED_ALWAYSON_WITHOUT_TRUE_MSR |
2331 CPU_BASED_USE_MSR_BITMAPS;
2331 2332
2332 /* We support free control of CR3 access interception. */ 2333 /* We support free control of CR3 access interception. */
2333 nested_vmx_true_procbased_ctls_low = nested_vmx_procbased_ctls_low & 2334 nested_vmx_true_procbased_ctls_low = nested_vmx_procbased_ctls_low &