[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Yo5mrDnNctKmG2PQ@FVFF77S0Q05N>
Date: Wed, 25 May 2022 18:26:04 +0100
From: Mark Rutland <mark.rutland@....com>
To: Steven Rostedt <rostedt@...dmis.org>
Cc: "Wangshaobo (bobo)" <bobo.shaobowang@...wei.com>,
cj.chengjian@...wei.com, huawei.libin@...wei.com,
xiexiuqi@...wei.com, liwei391@...wei.com,
linux-kernel@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
catalin.marinas@....com, will@...nel.org, zengshun.wu@...look.com
Subject: Re: [RFC PATCH -next v2 0/4] arm64/ftrace: support dynamic trampoline
On Wed, May 25, 2022 at 09:58:45AM -0400, Steven Rostedt wrote:
> On Wed, 25 May 2022 13:45:13 +0100
> Mark Rutland <mark.rutland@....com> wrote:
>
> > ... the compiler places 3 NOPs *before* any BTI, and 2 NOPs *after* any BTI,
> > still recording the location of the first NOP. So in the two cases we get:
> >
> > NOP <--- recorded location
> > NOP
> > NOP
> > __func_without_bti:
> > NOP
> > NOP
> >
> > NOP <--- recorded location
> > NOP
> > NOP
> > __func_with_bti:
> > BTI
> > NOP
> > NOP
>
> Are you saying that the above "recorded location" is what we have in
> mcount_loc section?
Yes; I'm saying that with this series, the compiler would record that into the
mcount_loc section.
Note that's not necessarily what goes into rec->ip, which we can adjust at
initialization time to be within the function. We'd need to record the
presence/absence of the BTI somewhere (I guess in dyn_arch_ftrace).
> If that's the case, we will need to modify it to point to something that
> kallsyms will recognize (ie. sym+0 or greater). Because that will cause
> set_ftrace_filter to fail as well.
Yup, understood. Like I mentioned it also wrecks the unwinder and would make it
really hard to implement RELIABLE_STACKTRACE.
Just to be clear, I don't think we should follow this specific approach. I just
wrote the examples to clarify what was being proposed.
Thanks,
Mark.
Powered by blists - more mailing lists