arm64: stacktrace: Implement arch_stack_walk_reliable()
authorSong Liu <song@kernel.org>
Wed, 21 May 2025 11:10:00 +0000 (12:10 +0100)
committerCatalin Marinas <catalin.marinas@arm.com>
Fri, 20 Jun 2025 12:10:09 +0000 (13:10 +0100)
commit805f13e403cd43bb88790642feef507108af6fc7
treef7eab2a265d63aedc5b75f309c0bf8dad77aad14
parentbeecfd6a88a675e20987e70ec532ba734b230fa4
arm64: stacktrace: Implement arch_stack_walk_reliable()

Add arch_stack_walk_reliable(), which will be used during kernel live
patching to detect when threads have completed executing old versions of
functions.

Note that arch_stack_walk_reliable() only needs to guarantee that it
returns an error code when it cannot provide a reliable stacktrace. It
is not required to provide a reliable stacktrace in all scenarios so
long as it returns said error code.

At present we can only reliably unwind up to an exception boundary. In
future we should be able to improve this with additional data from the
compiler (e.g. sframe).

Signed-off-by: Song Liu <song@kernel.org>
Link: https://lore.kernel.org/r/20250320171559.3423224-2-song@kernel.org
[ Mark: Simplify logic, clarify commit message ]
Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Cc: Andrea della Porta <andrea.porta@suse.com>
Cc: Breno Leitao <leitao@debian.org>
Cc: Josh Poimboeuf <jpoimboe@kernel.org>
Cc: Miroslav Benes <mbenes@suse.cz>
Cc: Petr Mladek <pmladek@suse.com>
Cc: Song Liu <song@kernel.org>
Cc: Will Deacon <will@kernel.org>
Link: https://lore.kernel.org/r/20250521111000.2237470-3-mark.rutland@arm.com
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
arch/arm64/Kconfig
arch/arm64/kernel/stacktrace.c