hi, as part of the effort on speeding up the uprobes [0] coming with return uprobe optimization by using syscall instead of the trap on the uretprobe trampoline. The speed up depends on instruction type that uprobe is installed and depends on specific HW type, please check patch 1 for details. I added extra bpf selftest to check on registers values before and after uretprobe to make sure the syscall saves all the needed regs. changes from RFC: - using __NR_uretprobe instead hardcoded syscall value [Andrii] - using __builtin_memcpy to copy registers [Andrii] - adding more comments - Oleg provided the code that enabled the syscall to take the sysret path, which made it lot faster [Oleg] - nocf_check attribute change was sent separatelly - added test for checking up changed registers in uprobe consumer thanks, jirka [0] https://lore.kernel.org/bpf/ZeCXHKJ--iYYbmLj@krava/ --- Jiri Olsa (3): uprobe: Add uretprobe syscall to speed up return probe selftests/bpf: Add uretprobe syscall test for regs integrity selftests/bpf: Add uretprobe syscall test for regs changes arch/x86/entry/syscalls/syscall_64.tbl | 1 + arch/x86/kernel/uprobes.c | 83 ++++++++++++++++++++++++++++++++++ include/linux/syscalls.h | 2 + include/linux/uprobes.h | 2 + include/uapi/asm-generic/unistd.h | 5 ++- kernel/events/uprobes.c | 18 ++++++-- kernel/sys_ni.c | 2 + tools/include/linux/compiler.h | 4 ++ tools/testing/selftests/bpf/bpf_testmod/bpf_testmod.c | 119 ++++++++++++++++++++++++++++++++++++++++++++++++- tools/testing/selftests/bpf/prog_tests/uprobe_syscall.c | 230 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ tools/testing/selftests/bpf/progs/uprobe_syscall.c | 15 +++++++ 11 files changed, 475 insertions(+), 6 deletions(-) create mode 100644 tools/testing/selftests/bpf/prog_tests/uprobe_syscall.c create mode 100644 tools/testing/selftests/bpf/progs/uprobe_syscall.c