hv: vioapic: check vector prior to irr in EOI write emulation

Check the vector first to avoid unnecessary irr check.

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 08:31:23 +00:00 committed by lijinxia
parent fc4162918a
commit f0d2291fe2
1 changed files with 7 additions and 12 deletions

View File

@ -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;
}