From: David Woodhouse <dwmw2@infradead.org>
To: qemu-devel@nongnu.org
Cc: "Paolo Bonzini" <pbonzini@redhat.com>,
"Marcelo Tosatti" <mtosatti@redhat.com>,
kvm@vger.kernel.org, xen-devel <xen-devel@lists.xenproject.org>,
"Roger Pau Monné" <roger.pau@citrix.com>,
"Jürgen Gross" <jgross@suse.com>
Subject: [PATCH] i386/xen: Advertise XEN_HVM_CPUID_EXT_DEST_ID for Xen guests where supported
Date: Fri, 29 Aug 2025 15:04:55 +0100 [thread overview]
Message-ID: <9912a9c26aa322623b09ace7a01c7a86665e147a.camel@infradead.org> (raw)
[-- 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 --]
reply other threads:[~2025-08-30 16:02 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=9912a9c26aa322623b09ace7a01c7a86665e147a.camel@infradead.org \
--to=dwmw2@infradead.org \
--cc=jgross@suse.com \
--cc=kvm@vger.kernel.org \
--cc=mtosatti@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=roger.pau@citrix.com \
--cc=xen-devel@lists.xenproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).