From: John Allen <john.allen@amd.com>
To: <pbonzini@redhat.com>, <kvm@vger.kernel.org>
Cc: <seanjc@google.com>, <thomas.lendacky@amd.com>, <bp@alien8.de>,
<mlevitsk@redhat.com>, <linux-kernel@vger.kernel.org>,
<x86@kernel.org>, <yazen.ghannam@amd.com>,
John Allen <john.allen@amd.com>
Subject: [PATCH] KVM: x86: Advertise SUCCOR and OVERFLOW_RECOV cpuid bits
Date: Tue, 30 Jul 2024 17:47:51 +0000 [thread overview]
Message-ID: <20240730174751.15824-1-john.allen@amd.com> (raw)
Handling deferred, uncorrected MCEs on AMD guests is now possible with
additional support in qemu. Ensure that the SUCCOR and OVERFLOW_RECOV
bits are advertised to the guest in KVM.
Suggested-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: John Allen <john.allen@amd.com>
---
arch/x86/kvm/cpuid.c | 2 +-
arch/x86/kvm/svm/svm.c | 7 +++++++
2 files changed, 8 insertions(+), 1 deletion(-)
diff --git a/arch/x86/kvm/cpuid.c b/arch/x86/kvm/cpuid.c
index 2617be544480..4745098416c3 100644
--- a/arch/x86/kvm/cpuid.c
+++ b/arch/x86/kvm/cpuid.c
@@ -1241,7 +1241,7 @@ static inline int __do_cpuid_func(struct kvm_cpuid_array *array, u32 function)
/* mask against host */
entry->edx &= boot_cpu_data.x86_power;
- entry->eax = entry->ebx = entry->ecx = 0;
+ entry->eax = entry->ecx = 0;
break;
case 0x80000008: {
/*
diff --git a/arch/x86/kvm/svm/svm.c b/arch/x86/kvm/svm/svm.c
index c115d26844f7..a6820b0915db 100644
--- a/arch/x86/kvm/svm/svm.c
+++ b/arch/x86/kvm/svm/svm.c
@@ -5199,6 +5199,13 @@ static __init void svm_set_cpu_caps(void)
kvm_cpu_cap_set(X86_FEATURE_SVME_ADDR_CHK);
}
+ /* CPUID 0x80000007 */
+ if (boot_cpu_has(X86_FEATURE_SUCCOR))
+ kvm_cpu_cap_set(X86_FEATURE_SUCCOR);
+
+ if (boot_cpu_has(X86_FEATURE_OVERFLOW_RECOV))
+ kvm_cpu_cap_set(X86_FEATURE_OVERFLOW_RECOV);
+
/* CPUID 0x80000008 */
if (boot_cpu_has(X86_FEATURE_LS_CFG_SSBD) ||
boot_cpu_has(X86_FEATURE_AMD_SSBD))
--
2.34.1
next reply other threads:[~2024-07-30 17:48 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-30 17:47 John Allen [this message]
2024-07-30 18:00 ` [PATCH] KVM: x86: Advertise SUCCOR and OVERFLOW_RECOV cpuid bits Sean Christopherson
2024-07-30 19:04 ` John Allen
2024-07-30 20:24 ` Sean Christopherson
2024-07-30 20:28 ` John Allen
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=20240730174751.15824-1-john.allen@amd.com \
--to=john.allen@amd.com \
--cc=bp@alien8.de \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mlevitsk@redhat.com \
--cc=pbonzini@redhat.com \
--cc=seanjc@google.com \
--cc=thomas.lendacky@amd.com \
--cc=x86@kernel.org \
--cc=yazen.ghannam@amd.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