diff options
author | Jan Kiszka <jan.kiszka@siemens.com> | 2014-03-07 14:03:14 -0500 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2014-03-11 03:41:46 -0400 |
commit | 220c56729766444f3dd823f740a147ca6d82c4c6 (patch) | |
tree | 9777e200c55a58c11afd8727a9b702fc843dd268 /arch/x86 | |
parent | f4124500c2c13eb1208c6143b3f6d469709dea10 (diff) |
KVM: nVMX: Do not inject NMI vmexits when L2 has a pending interrupt
According to SDM 27.2.3, IDT vectoring information will not be valid on
vmexits caused by external NMIs. So we have to avoid creating such
scenarios by delaying EXIT_REASON_EXCEPTION_NMI injection as long as we
have a pending interrupt because that one would be migrated to L1's IDT
vectoring info on nested exit.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'arch/x86')
-rw-r--r-- | arch/x86/kvm/vmx.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c index e559675e113f..2c9d21e2d033 100644 --- a/arch/x86/kvm/vmx.c +++ b/arch/x86/kvm/vmx.c | |||
@@ -8176,7 +8176,8 @@ static int vmx_check_nested_events(struct kvm_vcpu *vcpu, bool external_intr) | |||
8176 | } | 8176 | } |
8177 | 8177 | ||
8178 | if (vcpu->arch.nmi_pending && nested_exit_on_nmi(vcpu)) { | 8178 | if (vcpu->arch.nmi_pending && nested_exit_on_nmi(vcpu)) { |
8179 | if (vmx->nested.nested_run_pending) | 8179 | if (vmx->nested.nested_run_pending || |
8180 | vcpu->arch.interrupt.pending) | ||
8180 | return -EBUSY; | 8181 | return -EBUSY; |
8181 | nested_vmx_vmexit(vcpu, EXIT_REASON_EXCEPTION_NMI, | 8182 | nested_vmx_vmexit(vcpu, EXIT_REASON_EXCEPTION_NMI, |
8182 | NMI_VECTOR | INTR_TYPE_NMI_INTR | | 8183 | NMI_VECTOR | INTR_TYPE_NMI_INTR | |