* [PATCH] i386/xen: Advertise XEN_HVM_CPUID_EXT_DEST_ID for Xen guests where supported
@ 2025-08-29 14:04 David Woodhouse
0 siblings, 0 replies; only message in thread
From: David Woodhouse @ 2025-08-29 14:04 UTC (permalink / raw)
To: qemu-devel
Cc: Paolo Bonzini, Marcelo Tosatti, kvm, xen-devel,
Roger Pau Monné, Jürgen Gross
[-- Attachment #1: Type: text/plain, Size: 1551 bytes --]
From: David Woodhouse <dwmw@amazon.co.uk>
The 15-bit MSI enlightenment which allows for up to 32768 vCPUs without a
virtual IOMMU is documented at http://david.woodhou.se/ExtDestId.pdf and
has been supported for native KVM guests since QEMU v6.0.
Although Xen itself has only defined the CPUID bit and not yet implemented
it because of complexity in the interface between QEMU and Xen for MSI
handling, there's no reason why it can't work when QEMU/KVM is hosting Xen
guests. Advertise it accordingly.
Tested with a standard Linux guest (which has supported this under Xen
since v5.17) and QEMU command line including -M q35 -smp 4,maxcpus=288
-device host-x86_64-cpu,socket-id=0,core-id=257,thread-id=0
-cpu host,+xen-vapic
We need +xen-vapic to test it properly, or the guest turns every MSI and
I/O APIC interrupt into an event channel. Testing shows that both line
interrupts and MSIs can be set affine to the fifth CPU and are delivered
correctly.
Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
---
target/i386/kvm/kvm.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/target/i386/kvm/kvm.c b/target/i386/kvm/kvm.c
index 369626f8c8..1401d7a903 100644
--- a/target/i386/kvm/kvm.c
+++ b/target/i386/kvm/kvm.c
@@ -2221,6 +2221,7 @@ int kvm_arch_init_vcpu(CPUState *cs)
if (cs->kvm_state->xen_version >= XEN_VERSION(4, 17)) {
c->eax |= XEN_HVM_CPUID_UPCALL_VECTOR;
+ c->eax |= XEN_HVM_CPUID_EXT_DEST_ID;
}
}
--
2.49.0
[-- Attachment #2: smime.p7s --]
[-- Type: application/pkcs7-signature, Size: 5069 bytes --]
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2025-08-29 14:05 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-29 14:04 [PATCH] i386/xen: Advertise XEN_HVM_CPUID_EXT_DEST_ID for Xen guests where supported David Woodhouse
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).