Skip to content

Commit f69759b

Browse files
committed
x86/CPU/AMD: Move Zenbleed check to the Zen2 init function
Prefix it properly so that it is clear which generation it is dealing with. No functional changes. Signed-off-by: Borislav Petkov (AMD) <[email protected]> Link: http://lore.kernel.org/r/[email protected]
1 parent 7c81ad8 commit f69759b

File tree

1 file changed

+3
-13
lines changed

1 file changed

+3
-13
lines changed

arch/x86/kernel/cpu/amd.c

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -70,12 +70,6 @@ static const int amd_erratum_383[] =
7070
static const int amd_erratum_1054[] =
7171
AMD_LEGACY_ERRATUM(AMD_MODEL_RANGE(0x17, 0, 0, 0x2f, 0xf));
7272

73-
static const int amd_zenbleed[] =
74-
AMD_LEGACY_ERRATUM(AMD_MODEL_RANGE(0x17, 0x30, 0x0, 0x4f, 0xf),
75-
AMD_MODEL_RANGE(0x17, 0x60, 0x0, 0x7f, 0xf),
76-
AMD_MODEL_RANGE(0x17, 0x90, 0x0, 0x91, 0xf),
77-
AMD_MODEL_RANGE(0x17, 0xa0, 0x0, 0xaf, 0xf));
78-
7973
static const int amd_div0[] =
8074
AMD_LEGACY_ERRATUM(AMD_MODEL_RANGE(0x17, 0x00, 0x0, 0x2f, 0xf),
8175
AMD_MODEL_RANGE(0x17, 0x50, 0x0, 0x5f, 0xf));
@@ -1059,11 +1053,8 @@ static bool cpu_has_zenbleed_microcode(void)
10591053
return true;
10601054
}
10611055

1062-
static void zenbleed_check(struct cpuinfo_x86 *c)
1056+
static void zen2_zenbleed_check(struct cpuinfo_x86 *c)
10631057
{
1064-
if (!cpu_has_amd_erratum(c, amd_zenbleed))
1065-
return;
1066-
10671058
if (cpu_has(c, X86_FEATURE_HYPERVISOR))
10681059
return;
10691060

@@ -1084,6 +1075,7 @@ static void init_amd_zen2(struct cpuinfo_x86 *c)
10841075
init_amd_zen_common();
10851076
init_spectral_chicken(c);
10861077
fix_erratum_1386(c);
1078+
zen2_zenbleed_check(c);
10871079
}
10881080

10891081
static void init_amd_zen3(struct cpuinfo_x86 *c)
@@ -1227,8 +1219,6 @@ static void init_amd(struct cpuinfo_x86 *c)
12271219
cpu_has(c, X86_FEATURE_AUTOIBRS))
12281220
WARN_ON_ONCE(msr_set_bit(MSR_EFER, _EFER_AUTOIBRS));
12291221

1230-
zenbleed_check(c);
1231-
12321222
if (cpu_has_amd_erratum(c, amd_div0)) {
12331223
pr_notice_once("AMD Zen1 DIV0 bug detected. Disable SMT for full protection.\n");
12341224
setup_force_cpu_bug(X86_BUG_DIV0);
@@ -1393,7 +1383,7 @@ static void zenbleed_check_cpu(void *unused)
13931383
{
13941384
struct cpuinfo_x86 *c = &cpu_data(smp_processor_id());
13951385

1396-
zenbleed_check(c);
1386+
zen2_zenbleed_check(c);
13971387
}
13981388

13991389
void amd_check_microcode(void)

0 commit comments

Comments
 (0)