aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorColin Percival <cperciva@FreeBSD.org>2026-02-22 04:09:00 +0000
committerColin Percival <cperciva@FreeBSD.org>2026-03-28 05:54:52 +0000
commit8dd9a0d52175fbc5dafed851fb95a289a94fb6cd (patch)
tree512ec05139aec335d004e2e10f6db4e9844aaddb
parent49b6254b3e09ee741f456617111ecb18803459fb (diff)
Bhyve: Detect Extended Destination ID support
Bhyve advertises support for the Extended Destination ID standard via bit 0 (aka CPUID_BHYVE_FEAT_EXT_DEST_ID) of the value returned in the EAX register when Bhyve features are queried via CPUID. MFC after: 3 weeks Sponsored by: Amazon Differential Revision: https://reviews.freebsd.org/D55431
-rw-r--r--sys/x86/x86/local_apic.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/sys/x86/x86/local_apic.c b/sys/x86/x86/local_apic.c
index accdf853a174..20f095a13574 100644
--- a/sys/x86/x86/local_apic.c
+++ b/sys/x86/x86/local_apic.c
@@ -74,6 +74,7 @@
#include <x86/init.h>
#include <x86/kvm.h>
#include <contrib/xen/arch-x86/cpuid.h>
+#include <x86/bhyve.h>
#ifdef DDB
#include <sys/interrupt.h>
@@ -2111,6 +2112,13 @@ detect_extended_dest_id(void)
if (regs[0] & KVM_FEATURE_MSI_EXT_DEST_ID)
apic_ext_dest_id = 1;
break;
+ case VM_GUEST_BHYVE:
+ if (hv_high < CPUID_BHYVE_FEATURES)
+ break;
+ cpuid_count(CPUID_BHYVE_FEATURES, 0, regs);
+ if (regs[0] & CPUID_BHYVE_FEAT_EXT_DEST_ID)
+ apic_ext_dest_id = 1;
+ break;
}
}