[PATCH 0/1] KVM: arm64: Fix hyp VA size between layout and MMU
Petteri Kangaslampi
pekangas at google.com
Tue Dec 23 11:34:39 PST 2025
All,
In the KVM initialization code, kvm_mmu_init() and
kvm_compute_layout() use different logic when determining the
hypervisor's virtual address space size. Specifically, the MMU code
uses the larger of vabits_actual (the kernel's VA size) and
IDMAP_VA_BITS (48 bits), while the VA layout code just uses the
kernel's VA size.
This means that if the kernel is configured with a VA size of less
than 48 bits (like happens in our environment), the assumptions used
to calculate hyp_physvirt_offset and the code that determines VA
ranges to use for mappings in hyp/nvhe/mm.c get out of sync, which can
results in mapping failures.
The immediate fix is pretty obvious and attached here. This is against
6.12 but I don't think this code has changed recently. I think longer
term refactoring knowledge of the hypervisor's address space into one
place might be helpful; currently it is a bit spread out.
Petteri Kangaslampi (1):
KVM: arm64: Fix hyp VA size between layout and MMU
arch/arm64/kvm/va_layout.c | 17 ++++++++++++-----
1 file changed, 12 insertions(+), 5 deletions(-)
--
2.52.0.351.gbe84eed79e-goog
More information about the linux-arm-kernel
mailing list