powerpc/ftrace: Remove ftrace init tramp once kernel init is complete
commit 84ade0a6655bee803d176525ef457175cbf4df22 upstream.
Stop using the ftrace trampoline for init section once kernel init is
complete.
Fixes: 67361cf807
("powerpc/ftrace: Handle large kernel configs")
Cc: stable@vger.kernel.org # v4.20+
Signed-off-by: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20220516071422.463738-1-naveen.n.rao@linux.vnet.ibm.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:

committed by
Greg Kroah-Hartman

parent
6b734f7b70
commit
6a656280e7
@@ -336,9 +336,7 @@ static int setup_mcount_compiler_tramp(unsigned long tramp)
|
||||
|
||||
/* Is this a known long jump tramp? */
|
||||
for (i = 0; i < NUM_FTRACE_TRAMPS; i++)
|
||||
if (!ftrace_tramps[i])
|
||||
break;
|
||||
else if (ftrace_tramps[i] == tramp)
|
||||
if (ftrace_tramps[i] == tramp)
|
||||
return 0;
|
||||
|
||||
/* Is this a known plt tramp? */
|
||||
@@ -882,6 +880,17 @@ void arch_ftrace_update_code(int command)
|
||||
|
||||
extern unsigned int ftrace_tramp_text[], ftrace_tramp_init[];
|
||||
|
||||
void ftrace_free_init_tramp(void)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < NUM_FTRACE_TRAMPS && ftrace_tramps[i]; i++)
|
||||
if (ftrace_tramps[i] == (unsigned long)ftrace_tramp_init) {
|
||||
ftrace_tramps[i] = 0;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
int __init ftrace_dyn_arch_init(void)
|
||||
{
|
||||
int i;
|
||||
|
Reference in New Issue
Block a user