]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
x86/bugs: Allow retbleed=stuff only on Intel
authorDavid Kaplan <david.kaplan@amd.com>
Fri, 18 Apr 2025 16:17:14 +0000 (11:17 -0500)
committerBorislav Petkov (AMD) <bp@alien8.de>
Mon, 28 Apr 2025 17:55:50 +0000 (19:55 +0200)
The retbleed=stuff mitigation is only applicable for Intel CPUs affected
by retbleed.  If this option is selected for another vendor, print a
warning and fall back to the AUTO option.

Signed-off-by: David Kaplan <david.kaplan@amd.com>
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
Reviewed-by: Josh Poimboeuf <jpoimboe@kernel.org>
Link: https://lore.kernel.org/20250418161721.1855190-10-david.kaplan@amd.com
arch/x86/kernel/cpu/bugs.c

index 1a42abb289ac641a44457b140e59eb2ef3561adf..7edf42912cdf83a8846d7fdc37314f74356f6c91 100644 (file)
@@ -1191,6 +1191,10 @@ static void __init retbleed_select_mitigation(void)
        case RETBLEED_CMD_STUFF:
                if (IS_ENABLED(CONFIG_MITIGATION_CALL_DEPTH_TRACKING) &&
                    spectre_v2_enabled == SPECTRE_V2_RETPOLINE) {
+                       if (boot_cpu_data.x86_vendor != X86_VENDOR_INTEL) {
+                               pr_err("WARNING: retbleed=stuff only supported for Intel CPUs.\n");
+                               goto do_cmd_auto;
+                       }
                        retbleed_mitigation = RETBLEED_MITIGATION_STUFF;
 
                } else {