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
Unknown Object (File)
Tue, Nov 12, 9:16 AM
Unknown Object (File)
Tue, Nov 12, 9:09 AM
Unknown Object (File)
Oct 14 2024, 12:21 PM
Unknown Object (File)
Oct 6 2024, 3:46 PM
Unknown Object (File)
Oct 6 2024, 2:55 PM
Unknown Object (File)
Oct 6 2024, 11:29 AM
Unknown Object (File)
Sep 24 2024, 7:25 PM
Unknown Object (File)
Sep 20 2024, 4:37 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
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 36340
Build 33229: arc lint + arc unit

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.