]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: arm64: Make unwind()/on_accessible_stack() per-unwinder functions
authorMarc Zyngier <maz@kernel.org>
Wed, 27 Jul 2022 14:29:03 +0000 (15:29 +0100)
committerMarc Zyngier <maz@kernel.org>
Wed, 27 Jul 2022 17:18:03 +0000 (18:18 +0100)
commitcb82b37dd35657b1ae3f1244a23e810972cc47f0
tree0cbf96bc70560cc826d5d1334bce530e1269b75c
parent67db998b0fda274116565f7f05ab1963b001af2a
KVM: arm64: Make unwind()/on_accessible_stack() per-unwinder functions

Having multiple versions of on_accessible_stack() (one per unwinder)
makes it very hard to reason about what is used where due to the
complexity of the various includes, the forward declarations, and
the reliance on everything being 'inline'.

Instead, move the code back where it should be. Each unwinder
implements:

- on_accessible_stack() as well as the helpers it depends on,

- unwind()/unwind_next(), as they pass on_accessible_stack as
  a parameter to unwind_next_common() (which is the only common
  code here)

This hardly results in any duplication, and makes it much
easier to reason about the code.

Signed-off-by: Marc Zyngier <maz@kernel.org>
Reviewed-by: Kalesh Singh <kaleshsingh@google.com>
Tested-by: Kalesh Singh <kaleshsingh@google.com>
Reviewed-by: Oliver Upton <oliver.upton@linux.dev>
Link: https://lore.kernel.org/r/20220727142906.1856759-4-maz@kernel.org
arch/arm64/include/asm/stacktrace.h
arch/arm64/include/asm/stacktrace/common.h
arch/arm64/include/asm/stacktrace/nvhe.h
arch/arm64/kernel/stacktrace.c
arch/arm64/kvm/hyp/nvhe/stacktrace.c
arch/arm64/kvm/stacktrace.c