Subject: Re: [PATCHv2 7/8] arm64: implement ftrace with regs

From: Torsten Duwe <[email-masked]>
Date: Fri, 15 Nov 2019 08:45:38 +0100

On Fri, 15 Nov 2019 07:05:39 +0900
Itaru Kitayama <[email-masked]> wrote:

> Is this feature avail even when building kernel with Clang?

If your compiler can ...

[...]
> > compiler insert a configurable number of NOPs between the function
> > entry point and the usual prologue. This also ensures functions are
> > AAPCS compliant (e.g. disabling inter-procedural register
> > allocation).
> >
> > For example, with -fpatchable-function-entry=2, GCC 8.1.0 compiles
> > the following:
> >
> > | unsigned long bar(void);
> > |
> > | unsigned long foo(void)
> > | {
> > |         return bar() + 1;
> > | }
> >
> > ... to:
> >
> > | <foo>:
> > |         nop
> > |         nop
> > |         stp     x29, x30, [sp, #-16]!

* insert e.g. 2 NOPs
* record all those locations in a section called
  "patchable_function_entries"
* stick to the AAPCS

then: yes. So far I only implemented this for gcc.

	Torsten

_______________________________________________
linux-arm-kernel mailing list
[email-masked]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel