]> git.ipfire.org Git - thirdparty/linux.git/commit
unwind_user/deferred: Add unwind_user_faultable()
authorSteven Rostedt <rostedt@goodmis.org>
Tue, 29 Jul 2025 18:23:06 +0000 (14:23 -0400)
committerSteven Rostedt (Google) <rostedt@goodmis.org>
Tue, 29 Jul 2025 18:46:07 +0000 (14:46 -0400)
commit5e32d0f15cc5c843a4115c4644d984d42524c794
treef4a31493626af2c675bb1032ce0726916bd7bf4f
parent71753c6ed2bf2aee5be26c1bc06a94c9e3713ade
unwind_user/deferred: Add unwind_user_faultable()

Add a new API to retrieve a user space callstack called
unwind_user_faultable(). The difference between this user space stack
tracer from the current user space stack tracer is that this must be
called from faultable context as it may use routines to access user space
data that needs to be faulted in.

It can be safely called from entering or exiting a system call as the code
can still be faulted in there.

This code is based on work by Josh Poimboeuf's deferred unwinding code:

Link: https://lore.kernel.org/all/6052e8487746603bdb29b65f4033e739092d9925.1737511963.git.jpoimboe@kernel.org/
Cc: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Cc: Josh Poimboeuf <jpoimboe@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Arnaldo Carvalho de Melo <acme@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Andrii Nakryiko <andrii@kernel.org>
Cc: Indu Bhagat <indu.bhagat@oracle.com>
Cc: "Jose E. Marchesi" <jemarch@gnu.org>
Cc: Beau Belgrave <beaub@linux.microsoft.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Jens Axboe <axboe@kernel.dk>
Cc: Florian Weimer <fweimer@redhat.com>
Cc: Sam James <sam@gentoo.org>
Link: https://lore.kernel.org/20250729182405.147896868@kernel.org
Reviewed-by: Jens Remus <jremus@linux.ibm.com>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
include/linux/sched.h
include/linux/unwind_deferred.h [new file with mode: 0644]
include/linux/unwind_deferred_types.h [new file with mode: 0644]
kernel/fork.c
kernel/unwind/Makefile
kernel/unwind/deferred.c [new file with mode: 0644]