linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] arm64: stacktrace: add kunwind_stack_walk()
@ 2023-11-24 11:05 Mark Rutland
  2023-11-24 11:05 ` [PATCH 1/2] arm64: stacktrace: factor out kernel unwind state Mark Rutland
                   ` (4 more replies)
  0 siblings, 5 replies; 10+ messages in thread
From: Mark Rutland @ 2023-11-24 11:05 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: broonie, catalin.marinas, kaleshsingh, madvenka, mark.rutland,
	puranjay12, will

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(-)

-- 
2.30.2


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2023-12-11 20:28 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-11-24 11:05 [PATCH 0/2] arm64: stacktrace: add kunwind_stack_walk() Mark Rutland
2023-11-24 11:05 ` [PATCH 1/2] arm64: stacktrace: factor out kernel unwind state Mark Rutland
2023-11-27 18:28   ` Kalesh Singh
2023-11-28  8:52   ` Puranjay Mohan
2023-11-24 11:05 ` [PATCH 2/2] arm64: stacktrace: factor out kunwind_stack_walk() Mark Rutland
2023-11-27 18:37   ` Kalesh Singh
2023-11-28  9:17   ` Puranjay Mohan
2023-11-24 12:32 ` [PATCH 0/2] arm64: stacktrace: add kunwind_stack_walk() Mark Brown
2023-11-27 16:31 ` Madhavan T. Venkataraman
2023-12-11 20:27 ` Will Deacon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).