Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 16 Apr 2026 15:04:31 +0000
From:      Colin Percival <cperciva@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: d78de8bb7966 - stable/15 - Xen: Detect Extended Destination ID support
Message-ID:  <69e0fa7f.1a5f3.3312478a@gitrepo.freebsd.org>

index | next in thread | raw e-mail

The branch stable/15 has been updated by cperciva:

URL: https://cgit.FreeBSD.org/src/commit/?id=d78de8bb79667b97262e6b580865041e51db6204

commit d78de8bb79667b97262e6b580865041e51db6204
Author:     Colin Percival <cperciva@FreeBSD.org>
AuthorDate: 2026-02-22 04:09:00 +0000
Commit:     Colin Percival <cperciva@FreeBSD.org>
CommitDate: 2026-04-16 15:03:59 +0000

    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
    
    (cherry picked from commit 9b18ba2c16a0750e6c78f348845368284ef1a704)
---
 sys/x86/x86/local_apic.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/sys/x86/x86/local_apic.c b/sys/x86/x86/local_apic.c
index ea5b14d92262..9bdf343886da 100644
--- a/sys/x86/x86/local_apic.c
+++ b/sys/x86/x86/local_apic.c
@@ -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>
@@ -2081,6 +2082,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)


home | help

Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?69e0fa7f.1a5f3.3312478a>