qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Zhao Liu <zhao1.liu@intel.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: qemu-devel@nongnu.org,
	"Alexandre Chartre" <alexandre.chartre@oracle.com>,
	"Daniel P. Berrangé" <berrange@redhat.com>
Subject: Re: [PATCH] target/i386: do not expose ARCH_CAPABILITIES on AMD CPU
Date: Fri, 18 Jul 2025 17:47:52 +0800	[thread overview]
Message-ID: <aHoYSBDZmSliPQJL@intel.com> (raw)
In-Reply-To: <20250717103448.331037-1-pbonzini@redhat.com>

On Thu, Jul 17, 2025 at 12:34:48PM +0200, Paolo Bonzini wrote:
> Date: Thu, 17 Jul 2025 12:34:48 +0200
> From: Paolo Bonzini <pbonzini@redhat.com>
> Subject: [PATCH] target/i386: do not expose ARCH_CAPABILITIES on AMD CPU
> X-Mailer: git-send-email 2.50.1
> 
> KVM emulates the ARCH_CAPABILITIES on x86 for both Intel and AMD
> cpus, although the IA32_ARCH_CAPABILITIES MSR is an Intel-specific
> MSR and it makes no sense to emulate it on AMD.
> 
> As a consequence, VMs created on AMD with qemu -cpu host and using
> KVM will advertise the ARCH_CAPABILITIES feature and provide the
> IA32_ARCH_CAPABILITIES MSR. This can cause issues (like Windows BSOD)
> as the guest OS might not expect this MSR to exist on such cpus (the
> AMD documentation specifies that ARCH_CAPABILITIES feature and MSR
> are not defined on the AMD architecture).
> 
> A fix was proposed in KVM code, however KVM maintainers don't want to
> change this behavior that exists for 6+ years and suggest changes to be
> done in QEMU instead.  Therefore, hide the bit from "-cpu host":
> migration of -cpu host guests is only possible between identical host
> kernel and QEMU versions, therefore this is not a problematic breakage.
> 
> If a future AMD machine does include the MSR, that would re-expose the
> Windows guest bug; but it would not be KVM/QEMU's problem at that
> point, as we'd be following a genuine physical CPU impl.

Make sense.

> Reported-by: Alexandre Chartre <alexandre.chartre@oracle.com>
> Suggested-by: Daniel P. Berrangé <berrange@redhat.com>
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
>  target/i386/kvm/kvm.c | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)

Good to see this fix. Late but,

Reviewed-by: Zhao Liu <zhao1.liu@intel.com>




      parent reply	other threads:[~2025-07-18  9:26 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-17 10:34 [PATCH] target/i386: do not expose ARCH_CAPABILITIES on AMD CPU Paolo Bonzini
2025-07-17 12:07 ` Xiaoyao Li
2025-07-18  9:47 ` Zhao Liu [this message]

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=aHoYSBDZmSliPQJL@intel.com \
    --to=zhao1.liu@intel.com \
    --cc=alexandre.chartre@oracle.com \
    --cc=berrange@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.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).