x86/amd: Mitigate AMD-SN-7052

This is XSA-490 / CVE-2025-54518.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
(cherry picked from commit 8070bdfa72)
This commit is contained in:
Andrew Cooper committed 2026-05-06 15:32:52 +01:00
1 parent 7bcc106db0
commit 8056c4032f
1 file changed
+19 -5
+19 -5
View File
@@ -1050,11 +1050,25 @@ static void amd_check_bp_cfg(void)
{
uint64_t val, new = 0;
/*
* AMD Erratum #1485. Set bit 5, as instructed.
*/
if (!cpu_has_hypervisor && boot_cpu_data.x86 == 0x19 && is_zen4_uarch())
new |= (1 << 5);
if (!cpu_has_hypervisor) {
/*
* AMD Erratum #1485. If SMT is enabled and STIBP disabled,
* the CPU may fetch incorrect instruction bytes.
*
* Set bit 5, as instructed.
*/
if (boot_cpu_data.x86 == 0x19 && is_zen4_uarch())
new |= (1 << 5);
/*
* AMD SB-7052. CPU OP Cache corruption, causing instructions
* to be executed at a higher privilege.
*
* Set bit 33, as instructed.
*/
if (boot_cpu_data.x86 == 0x17 && is_zen2_uarch())
new |= (1UL << 33);
}
/*
* On hardware supporting SRSO_MSR_FIX, activate BP_SPEC_REDUCE by
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.