Skip to content

Commit b61ec8d

Browse files
committed
Merge tag 'x86_urgent_for_v6.6-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull x86 rethunk fixes from Borislav Petkov: "Fix the patching ordering between static calls and return thunks" * tag 'x86_urgent_for_v6.6-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86,static_call: Fix static-call vs return-thunk x86/alternatives: Remove faulty optimization
2 parents e583bff + aee9d30 commit b61ec8d

File tree

2 files changed

+2
-8
lines changed

2 files changed

+2
-8
lines changed

arch/x86/kernel/alternative.c

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -720,13 +720,8 @@ void __init_or_module noinline apply_returns(s32 *start, s32 *end)
720720
{
721721
s32 *s;
722722

723-
/*
724-
* Do not patch out the default return thunks if those needed are the
725-
* ones generated by the compiler.
726-
*/
727-
if (cpu_feature_enabled(X86_FEATURE_RETHUNK) &&
728-
(x86_return_thunk == __x86_return_thunk))
729-
return;
723+
if (cpu_feature_enabled(X86_FEATURE_RETHUNK))
724+
static_call_force_reinit();
730725

731726
for (s = start; s < end; s++) {
732727
void *dest = NULL, *addr = (void *)s + *s;

arch/x86/kernel/callthunks.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,6 @@ void __init callthunks_patch_builtin_calls(void)
272272
pr_info("Setting up call depth tracking\n");
273273
mutex_lock(&text_mutex);
274274
callthunks_setup(&cs, &builtin_coretext);
275-
static_call_force_reinit();
276275
thunks_initialized = true;
277276
mutex_unlock(&text_mutex);
278277
}

0 commit comments

Comments
 (0)