public inbox for stable@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] x86/amd: Disable RDSEED on AMD Zen5 because of an error.
@ 2025-10-18  2:40 Gregory Price
  2025-10-18 10:03 ` Borislav Petkov
  0 siblings, 1 reply; 21+ messages in thread
From: Gregory Price @ 2025-10-18  2:40 UTC (permalink / raw)
  To: x86
  Cc: linux-kernel, tglx, mingo, bp, dave.hansen, hpa, peterz,
	mario.limonciello, riel, yazen.ghannam, me, kai.huang,
	sandipan.das, darwi, stable

Under unknown conditions, Zen5 chips running rdseed can produce
(val=0,CF=1) over 10% of the time (when rdseed is successful).
CF=1 indicates success, while val=0 is typically only produced
when rdseed fails (CF=0).

This suggests there is a bug which causes rdseed to silently fail.

This was reproduced reliably by launching 2-threads per available
core, 1-thread per for hamming on RDSEED, and 1-thread per core
collectively eating and hammering on ~90% of memory.

This was observed on more than 1 Zen5 model, so it should be disabled
for all of Zen5 until/unless a comprehensive blacklist can be built.

Cc: stable@vger.kernel.org
Signed-off-by: Gregory Price <gourry@gourry.net>
---
 arch/x86/kernel/cpu/amd.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/arch/x86/kernel/cpu/amd.c b/arch/x86/kernel/cpu/amd.c
index 5398db4dedb4..1af30518d3e7 100644
--- a/arch/x86/kernel/cpu/amd.c
+++ b/arch/x86/kernel/cpu/amd.c
@@ -1037,6 +1037,10 @@ static void init_amd_zen4(struct cpuinfo_x86 *c)
 
 static void init_amd_zen5(struct cpuinfo_x86 *c)
 {
+	/* Disable RDSEED on AMD Turin because of an error. */
+	clear_cpu_cap(c, X86_FEATURE_RDSEED);
+	msr_clear_bit(MSR_AMD64_CPUID_FN_7, 18);
+	pr_emerg("RDSEED is not reliable on this platform; disabling.\n");
 }
 
 static void init_amd(struct cpuinfo_x86 *c)
-- 
2.51.0


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

end of thread, other threads:[~2025-11-08  0:05 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-10-18  2:40 [PATCH v2] x86/amd: Disable RDSEED on AMD Zen5 because of an error Gregory Price
2025-10-18 10:03 ` Borislav Petkov
2025-10-19 14:46   ` Jason A. Donenfeld
2025-10-19 15:00     ` Borislav Petkov
2025-10-19 15:03       ` Jason A. Donenfeld
2025-11-03 10:22         ` Christopher Snowhill
2025-11-03 12:03           ` Borislav Petkov
2025-11-03 23:55             ` Christopher Snowhill
2025-11-04 13:21               ` Borislav Petkov
2025-11-04 14:28                 ` Jason A. Donenfeld
2025-11-04 15:00                   ` Jason A. Donenfeld
2025-11-04 18:08                   ` Thiago Macieira
2025-11-04 21:56                     ` Jason A. Donenfeld
2025-11-04 23:50                       ` Thiago Macieira
2025-11-05  1:58                         ` Jason A. Donenfeld
2025-11-05 16:41                           ` Thiago Macieira
2025-11-07 19:13                             ` Jason A. Donenfeld
2025-11-07 19:55                               ` Thiago Macieira
2025-11-07 23:07                                 ` Jason A. Donenfeld
2025-11-07 23:11                                   ` Thiago Macieira
2025-11-08  0:04                                     ` Jason A. Donenfeld

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox