[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <6209682d-0caa-b779-8763-376a984d8ed8@csgroup.eu>
Date: Mon, 13 Dec 2021 14:39:15 +0000
From: Christophe Leroy <christophe.leroy@...roup.eu>
To: Steven Rostedt <rostedt@...dmis.org>
CC: Josh Poimboeuf <jpoimboe@...hat.com>,
Jiri Kosina <jikos@...nel.org>,
Miroslav Benes <mbenes@...e.cz>,
Petr Mladek <pmladek@...e.com>,
Joe Lawrence <joe.lawrence@...hat.com>,
Ingo Molnar <mingo@...hat.com>,
"Naveen N . Rao" <naveen.n.rao@...ux.vnet.ibm.com>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"linuxppc-dev@...ts.ozlabs.org" <linuxppc-dev@...ts.ozlabs.org>,
"live-patching@...r.kernel.org" <live-patching@...r.kernel.org>
Subject: Re: [PATCH v1 0/5] Implement livepatch on PPC32
Le 28/10/2021 à 15:35, Steven Rostedt a écrit :
> On Thu, 28 Oct 2021 14:24:00 +0200
> Christophe Leroy <christophe.leroy@...roup.eu> wrote:
>
>> This series implements livepatch on PPC32.
>>
>> This is largely copied from what's done on PPC64.
>>
>> Christophe Leroy (5):
>> livepatch: Fix build failure on 32 bits processors
>> powerpc/ftrace: No need to read LR from stack in _mcount()
>> powerpc/ftrace: Add module_trampoline_target() for PPC32
>> powerpc/ftrace: Activate HAVE_DYNAMIC_FTRACE_WITH_REGS on PPC32
>> powerpc/ftrace: Add support for livepatch to PPC32
>>
>> arch/powerpc/Kconfig | 2 +-
>> arch/powerpc/include/asm/livepatch.h | 4 +-
>> arch/powerpc/kernel/module_32.c | 33 +++++
>> arch/powerpc/kernel/trace/ftrace.c | 53 +++-----
>> arch/powerpc/kernel/trace/ftrace_32.S | 187 ++++++++++++++++++++++++--
>> kernel/livepatch/core.c | 4 +-
>> 6 files changed, 230 insertions(+), 53 deletions(-)
>>
>
> This is great that you are doing this, but I wonder if it would even be
> easier, and more efficient, if you could implement
> HAVE_DYNAMIC_FTRACE_WITH_ARGS?
>
> Then you don't need to save all regs for live kernel patching. And I am
> also working on function tracing with arguments with this too.
>
> That is, to call a generic ftrace callback, you need to save all the args
> that are stored in registers to prevent the callback from clobbering them.
> As live kernel patching only needs to have the arguments of the functions,
> you save time from having to save the other regs as well.
>
> The callbacks now have "struct ftrace_regs" instead of pt_regs, because it
> will allow non ftrace_regs_caller functions to access the arguments if it
> is supported.
>
> Look at how x86_64 implements this. It should be possible to do this for
> all other archs as well.
>
> Also note, by doing this, we can then get rid of the ftrace_graph_caller,
> and have function graph tracer be a function tracing callback, as it will
> allow ftrace_graph_caller to have access to the stack and the return as
> well.
>
> If you need any more help or information to do this, I'd be happy to assist
> you.
>
> Note, you can implement this first, (I looked over the patches and they
> seem fine) and then update both ppc64 and ppc32 to implement
> DYNAMIC_FTRACE_WITH_ARGS.
>
I tried to activate DYNAMIC_FTRACE_WITH_ARGS on PPC32.
I copied into powerpc the changes from 5740a7c71ab6 ("s390/ftrace: add
HAVE_DYNAMIC_FTRACE_WITH_ARGS support")
Ftrace selftests tell "Testing tracer function_graph: FAILED!".
Is there anything else to do ?
Thanks for your help
Christophe
Powered by blists - more mailing lists