diff mbox series

[05/17] powerpc/ftrace: Use FTRACE_REGS_ADDR to identify the correct ftrace trampoline

Message ID 6045a280a57a7ea937a5bb13ccac747026dbfb07.1687166935.git.naveen@kernel.org (mailing list archive)
State Accepted
Commit b5efb61c70f8ba9b1e168185530b9c7342184a4c
Headers show
Series powerpc/ftrace: refactor and add support for -fpatchable-function-entry | expand

Commit Message

Naveen N Rao June 19, 2023, 9:47 a.m. UTC
Instead of keying off DYNAMIC_FTRACE_WITH_REGS, use FTRACE_REGS_ADDR to
identify the proper ftrace trampoline address to use.

Signed-off-by: Naveen N Rao <naveen@kernel.org>
---
 arch/powerpc/kernel/trace/ftrace.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

Comments

Christophe Leroy June 23, 2023, 5:15 a.m. UTC | #1
Le 19/06/2023 à 11:47, Naveen N Rao a écrit :
> Instead of keying off DYNAMIC_FTRACE_WITH_REGS, use FTRACE_REGS_ADDR to
> identify the proper ftrace trampoline address to use.
> 
> Signed-off-by: Naveen N Rao <naveen@kernel.org>

Reviewed-by: Christophe Leroy <christophe.leroy@csgroup.eu>

> ---
>   arch/powerpc/kernel/trace/ftrace.c | 7 +------
>   1 file changed, 1 insertion(+), 6 deletions(-)
> 
> diff --git a/arch/powerpc/kernel/trace/ftrace.c b/arch/powerpc/kernel/trace/ftrace.c
> index f117124c30325f..5aa36272617a03 100644
> --- a/arch/powerpc/kernel/trace/ftrace.c
> +++ b/arch/powerpc/kernel/trace/ftrace.c
> @@ -745,14 +745,9 @@ int __init ftrace_dyn_arch_init(void)
>   	};
>   #endif
>   
> -	unsigned long addr;
> +	unsigned long addr = FTRACE_REGS_ADDR;
>   	long reladdr;
>   
> -	if (IS_ENABLED(CONFIG_DYNAMIC_FTRACE_WITH_REGS))
> -		addr = ppc_global_function_entry((void *)ftrace_regs_caller);
> -	else
> -		addr = ppc_global_function_entry((void *)ftrace_caller);
> -
>   	if (IS_ENABLED(CONFIG_PPC_KERNEL_PCREL)) {
>   		for (i = 0; i < 2; i++) {
>   			reladdr = addr - (unsigned long)tramp[i];
diff mbox series

Patch

diff --git a/arch/powerpc/kernel/trace/ftrace.c b/arch/powerpc/kernel/trace/ftrace.c
index f117124c30325f..5aa36272617a03 100644
--- a/arch/powerpc/kernel/trace/ftrace.c
+++ b/arch/powerpc/kernel/trace/ftrace.c
@@ -745,14 +745,9 @@  int __init ftrace_dyn_arch_init(void)
 	};
 #endif
 
-	unsigned long addr;
+	unsigned long addr = FTRACE_REGS_ADDR;
 	long reladdr;
 
-	if (IS_ENABLED(CONFIG_DYNAMIC_FTRACE_WITH_REGS))
-		addr = ppc_global_function_entry((void *)ftrace_regs_caller);
-	else
-		addr = ppc_global_function_entry((void *)ftrace_caller);
-
 	if (IS_ENABLED(CONFIG_PPC_KERNEL_PCREL)) {
 		for (i = 0; i < 2; i++) {
 			reladdr = addr - (unsigned long)tramp[i];