Re: [PATCH v6 8/9] Implement kernel live patching for ppc64le (ABIv2)
From: Miroslav Benes
Date: Tue Jan 26 2016 - 05:50:36 EST
[ 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>
Hi,
I have a few questions...
We still need Petr's patch from [1] 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 haven't reviewed the patch properly yet, but there is a comment below.
[1] http://lkml.kernel.org/g/20151203160004.GE8047@xxxxxxxxxxxxxxx
> +/**
> + * klp_write_module_reloc() - write a relocation in a module
> + * @mod: module in which the section to be modified is found
> + * @type: ELF relocation type (see asm/elf.h)
> + * @loc: address that the relocation should be written to
> + * @value: relocation value (sym address + addend)
> + *
> + * This function writes a relocation to the specified location for
> + * a particular module.
> + */
> +int klp_write_module_reloc(struct module *mod, unsigned long type,
> + unsigned long loc, unsigned long value)
> +{
> + /* This requires infrastructure changes; we need the loadinfos. */
> + pr_err("lpc_write_module_reloc not yet supported\n");
This is a nit, but there is no lpc_write_module_reloc. It should be
klp_write_module_reloc.
Thanks,
Miroslav