linux/arch/arm64/kvm
Mark Rutland 8df137300d arm64: stacktrace: track all stack boundaries explicitly
Currently we call an on_accessible_stack() callback for each step of the
unwinder, requiring redundant work to be performed in the core of the
unwind loop (e.g. disabling preemption around accesses to per-cpu
variables containing stack boundaries). To prevent unwind loops which go
through a stack multiple times, we have to track the set of unwound
stacks, requiring a stack_type enum which needs to cater for all the
stacks of all possible callees. To prevent loops within a stack, we must
track the prior FP values.

This patch reworks the unwinder to minimize the work in the core of the
unwinder, and to remove the need for the stack_type enum. The set of
accessible stacks (and their boundaries) are determined at the start of
the unwind, and the current stack is tracked during the unwind, with
completed stacks removed from the set of accessible stacks. This makes
the boundary checks more accurate (e.g. detecting overlapped frame
records), and removes the need for separate tracking of the prior FP and
visited stacks.

Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Reviewed-by: Kalesh Singh <kaleshsingh@google.com>
Reviewed-by: Madhavan T. Venkataraman <madvenka@linux.microsoft.com>
Reviewed-by: Mark Brown <broonie@kernel.org>
Cc: Fuad Tabba <tabba@google.com>
Cc: Marc Zyngier <maz@kernel.org>
Cc: Will Deacon <will@kernel.org>
Link: https://lore.kernel.org/r/20220901130646.1316937-9-mark.rutland@arm.com
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
2022-09-09 12:30:08 +01:00
..
hyp arm64: stacktrace: track all stack boundaries explicitly 2022-09-09 12:30:08 +01:00
vgic KVM: arm64: vgic: Tidy-up calls to vgic_{get,set}_common_attr() 2022-07-17 11:55:33 +01:00
.gitignore KVM: arm64: Generate hyp_constants.h for the host 2021-12-06 08:37:03 +00:00
arch_timer.c Merge branch kvm-arm64/burn-the-flags into kvmarm-master/next 2022-06-29 10:30:10 +01:00
arm.c KVM/arm64 fixes for 6.0, take #1 2022-08-19 05:43:53 -04:00
debug.c KVM: arm64: Move vcpu debug/SPE/TRBE flags to the input flag set 2022-06-29 10:23:03 +01:00
fpsimd.c KVM: arm64: Move the handling of !FP outside of the fast path 2022-06-29 10:23:56 +01:00
guest.c KVM: arm64: Reject 32bit user PSTATE on asymmetric systems 2022-08-17 10:29:07 +01:00
handle_exit.c Merge branch kvm-arm64/nvhe-stacktrace into kvmarm-master/next 2022-07-27 18:33:27 +01:00
hypercalls.c KVM: arm64: Fix hypercall bitmap writeback when vcpus have already run 2022-05-16 17:40:48 +01:00
inject_fault.c KVM: arm64: Move vcpu PC/Exception flags to the input flag set 2022-06-10 09:54:34 +01:00
irq.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 422 2019-06-05 17:37:15 +02:00
Kconfig KVM: arm64: Move PROTECTED_NVHE_STACKTRACE around 2022-07-27 18:18:03 +01:00
Makefile KVM: arm64: Move nVHE stacktrace unwinding into its own compilation unit 2022-07-27 18:18:03 +01:00
mmio.c KVM: arm64: Generalise VM features into a set of flags 2022-03-18 14:02:33 +00:00
mmu.c KVM: Rename mmu_notifier_* to mmu_invalidate_* 2022-08-19 04:05:41 -04:00
pkvm.c KVM: arm64: Move host EL1 code out of hyp/ directory 2021-12-06 08:37:03 +00:00
pmu-emul.c Merge branch kvm-arm64/per-vcpu-host-pmu-data into kvmarm-master/next 2022-05-16 17:48:36 +01:00
pmu.c KVM: arm64: Pass pmu events to hyp via vcpu 2022-05-15 11:26:41 +01:00
psci.c Merge branch kvm-arm64/psci-suspend into kvmarm-master/next 2022-05-16 17:48:20 +01:00
pvtime.c KVM: arm64: Use kvm_write_guest_lock when init stolen time 2020-12-03 19:02:18 +00:00
reset.c KVM: arm64: Move vcpu configuration flags into their own set 2022-06-09 15:43:46 +01:00
stacktrace.c arm64: stacktrace: track all stack boundaries explicitly 2022-09-09 12:30:08 +01:00
sys_regs.c KVM/arm64 fixes for 6.0, take #1 2022-08-19 05:43:53 -04:00
sys_regs.h KVM: arm64: Descope kvm_arm_sys_reg_{get,set}_reg() 2022-07-17 11:55:33 +01:00
trace_arm.h KVM: Move arm64's MMU notifier trace events to generic code 2021-04-17 08:30:56 -04:00
trace_handle_exit.h KVM: arm64: Upgrade trace_kvm_arm_set_dreg32() to 64bit 2021-08-20 11:12:18 +01:00
trace.h KVM: arm64: Move virt/kvm/arm to arch/arm64 2020-05-16 15:03:59 +01:00
trng.c KVM: arm64: Implement the TRNG hypervisor call 2021-01-25 22:19:31 +00:00
va_layout.c KVM: arm64: Generate final CTR_EL0 value when running in Protected mode 2021-03-25 11:00:33 +00:00
vgic-sys-reg-v3.c KVM: arm64: vgic-v3: Convert userspace accessors over to FIELD_GET/FIELD_PREP 2022-07-17 11:55:33 +01:00
vmid.c KVM: arm64: Fix inconsistent indenting 2022-06-07 15:27:05 +01:00