aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNikita Leshenko <nikita.leshchenko@oracle.com>2017-11-05 08:52:30 -0500
committerPaolo Bonzini <pbonzini@redhat.com>2017-11-17 07:20:18 -0500
commitda3fe7bdfada217bf02ecd0477fcdb55da50944c (patch)
tree83c19f01d52b4f080dd051de89ad264692bf9733
parent0fc5a36dd6b345eb0d251a65c236e53bead3eef7 (diff)
KVM: x86: ioapic: Don't fire level irq when Remote IRR set
Avoid firing a level-triggered interrupt that has the Remote IRR bit set, because that means that some CPU is already processing it. The Remote IRR bit will be cleared after an EOI and the interrupt will refire if the irq line is still asserted. This behavior is aligned with QEMU's IOAPIC implementation that was introduced by commit f99b86b94987 ("x86: ioapic: ignore level irq during processing") in QEMU. Signed-off-by: Nikita Leshenko <nikita.leshchenko@oracle.com> Reviewed-by: Liran Alon <liran.alon@oracle.com> Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> Reviewed-by: Wanpeng Li <wanpeng.li@hotmail.com> Signed-off-by: Radim Krčmář <rkrcmar@redhat.com>
-rw-r--r--arch/x86/kvm/ioapic.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/arch/x86/kvm/ioapic.c b/arch/x86/kvm/ioapic.c
index ae0a7dc318b2..5c9231139243 100644
--- a/arch/x86/kvm/ioapic.c
+++ b/arch/x86/kvm/ioapic.c
@@ -323,7 +323,9 @@ static int ioapic_service(struct kvm_ioapic *ioapic, int irq, bool line_status)
323 struct kvm_lapic_irq irqe; 323 struct kvm_lapic_irq irqe;
324 int ret; 324 int ret;
325 325
326 if (entry->fields.mask) 326 if (entry->fields.mask ||
327 (entry->fields.trig_mode == IOAPIC_LEVEL_TRIG &&
328 entry->fields.remote_irr))
327 return -1; 329 return -1;
328 330
329 ioapic_debug("dest=%x dest_mode=%x delivery_mode=%x " 331 ioapic_debug("dest=%x dest_mode=%x delivery_mode=%x "