aboutsummaryrefslogtreecommitdiff
path: root/arch/x86/kernel/ftrace.c
diff options
context:
space:
mode:
authorGravatar Peter Zijlstra <peterz@infradead.org> 2022-10-25 21:39:47 +0200
committerGravatar Dave Hansen <dave.hansen@linux.intel.com> 2022-12-15 10:37:26 -0800
commiteb7d389d5b2b3c453332abc41c3eea73290cc006 (patch)
tree3437aa2f03b0fed33a6e335a82da817f73447ebd /arch/x86/kernel/ftrace.c
parentx86/mm: Initialize text poking earlier (diff)
downloadlinux-eb7d389d5b2b3c453332abc41c3eea73290cc006.tar.gz
linux-eb7d389d5b2b3c453332abc41c3eea73290cc006.tar.bz2
linux-eb7d389d5b2b3c453332abc41c3eea73290cc006.zip
x86/ftrace: Remove SYSTEM_BOOTING exceptions
Now that text_poke is available before ftrace, remove the SYSTEM_BOOTING exceptions. Specifically, this cures a W+X case during boot. Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Link: https://lkml.kernel.org/r/20221025201057.945960823@infradead.org
Diffstat (limited to 'arch/x86/kernel/ftrace.c')
-rw-r--r--arch/x86/kernel/ftrace.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/arch/x86/kernel/ftrace.c b/arch/x86/kernel/ftrace.c
index bd165004776d..43628b8480fa 100644
--- a/arch/x86/kernel/ftrace.c
+++ b/arch/x86/kernel/ftrace.c
@@ -415,8 +415,7 @@ create_trampoline(struct ftrace_ops *ops, unsigned int *tramp_size)
set_vm_flush_reset_perms(trampoline);
- if (likely(system_state != SYSTEM_BOOTING))
- set_memory_ro((unsigned long)trampoline, npages);
+ set_memory_ro((unsigned long)trampoline, npages);
set_memory_x((unsigned long)trampoline, npages);
return (unsigned long)trampoline;
fail: