Skip to contentSkip to conversation

KVM: arm64: Fix the upper limit of the walker range

PATCH New Sebastian Ene 1 participant 1 message Jan 14, 2025

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 KVM: arm64: Fix the upper limit of the walker range

Prevent the walker from running into weeds when walking an entire address range.

Fixes b1e57de62cfb4 ("KVM: arm64: Add stand-alone page-table walker

infrastructure")

---
 arch/arm64/kvm/hyp/pgtable.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/kvm/hyp/pgtable.c +1 -1
index 40bd55966..2ffb5571e 100644
@@ -260,7 +260,7 @@ static int _kvm_pgtable_walk(struct kvm_pgtable *pgt, struct kvm_pgtable_walk_da
 {
 	u32 idx;
 	int ret = 0;
-	u64 limit = BIT(pgt->ia_bits);
+	u64 limit = BIT(pgt->ia_bits) - 1;
 
 	if (data->addr > limit || data->end > limit)
 		return -ERANGE;
Signature · 1 line
2.47.1.688.g23fc6f90ad-goog