From: Gregory Price <gourry@gourry.net>
To: x86@kernel.org
Cc: linux-kernel@vger.kernel.org, tglx@linutronix.de,
mingo@redhat.com, bp@alien8.de, dave.hansen@linux.intel.com,
hpa@zytor.com, peterz@infradead.org, mario.limonciello@amd.com,
riel@surriel.com, yazen.ghannam@amd.com, me@mixaill.net,
kai.huang@intel.com, sandipan.das@amd.com, darwi@linutronix.de,
stable@kernel.org
Subject: Re: [PATCH] x86/amd: Disable RDSEED on AMD Zen5 Turin because of an error.
Date: Thu, 16 Oct 2025 15:12:31 -0400 [thread overview]
Message-ID: <aPFDn-4Cm6n0_3_e@gourry-fedora-PF4VCD3F> (raw)
In-Reply-To: <20251016182107.3496116-1-gourry@gourry.net>
On Thu, Oct 16, 2025 at 02:21:07PM -0400, Gregory Price wrote:
> Under unknown architectural conditions, Zen5 chips running rdseed
> can produce (val=0,CF=1) as a "random" result 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 an architectural issue which causes rdseed
> to misclassify a failure as a success under unknown conditions.
>
> 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.
>
> Fix was modeled after a different RDSEED issue in Zen2 Cyan Skillfish.
>
> Link: https://lore.kernel.org/all/20250715130819.461718765@linuxfoundation.org/
> Cc: <stable@kernel.org>
> Signed-off-by: Gregory Price <gourry@gourry.net>
> ---
> arch/x86/kernel/cpu/amd.c | 6 ++++++
> 1 file changed, 6 insertions(+)
>
> diff --git a/arch/x86/kernel/cpu/amd.c b/arch/x86/kernel/cpu/amd.c
> index 5398db4dedb4..9c3b2f010f8c 100644
> --- a/arch/x86/kernel/cpu/amd.c
> +++ b/arch/x86/kernel/cpu/amd.c
> @@ -1037,6 +1037,12 @@ 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. */
> + if (c->x86_model == 0x11 && c->x86_stepping == 0x0) {
After re-examining the results, this was also observed on
c->x86_model == 0x2
Maybe this should just be disabled for all of Zen5?
I will wait for comment.
In a stress test (link) I found that my Zen5 chips have a bizarrely
low rdseed success rate anyway - so it doesn't even seem useful.
./rdseed_stress_single_core
RDRAND: 100.00%, RDSEED: 3.48%
./rdseed_stress_multi_thread
RDRAND: 99.99%, RDSEED: 0.33%
Link: https://lore.kernel.org/all/Zbjw5hRHr_E6k18r@zx2c4.com/
---
diff --git a/arch/x86/kernel/cpu/amd.c b/arch/x86/kernel/cpu/amd.c
index 9c3b2f010f8c..54f07514674a 100644
--- a/arch/x86/kernel/cpu/amd.c
+++ b/arch/x86/kernel/cpu/amd.c
@@ -1038,7 +1038,8 @@ 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. */
- if (c->x86_model == 0x11 && c->x86_stepping == 0x0) {
+ if ((c->x86_model == 0x11 || c->x86_model == 0x2) &&
+ (c->x86_stepping == 0x0)) {
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");
next prev parent reply other threads:[~2025-10-16 19:12 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-16 18:21 [PATCH] x86/amd: Disable RDSEED on AMD Zen5 Turin because of an error Gregory Price
2025-10-16 19:12 ` Gregory Price [this message]
2025-10-16 19:39 ` H. Peter Anvin
2025-10-17 11:48 ` Borislav Petkov
2025-10-17 22:10 ` Jason A. Donenfeld
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=aPFDn-4Cm6n0_3_e@gourry-fedora-PF4VCD3F \
--to=gourry@gourry.net \
--cc=bp@alien8.de \
--cc=darwi@linutronix.de \
--cc=dave.hansen@linux.intel.com \
--cc=hpa@zytor.com \
--cc=kai.huang@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mario.limonciello@amd.com \
--cc=me@mixaill.net \
--cc=mingo@redhat.com \
--cc=peterz@infradead.org \
--cc=riel@surriel.com \
--cc=sandipan.das@amd.com \
--cc=stable@kernel.org \
--cc=tglx@linutronix.de \
--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