x86/rdrand: disable RDSEED on AMD Cyan Skillfish
PATCH v2 1/1 x86/rdrand: disable RDSEED on AMD Cyan Skillfish
AMD Cyan Skillfish (Family 17h, Model 47h, Stepping 0h) has an error that causes RDSEED to always return 0xffffffff, while RDRAND works correctly.
This patch masks the RDSEED cap for this CPU so that both /proc/cpuinfo and direct CPUID read report RDSEED as unavailable.
v2:
* Limit changes to AMD Cyan Skillfish
* Replace the runtime RDSEED sanity check with a simple family/model/stepping match
--- arch/x86/include/asm/msr-index.h | 1 + arch/x86/kernel/cpu/rdrand.c | 9 +++++++++ tools/arch/x86/include/asm/msr-index.h | 1 + 3 files changed, 11 insertions(+)
arch/x86/include/asm/msr-index.h +1 -0
@@ -624,6 +624,7 @@#define MSR_AMD64_OSVW_STATUS 0xc0010141#define MSR_AMD_PPIN_CTL 0xc00102f0#define MSR_AMD_PPIN 0xc00102f1 +#define MSR_AMD64_CPUID_FN_7 0xc0011002#define MSR_AMD64_CPUID_FN_1 0xc0011004#define MSR_AMD64_LS_CFG 0xc0011020#define MSR_AMD64_DC_CFG 0xc0011022
arch/x86/kernel/cpu/rdrand.c +9 -0
@@ -11,6 +11,7 @@#include <asm/processor.h> #include <asm/archrandom.h> #include <asm/sections.h> +#include <asm/msr.h> /* * RDRAND has Built-In-Self-Test (BIST) that runs on every invocation.
@@ -47,4 +48,12 @@ void x86_init_rdrand(struct cpuinfo_x86 *c)clear_cpu_cap (c,X86_FEATURE_RDSEED );pr_emerg ("RDRAND is not reliable on this platform; disabling.\n" ); } + +/* disable RDSEED on AMD Cyan Skillfish because of hw bug */ +if (c->x86_vendor ==X86_VENDOR_AMD && c->x86 ==0x17 && + c->x86_model ==0x47 && 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" ); + } }
tools/arch/x86/include/asm/msr-index.h +1 -0
@@ -616,6 +616,7 @@#define MSR_AMD64_OSVW_STATUS 0xc0010141#define MSR_AMD_PPIN_CTL 0xc00102f0#define MSR_AMD_PPIN 0xc00102f1 +#define MSR_AMD64_CPUID_FN_7 0xc0011002#define MSR_AMD64_CPUID_FN_1 0xc0011004#define MSR_AMD64_LS_CFG 0xc0011020#define MSR_AMD64_DC_CFG 0xc0011022
Signature · 1 line
2.49.0
Borislav Petkov
maintainerQuoted 5 lines · Mikhail Paulyshka
AMD Cyan Skillfish (Family 17h, Model 47h, Stepping 0h) has an error that causes RDSEED to always return
0xffffffff, while RDRAND works correctly.This patch masks the RDSEED cap for this CPU so that both
s/This patch masks/Mask/
Quoted 7 lines
/proc/cpuinfoand direct CPUID read report RDSEED as unavailable.v2:
* Limit changes to AMD Cyan Skillfish
* Replace the runtime RDSEED sanity check with a simple family/model/stepping match
Changelog stuff goes...
Quoted 3 lines
Signed-off-by Mikhail Paulyshka <[email protected]>---
<--- ... here, under the "---" so that patch handling scripts can ignore it.
Quoted 30 lines
arch/x86/include/asm/msr-index.h | 1 + arch/x86/kernel/cpu/rdrand.c | 9 +++++++++ tools/arch/x86/include/asm/msr-index.h | 1 + 3 files changed, 11 insertions(+)arch/x86/include/asm/msr-index.h +1
-0@@ -624,6 +624,7 @@#define MSR_AMD64_OSVW_STATUS 0xc0010141#define MSR_AMD_PPIN_CTL 0xc00102f0#define MSR_AMD_PPIN 0xc00102f1 +#define MSR_AMD64_CPUID_FN_7 0xc0011002#define MSR_AMD64_CPUID_FN_1 0xc0011004#define MSR_AMD64_LS_CFG 0xc0011020#define MSR_AMD64_DC_CFG 0xc0011022arch/x86/kernel/cpu/rdrand.c +1
-0@@ -11,6 +11,7 @@#include <asm/processor.h> #include <asm/archrandom.h> #include <asm/sections.h> +#include <asm/msr.h> /* * RDRAND has Built-In-Self-Test (BIST) that runs on every invocation.
arch/x86/kernel/cpu/rdrand.c void x86_init_rdrand(struct cpuinfo_x86 *c) · line 52
Quoted 5 lines
arch/x86/kernel/cpu/rdrand.c +2
-0@@ -47,4 +48,12 @@ void x86_init_rdrand(struct cpuinfo_x86 *c)clear_cpu_cap (c,X86_FEATURE_RDSEED );pr_emerg ("RDRAND is not reliable on this platform; disabling.\n" ); } + +/* disable RDSEED on AMD Cyan Skillfish because of hw bug */
Not a hw bug - "... has an error" above was closer :-)
Quoted 13 lines
arch/x86/kernel/cpu/rdrand.c +6
-0+if (c->x86_vendor ==X86_VENDOR_AMD && c->x86 ==0x17 && + c->x86_model ==0x47 && 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" ); + } }tools/arch/x86/include/asm/msr-index.h +0
-0
tools/arch/x86/include/asm/msr-index.h line 622
Quoted 7 lines
tools/arch/x86/include/asm/msr-index.h +1
-0@@ -616,6 +616,7 @@#define MSR_AMD64_OSVW_STATUS 0xc0010141#define MSR_AMD_PPIN_CTL 0xc00102f0#define MSR_AMD_PPIN 0xc00102f1 +#define MSR_AMD64_CPUID_FN_7 0xc0011002#define MSR_AMD64_CPUID_FN_1 0xc0011004#define MSR_AMD64_LS_CFG 0xc0011020#define MSR_AMD64_DC_CFG 0xc0011022
In any case, those are just minor nits which can be dealt with when applying.
Otherwise, patch looks good, thanks.
We have merge window upcoming next week so I'll take it after that but it is on my list of patches to take after the MW.
Signature · 4 lines
Regards/Gruss,
Boris.
https://people.kernel.org/tglx/notes-about-netiquetteBorislav Petkov
maintainerQuoted 13 lines · Mikhail Paulyshka
AMD Cyan Skillfish (Family 17h, Model 47h, Stepping 0h) has an error that causes RDSEED to always return
0xffffffff, while RDRAND works correctly.This patch masks the RDSEED cap for this CPU so that both
/proc/cpuinfoand direct CPUID read report RDSEED as unavailable.v2:
* Limit changes to AMD Cyan Skillfish
* Replace the runtime RDSEED sanity check with a simple family/model/stepping match
Quoted 6 lines
Signed-off-by Mikhail Paulyshka <[email protected]>--- arch/x86/include/asm/msr-index.h | 1 + arch/x86/kernel/cpu/rdrand.c | 9 +++++++++ tools/arch/x86/include/asm/msr-index.h | 1 + 3 files changed, 11 insertions(+)
Does this one work too?
---
From: Mikhail Paulyshka <[email protected]>
Date: Sat, 24 May 2025 17:53:19 +0300
Subject: [PATCH] x86/rdrand: Disable RDSEED on AMD Cyan Skillfish
AMD Cyan Skillfish (Family 17h, Model 47h, Stepping 0h) has an error that causes RDSEED to always return 0xffffffff, while RDRAND works correctly.
Mask the RDSEED cap for this CPU so that both /proc/cpuinfo and direct CPUID read report RDSEED as unavailable.
[ bp: Move to amd.c, massage. ]
--- arch/x86/include/asm/msr-index.h | 1 + arch/x86/kernel/cpu/amd.c | 7 +++++++ tools/arch/x86/include/asm/msr-index.h | 1 + 3 files changed, 9 insertions(+)
arch/x86/include/asm/msr-index.h +1 -0
@@ -628,6 +628,7 @@#define MSR_AMD64_OSVW_STATUS 0xc0010141#define MSR_AMD_PPIN_CTL 0xc00102f0#define MSR_AMD_PPIN 0xc00102f1 +#define MSR_AMD64_CPUID_FN_7 0xc0011002#define MSR_AMD64_CPUID_FN_1 0xc0011004#define MSR_AMD64_LS_CFG 0xc0011020#define MSR_AMD64_DC_CFG 0xc0011022
arch/x86/kernel/cpu/amd.c +7 -0
@@ -930,6 +930,13 @@ static void init_amd_zen2(struct cpuinfo_x86 *c)init_spectral_chicken (c);fix_erratum_1386 (c);zen2_zenbleed_check (c); + +/* Disable RDSEED on AMD Cyan Skillfish because of an error. */ +if (c->x86_model ==0x47 && 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" ); + } }static void init_amd_zen3 (struct cpuinfo_x86 *c)
tools/arch/x86/include/asm/msr-index.h +1 -0
@@ -624,6 +624,7 @@#define MSR_AMD64_OSVW_STATUS 0xc0010141#define MSR_AMD_PPIN_CTL 0xc00102f0#define MSR_AMD_PPIN 0xc00102f1 +#define MSR_AMD64_CPUID_FN_7 0xc0011002#define MSR_AMD64_CPUID_FN_1 0xc0011004#define MSR_AMD64_LS_CFG 0xc0011020#define MSR_AMD64_DC_CFG 0xc0011022
Signature · 7 lines
2.43.0
--
Regards/Gruss,
Boris.
https://people.kernel.org/tglx/notes-about-netiquettearch/x86/kernel/cpu/amd.c static void init_amd_zen2(struct cpuinfo_x86 *c) · line 939
Quoted 6 lines · Borislav Petkov
arch/x86/kernel/cpu/amd.c +6
-0+/* Disable RDSEED on AMD Cyan Skillfish because of an error. */ +if (c->x86_model ==0x47 && 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" ); + }
Heh, maybe if x86_init_rdrand() did RDSEED too, this wouldn't have slipped through QA.
Quoted 2 lines · Dave Hansen
Heh, maybe if
x86_init_rdrand()did RDSEED too, this wouldn't have slipped through QA.
This might be interesting to you: in V1 of this patch set, there was an RDSEED sanity check, and Intel's CI detected broken RDSEED on Comet Lake:
Borislav Petkov
maintainerQuoted 8 lines · Mikhail Paulyshka
Quoted 2 lines · Dave Hansen
Heh, maybe if
x86_init_rdrand()did RDSEED too, this wouldn't have slipped through QA.This might be interesting to you: in V1 of this patch set, there was an RDSEED sanity check, and Intel's CI detected broken RDSEED on Comet Lake:
Right, I'm being told this is preproduction hw:
[ 2.823625][ T1] smpboot: CPU0: Genuine Intel(R) CPU 0000 @ 3.30GHz (family: 0x6, model: 0xa5, stepping: 0x1)
and strictly speaking, RDSEED *can* fail due to resources exhaustion etc
- doesn't necessarily mean it is broken.
Thx.
Signature · 4 lines
Regards/Gruss,
Boris.
https://people.kernel.org/tglx/notes-about-netiquetteQuoted 8 lines · Mikhail Paulyshka
Quoted 2 lines · Dave Hansen
Heh, maybe if
x86_init_rdrand()did RDSEED too, this wouldn't have slipped through QA.This might be interesting to you: in V1 of this patch set, there was an RDSEED sanity check, and Intel's CI detected broken RDSEED on Comet Lake:
Just to be clear, I'd call that *A* Comet Lake system. Saying it's "broken on Comet Lake" kinda implies that they're all broken.
I'd definitely want to rule out a single wonky system first, like it being on some old weird microcode.
Quoted 1 line · Borislav Petkov
Does this one work too?
It works, however, there is another issue with the BC250 that appeared since Linux 6.15.
Commit 4afeb0ed1753ebcad93ee3b45427ce85e9c8ec40 ( x86/mm: Enable broadcast TLB invalidation for multi-threaded processes)[1], merged in Linux 6.15-rc1, breaks the device — it starts to oops and panic under any load [2].
[1] https://docs.google.com/spreadsheets/d/1kJleOY5k-YREGak1pQhVWIGckA9YA3OWJyCbybZbk00/edit?gid=0#gid=0
[2] https://mixaill.net/linux-kernel-lists/bc250_log_invlpgb-1.txt
Clearing the X86_FEATURE_INVLPGB cap helps and the device works normally again.
It would be great to have this change backported to 6.15 and 6.16 as the device is currently unstable with these kernels.
---
From 064c91c5f3fc02a6eecd6b0b7cf074e2d0eb75aa Mon Sep 17 00:00:00 2001
From: Mikhail Paulyshka <[email protected]>
Date: Sun, 6 Jul 2025 01:46:46 +0300
Subject: [PATCH 2/2] x86/cpu/amd: disable INVLPGB on AMD Cyan Skillfish
AMD Cyan Skillfish (Family 17h, Model 47h, Stepping 0h) has an issue that causes system oopses and panics when performing TLB flush using INVLPGB.
Clearing the X86_FEATURE_INVLPGB flag restoring system stability.
---
arch/x86/kernel/cpu/amd.c | 6 ++++++
1 file changed, 6 insertions(+)
arch/x86/kernel/cpu/amd.c +0 -0
@@ -935,6 +935,12 @@ static void init_amd_zen2(struct cpuinfo_x86 *c)
msr_clear_bit(MSR_AMD64_CPUID_FN_7, 18); pr_emerg("RDSEED is not reliable on this platform; disabling.\n"); }
+
+ /* Disable INVLPGB on AMD Cyan Skillfish because of an error */ + if (c->x86_model == 0x47 && c->x86_stepping == 0x0) {
+ clear_cpu_cap(c, X86_FEATURE_INVLPGB);
+ pr_emerg("INVLPGB is not reliable on this platform; disabling.\n"); + }
}
static void init_amd_zen3(struct cpuinfo_x86 *c)
Signature · 1 line
2.50.0
Borislav Petkov
maintainerQuoted 9 lines · Mikhail Paulyshka
Quoted 1 line · Borislav Petkov
Does this one work too?
It works, however, there is another issue with the BC250 that appeared since Linux 6.15.
Commit
4afeb0ed1753ebcad93ee3b45427ce85e9c8ec40( x86/mm: Enable broadcast TLB invalidation for multi-threaded processes)[1], merged in Linux 6.15-rc1, breaks the device — it starts to oops and panic under any load [2].
Looks like it GPs because CR4.PCID == 0.
Looks weird, we need to check PCID support somewhere, it seems.
Ok, let's get a common code base - 6.15. Pls boot it, send me full dmesg again, your .config and the output of
cpuid -1r
Thx.
Signature · 4 lines
Regards/Gruss,
Boris.
https://people.kernel.org/tglx/notes-about-netiquetteQuoted 5 lines · Borislav Petkov
Looks like it GPs because CR4.PCID == 0.
Looks weird, we need to check PCID support somewhere, it seems.
Ok, let's get a common code base - 6.15. Pls boot it, send me full dmesg again
dmesg with vanilla 6.15.0:
https://mixaill.net/linux-kernel-lists/bc250_log_invlpgb-2-dmesg.txt
Quoted 1 line
your .config
Quoted 1 line
and the output of cpuid -1r
https://mixaill.net/linux-kernel-lists/bc250_log_invlpgb-2-cpuid.txt
[tip: x86/urgent] x86/CPU/AMD: Disable INVLPGB on Zen2
In reply to Mikhail PaulyshkaThe following commit has been merged into the x86/urgent branch of tip:
The following commit has been merged into the x86/urgent branch of tip:
Commit-ID: 5a97aa3a4f1f19656aea5c76c1da66ce9dc5ddaf Gitweb: https://git.kernel.org/tip/5a97aa3a4f1f19656aea5c76c1da66ce9dc5ddaf Author: Mikhail Paulyshka <[email protected]> AuthorDate: Tue, 08 Jul 2025 16:39:10 +02:00 Committer: Borislav Petkov (AMD) <[email protected]> CommitterDate: Tue, 08 Jul 2025 16:41:59 +02:00
x86/CPU/AMD: Disable INVLPGB on Zen2
AMD Cyan Skillfish (Family 17h, Model 47h, Stepping 0h) has an issue that causes system oopses and panics when performing TLB flush using INVLPGB.
However, the problem is that that machine has misconfigured CPUID and should not report the INVLPGB bit in the first place. So zap the kernel's representation of the flag so that nothing gets confused.
[ bp: Massage. ]
--- arch/x86/kernel/cpu/amd.c | 3 +++ 1 file changed, 3 insertions(+)
arch/x86/kernel/cpu/amd.c +3 -0
@@ -937,6 +937,9 @@ static void init_amd_zen2(struct cpuinfo_x86 *c)msr_clear_bit (MSR_AMD64_CPUID_FN_7 ,18 );pr_emerg ("RDSEED is not reliable on this platform; disabling.\n" ); } + +/* Correct misconfigured CPUID on some clients. */ +clear_cpu_cap (c,X86_FEATURE_INVLPGB ); }static void init_amd_zen3 (struct cpuinfo_x86 *c)
[tip: x86/urgent] x86/CPU/AMD: Disable INVLPGB on Zen2
In reply to Mikhail PaulyshkaThe following commit has been merged into the x86/urgent branch of tip:
The following commit has been merged into the x86/urgent branch of tip:
Commit-ID: a74bb5f202dabddfea96abc1328fcedae8aa140a Gitweb: https://git.kernel.org/tip/a74bb5f202dabddfea96abc1328fcedae8aa140a Author: Mikhail Paulyshka <[email protected]> AuthorDate: Tue, 08 Jul 2025 16:39:10 +02:00 Committer: Borislav Petkov (AMD) <[email protected]> CommitterDate: Tue, 08 Jul 2025 21:34:01 +02:00
x86/CPU/AMD: Disable INVLPGB on Zen2
AMD Cyan Skillfish (Family 17h, Model 47h, Stepping 0h) has an issue that causes system oopses and panics when performing TLB flush using INVLPGB.
However, the problem is that that machine has misconfigured CPUID and should not report the INVLPGB bit in the first place. So zap the kernel's representation of the flag so that nothing gets confused.
[ bp: Massage. ]
--- arch/x86/kernel/cpu/amd.c | 3 +++ 1 file changed, 3 insertions(+)
arch/x86/kernel/cpu/amd.c +3 -0
@@ -937,6 +937,9 @@ static void init_amd_zen2(struct cpuinfo_x86 *c)msr_clear_bit (MSR_AMD64_CPUID_FN_7 ,18 );pr_emerg ("RDSEED is not reliable on this platform; disabling.\n" ); } + +/* Correct misconfigured CPUID on some clients. */ +clear_cpu_cap (c,X86_FEATURE_INVLPGB ); }static void init_amd_zen3 (struct cpuinfo_x86 *c)
[tip: x86/urgent] x86/rdrand: Disable RDSEED on AMD Cyan Skillfish
In reply to Mikhail PaulyshkaThe following commit has been merged into the x86/urgent branch of tip:
The following commit has been merged into the x86/urgent branch of tip:
Commit-ID: dc562662cb2b0bcc7af4ca3cd53e6140ff52a418 Gitweb: https://git.kernel.org/tip/dc562662cb2b0bcc7af4ca3cd53e6140ff52a418 Author: Mikhail Paulyshka <[email protected]> AuthorDate: Sat, 24 May 2025 17:53:19 +03:00 Committer: Borislav Petkov (AMD) <[email protected]> CommitterDate: Tue, 08 Jul 2025 16:26:42 +02:00
x86/rdrand: Disable RDSEED on AMD Cyan Skillfish
AMD Cyan Skillfish (Family 17h, Model 47h, Stepping 0h) has an error that causes RDSEED to always return 0xffffffff, while RDRAND works correctly.
Mask the RDSEED cap for this CPU so that both /proc/cpuinfo and direct CPUID read report RDSEED as unavailable.
[ bp: Move to amd.c, massage. ]
--- arch/x86/include/asm/msr-index.h | 1 + arch/x86/kernel/cpu/amd.c | 7 +++++++ tools/arch/x86/include/asm/msr-index.h | 1 + 3 files changed, 9 insertions(+)
arch/x86/include/asm/msr-index.h +1 -0
@@ -628,6 +628,7 @@#define MSR_AMD64_OSVW_STATUS 0xc0010141#define MSR_AMD_PPIN_CTL 0xc00102f0#define MSR_AMD_PPIN 0xc00102f1 +#define MSR_AMD64_CPUID_FN_7 0xc0011002#define MSR_AMD64_CPUID_FN_1 0xc0011004#define MSR_AMD64_LS_CFG 0xc0011020#define MSR_AMD64_DC_CFG 0xc0011022
arch/x86/kernel/cpu/amd.c +7 -0
@@ -930,6 +930,13 @@ static void init_amd_zen2(struct cpuinfo_x86 *c)init_spectral_chicken (c);fix_erratum_1386 (c);zen2_zenbleed_check (c); + +/* Disable RDSEED on AMD Cyan Skillfish because of an error. */ +if (c->x86_model ==0x47 && 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" ); + } }static void init_amd_zen3 (struct cpuinfo_x86 *c)
tools/arch/x86/include/asm/msr-index.h +1 -0
@@ -628,6 +628,7 @@#define MSR_AMD64_OSVW_STATUS 0xc0010141#define MSR_AMD_PPIN_CTL 0xc00102f0#define MSR_AMD_PPIN 0xc00102f1 +#define MSR_AMD64_CPUID_FN_7 0xc0011002#define MSR_AMD64_CPUID_FN_1 0xc0011004#define MSR_AMD64_LS_CFG 0xc0011020#define MSR_AMD64_DC_CFG 0xc0011022
[tip: x86/urgent] x86/rdrand: Disable RDSEED on AMD Cyan Skillfish
In reply to Mikhail PaulyshkaThe following commit has been merged into the x86/urgent branch of tip:
The following commit has been merged into the x86/urgent branch of tip:
Commit-ID: 5b937a1ed64ebeba8876e398110a5790ad77407c Gitweb: https://git.kernel.org/tip/5b937a1ed64ebeba8876e398110a5790ad77407c Author: Mikhail Paulyshka <[email protected]> AuthorDate: Sat, 24 May 2025 17:53:19 +03:00 Committer: Borislav Petkov (AMD) <[email protected]> CommitterDate: Tue, 08 Jul 2025 21:33:26 +02:00
x86/rdrand: Disable RDSEED on AMD Cyan Skillfish
AMD Cyan Skillfish (Family 17h, Model 47h, Stepping 0h) has an error that causes RDSEED to always return 0xffffffff, while RDRAND works correctly.
Mask the RDSEED cap for this CPU so that both /proc/cpuinfo and direct CPUID read report RDSEED as unavailable.
[ bp: Move to amd.c, massage. ]
--- arch/x86/include/asm/msr-index.h | 1 + arch/x86/kernel/cpu/amd.c | 7 +++++++ tools/arch/x86/include/asm/msr-index.h | 1 + 3 files changed, 9 insertions(+)
arch/x86/include/asm/msr-index.h +1 -0
@@ -628,6 +628,7 @@#define MSR_AMD64_OSVW_STATUS 0xc0010141#define MSR_AMD_PPIN_CTL 0xc00102f0#define MSR_AMD_PPIN 0xc00102f1 +#define MSR_AMD64_CPUID_FN_7 0xc0011002#define MSR_AMD64_CPUID_FN_1 0xc0011004#define MSR_AMD64_LS_CFG 0xc0011020#define MSR_AMD64_DC_CFG 0xc0011022
arch/x86/kernel/cpu/amd.c +7 -0
@@ -930,6 +930,13 @@ static void init_amd_zen2(struct cpuinfo_x86 *c)init_spectral_chicken (c);fix_erratum_1386 (c);zen2_zenbleed_check (c); + +/* Disable RDSEED on AMD Cyan Skillfish because of an error. */ +if (c->x86_model ==0x47 && 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" ); + } }static void init_amd_zen3 (struct cpuinfo_x86 *c)
tools/arch/x86/include/asm/msr-index.h +1 -0
@@ -628,6 +628,7 @@#define MSR_AMD64_OSVW_STATUS 0xc0010141#define MSR_AMD_PPIN_CTL 0xc00102f0#define MSR_AMD_PPIN 0xc00102f1 +#define MSR_AMD64_CPUID_FN_7 0xc0011002#define MSR_AMD64_CPUID_FN_1 0xc0011004#define MSR_AMD64_LS_CFG 0xc0011020#define MSR_AMD64_DC_CFG 0xc0011022