Page MenuHomeFreeBSD

msi: Support APIC Extended Destination IDs
ClosedPublic

Authored by cperciva on Feb 22 2026, 4:10 AM.
Tags
None
Referenced Files
F151109267: D55426.id172486.diff
Mon, Apr 6, 3:26 AM
F151046723: D55426.id172425.diff
Sun, Apr 5, 3:38 PM
Unknown Object (File)
Sun, Apr 5, 1:09 PM
Unknown Object (File)
Wed, Mar 18, 5:21 PM
Unknown Object (File)
Wed, Mar 11, 8:10 PM
Unknown Object (File)
Wed, Mar 11, 12:34 PM
Unknown Object (File)
Wed, Mar 11, 9:30 AM
Unknown Object (File)
Wed, Mar 11, 5:11 AM
Subscribers

Details

Summary

Without an IOMMU, the APIC standard only allow 8 bits of Destination ID
for MSI messages, limiting us to 256 CPUs. While IOMMUs can allow for
more than 256 CPUs to be supported, they are not necessarily desireable
in virtualized environments.

Implement the Extended Destination ID standard authored by David
Woodhouse, which uses 7 "Reserved" bits for the high bits of a 15-bit
Extended Destination ID: http://david.woodhou.se/ExtDestId.pdf

This standard is implemented on the host side in Xen, Hyper-V, KVM,
and Bhyve; future commits will add code to detect and enable it
automatically but in the mean time it can be enabled via the loader
tunable machdep.msi_ext_dest_id.

MFC after: 2 weeks

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 70903
Build 67786: arc lint + arc unit

Event Timeline

sys/x86/x86/msi.c
100

Should it be SYSCTL_BOOL?

sys/x86/x86/msi.c
100

I'm actually about to change this to be tri-state, with -1 meaning "autodetect", so that the loader tunable can set this in either direction. So yes it probably should have been, but no it shouldn't be after that change.

This revision is now accepted and ready to land.Feb 23 2026, 7:36 PM
sys/x86/x86/msi.c
666

This line seems to be over-indented by one space.

Switch machdep.msi_ext_dest_id to tristate

-1 (default) means autodetect

Setting the loader tunable to 0 or 1 forces the state off or on.

This revision now requires review to proceed.Feb 23 2026, 7:52 PM
sys/x86/x86/msi.c
105

Too much indentation for this line too.

sys/x86/x86/msi.c
105

That indentation was there in the original INTEL_ADDR which I copied. Although perhaps the second line (which I added) should have the same extra half-indent?

666

That was deliberate based on the nesting of parentheses; I thought it was clearer this way.

sys/x86/x86/msi.c
105

I believe all lines after the first must have the same indent, per style.

666

Style(9) does not say anything about increasing indent for nested expressions. It is plain +4 spaces, same for all continuation lines.

Rework for apic_ext_dest_id shared with ioapic code

This revision was not accepted when it landed; it landed in state Needs Review.Sat, Mar 28, 5:56 AM
This revision was automatically updated to reflect the committed changes.