]> git.ipfire.org Git - thirdparty/linux.git/commit
uprobes/x86: Add uprobe syscall to speed up uprobe
authorJiri Olsa <jolsa@kernel.org>
Sun, 20 Jul 2025 11:21:19 +0000 (13:21 +0200)
committerPeter Zijlstra <peterz@infradead.org>
Thu, 21 Aug 2025 18:09:20 +0000 (20:09 +0200)
commit56101b69c9190667f473b9f93f8b6d8209aaa816
tree4804e46379770549703318f4f45d5bcfd39479b0
parent91440ff4cafad4c86322a612e523f7f021a493e7
uprobes/x86: Add uprobe syscall to speed up uprobe

Adding new uprobe syscall that calls uprobe handlers for given
'breakpoint' address.

The idea is that the 'breakpoint' address calls the user space
trampoline which executes the uprobe syscall.

The syscall handler reads the return address of the initial call
to retrieve the original 'breakpoint' address. With this address
we find the related uprobe object and call its consumers.

Adding the arch_uprobe_trampoline_mapping function that provides
uprobe trampoline mapping. This mapping is backed with one global
page initialized at __init time and shared by the all the mapping
instances.

We do not allow to execute uprobe syscall if the caller is not
from uprobe trampoline mapping.

The uprobe syscall ensures the consumer (bpf program) sees registers
values in the state before the trampoline was called.

Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Acked-by: Andrii Nakryiko <andrii@kernel.org>
Acked-by: Oleg Nesterov <oleg@redhat.com>
Acked-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
Link: https://lore.kernel.org/r/20250720112133.244369-10-jolsa@kernel.org
arch/x86/entry/syscalls/syscall_64.tbl
arch/x86/kernel/uprobes.c
include/linux/syscalls.h
include/linux/uprobes.h
kernel/events/uprobes.c
kernel/sys_ni.c