diff options
author | Liran Alon <liran.alon@oracle.com> | 2018-03-22 20:01:30 -0400 |
---|---|---|
committer | Radim Krčmář <rkrcmar@redhat.com> | 2018-03-28 16:47:06 -0400 |
commit | 7c5a6a5970af76b3a303757487d50b18d6830f66 (patch) | |
tree | 720f85235c86ba56910072f9041e37e63321ce18 | |
parent | 773e8a0425c923bc02668a2d6534a5ef5a43cc69 (diff) |
KVM: VMX: No need to clear pending NMI/interrupt on inject realmode interrupt
kvm_inject_realmode_interrupt() is called from one of the injection
functions which writes event-injection to VMCS: vmx_queue_exception(),
vmx_inject_irq() and vmx_inject_nmi().
All these functions are called just to cause an event-injection to
guest. They are not responsible of manipulating the event-pending
flag. The only purpose of kvm_inject_realmode_interrupt() should be
to emulate real-mode interrupt-injection.
This was also incorrect when called from vmx_queue_exception().
Signed-off-by: Liran Alon <liran.alon@oracle.com>
Reviewed-by: Nikita Leshenko <nikita.leshchenko@oracle.com>
Reviewed-by: Jim Mattson <jmattson@google.com>
Signed-off-by: Krish Sadhukhan <krish.sadhukhan@oracle.com>
Signed-off-by: Radim Krčmář <rkrcmar@redhat.com>
-rw-r--r-- | arch/x86/kvm/x86.c | 5 |
1 files changed, 0 insertions, 5 deletions
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index 260261d01a41..dfa135bb0e5a 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c | |||
@@ -5681,11 +5681,6 @@ int kvm_inject_realmode_interrupt(struct kvm_vcpu *vcpu, int irq, int inc_eip) | |||
5681 | kvm_rip_write(vcpu, ctxt->eip); | 5681 | kvm_rip_write(vcpu, ctxt->eip); |
5682 | kvm_set_rflags(vcpu, ctxt->eflags); | 5682 | kvm_set_rflags(vcpu, ctxt->eflags); |
5683 | 5683 | ||
5684 | if (irq == NMI_VECTOR) | ||
5685 | vcpu->arch.nmi_pending = 0; | ||
5686 | else | ||
5687 | vcpu->arch.interrupt.pending = false; | ||
5688 | |||
5689 | return EMULATE_DONE; | 5684 | return EMULATE_DONE; |
5690 | } | 5685 | } |
5691 | EXPORT_SYMBOL_GPL(kvm_inject_realmode_interrupt); | 5686 | EXPORT_SYMBOL_GPL(kvm_inject_realmode_interrupt); |