Skip to content

Commit bd8323e

Browse files
superm1opsiff
authored andcommitted
x86/CPU/AMD: Clear virtualized VMLOAD/VMSAVE on Zen4 client
mainline inclusion from mainline-v6.12 commit a5ca1dc category: bugfix bugzilla: https://gitee.com/src-openeuler/kernel/issues/IB8IUH CVE: CVE-2024-53114 A number of Zen4 client SoCs advertise the ability to use virtualized VMLOAD/VMSAVE, but using these instructions is reported to be a cause of a random host reboot. These instructions aren't intended to be advertised on Zen4 client so clear the capability. Signed-off-by: Mario Limonciello <mario.limonciello@amd.com> Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de> Cc: stable@vger.kernel.org Link: https://bugzilla.kernel.org/show_bug.cgi?id=219009 (cherry picked from commit a5ca1dc) Signed-off-by: Wentao Guan <guanwentao@uniontech.com>
1 parent 1ad258a commit bd8323e

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

arch/x86/kernel/cpu/amd.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1059,6 +1059,17 @@ static void init_amd_zen4(struct cpuinfo_x86 *c)
10591059
{
10601060
if (!cpu_has(c, X86_FEATURE_HYPERVISOR))
10611061
msr_set_bit(MSR_ZEN4_BP_CFG, MSR_ZEN4_BP_CFG_SHARED_BTB_FIX_BIT);
1062+
1063+
/*
1064+
* These Zen4 SoCs advertise support for virtualized VMLOAD/VMSAVE
1065+
* in some BIOS versions but they can lead to random host reboots.
1066+
*/
1067+
switch (c->x86_model) {
1068+
case 0x18 ... 0x1f:
1069+
case 0x60 ... 0x7f:
1070+
clear_cpu_cap(c, X86_FEATURE_V_VMSAVE_VMLOAD);
1071+
break;
1072+
}
10621073
}
10631074

10641075
static void init_amd_zen5(struct cpuinfo_x86 *c)

0 commit comments

Comments
 (0)