public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/1] KVM: arm64: Calculate hyp VA size only once
@ 2026-01-13 19:44 Petteri Kangaslampi
  2026-01-13 19:44 ` [PATCH v2 1/1] " Petteri Kangaslampi
  2026-01-14 10:51 ` [PATCH v2 0/1] " Marc Zyngier
  0 siblings, 2 replies; 4+ messages in thread
From: Petteri Kangaslampi @ 2026-01-13 19:44 UTC (permalink / raw)
  To: kvmarm
  Cc: Marc Zyngier, Oliver Upton, Vincent Donnefort, Joey Gouly,
	Suzuki K Poulose, Zenghui Yu, Catalin Marinas, Will Deacon,
	linux-arm-kernel, linux-kernel, Petteri Kangaslampi

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(-)

-- 
2.52.0.457.g6b5491de43-goog


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-01-14 10:51 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-01-13 19:44 [PATCH v2 0/1] KVM: arm64: Calculate hyp VA size only once Petteri Kangaslampi
2026-01-13 19:44 ` [PATCH v2 1/1] " Petteri Kangaslampi
2026-01-14  9:27   ` Vincent Donnefort
2026-01-14 10:51 ` [PATCH v2 0/1] " Marc Zyngier

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox