bhyve/ioapic: only account for asserted line in level mode

After modifying a redirection entry only try to inject an interrupt if
the pin is in level mode, pins in edge mode shouldn't take into
account the line assert status as they are triggered by edge changes,
not the line status itself.

Reviewed by:		grehan
Differential revision:	https://reviews.freebsd.org/D28237
This commit is contained in:
Roger Pau Monné 2021-01-19 13:41:03 +01:00
parent 49429cf9be
commit d7d067698a

View File

@ -364,9 +364,11 @@ vioapic_write(struct vioapic *vioapic, int vcpuid, uint32_t addr, uint32_t data)
/*
* Generate an interrupt if the following conditions are met:
* - previous interrupt has been EOIed
* - pin trigger mode is level
* - pin level is asserted
*/
if ((vioapic->rtbl[pin].reg & IOART_REM_IRR) == 0 &&
(vioapic->rtbl[pin].reg & IOART_TRGRMOD) == IOART_TRGRLVL &&
(vioapic->rtbl[pin].acnt > 0)) {
VIOAPIC_CTR2(vioapic, "ioapic pin%d: asserted at rtbl "
"write, acnt %d", pin, vioapic->rtbl[pin].acnt);