diff options
author | Vasily Gorbik <gor@linux.ibm.com> | 2024-08-21 20:06:16 +0200 |
---|---|---|
committer | Vasily Gorbik <gor@linux.ibm.com> | 2024-08-27 20:16:48 +0200 |
commit | d759be28232f8a4ebdfc1a2c20989e54a6965dbf (patch) | |
tree | ded004e3215effea569ed8125dc269b8d008017a /arch/s390 | |
parent | s390/ftrace: Remove unused ftrace_plt_template* (diff) | |
download | linux-d759be28232f8a4ebdfc1a2c20989e54a6965dbf.tar.xz linux-d759be28232f8a4ebdfc1a2c20989e54a6965dbf.zip |
s390/ftrace: Use kernel ftrace trampoline for modules
Now that both the kernel modules area and the kernel image itself are
located within 4 GB, there is no longer a need to maintain a separate
ftrace_plt trampoline. Use the existing trampoline in the kernel.
Reviewed-by: Ilya Leoshkevich <iii@linux.ibm.com>
Reviewed-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
Diffstat (limited to 'arch/s390')
-rw-r--r-- | arch/s390/kernel/ftrace.c | 24 |
1 files changed, 0 insertions, 24 deletions
diff --git a/arch/s390/kernel/ftrace.c b/arch/s390/kernel/ftrace.c index 0bd6adc40a34..9552b1e7121f 100644 --- a/arch/s390/kernel/ftrace.c +++ b/arch/s390/kernel/ftrace.c @@ -50,10 +50,6 @@ struct ftrace_insn { s32 disp; } __packed; -#ifdef CONFIG_MODULES -static char *ftrace_plt; -#endif /* CONFIG_MODULES */ - static const char *ftrace_shared_hotpatch_trampoline(const char **end) { const char *tstart, *tend; @@ -99,7 +95,6 @@ int ftrace_init_nop(struct module *mod, struct dyn_ftrace *rec) if (mod) { next_trampoline = &mod->arch.next_trampoline; trampolines_end = mod->arch.trampolines_end; - shared = ftrace_plt; } #endif @@ -215,25 +210,6 @@ void ftrace_arch_code_modify_post_process(void) text_poke_sync_lock(); } -#ifdef CONFIG_MODULES - -static int __init ftrace_plt_init(void) -{ - const char *start, *end; - - ftrace_plt = execmem_alloc(EXECMEM_FTRACE, PAGE_SIZE); - if (!ftrace_plt) - panic("cannot allocate ftrace plt\n"); - - start = ftrace_shared_hotpatch_trampoline(&end); - memcpy(ftrace_plt, start, end - start); - set_memory_rox((unsigned long)ftrace_plt, 1); - return 0; -} -device_initcall(ftrace_plt_init); - -#endif /* CONFIG_MODULES */ - #ifdef CONFIG_FUNCTION_GRAPH_TRACER /* * Hook the return address and push it in the stack of return addresses |