KVM: arm64: Fix nVHE stacktrace VA bits mask
authorVincent Donnefort <vdonnefort@google.com>
Tue, 7 Jan 2025 11:28:21 +0000 (11:28 +0000)
committerMarc Zyngier <maz@kernel.org>
Wed, 8 Jan 2025 11:18:39 +0000 (11:18 +0000)
commit68344037b764401f751c66661c53334ea1e15324
tree280c346d64c2652836e8625f137e3e46ff82a11e
parente8440c1e2d23a9ca5e0af1a18be637cbd5a5d44f
KVM: arm64: Fix nVHE stacktrace VA bits mask

The hypervisor VA space size depends on both the ID map's
(IDMAP_VA_BITS) and the kernel stage-1 (VA_BITS). However, the
hypervisor stacktrace decoding is solely relying on VA_BITS. This is
especially an issue when VA_BITS < IDMAP_VA_BITS (i.e. VA_BITS is
39-bit): the hypervisor may have addresses bigger than the stacktrace is
masking.

Align this mask with hyp_va_bits.

Signed-off-by: Vincent Donnefort <vdonnefort@google.com>
Link: https://lore.kernel.org/r/20250107112821.416591-1-vdonnefort@google.com
Signed-off-by: Marc Zyngier <maz@kernel.org>
arch/arm64/include/asm/kvm_mmu.h
arch/arm64/kvm/mmu.c
arch/arm64/kvm/stacktrace.c