public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
From: Mark Rutland <mark.rutland@arm.com>
To: Florent Revest <revest@chromium.org>
Cc: linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org,
	bpf@vger.kernel.org, catalin.marinas@arm.com, will@kernel.org,
	rostedt@goodmis.org, mhiramat@kernel.org, ast@kernel.org,
	daniel@iogearbox.net, andrii@kernel.org, kpsingh@kernel.org,
	jolsa@kernel.org, xukuohai@huaweicloud.com, lihuafei1@huawei.com
Subject: Re: [PATCH v3 2/4] arm64: ftrace: Simplify get_ftrace_plt
Date: Fri, 24 Mar 2023 18:01:13 +0000	[thread overview]
Message-ID: <ZB3laWS5+X13nhvi@FVFF77S0Q05N> (raw)
In-Reply-To: <20230324171451.2752302-3-revest@chromium.org>

On Fri, Mar 24, 2023 at 06:14:49PM +0100, Florent Revest wrote:
> Following recent refactorings, the get_ftrace_plt function only ever
> gets called with addr = FTRACE_ADDR so its code can be simplified to
> always return the ftrace trampoline plt.
> 
> Signed-off-by: Florent Revest <revest@chromium.org>

Acked-by: Mark Rutland <mark.rutland@arm.com>

Mark.

> ---
>  arch/arm64/kernel/ftrace.c | 10 +++++-----
>  1 file changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/arch/arm64/kernel/ftrace.c b/arch/arm64/kernel/ftrace.c
> index 758436727fba..432626c866a8 100644
> --- a/arch/arm64/kernel/ftrace.c
> +++ b/arch/arm64/kernel/ftrace.c
> @@ -195,15 +195,15 @@ int ftrace_update_ftrace_func(ftrace_func_t func)
>  	return ftrace_modify_code(pc, 0, new, false);
>  }
>  
> -static struct plt_entry *get_ftrace_plt(struct module *mod, unsigned long addr)
> +static struct plt_entry *get_ftrace_plt(struct module *mod)
>  {
>  #ifdef CONFIG_ARM64_MODULE_PLTS
>  	struct plt_entry *plt = mod->arch.ftrace_trampolines;
>  
> -	if (addr == FTRACE_ADDR)
> -		return &plt[FTRACE_PLT_IDX];
> -#endif
> +	return &plt[FTRACE_PLT_IDX];
> +#else
>  	return NULL;
> +#endif
>  }
>  
>  static bool reachable_by_bl(unsigned long addr, unsigned long pc)
> @@ -270,7 +270,7 @@ static bool ftrace_find_callable_addr(struct dyn_ftrace *rec,
>  	if (WARN_ON(!mod))
>  		return false;
>  
> -	plt = get_ftrace_plt(mod, *addr);
> +	plt = get_ftrace_plt(mod);
>  	if (!plt) {
>  		pr_err("ftrace: no module PLT for %ps\n", (void *)*addr);
>  		return false;
> -- 
> 2.40.0.348.gf938b09366-goog
> 

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2023-03-24 18:02 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-24 17:14 [PATCH v3 0/4] Add ftrace direct call for arm64 Florent Revest
2023-03-24 17:14 ` [PATCH v3 1/4] arm64: ftrace: Add direct call support Florent Revest
2023-03-24 17:14 ` [PATCH v3 2/4] arm64: ftrace: Simplify get_ftrace_plt Florent Revest
2023-03-24 18:01   ` Mark Rutland [this message]
2023-03-24 17:14 ` [PATCH v3 3/4] arm64: ftrace: Add direct call trampoline samples support Florent Revest
2023-03-27 13:45   ` Florent Revest
2023-03-24 17:14 ` [PATCH v3 4/4] selftests/bpf: Update the tests deny list on aarch64 Florent Revest

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZB3laWS5+X13nhvi@FVFF77S0Q05N \
    --to=mark.rutland@arm.com \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=catalin.marinas@arm.com \
    --cc=daniel@iogearbox.net \
    --cc=jolsa@kernel.org \
    --cc=kpsingh@kernel.org \
    --cc=lihuafei1@huawei.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-trace-kernel@vger.kernel.org \
    --cc=mhiramat@kernel.org \
    --cc=revest@chromium.org \
    --cc=rostedt@goodmis.org \
    --cc=will@kernel.org \
    --cc=xukuohai@huaweicloud.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox