diff --git a/sys/x86/include/kvm.h b/sys/x86/include/kvm.h --- a/sys/x86/include/kvm.h +++ b/sys/x86/include/kvm.h @@ -49,6 +49,7 @@ #define KVM_FEATURE_CLOCKSOURCE 0x00000001 #define KVM_FEATURE_CLOCKSOURCE2 0x00000008 +#define KVM_FEATURE_MSI_EXT_DEST_ID 0x00008000 #define KVM_FEATURE_CLOCKSOURCE_STABLE_BIT 0x01000000 /* Deprecated: for the CLOCKSOURCE feature. */ diff --git a/sys/x86/x86/local_apic.c b/sys/x86/x86/local_apic.c --- a/sys/x86/x86/local_apic.c +++ b/sys/x86/x86/local_apic.c @@ -72,6 +72,7 @@ #include #include #include +#include #ifdef DDB #include @@ -2095,6 +2096,16 @@ static void detect_extended_dest_id(void) { + u_int regs[4]; + + /* Check if we support extended destination IDs. */ + switch (vm_guest) { + case VM_GUEST_KVM: + kvm_cpuid_get_features(regs); + if (regs[0] & KVM_FEATURE_MSI_EXT_DEST_ID) + apic_ext_dest_id = 1; + break; + } } /*