arm64: stacktrace: factor out kernel unwind state
authorMark Rutland <mark.rutland@arm.com>
Fri, 24 Nov 2023 11:05:10 +0000 (11:05 +0000)
committerWill Deacon <will@kernel.org>
Mon, 11 Dec 2023 11:42:55 +0000 (11:42 +0000)
commit1beef60e7d6b90be826a73f626204f55a4cd7640
treeaa45cf19e73a8fc13e8611e73085bc9900c5577e
parent2cc14f52aeb78ce3f29677c2de1f06c0e91471ab
arm64: stacktrace: factor out kernel unwind state

On arm64 we share some unwinding code between the regular kernel
unwinder and the KVM hyp unwinder. Some of this common code only matters
to the regular unwinder, e.g. the `kr_cur` and `task` fields in the
common struct unwind_state.

We're likely to add more state which only matters for regular kernel
unwinding (or only for hyp unwinding). In preparation for such changes,
this patch factors out the kernel-specific state into a new struct
kunwind_state, and updates the kernel unwind code accordingly.

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

Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Kalesh Singh <kaleshsingh@google.com>
Cc: Madhavan T. Venkataraman <madvenka@linux.microsoft.com>
Cc: Mark Brown <broonie@kernel.org>
Cc: Puranjay Mohan <puranjay12@gmail.com>
Cc: Will Deacon <will@kernel.org>
Reviewed-by: Puranjay Mohan <puranjay12@gmail.com>
Reviewed-by: Kalesh Singh <kaleshsingh@google.com>
Reviewed-by: Madhavan T. Venkataraman <madvenka@linux.microsoft.com>
Reviewed-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20231124110511.2795958-2-mark.rutland@arm.com
Signed-off-by: Will Deacon <will@kernel.org>
arch/arm64/include/asm/stacktrace/common.h
arch/arm64/include/asm/stacktrace/nvhe.h
arch/arm64/kernel/stacktrace.c