Skip to content

Commit 9f85fdb

Browse files
pa1guptabp3tk0v
authored andcommitted
x86/bugs: Avoid warning when overriding return thunk
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
1 parent 530e806 commit 9f85fdb

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

arch/x86/kernel/cpu/bugs.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -113,10 +113,9 @@ void (*x86_return_thunk)(void) __ro_after_init = __x86_return_thunk;
113113

114114
static void __init set_return_thunk(void *thunk)
115115
{
116-
if (x86_return_thunk != __x86_return_thunk)
117-
pr_warn("x86/bugs: return thunk changed\n");
118-
119116
x86_return_thunk = thunk;
117+
118+
pr_info("active return thunk: %ps\n", thunk);
120119
}
121120

122121
/* Update SPEC_CTRL MSR and its cached copy unconditionally */

0 commit comments

Comments
 (0)