Port patches from v5.10 to support basic functions of kernel livepatch on arch x86_64/arm64/arm32/ppc32.
Zheng Yejian (19): livepatch/core: Allow implementation without ftrace livepatch/core: Reuse common codes in the solution without ftrace Revert "x86/insn: Make insn_complete() static" livepatch/x86: Support livepatch without ftrace livepatch/core: Disable support for replacing livepatch/core: Restrict livepatch patched/unpatched when plant kprobe livepatch/core: Support load and unload hooks livepatch: samples: Adapt livepatch-sample for solution without ftrace livepatch/core: Support jump_label livepatch: Fix crash when access the global variable in hook livepatch: Fix patching functions which have static_call livepatch/core: Avoid conflict with static {call,key} livepatch/arm64: Support livepatch without ftrace livepatch/core: Revert module_enable_ro and module_disable_ro livepatch: Enable livepatch configs in openeuler_defconfig arm/module: Use plt section indices for relocations livepatch/core: Add support for arm for klp relocation livepatch/arm: Support livepatch without ftrace livepatch/ppc32: Support livepatch without ftrace
Documentation/filesystems/proc.rst | 2 +- arch/arm/Kconfig | 3 + arch/arm/include/asm/livepatch.h | 51 + arch/arm/include/asm/module.h | 4 +- arch/arm/kernel/Makefile | 1 + arch/arm/kernel/ftrace.c | 4 +- arch/arm/kernel/livepatch.c | 256 ++++ arch/arm/kernel/module-plts.c | 22 +- arch/arm/kernel/module.c | 4 +- arch/arm64/Kconfig | 3 + arch/arm64/configs/openeuler_defconfig | 12 + arch/arm64/include/asm/livepatch.h | 48 + arch/arm64/kernel/Makefile | 1 + arch/arm64/kernel/livepatch.c | 225 ++++ arch/powerpc/Kconfig | 5 +- arch/powerpc/include/asm/livepatch.h | 24 + arch/powerpc/kernel/Makefile | 1 + arch/powerpc/kernel/livepatch.c | 282 +++++ arch/powerpc/kernel/livepatch_32.c | 124 ++ arch/s390/Kconfig | 2 +- arch/s390/configs/debug_defconfig | 1 + arch/s390/configs/defconfig | 1 + arch/x86/Kconfig | 3 +- arch/x86/configs/openeuler_defconfig | 12 +- arch/x86/include/asm/insn.h | 7 + arch/x86/include/asm/livepatch.h | 33 + arch/x86/kernel/Makefile | 1 + arch/x86/kernel/livepatch.c | 289 +++++ arch/x86/kernel/module.c | 2 +- arch/x86/lib/insn.c | 7 - include/linux/jump_label.h | 10 + include/linux/livepatch.h | 99 +- include/linux/livepatch_sched.h | 6 +- include/linux/module.h | 33 + include/linux/moduleloader.h | 4 +- include/linux/static_call.h | 6 + kernel/jump_label.c | 22 + kernel/livepatch/Kconfig | 78 +- kernel/livepatch/Makefile | 3 +- kernel/livepatch/core.c | 1242 +++++++++++++++++++- kernel/livepatch/core.h | 4 + kernel/module/main.c | 10 +- kernel/module/strict_rwx.c | 17 + kernel/static_call_inline.c | 20 + lib/Kconfig.debug | 2 +- samples/livepatch/Makefile | 2 + samples/livepatch/livepatch-sample.c | 36 + tools/arch/x86/include/asm/insn.h | 7 + tools/arch/x86/lib/insn.c | 7 - tools/testing/selftests/bpf/config.aarch64 | 1 + tools/testing/selftests/bpf/config.s390x | 1 + tools/testing/selftests/livepatch/README | 1 + tools/testing/selftests/livepatch/config | 1 + 53 files changed, 2985 insertions(+), 57 deletions(-) create mode 100644 arch/arm/include/asm/livepatch.h create mode 100644 arch/arm/kernel/livepatch.c create mode 100644 arch/arm64/include/asm/livepatch.h create mode 100644 arch/arm64/kernel/livepatch.c create mode 100644 arch/powerpc/kernel/livepatch.c create mode 100644 arch/powerpc/kernel/livepatch_32.c create mode 100644 arch/x86/include/asm/livepatch.h create mode 100644 arch/x86/kernel/livepatch.c