hv: vioapic: avoid deliver unnecessary interrupt for level trigger

For level sensitive trigger mode, the vioapic should not deliver extra
interrupt to vlapic if the previous one hasn't received EOI.

Signed-off-by: Yu Wang <yu1.wang@intel.com>
Acked-by: Anthony Xu <anthony.xu@intel.com>
This commit is contained in:
Yu Wang 2018-08-01 13:08:47 +00:00 committed by lijinxia
parent 771c6db321
commit 68cbdb39de
1 changed files with 8 additions and 1 deletions

View File

@ -87,13 +87,20 @@ vioapic_send_intr(struct vioapic *vioapic, uint8_t pin)
phys = ((rte.full & IOAPIC_RTE_DESTMOD) == IOAPIC_RTE_DESTPHY);
delmode = (uint32_t)(rte.full & IOAPIC_RTE_DELMOD);
level = ((rte.full & IOAPIC_RTE_TRGRLVL) != 0UL);
/* For level trigger irq, avoid send intr if
* previous one hasn't received EOI
*/
if (level) {
if (vioapic->rtbl[pin].full & IOAPIC_RTE_REM_IRR) {
return;
}
vioapic->rtbl[pin].full |= IOAPIC_RTE_REM_IRR;
}
vector = rte.u.lo_32 & IOAPIC_RTE_LOW_INTVEC;
dest = (uint32_t)(rte.full >> IOAPIC_RTE_DEST_SHIFT);
vlapic_deliver_intr(vioapic->vm, level, dest, phys, delmode, vector, false);
vlapic_deliver_intr(vioapic->vm, level, dest, phys,
delmode, vector, false);
}
static void