[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YfKZXvB9vCN1bA1c@FVFF77S0Q05N>
Date: Thu, 27 Jan 2022 13:08:46 +0000
From: Mark Rutland <mark.rutland@....com>
To: Steven Rostedt <rostedt@...dmis.org>
Cc: Sven Schnelle <svens@...ux.ibm.com>,
Yinan Liu <yinan@...ux.alibaba.com>,
linuxppc-dev@...ts.ozlabs.org, Sachin Sant <sachinp@...ux.ibm.com>,
linux-kernel@...r.kernel.org, ardb@...nel.org,
keescook@...omium.org
Subject: Re: [powerpc] ftrace warning kernel/trace/ftrace.c:2068 with
code-patching selftests
On Thu, Jan 27, 2022 at 07:46:01AM -0500, Steven Rostedt wrote:
> On Thu, 27 Jan 2022 12:27:04 +0000
> Mark Rutland <mark.rutland@....com> wrote:
>
> > Ah, so those non-ELF relocations for the mcount_loc table just mean "apply the
> > KASLR offset here", which is equivalent for all entries.
> >
> > That makes sense, thanks!
>
> And this is why we were having such a hard time understanding each other ;-)
;)
With that in mind, I think that we understand that the build-time sort works
for:
* arch/x86, becuase the non-ELF relocations for mcount_loc happen to be
equivalent.
* arch/arm, because there's no dynamic relocaiton and the mcount_loc entries
have been finalized prior to sorting.
... but doesn't work for anyone else (including arm64) because the ELF
relocations are not equivalent, and need special care that is not yet
implemented.
So we should have arm and x86 opt-in, but for now everyone else (including
arm64, powerpc, s390) should be left with the prior behaviour with the runtime
sort only (in case the build-time sort breaks anything, as I mentioned in my
other mail).
Does that sound about right?
In future we might be able to do something much smarter (e.g. adding some
preprocessing to use relative entries).
I'll take a look at shelf. :)
Thanks,
Mark.
> I started a new project called "shelf", which is a shell interface to
> read ELF files (Shelf on a ELF!).
>
> It uses my ccli library:
>
> https://github.com/rostedt/libccli
>
> and can be found here:
>
> https://github.com/rostedt/shelf
>
> Build and install the latest libccli and then build this with just
> "make".
>
> $ shelf vmlinux
>
> and then you can see what is stored in the mcount location:
>
> shelf> dump symbol __start_mcount_loc - __stop_mcount_loc
>
> I plan on adding more to include the REL and RELA sections and show how
> they affect symbols and such.
>
> Feel free to contribute too ;-)
>
> -- Steve
Powered by blists - more mailing lists