Re: [PATCH v6 8/9] Implement kernel live patching for ppc64le (ABIv2)
From: Petr Mladek
Date: Tue Jan 26 2016 - 07:49:03 EST
On Tue 2016-01-26 11:50:25, Miroslav Benes wrote:
> [ added Petr to CC list ]
> On Mon, 25 Jan 2016, Torsten Duwe wrote:
> > * create the appropriate files+functions
> > arch/powerpc/include/asm/livepatch.h
> > klp_check_compiler_support,
> > klp_arch_set_pc
> > arch/powerpc/kernel/livepatch.c with a stub for
> > klp_write_module_reloc
> > This is architecture-independent work in progress.
> > * introduce a fixup in arch/powerpc/kernel/entry_64.S
> > for local calls that are becoming global due to live patching.
> > And of course do the main KLP thing: return to a maybe different
> > address, possibly altered by the live patching ftrace op.
> > Signed-off-by: Torsten Duwe <duwe@xxxxxxx>
> I have a few questions...
> We still need Petr's patch from  to make livepatch work, right? Could
> you, please, add it to this patch set to make it self-sufficient?
> Second, what is the situation with mcount prologue between gcc < 6 and
> gcc-6? Are there only 12 bytes in gcc-6 prologue? If yes, we need to
> change Petr's patch to make it more general and to be able to cope with
> different prologues. This is unfortunate. Either way, please mention it
> somewhere in a changelog.
I am going to update the extra patch. There is an idea to detect the
offset during build by scrips/recordmcount. This tool looks for the
ftrace locations. The offset should always be a constant that depends
on the used architecture, compiler, and compiler flags.
The tool is called post build. We might need to pass the constant
as a symbol added to the binary. The tool already adds some symbols.