From: David Kaplan Date: Fri, 18 Apr 2025 16:17:14 +0000 (-0500) Subject: x86/bugs: Allow retbleed=stuff only on Intel X-Git-Tag: v6.16-rc1~195^2~31^2~7 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=83d4b19331f3a5d5829d338a0a64b69c9c28b36e;p=thirdparty%2Fkernel%2Flinux.git x86/bugs: Allow retbleed=stuff only on Intel 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 Signed-off-by: Borislav Petkov (AMD) Reviewed-by: Josh Poimboeuf Link: https://lore.kernel.org/20250418161721.1855190-10-david.kaplan@amd.com --- diff --git a/arch/x86/kernel/cpu/bugs.c b/arch/x86/kernel/cpu/bugs.c index 1a42abb289ac6..7edf42912cdf8 100644 --- a/arch/x86/kernel/cpu/bugs.c +++ b/arch/x86/kernel/cpu/bugs.c @@ -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 {