diff options
author | Jessica Yu <jeyu@redhat.com> | 2016-03-23 01:03:18 +0100 |
---|---|---|
committer | Jiri Kosina <jkosina@suse.cz> | 2016-04-01 15:00:11 +0200 |
commit | 425595a7fc2096ab46c741b5ed5372c5ab5bbeac (patch) | |
tree | 9cf12348ba352e7679be0aadf370aa0a7bc5509e /arch/s390/include | |
parent | module: s390: keep mod_arch_specific for livepatch modules (diff) | |
download | linux-425595a7fc2096ab46c741b5ed5372c5ab5bbeac.tar.xz linux-425595a7fc2096ab46c741b5ed5372c5ab5bbeac.zip |
livepatch: reuse module loader code to write relocations
Reuse module loader code to write relocations, thereby eliminating the need
for architecture specific relocation code in livepatch. Specifically, reuse
the apply_relocate_add() function in the module loader to write relocations
instead of duplicating functionality in livepatch's arch-dependent
klp_write_module_reloc() function.
In order to accomplish this, livepatch modules manage their own relocation
sections (marked with the SHF_RELA_LIVEPATCH section flag) and
livepatch-specific symbols (marked with SHN_LIVEPATCH symbol section
index). To apply livepatch relocation sections, livepatch symbols
referenced by relocs are resolved and then apply_relocate_add() is called
to apply those relocations.
In addition, remove x86 livepatch relocation code and the s390
klp_write_module_reloc() function stub. They are no longer needed since
relocation work has been offloaded to module loader.
Lastly, mark the module as a livepatch module so that the module loader
canappropriately identify and initialize it.
Signed-off-by: Jessica Yu <jeyu@redhat.com>
Reviewed-by: Miroslav Benes <mbenes@suse.cz>
Acked-by: Josh Poimboeuf <jpoimboe@redhat.com>
Acked-by: Heiko Carstens <heiko.carstens@de.ibm.com> # for s390 changes
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'arch/s390/include')
-rw-r--r-- | arch/s390/include/asm/livepatch.h | 7 |
1 files changed, 0 insertions, 7 deletions
diff --git a/arch/s390/include/asm/livepatch.h b/arch/s390/include/asm/livepatch.h index d5427c78b1b3..2c1213785892 100644 --- a/arch/s390/include/asm/livepatch.h +++ b/arch/s390/include/asm/livepatch.h @@ -24,13 +24,6 @@ static inline int klp_check_compiler_support(void) return 0; } -static inline int klp_write_module_reloc(struct module *mod, unsigned long - type, unsigned long loc, unsigned long value) -{ - /* not supported yet */ - return -ENOSYS; -} - static inline void klp_arch_set_pc(struct pt_regs *regs, unsigned long ip) { regs->psw.addr = ip; |