lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240730174751.15824-1-john.allen@amd.com>
Date: Tue, 30 Jul 2024 17:47:51 +0000
From: John Allen <john.allen@....com>
To: <pbonzini@...hat.com>, <kvm@...r.kernel.org>
CC: <seanjc@...gle.com>, <thomas.lendacky@....com>, <bp@...en8.de>,
	<mlevitsk@...hat.com>, <linux-kernel@...r.kernel.org>, <x86@...nel.org>,
	<yazen.ghannam@....com>, John Allen <john.allen@....com>
Subject: [PATCH] KVM: x86: Advertise SUCCOR and OVERFLOW_RECOV cpuid bits

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@...hat.com>
Signed-off-by: John Allen <john.allen@....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


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ