Skip to content

arm64: stacktrace: unify unwind code

Mark Rutland linux-arm-kernel 2 versions – Applied

Status from this message: Applied to arm64 (for-next/stacktrace), thanks!

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest9 patches 4 repliesApplied
  2. v19 patches 8 repliesSuperseded

Patches in v2 Applied

#Subject and filesSizeRepliesApplied
1/9arch: Make ARCH_STACKWALK independent of STACKTRACEarch/arm64/kernel/stacktrace.c arch/powerpc/kernel/Makefile arch/riscv/kernel/stacktrace.c +3 more+21 -301 reply
2/9arm64: Add comment for stack_info::kr_curarch/arm64/include/asm/stacktrace.h+4 -00 replies
3/9arm64: Mark __switch_to() as __schedarch/arm64/kernel/process.c+2 -11 reply
4/9arm64: Make perf_callchain_kernel() use arch_stack_walk()arch/arm64/kernel/perf_callchain.c+3 -120 replies
5/9arm64: Make __get_wchan() use arch_stack_walk()arch/arm64/kernel/process.c+25 -171 reply
6/9arm64: Make return_address() use arch_stack_walk()arch/arm64/kernel/return_address.c+2 -60 replies
7/9arm64: Make profile_pc() use arch_stack_walk()arch/arm64/kernel/time.c+13 -120 replies
8/9arm64: Make dump_backtrace() use arch_stack_walk()arch/arm64/kernel/stacktrace.c+6 -380 replies
9/9arm64: Make some stacktrace functions privatearch/arm64/include/asm/stacktrace.h arch/arm64/kernel/stacktrace.c+7 -110 replies

Reviews trailers per patch

8 of 9 patches have a Reviewed-by or Acked-by.

PatchMark BrownMasami HiramatsuMark Rutland
1/9
2/9Reviwed-by R-b
3/9R-b
4/9R-b T-b R-b
5/9R-b
6/9R-b T-b R-b
7/9R-b R-b
8/9R-b
9/9R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 3 reviewers.

Read the v2 thread

Cover letter [PATCH v2 0/9] arm64: stacktrace: unify unwind code

For historical reasons arm64 has a number of open-coded unwind functions. We'd like to unify these to reduce the amount of unwind code we have to expose, and to make it easier for subsequent patches to rework the unwind code for RELIABLE_STACKTRACE.

These patches unify the various unwinders using arch_stack_walk(). So that we can use arch_stack_walk() without having to expose /proc/${PID}/stack, I've picked Peter's patch decoupling ARCH_STACKWALK from STACKTRACE, which was previously posted at:

https://lore.kernel.org/lkml/[email protected]/

As the direction of travel seems to be to not unify the get_wchan() implementations, Peter suggested I pick the patch for now. This is the only patch in the series touching other architectures.

The bulk of the series was perviously posted in Madhavan's series adding reliability checks to the unwinder:

https://lore.kernel.org/linux-arm-kernel/[email protected]/

I have made some minor tweaks and updated each commit message to explain why the transformation is safe. Largely the changes should have no functional effect, but in a couple of cases there is a (benign and/or desirable) functional change, which is described in the relevant commit message.

To make it possible for get_wchan() to use arch_stack_walk(), and to correct the expected behaviour of stack_trace_consume_entry_nosched() and stack_trace_save_tsk(), we need to mark arm64's __switch_to() as __sched, for which I've added a preparatory patch.

Since v1 [1]:
* Add necessary includes of <linux/stacktrace.h>
* Remove unnecessary includes of <asm/stacktrace.h>
* Rebase to v5.16-rc3

[1] https://lore.kernel.org/r/[email protected]/

Thanks,
Mark.

Madhavan T. Venkataraman (5):
arm64: Make perf_callchain_kernel() use arch_stack_walk()
arm64: Make __get_wchan() use arch_stack_walk()
arm64: Make return_address() use arch_stack_walk()
arm64: Make profile_pc() use arch_stack_walk()
arm64: Make dump_backtrace() use arch_stack_walk()

Mark Rutland (3):
arm64: Add comment for stack_info::kr_cur
arm64: Mark __switch_to() as __sched
arm64: Make some stacktrace functions private

Peter Zijlstra (1):
arch: Make ARCH_STACKWALK independent of STACKTRACE

 arch/arm64/include/asm/stacktrace.h | 10 ++---
 arch/arm64/kernel/perf_callchain.c  | 15 ++------
 arch/arm64/kernel/process.c         | 45 +++++++++++++---------
 arch/arm64/kernel/return_address.c  |  8 +---
 arch/arm64/kernel/stacktrace.c      | 60 +++++++----------------------
 arch/arm64/kernel/time.c            | 25 ++++++------
 arch/powerpc/kernel/Makefile        |  3 +-
 arch/riscv/kernel/stacktrace.c      |  4 --
 arch/s390/kernel/Makefile           |  3 +-
 arch/x86/kernel/Makefile            |  2 +-
 include/linux/stacktrace.h          | 35 +++++++++--------
 11 files changed, 83 insertions(+), 127 deletions(-)
Signature · 7 lines
2.30.2


_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel