Add xcall 2.0 support, which is compatible with xcall1.0, and can be used to dynamic instruction replacement for hardware xcall. Changes in v6: - Add "xcall=debug" debug mode to use the "fast syscall" for every system call. - Use alternative to reduce the baseline performance noise floor when not set "xcall" on the kernel cmdline - Move binary_path out from xcall struct, and add to xcall_comm struct. - Fix1. insert_xcall_locked() check both "name" and "binary" to avoid repeated attach same name of xcall. - Fix2. Check if it is an executable file for the binary path. - Fix3. Check if it is an absolute path for the binary path. - Fix4. Remove the extra free_xcall_comm(info) in default branch in proc_xcall_command(). - Fix5. Add zero syscall hijack check for xcall_prog_register(). - Use __arm64_sys_ni_syscall() instead of define inv_xcall(). - Replace the -ENOSYS return value with -EINVAL, to avoid the warning. Changes in v5: - Fix build problem. - el0t_64_sync_ventry jump to kernel_ventry to do VMAP_STACK. - Some cleanups. - Merge the three refactor patch. Changes in v4: - Reuse uprobe_write_opcode() instead of use __replace_page() and copy_to_page(). - Handle error for uprobe_write_opcode(). - Support xcall1.0 before 920G. - Change xcall1.0 bitmap to byte array to save check insns. - Use percpu variable to save check insns for xcall1.0. - A little cleanup. Changes in v3: - Add validity checks during xcall registration to prevent out-of-bounds access and null pointer dereferences. - Extract __replace_page() and copy_to_page() from uprobe, to avoid code duplication. - Replace with new compatible refactored code. - Remove unnecessary member, such as old_name. Changes in v2: - Remove duplicates or unnecessary ~300 LOC, such as link_slot, init_task. - Fix kabi. - Some cleanups. Jinjie Ruan (2): xcall2.0: Support xcall1.0 for hardware xcall openeuler_defconfig: Enable CONFIG_DYNAMIC_XCALL by default Liao Chang (6): xcall2.0: Add userspace proc interface xcall2.0: Add xcall module register interface xcall2.0: Add xcall_area xcall2.0: Hajack syscall with dynamic instruciton replace xcall: Rework the early exception vector of XCALL and SYNC xcall2.0: Add a basic testcase Yipeng Zou (1): xcall: Add debug mode to force fast syscall for all threads Yuntao Liu (1): xcall2.0: Intruduce xcall2.0 prefetch kernel module arch/arm64/Kconfig.turbo | 13 + arch/arm64/configs/openeuler_defconfig | 1 + arch/arm64/include/asm/exception.h | 4 +- arch/arm64/include/asm/mmu_context.h | 7 - arch/arm64/include/asm/xcall.h | 154 +++++---- arch/arm64/kernel/cpufeature.c | 76 ++-- arch/arm64/kernel/entry-common.c | 28 +- arch/arm64/kernel/entry.S | 86 +---- arch/arm64/kernel/probes/uprobes.c | 6 + arch/arm64/kernel/process.c | 5 + arch/arm64/kernel/syscall.c | 14 + arch/arm64/kernel/xcall/Makefile | 3 +- arch/arm64/kernel/xcall/core.c | 384 +++++++++++++++++++++ arch/arm64/kernel/xcall/entry.S | 180 ++++++++-- arch/arm64/kernel/xcall/proc.c | 223 ++++++++++++ arch/arm64/kernel/xcall/xcall.c | 66 ++-- arch/arm64/kvm/sys_regs.c | 1 + drivers/staging/Kconfig | 2 + drivers/staging/Makefile | 1 + drivers/staging/xcall/Kconfig | 19 + drivers/staging/xcall/Makefile | 1 + drivers/staging/xcall/dynamic_xcall_test.c | 90 +++++ drivers/staging/xcall/prefetch.c | 265 ++++++++++++++ fs/proc/proc_xcall.c | 144 ++------ include/linux/mm_types.h | 4 + include/linux/xcall.h | 51 +++ kernel/events/uprobes.c | 23 ++ kernel/fork.c | 3 + mm/mmap.c | 14 +- 29 files changed, 1494 insertions(+), 374 deletions(-) create mode 100644 arch/arm64/kernel/xcall/core.c create mode 100644 arch/arm64/kernel/xcall/proc.c create mode 100644 drivers/staging/xcall/Kconfig create mode 100644 drivers/staging/xcall/Makefile create mode 100644 drivers/staging/xcall/dynamic_xcall_test.c create mode 100644 drivers/staging/xcall/prefetch.c create mode 100644 include/linux/xcall.h -- 2.34.1