aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kvm/vmx.c
diff options
context:
space:
mode:
authorJan Kiszka <jan.kiszka@siemens.com>2013-04-14 06:12:45 -0400
committerGleb Natapov <gleb@redhat.com>2013-04-14 11:27:05 -0400
commit3b656cf764cbc43d3efb9bf5f45c618d4cf0989f (patch)
tree2f2fd183f9826f49158cc30303e84a7edf555cfc /arch/x86/kvm/vmx.c
parent188424ba10313bbbc015727d418b7f18593becdd (diff)
KVM: nVMX: Fix injection of PENDING_INTERRUPT and NMI_WINDOW exits to L1
Check if the interrupt or NMI window exit is for L1 by testing if it has the corresponding controls enabled. This is required when we allow direct injection from L0 to L2 Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Reviewed-by: Gleb Natapov <gleb@redhat.com> Signed-off-by: Gleb Natapov <gleb@redhat.com>
Diffstat (limited to 'arch/x86/kvm/vmx.c')
-rw-r--r--arch/x86/kvm/vmx.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
index d2686771481f..5ae969b741f8 100644
--- a/arch/x86/kvm/vmx.c
+++ b/arch/x86/kvm/vmx.c
@@ -6112,14 +6112,9 @@ static bool nested_vmx_exit_handled(struct kvm_vcpu *vcpu)
6112 case EXIT_REASON_TRIPLE_FAULT: 6112 case EXIT_REASON_TRIPLE_FAULT:
6113 return 1; 6113 return 1;
6114 case EXIT_REASON_PENDING_INTERRUPT: 6114 case EXIT_REASON_PENDING_INTERRUPT:
6115 return nested_cpu_has(vmcs12, CPU_BASED_VIRTUAL_INTR_PENDING);
6115 case EXIT_REASON_NMI_WINDOW: 6116 case EXIT_REASON_NMI_WINDOW:
6116 /* 6117 return nested_cpu_has(vmcs12, CPU_BASED_VIRTUAL_NMI_PENDING);
6117 * prepare_vmcs02() set the CPU_BASED_VIRTUAL_INTR_PENDING bit
6118 * (aka Interrupt Window Exiting) only when L1 turned it on,
6119 * so if we got a PENDING_INTERRUPT exit, this must be for L1.
6120 * Same for NMI Window Exiting.
6121 */
6122 return 1;
6123 case EXIT_REASON_TASK_SWITCH: 6118 case EXIT_REASON_TASK_SWITCH:
6124 return 1; 6119 return 1;
6125 case EXIT_REASON_CPUID: 6120 case EXIT_REASON_CPUID: