]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
x86/bugs: Avoid warning when overriding return thunk
authorPawan Gupta <pawan.kumar.gupta@linux.intel.com>
Wed, 11 Jun 2025 17:29:31 +0000 (10:29 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 20 Aug 2025 16:30:26 +0000 (18:30 +0200)
[ Upstream commit 9f85fdb9fc5a1bd308a10a0a7d7e34f2712ba58b ]

The purpose of the warning is to prevent an unexpected change to the return
thunk mitigation. However, there are legitimate cases where the return
thunk is intentionally set more than once. For example, ITS and SRSO both
can set the return thunk after retbleed has set it. In both the cases
retbleed is still mitigated.

Replace the warning with an info about the active return thunk.

Suggested-by: Borislav Petkov <bp@alien8.de>
Signed-off-by: Pawan Gupta <pawan.kumar.gupta@linux.intel.com>
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
Link: https://lore.kernel.org/20250611-eibrs-fix-v4-3-5ff86cac6c61@linux.intel.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
arch/x86/kernel/cpu/bugs.c

index c2c7b76d953f77bdbb99350074cc763c8dc7fcaa..31b4b73e54053b733f72a3ade8f45ab06c7a3dea 100644 (file)
@@ -71,10 +71,9 @@ void (*x86_return_thunk)(void) __ro_after_init = __x86_return_thunk;
 
 static void __init set_return_thunk(void *thunk)
 {
-       if (x86_return_thunk != __x86_return_thunk)
-               pr_warn("x86/bugs: return thunk changed\n");
-
        x86_return_thunk = thunk;
+
+       pr_info("active return thunk: %ps\n", thunk);
 }
 
 /* Update SPEC_CTRL MSR and its cached copy unconditionally */