mirror of
https://github.com/dynup/kpatch
synced 2025-04-18 21:15:35 +00:00
Kernel livepatching modules build on GCC 10, with patched functions referring to local function would fail to load with the error: module_64: livepatch_ext4_cond_resched: Expected nop after call, got 7fe5fb78 at ext4_setup_system_zone+0x460/0xc90 [livepatch_ext4_cond_resched] for more details on the error, refer to discussion at: https://lkml.kernel.org/r/1508217523-18885-1-git-send-email-kamalesh@linux.vnet.ibm.com the reason was that the gcc-plugin would skip the pass on error, failing to convert the local calls into global, i.e on ppc64le every global call is followed by a nop instruction, that gets replaced by the kernel to restore the TOC/r2 value of the callee, while parsing the relocations and would skip the TOC restoration for local functions, where the TOC remains the same across sibling functions. GCC 10 commit 07c48b61a082("[RS6000] Put call cookie back in AIX/ELFv2 call patterns") merged a couple of call codes definition, breaking the plugin. Change the plugin codes to match the GCC 10 codes. Signed-off-by: Kamalesh Babulal <kamalesh@linux.vnet.ibm.com> |
||
---|---|---|
.. | ||
gcc-plugins | ||
insn | ||
create-diff-object.c | ||
create-klp-module.c | ||
create-kpatch-module.c | ||
kpatch-build | ||
kpatch-elf.c | ||
kpatch-elf.h | ||
kpatch-gcc | ||
kpatch-intermediate.h | ||
kpatch.h | ||
list.h | ||
log.h | ||
lookup.c | ||
lookup.h | ||
Makefile |