Page MenuHomeFreeBSD

Xen: Detect Extended Destination ID support
Needs ReviewPublic

Authored by cperciva on Feb 22 2026, 4:10 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Mar 22, 7:41 AM
Unknown Object (File)
Tue, Mar 17, 12:52 PM
Unknown Object (File)
Mon, Mar 9, 6:48 PM
Unknown Object (File)
Mon, Mar 9, 6:44 PM
Unknown Object (File)
Sun, Mar 8, 6:14 AM
Unknown Object (File)
Fri, Mar 6, 8:02 AM
Unknown Object (File)
Wed, Mar 4, 1:55 PM
Unknown Object (File)
Tue, Mar 3, 1:25 AM
Subscribers

Details

Reviewers
royger
Summary

Xen advertises support for the Extended Destination ID standard via
bit 5 (aka XEN_HVM_CPUID_EXT_DEST_ID) of the value returned in the
EAX register when Xen features are queried via CPUID.

MFC after: 2 weeks

Diff Detail

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

Event Timeline

Only enable if ext_dest_id is set to -1.

I think I'm missing the previous changes that introduce the support for KVM, as those haven't landed in the git repository yet. FWIW, while the CPUID has been reserved on Xen, the implementation is not done, so there's no way to test it on Xen.

sys/x86/x86/msi.c
398 ↗(On Diff #172539)

Why are you doing the detection in MSI init code? The usage of the extended destination ID is not limited to MSI, and can also be used with IO-APIC RTEs. It should likely be done in a more generic place, maybe at interrupt initialization? So that it can be used by the IO-APIC.

I think I'm missing the previous changes that introduce the support for KVM, as those haven't landed in the git repository yet. FWIW, while the CPUID has been reserved on Xen, the implementation is not done, so there's no way to test it on Xen.

The KVM detection is just before this in the stack: https://reviews.freebsd.org/D55427 . And the code which uses ext_dest_id is in https://reviews.freebsd.org/D55426.

sys/x86/x86/msi.c
398 ↗(On Diff #172539)

I'm doing it here because this is the file where I needed to use it (see the earlier patch).

But you're right that I forgot about IO-APIC RTEs. I need to understand our code for those better...

Move detection code into local_apic.c

@royger The handling of APIC RTEs is now in D55889. (The handling of MSIs remains in D55426, and there's now a new D55890 which creates the detect_extended_dest_id function which this revision adds Xen detection code to.)