kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] kvm/x86: ARCH_CAPABILITIES should not be advertised on AMD
@ 2025-06-26 12:57 Alexandre Chartre
  2025-06-26 14:02 ` Sean Christopherson
  0 siblings, 1 reply; 10+ messages in thread
From: Alexandre Chartre @ 2025-06-26 12:57 UTC (permalink / raw)
  To: linux-kernel, kvm, pbonzini
  Cc: seanjc, xiaoyao.li, x86, konrad.wilk, boris.ostrovsky,
	alexandre.chartre

KVM emulates the ARCH_CAPABILITIES on x86 for both vmx and svm.
However the IA32_ARCH_CAPABILITIES MSR is an Intel-specific MSR
so it makes no sense to emulate it on AMD.

The AMD documentation specifies that this MSR is not defined on
the AMD architecture. So emulating this MSR on AMD can even cause
issues (like Windows BSOD) as the guest OS might not expect this
MSR to exist on such architecture.

Signed-off-by: Alexandre Chartre <alexandre.chartre@oracle.com>
---

A similar patch was submitted some years ago but it looks like it felt
through the cracks:
https://lore.kernel.org/kvm/20190307093143.77182-1-xiaoyao.li@linux.intel.com/

I am resurecting this change because some recent Windows updates (like OS Build
26100.4351) crashes on AMD KVM guests (BSOD with Stop code: UNSUPPORTED PROCESSOR)
just because the ARCH_CAPABILITIES is available.

---
 arch/x86/kvm/svm/svm.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/arch/x86/kvm/svm/svm.c b/arch/x86/kvm/svm/svm.c
index ab9b947dbf4f..600d2029156e 100644
--- a/arch/x86/kvm/svm/svm.c
+++ b/arch/x86/kvm/svm/svm.c
@@ -5469,6 +5469,9 @@ static __init void svm_set_cpu_caps(void)
 
 	/* Don't advertise Bus Lock Detect to guest if SVM support is absent */
 	kvm_cpu_cap_clear(X86_FEATURE_BUS_LOCK_DETECT);
+
+	/* Don't advertise ARCH_CAPABILITIES on AMD */
+	kvm_cpu_cap_clear(X86_FEATURE_ARCH_CAPABILITIES);
 }
 
 static __init int svm_hardware_setup(void)
-- 
2.43.5


^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2025-07-07 20:26 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-06-26 12:57 [PATCH] kvm/x86: ARCH_CAPABILITIES should not be advertised on AMD Alexandre Chartre
2025-06-26 14:02 ` Sean Christopherson
2025-06-26 15:31   ` Konrad Rzeszutek Wilk
2025-06-26 15:44     ` Sean Christopherson
2025-06-26 16:08   ` Jim Mattson
2025-06-26 19:22   ` Alexandre Chartre
2025-06-27  5:41   ` Xiaoyao Li
2025-06-27  6:23     ` Alexandre Chartre
2025-06-27 20:57       ` Konrad Rzeszutek Wilk
2025-07-07 20:25         ` Sean Christopherson

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).