[PATCH 0/2] arm64: stacktrace: add kunwind_stack_walk()

Madhavan T. Venkataraman madvenka at linux.microsoft.com
Mon Nov 27 08:31:30 PST 2023



On 11/24/23 05:05, Mark Rutland wrote:
> Currently arm64 uses the generic arch_stack_walk() interface for all
> stack walking code. This only passes a PC value and cookie to the unwind
> callback, whereas we'd like to pass some additional information in some
> cases. For example, the BPF exception unwinder wants the FP, for
> reliable stacktrace we'll want to perform additional checks on other
> portions of unwind state, and we'd like to expand the information
> printed by dump_backtrace() to include provenance and reliability
> information.
> 
> These patches refactor arm64's stacktrace code into a new
> kunwind_stack_walk() function that provides the full unwind state to
> callback functions. The existing arch_stack_walk() interface is
> unchanged, and is implemented atop kunwind_stack_walk().
> 
> I had originally intended to send this with additional patches that
> would have dump_backtrace() use this to identify and report exception
> boundaries and fgraph/kretprobes PC recovery, but due to LPC and bug
> hunting over the last few weeks I haven't managed to get all of that
> ready just yet.
> 
> Puranjay has a need for this for BPF:
> 
>   https://lore.kernel.org/linux-arm-kernel/20230917000045.56377-1-puranjay12@gmail.com/
> 
> Hence I'm sending this as-is as preparatory rework.
> 
> Thanks,
> Mark.
> 
> Mark Rutland (2):
>   arm64: stacktrace: factor out kernel unwind state
>   arm64: stacktrace: factor out kunwind_stack_walk()
> 
>  arch/arm64/include/asm/stacktrace/common.h |  19 +--
>  arch/arm64/include/asm/stacktrace/nvhe.h   |   2 +-
>  arch/arm64/kernel/stacktrace.c             | 146 ++++++++++++++-------
>  3 files changed, 104 insertions(+), 63 deletions(-)
> 

Reviewed-by: Madhavan T. Venkataraman <madvenka at linux.microsoft.com>



More information about the linux-arm-kernel mailing list