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)
Thu, Mar 28, 10:33 AM
Unknown Object (File)
Feb 17 2024, 12:10 AM
Unknown Object (File)
Dec 20 2023, 4:45 AM
Unknown Object (File)
Dec 12 2023, 10:41 AM
Unknown Object (File)
Nov 11 2023, 10:53 AM
Unknown Object (File)
Nov 3 2023, 12:16 AM
Unknown Object (File)
Sep 24 2023, 1:44 AM
Unknown Object (File)
Sep 6 2023, 2:16 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.