diff options
author | Nikita Leshenko <nikita.leshchenko@oracle.com> | 2017-11-05 14:52:30 +0100 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2017-11-17 13:20:18 +0100 |
commit | da3fe7bdfada217bf02ecd0477fcdb55da50944c (patch) | |
tree | 83c19f01d52b4f080dd051de89ad264692bf9733 /arch/x86/kvm | |
parent | KVM: x86: ioapic: Fix level-triggered EOI and IOAPIC reconfigure race (diff) | |
download | linux-da3fe7bdfada217bf02ecd0477fcdb55da50944c.tar.xz linux-da3fe7bdfada217bf02ecd0477fcdb55da50944c.zip |
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>
Diffstat (limited to 'arch/x86/kvm')
-rw-r--r-- | arch/x86/kvm/ioapic.c | 4 |
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) struct kvm_lapic_irq irqe; int ret; - if (entry->fields.mask) + if (entry->fields.mask || + (entry->fields.trig_mode == IOAPIC_LEVEL_TRIG && + entry->fields.remote_irr)) return -1; ioapic_debug("dest=%x dest_mode=%x delivery_mode=%x " |