From: David Woodhouse <dwmw2@infradead.org>
To: Sandesh Patel <sandesh.patel@nutanix.com>
Cc: "qemu-devel@nongnu.org" <qemu-devel@nongnu.org>,
Rob Scheepens <rob.scheepens@nutanix.com>,
Prerna Saxena <confluence@nutanix.com>,
Dexuan Cui <decui@microsoft.com>
Subject: Re: More than 255 vcpus Windows VM setup without viommu ?
Date: Mon, 08 Jul 2024 10:13:22 +0100 [thread overview]
Message-ID: <39b92288418839e9cdba447705a44a8e216dedc3.camel@infradead.org> (raw)
In-Reply-To: <7BBA47BD-AC3D-4F12-A860-AD3F2B509257@nutanix.com>
[-- Attachment #1: Type: text/plain, Size: 2016 bytes --]
On Wed, 2024-07-03 at 16:01 +0000, Sandesh Patel wrote:
> >
> > Interesting. What exactly has Windows *done* in those MSI entries?
> > That
> > might give a clue about how to support it.
>
> The KVM_SET_GSI_ROUTING ioctl calls kvm_set_routing_entry function in
> kvm.
>
> int kvm_set_routing_entry(struct kvm *kvm, struct
> kvm_kernel_irq_routing_entry *e,
> const struct kvm_irq_routing_entry *ue)
> {
>
> switch (ue->type) {
> case KVM_IRQ_ROUTING_MSI:
> e->set = kvm_set_msi;
> e->msi.address_lo = ue->u.msi.address_lo;
> e->msi.address_hi = ue->u.msi.address_hi;
> e->msi.data = ue->u.msi.data;
>
> if (kvm_msi_route_invalid(kvm, e))
> return -EINVAL;
> break;
> }
> }
>
> static inline bool kvm_msi_route_invalid(struct kvm *kvm,
> struct kvm_kernel_irq_routing_entry *e)
> {
> return kvm->arch.x2apic_format && (e->msi.address_hi & 0xff);
> }
>
> That means msi.address_hi must have 0 in the last byte.
>
> Qemu function kvm_arch_fixup_msi_route is responsible for
> fixing msi.address_hi value in
> msi routing entry that is passed to kvm.
> This function got msi.addr_hi: 0x0 in input when iommu was enabled
> and msi.addr_hi: 0x1
> when viommu was not enabled for one of the entry. The same value was
> returned in the output.
> and saved as routing entry.
That's after QEMU has translated it though. Precisely which MSI is
this, belonging to which device, and what exactly did Windows write to
the MSI table?
If *Windows* put anything into the high address bits, that isn't even
targeted at the APIC, and it would be an attempt at writing to actual
memory. I suspect that isn't the case.
Can you make kvm_arch_fixup_msi_route() print the actual address and
data directly from the guest?
[-- Attachment #2: smime.p7s --]
[-- Type: application/pkcs7-signature, Size: 5965 bytes --]
next prev parent reply other threads:[~2024-07-08 9:14 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-02 5:17 More than 255 vcpus Windows VM setup without viommu ? Sandesh Patel
2024-07-02 9:04 ` David Woodhouse
2024-07-03 16:01 ` Sandesh Patel
2024-07-08 9:13 ` David Woodhouse [this message]
2024-07-11 7:26 ` David Woodhouse
2024-07-11 11:23 ` David Woodhouse
2024-07-11 11:52 ` Sandesh Patel
2024-07-16 5:13 ` Sandesh Patel
2024-07-24 9:22 ` David Woodhouse
2024-08-01 10:28 ` Sandesh Patel
2024-09-28 14:59 ` David Woodhouse
2024-09-30 15:50 ` David Woodhouse
2024-10-02 11:33 ` Igor Mammedov
2024-10-02 15:30 ` David Woodhouse
2024-10-01 13:33 ` Daniel P. Berrangé
2024-10-01 16:37 ` David Woodhouse
-- strict thread matches above, loose matches on Subject: below --
2024-07-02 7:20 Sandesh Patel
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=39b92288418839e9cdba447705a44a8e216dedc3.camel@infradead.org \
--to=dwmw2@infradead.org \
--cc=confluence@nutanix.com \
--cc=decui@microsoft.com \
--cc=qemu-devel@nongnu.org \
--cc=rob.scheepens@nutanix.com \
--cc=sandesh.patel@nutanix.com \
/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).