Commit cfbf4f99 authored by Borislav Petkov (AMD)'s avatar Borislav Petkov (AMD)

x86/CPU/AMD: Call the spectral chicken in the Zen2 init function

No functional change.
Signed-off-by: default avatarBorislav Petkov (AMD) <bp@alien8.de>
Reviewed-by: default avatarNikolay Borisov <nik.borisov@suse.com>
Link: http://lore.kernel.org/r/20231120104152.13740-6-bp@alien8.de
parent 0da91912
...@@ -1007,10 +1007,8 @@ void init_spectral_chicken(struct cpuinfo_x86 *c) ...@@ -1007,10 +1007,8 @@ void init_spectral_chicken(struct cpuinfo_x86 *c)
* *
* This suppresses speculation from the middle of a basic block, i.e. it * This suppresses speculation from the middle of a basic block, i.e. it
* suppresses non-branch predictions. * suppresses non-branch predictions.
*
* We use STIBP as a heuristic to filter out Zen2 from the rest of F17H
*/ */
if (!cpu_has(c, X86_FEATURE_HYPERVISOR) && cpu_has(c, X86_FEATURE_AMD_STIBP)) { if (!cpu_has(c, X86_FEATURE_HYPERVISOR)) {
if (!rdmsrl_safe(MSR_ZEN2_SPECTRAL_CHICKEN, &value)) { if (!rdmsrl_safe(MSR_ZEN2_SPECTRAL_CHICKEN, &value)) {
value |= MSR_ZEN2_SPECTRAL_CHICKEN_BIT; value |= MSR_ZEN2_SPECTRAL_CHICKEN_BIT;
wrmsrl_safe(MSR_ZEN2_SPECTRAL_CHICKEN, value); wrmsrl_safe(MSR_ZEN2_SPECTRAL_CHICKEN, value);
...@@ -1081,6 +1079,7 @@ static void zenbleed_check(struct cpuinfo_x86 *c) ...@@ -1081,6 +1079,7 @@ static void zenbleed_check(struct cpuinfo_x86 *c)
static void init_amd_zen2(struct cpuinfo_x86 *c) static void init_amd_zen2(struct cpuinfo_x86 *c)
{ {
init_spectral_chicken(c);
fix_erratum_1386(c); fix_erratum_1386(c);
} }
...@@ -1136,7 +1135,7 @@ static void init_amd(struct cpuinfo_x86 *c) ...@@ -1136,7 +1135,7 @@ static void init_amd(struct cpuinfo_x86 *c)
case 0x12: init_amd_ln(c); break; case 0x12: init_amd_ln(c); break;
case 0x15: init_amd_bd(c); break; case 0x15: init_amd_bd(c); break;
case 0x16: init_amd_jg(c); break; case 0x16: init_amd_jg(c); break;
case 0x17: init_spectral_chicken(c); case 0x17:
fallthrough; fallthrough;
case 0x19: init_amd_zn(c); break; case 0x19: init_amd_zn(c); break;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment