]> git.baikalelectronics.ru Git - kernel.git/commit
arm64: Make profile_pc() use arch_stack_walk()
authorMadhavan T. Venkataraman <madvenka@linux.microsoft.com>
Mon, 29 Nov 2021 14:28:47 +0000 (14:28 +0000)
committerCatalin Marinas <catalin.marinas@arm.com>
Fri, 10 Dec 2021 14:06:04 +0000 (14:06 +0000)
commit92653292e6bb66626dd126c02e952532d529564a
treecaa1d4900b1684d1b05f3805956b60b27b8fe997
parent305c08d3cab8fc20b52d7782df42118aa9259f64
arm64: Make profile_pc() use arch_stack_walk()

To enable RELIABLE_STACKTRACE and LIVEPATCH on arm64, we need to
substantially rework arm64's unwinding code. As part of this, we want to
minimize the set of unwind interfaces we expose, and avoid open-coding
of unwind logic outside of stacktrace.c.

Currently profile_pc() walks the stack of an interrupted context by
calling start_backtrace() with the context's PC and FP, and iterating
unwind steps using walk_stackframe(). This is functionally equivalent to
calling arch_stack_walk() with the interrupted context's pt_regs, which
will start with the PC and FP from the regs.

Make profile_pc() use arch_stack_walk(). This simplifies profile_pc(),
and in future will alow us to make walk_stackframe() private to
stacktrace.c.

At the same time, we remove the early return for when regs->pc is not in
lock functions, as this will be handled by the first call to the
profile_pc_cb() callback.

There should be no functional change as a result of this patch.

Signed-off-by: Madhavan T. Venkataraman <madvenka@linux.microsoft.com>
Reviewed-by: Mark Rutland <mark.rutland@arm.com>
[Mark: remove early return, elaborate commit message, fix includes]
Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Reviewed-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20211129142849.3056714-8-mark.rutland@arm.com
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
arch/arm64/kernel/time.c