[PATCH 0/2] KVM: arm64: Handle unsupported guest translation granules
From: Wei-Lin Chang
Date: Mon Apr 06 2026 - 12:47:36 EST
Hi,
This small series fixes the granule size selection for software stage-1
and stage-2 walks. Previously we treat the guest's TCR/VTCR.TGx as-is
and use the encoded granule size for the walks. However this is
incorrect if the granule sizes are not advertised in the guest's
ID_AA64MMFR0_EL1.TGRAN*. The architecture specifies that when an
unsupported size is programed in TGx, it must be treated as an
implemented size. Fix this by choosing an available one while
prioritizing PAGE_SIZE.
The first patch is a refactor to prepare for the fix, and the fix is
implemented in the second patch. I lightly tested for regressions by
booting up nested guests of each page size.
Thanks!
Wei-Lin Chang (2):
KVM: arm64: Factor out TG0/1 decoding of VTCR and TCR
KVM: arm64: Fallback to a supported value for unsupported guest TGx
arch/arm64/kvm/at.c | 121 +++++++++++++++++++++++++--------
arch/arm64/kvm/nested.c | 145 ++++++++++++++++++++++++++++------------
2 files changed, 194 insertions(+), 72 deletions(-)
--
2.43.0