Commit 7f79c739 authored by John Allen's avatar John Allen Committed by Wen Zhiwei
Browse files

x86/CPU/AMD: Only apply Zenbleed fix for Zen2 during late microcode load

stable inclusion
from stable-v6.6.58
commit c8170b5ddc411201f8de0a654901f204a2cdd415
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/IB3BSC

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=c8170b5ddc411201f8de0a654901f204a2cdd415



--------------------------------

commit ee4d4e8d2c3bec6ee652599ab31991055a72c322 upstream.

Commit

  f69759be251d ("x86/CPU/AMD: Move Zenbleed check to the Zen2 init function")

causes a bit in the DE_CFG MSR to get set erroneously after a microcode late
load.

The microcode late load path calls into amd_check_microcode() and subsequently
zen2_zenbleed_check(). Since the above commit removes the cpu_has_amd_erratum()
call from zen2_zenbleed_check(), this will cause all non-Zen2 CPUs to go
through the function and set the bit in the DE_CFG MSR.

Call into the Zenbleed fix path on Zen2 CPUs only.

  [ bp: Massage commit message, use cpu_feature_enabled(). ]

Fixes: f69759be251d ("x86/CPU/AMD: Move Zenbleed check to the Zen2 init function")
Signed-off-by: default avatarJohn Allen <john.allen@amd.com>
Signed-off-by: default avatarBorislav Petkov (AMD) <bp@alien8.de>
Acked-by: default avatarBorislav Petkov (AMD) <bp@alien8.de>
Cc: <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20240923164404.27227-1-john.allen@amd.com


Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarWen Zhiwei <wenzhiwei@kylinos.cn>
parent 0a83f9af
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -1337,6 +1337,7 @@ void amd_check_microcode(void)
	if (boot_cpu_data.x86_vendor != X86_VENDOR_AMD)
		return;

	if (cpu_feature_enabled(X86_FEATURE_ZEN2))
		on_each_cpu(zenbleed_check_cpu, NULL, 1);
}