From: Marc Zyngier Date: Mon, 28 Jul 2025 15:29:56 +0000 (+0100) Subject: KVM: arm64: Expand valid block mappings to FEAT_LPA/LPA2 support X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=5da3a3b27a0108562547086e0ba7d9593f147cfe;p=users%2Fhch%2Fmisc.git KVM: arm64: Expand valid block mappings to FEAT_LPA/LPA2 support With 52bit PAs, block mappings can exist at different levels (such as level 0 for 4kB pages, or level 1 for 16kB and 64kB pages). Account for this in walk_s1(). Reviewed-by: Oliver Upton Signed-off-by: Marc Zyngier --- diff --git a/arch/arm64/kvm/at.c b/arch/arm64/kvm/at.c index d06cf816f848..e740df0d82f8 100644 --- a/arch/arm64/kvm/at.c +++ b/arch/arm64/kvm/at.c @@ -448,11 +448,11 @@ static int walk_s1(struct kvm_vcpu *vcpu, struct s1_walk_info *wi, switch (BIT(wi->pgshift)) { case SZ_4K: - valid_block = level == 1 || level == 2; + valid_block = level == 1 || level == 2 || (wi->pa52bit && level == 0); break; case SZ_16K: case SZ_64K: - valid_block = level == 2; + valid_block = level == 2 || (wi->pa52bit && level == 1); break; }