Skip to content

Commit 5da3a3b

Browse files
author
Marc Zyngier
committed
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 <[email protected]> Signed-off-by: Marc Zyngier <[email protected]>
1 parent dd82412 commit 5da3a3b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

arch/arm64/kvm/at.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -448,11 +448,11 @@ static int walk_s1(struct kvm_vcpu *vcpu, struct s1_walk_info *wi,
448448

449449
switch (BIT(wi->pgshift)) {
450450
case SZ_4K:
451-
valid_block = level == 1 || level == 2;
451+
valid_block = level == 1 || level == 2 || (wi->pa52bit && level == 0);
452452
break;
453453
case SZ_16K:
454454
case SZ_64K:
455-
valid_block = level == 2;
455+
valid_block = level == 2 || (wi->pa52bit && level == 1);
456456
break;
457457
}
458458

0 commit comments

Comments
 (0)