Commit eb7d389d authored by Peter Zijlstra's avatar Peter Zijlstra Committed by Dave Hansen

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: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
Link: https://lkml.kernel.org/r/20221025201057.945960823@infradead.org
parent 5b93a836
...@@ -1681,11 +1681,6 @@ void __ref text_poke_queue(void *addr, const void *opcode, size_t len, const voi ...@@ -1681,11 +1681,6 @@ void __ref text_poke_queue(void *addr, const void *opcode, size_t len, const voi
{ {
struct text_poke_loc *tp; struct text_poke_loc *tp;
if (unlikely(system_state == SYSTEM_BOOTING)) {
text_poke_early(addr, opcode, len);
return;
}
text_poke_flush(addr); text_poke_flush(addr);
tp = &tp_vec[tp_vec_nr++]; tp = &tp_vec[tp_vec_nr++];
...@@ -1707,11 +1702,6 @@ void __ref text_poke_bp(void *addr, const void *opcode, size_t len, const void * ...@@ -1707,11 +1702,6 @@ void __ref text_poke_bp(void *addr, const void *opcode, size_t len, const void *
{ {
struct text_poke_loc tp; struct text_poke_loc tp;
if (unlikely(system_state == SYSTEM_BOOTING)) {
text_poke_early(addr, opcode, len);
return;
}
text_poke_loc_init(&tp, addr, opcode, len, emulate); text_poke_loc_init(&tp, addr, opcode, len, emulate);
text_poke_bp_batch(&tp, 1); text_poke_bp_batch(&tp, 1);
} }
...@@ -415,7 +415,6 @@ create_trampoline(struct ftrace_ops *ops, unsigned int *tramp_size) ...@@ -415,7 +415,6 @@ create_trampoline(struct ftrace_ops *ops, unsigned int *tramp_size)
set_vm_flush_reset_perms(trampoline); 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); set_memory_x((unsigned long)trampoline, npages);
return (unsigned long)trampoline; return (unsigned long)trampoline;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment