Skip to content

KVM: arm64: Calculate hyp VA size only once

Petteri Kangaslampi kvmarm linux-arm-kernel lkml 1 version Applied

Status from this message: Applied to next, thanks!

Get series with b4
b4 am [email protected]

Versions newest first

  1. v2 Latest1 patch 2 repliesApplied

Patches in v2 Applied

#Subject and filesSizeRepliesApplied
1/1KVM: arm64: Calculate hyp VA size only oncearch/arm64/include/asm/kvm_mmu.h arch/arm64/kvm/arm.c arch/arm64/kvm/mmu.c +1 more+36 -321 reply

Reviews trailers per patch

The patch has no Reviewed-by or Acked-by.

PatchVincent Donnefort
1/1T-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [PATCH v2 0/1] KVM: arm64: Calculate hyp VA size only once

All,

Here's a reworked fix to keep VA size calculations consistent between the MMU and layout initialization code paths.

Previously, if the kernel was configured with a VA size of less than 48 bits (like happens in our environment), the assumptions used to calculate hyp_physvirt_offset in kvm_compute_layout() and the code that determines the VA size used in the rest of the system (calculated in kvm_mmu_init()) would get out of sync. This could eventually result in mapping failures.

The patch here is against 6.19-rc4 and tested in default, nVHE, and pKVM configurations thanks to help from Vincent Donnefort. Detailed knowledge of the address map remains somewhat distributed inside the codebase, but at least everything now uses the same VA size, and further refactoring is probably best done if/when Will's pKVM changes have been merged.

Petteri Kangaslampi (1):
KVM: arm64: Calculate hyp VA size only once

 arch/arm64/include/asm/kvm_mmu.h |  3 ++-
 arch/arm64/kvm/arm.c             |  4 ++--
 arch/arm64/kvm/mmu.c             | 28 ++++-----------------------
 arch/arm64/kvm/va_layout.c       | 33 +++++++++++++++++++++++++++-----
 4 files changed, 36 insertions(+), 32 deletions(-)
Signature · 1 line
2.52.0.457.g6b5491de43-goog