Port patches from v5.10 to support basic livepatch function on arch arm32/arm64/x86_64.
Zheng Yejian (16): 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: 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 livepatch/core: Add support for arm for klp relocation livepatch/arm: Support livepatch without ftrace
Documentation/filesystems/proc.rst | 2 +- arch/arm/Kconfig | 3 + arch/arm/include/asm/livepatch.h | 51 + arch/arm/kernel/Makefile | 1 + arch/arm/kernel/livepatch.c | 256 ++++ 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 | 4 +- 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 | 97 +- 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 | 1231 +++++++++++++++++++- 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 + 45 files changed, 2520 insertions(+), 43 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/x86/include/asm/livepatch.h create mode 100644 arch/x86/kernel/livepatch.c