Skip to content

Commit

Permalink
x86/CPU/AMD: Clear virtualized VMLOAD/VMSAVE on Zen4 client
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Mario Limonciello authored and Borislav Petkov (AMD) committed Nov 5, 2024
1 parent 59b723c commit a5ca1dc
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions arch/x86/kernel/cpu/amd.c
Original file line number Diff line number Diff line change
Expand Up @@ -924,6 +924,17 @@ static void init_amd_zen4(struct cpuinfo_x86 *c)
{
if (!cpu_has(c, X86_FEATURE_HYPERVISOR))
msr_set_bit(MSR_ZEN4_BP_CFG, MSR_ZEN4_BP_CFG_SHARED_BTB_FIX_BIT);

/*
* These Zen4 SoCs advertise support for virtualized VMLOAD/VMSAVE
* in some BIOS versions but they can lead to random host reboots.
*/
switch (c->x86_model) {
case 0x18 ... 0x1f:
case 0x60 ... 0x7f:
clear_cpu_cap(c, X86_FEATURE_V_VMSAVE_VMLOAD);
break;
}
}

static void init_amd_zen5(struct cpuinfo_x86 *c)
Expand Down

0 comments on commit a5ca1dc

Please sign in to comment.