diff --git a/hypervisor/arch/x86/guest/vioapic.c b/hypervisor/arch/x86/guest/vioapic.c index e524a702e..11df521eb 100644 --- a/hypervisor/arch/x86/guest/vioapic.c +++ b/hypervisor/arch/x86/guest/vioapic.c @@ -284,10 +284,8 @@ vioapic_write_eoi(struct vioapic *vioapic, uint32_t vector) for (pin = 0U; pin < pincount; pin++) { rte = vioapic->rtbl[pin]; - if ((rte.full & IOAPIC_RTE_REM_IRR) == 0UL) { - continue; - } - if ((rte.u.lo_32 & IOAPIC_RTE_LOW_INTVEC) != vector) { + if (((rte.u.lo_32 & IOAPIC_RTE_LOW_INTVEC) != vector) || + ((rte.full & IOAPIC_RTE_REM_IRR) == 0UL)) { continue; } @@ -492,12 +490,11 @@ vioapic_process_eoi(struct vm *vm, uint32_t vector) /* notify device to ack if assigned pin */ for (pin = 0U; pin < pincount; pin++) { rte = vioapic->rtbl[pin]; - if ((rte.full & IOAPIC_RTE_REM_IRR) == 0UL) { - continue; - } - if ((rte.u.lo_32 & IOAPIC_RTE_LOW_INTVEC) != vector) { + if (((rte.u.lo_32 & IOAPIC_RTE_LOW_INTVEC) != vector) || + ((rte.full & IOAPIC_RTE_REM_IRR) == 0UL)) { continue; } + ptdev_intx_ack(vm, pin, PTDEV_VPIN_IOAPIC); } @@ -508,10 +505,8 @@ vioapic_process_eoi(struct vm *vm, uint32_t vector) VIOAPIC_LOCK(vioapic); for (pin = 0U; pin < pincount; pin++) { rte = vioapic->rtbl[pin]; - if ((rte.full & IOAPIC_RTE_REM_IRR) == 0UL) { - continue; - } - if ((rte.u.lo_32 & IOAPIC_RTE_LOW_INTVEC) != vector) { + if (((rte.u.lo_32 & IOAPIC_RTE_LOW_INTVEC) != vector) || + ((rte.full & IOAPIC_RTE_REM_IRR) == 0UL)) { continue; }