Page MenuHomeFreeBSD

bhyve/ioapic: improve the tracking of IRR bit
ClosedPublic

Authored by royger on Jan 19 2021, 2:26 PM.
Tags
None
Referenced Files
F82698104: D28238.diff
Wed, May 1, 6:44 PM
Unknown Object (File)
Fri, Apr 26, 2:39 AM
Unknown Object (File)
Fri, Apr 26, 2:38 AM
Unknown Object (File)
Fri, Apr 26, 2:28 AM
Unknown Object (File)
Thu, Apr 25, 8:41 PM
Unknown Object (File)
Sat, Apr 20, 1:20 AM
Unknown Object (File)
Mar 28 2024, 10:33 AM
Unknown Object (File)
Feb 17 2024, 12:10 AM
Subscribers

Details

Summary

One common method of EOI'ing an interrupt at the IO-APIC level is to
switch the pin to edge triggering mode and then back into level mode.
That would cause the IRR bit to be cleared and thus further interrupts
to be injected. FreeBSD does indeed use that method if the IO-APIC EOI
register is not supported.

The bhyve IO-APIC emulation code didn't clear the IRR bit when doing
that switch, and was also missing acknowledging the IRR state when
trying to inject an interrupt in vioapic_send_intr.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

I tested all 3 ioapic diffs with a FreeBSD 12.2 guest on -current, with MSI/MSI-x disabled to force virtio-net and ahci to use level-triggered legacy IRQs. Some stress testing was done with those devices without any issue.

This revision is now accepted and ready to land.Feb 2 2021, 8:23 AM
This revision was automatically updated to reflect the committed changes.