All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/9] arm64: stacktrace: unify unwind code
@ 2021-11-29 14:28 Mark Rutland
  2021-11-29 14:28 ` [PATCH v2 1/9] arch: Make ARCH_STACKWALK independent of STACKTRACE Mark Rutland
                   ` (9 more replies)
  0 siblings, 10 replies; 14+ messages in thread
From: Mark Rutland @ 2021-11-29 14:28 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: aou, borntraeger, bp, broonie, catalin.marinas, dave.hansen, gor,
	hca, madvenka, mark.rutland, mhiramat, mingo, mpe, palmer,
	paul.walmsley, peterz, rostedt, tglx, will

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/20211022152104.356586621@infradead.org/

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/20211015025847.17694-1-madvenka@linux.microsoft.com/

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/20211117140737.44420-1-mark.rutland@arm.com/

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

-- 
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] 14+ messages in thread

end of thread, other threads:[~2021-12-10 18:42 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-29 14:28 [PATCH v2 0/9] arm64: stacktrace: unify unwind code Mark Rutland
2021-11-29 14:28 ` [PATCH v2 1/9] arch: Make ARCH_STACKWALK independent of STACKTRACE Mark Rutland
2021-12-10 14:04   ` Catalin Marinas
2021-11-29 14:28 ` [PATCH v2 2/9] arm64: Add comment for stack_info::kr_cur Mark Rutland
2021-11-29 14:28 ` [PATCH v2 3/9] arm64: Mark __switch_to() as __sched Mark Rutland
2021-11-29 17:03   ` Mark Brown
2021-11-29 14:28 ` [PATCH v2 4/9] arm64: Make perf_callchain_kernel() use arch_stack_walk() Mark Rutland
2021-11-29 14:28 ` [PATCH v2 5/9] arm64: Make __get_wchan() " Mark Rutland
2021-11-29 17:08   ` Mark Brown
2021-11-29 14:28 ` [PATCH v2 6/9] arm64: Make return_address() " Mark Rutland
2021-11-29 14:28 ` [PATCH v2 7/9] arm64: Make profile_pc() " Mark Rutland
2021-11-29 14:28 ` [PATCH v2 8/9] arm64: Make dump_backtrace() " Mark Rutland
2021-11-29 14:28 ` [PATCH v2 9/9] arm64: Make some stacktrace functions private Mark Rutland
2021-12-10 18:41 ` [PATCH v2 0/9] arm64: stacktrace: unify unwind code Catalin Marinas

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.