Xen: Detect Extended Destination ID support

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:	3 weeks
Sponsored by:	Amazon
Differential Revision:	https://reviews.freebsd.org/D55429
This commit is contained in:
Colin Percival committed 2026-03-27 22:54:48 -07:00
1 parent 8c986d1645
commit 9b18ba2c16
1 file changed
+6
+6
View File
@@ -73,6 +73,7 @@
#include <machine/specialreg.h>
#include <x86/init.h>
#include <x86/kvm.h>
#include <contrib/xen/arch-x86/cpuid.h>
#ifdef DDB
#include <sys/interrupt.h>
@@ -2100,6 +2101,11 @@ detect_extended_dest_id(void)
/* Check if we support extended destination IDs. */
switch (vm_guest) {
case VM_GUEST_XEN:
cpuid_count(hv_base + 4, 0, regs);
if (regs[0] & XEN_HVM_CPUID_EXT_DEST_ID)
apic_ext_dest_id = 1;
break;
case VM_GUEST_KVM:
kvm_cpuid_get_features(regs);
if (regs[0] & KVM_FEATURE_MSI_EXT_DEST_ID)