From: Sean Christopherson <seanjc@google.com>
To: "Daniel P. Berrangé" <berrange@redhat.com>
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>,
Xiaoyao Li <xiaoyao.li@intel.com>,
Alexandre Chartre <alexandre.chartre@oracle.com>,
Zhao Liu <zhao1.liu@intel.com>,
qemu-devel@nongnu.org, pbonzini@redhat.com,
qemu-stable@nongnu.org, boris.ostrovsky@oracle.com,
maciej.szmigiero@oracle.com, kvm@vger.kernel.org
Subject: Re: [PATCH] i386/cpu: ARCH_CAPABILITIES should not be advertised on AMD
Date: Mon, 7 Jul 2025 13:03:14 -0700 [thread overview]
Message-ID: <aGwoAo02SWIBx7QR@google.com> (raw)
In-Reply-To: <aGwgq2cz_xcYCf4o@redhat.com>
On Mon, Jul 07, 2025, Daniel P. Berrangé wrote:
> On Tue, Jul 01, 2025 at 03:59:12PM -0400, Konrad Rzeszutek Wilk wrote:
> > ..snip..
> > > OK, back to the original question "what should the code do?"
> > >
> > > My answer is, it can behave with any of below option:
> > >
> > > - Be vendor agnostic and stick to x86 architecture. If CPUID enumerates a
> > > feature, then the feature is available architecturally.
> >
> > Exactly. That is what we believe Windows does.
> >
> >
> > By this logic KVM is at fault for exposing this irregardless of the
> > platform (when using -cpu host). And Sean (the KVM maintainer) agrees it is
> > a bug. But he does not want it in the kernel due to guest ABI and hence
> > the ask is to put this in QEMU.
>
> If QEMU unconditionally disables this on AMD, and a future AMD CPU
> does implement it, then QEMU is now broken because it won't be fully
> exposing valid features impl by the host CPU and supported by KVM.
>
> IOW, if we're going to have QEMU workaround the KVM mistake, then
> the code change needs to be more refined.
>
> QEMU needs to first check whether the host CPU implements
> ARCH_CAPABILITIES and conditionally disable it in the guest CPU
> based on that host CPU check. Of course that would re-expose the
> Windows guest bug, but that ceases to be KVM/QEMU's problem at
> that point, as we'd be following a genuine physical CPU impl.
+1
In a perfect world, we'd quirk this in KVM. But to avoid a potentially breaking
ABI change, KVM's quirky behavior would need to remain the default behavior, i.e.
wouldn't actually help because QEMU would still need to be updated to opt out of
the quirk.
That, and KVM's quirk system is per-VM, whereas KVM_GET_SUPPORTED_CPUID is a
/dev/kvm ioctl.
next prev parent reply other threads:[~2025-07-07 20:03 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20250630133025.4189544-1-alexandre.chartre@oracle.com>
2025-07-01 10:26 ` [PATCH] i386/cpu: ARCH_CAPABILITIES should not be advertised on AMD Zhao Liu
2025-07-01 11:12 ` Xiaoyao Li
2025-07-01 12:12 ` Alexandre Chartre
2025-07-01 15:13 ` Xiaoyao Li
2025-07-01 19:59 ` Konrad Rzeszutek Wilk
2025-07-07 19:31 ` Daniel P. Berrangé
2025-07-07 20:03 ` Sean Christopherson [this message]
2025-07-01 12:36 ` Zhao Liu
2025-07-01 13:05 ` Igor Mammedov
2025-07-01 20:01 ` Konrad Rzeszutek Wilk
2025-07-02 5:01 ` Zhao Liu
2025-07-02 5:19 ` Zhao Liu
2025-07-02 5:30 ` Xiaoyao Li
2025-07-02 8:34 ` Zhao Liu
2025-07-07 19:20 ` Sean Christopherson
2025-07-02 9:27 ` Alexandre Chartre
2025-07-02 11:23 ` Igor Mammedov
2025-07-07 19:54 ` Sean Christopherson
2025-07-07 19:05 ` Sean Christopherson
2025-07-01 12:19 ` Alexandre Chartre
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=aGwoAo02SWIBx7QR@google.com \
--to=seanjc@google.com \
--cc=alexandre.chartre@oracle.com \
--cc=berrange@redhat.com \
--cc=boris.ostrovsky@oracle.com \
--cc=konrad.wilk@oracle.com \
--cc=kvm@vger.kernel.org \
--cc=maciej.szmigiero@oracle.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=qemu-stable@nongnu.org \
--cc=xiaoyao.li@intel.com \
--cc=zhao1.liu@intel.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