aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Turner <andrew@FreeBSD.org>2022-03-10 14:40:38 +0000
committerAndrew Turner <andrew@FreeBSD.org>2022-03-15 09:51:41 +0000
commit5e2f304cb4c7c2a8fdd8760ac53ed87d2df055f5 (patch)
tree30918a0d01e71502ca2640ed35e8e4e6b2e7a6d0
parent0977ebb07152199f27174177a3640ee7264ca592 (diff)
downloadsrc-5e2f304cb4c7c2a8fdd8760ac53ed87d2df055f5.tar.gz
src-5e2f304cb4c7c2a8fdd8760ac53ed87d2df055f5.zip
Fix calculating l0index in _pmap_alloc_l3 on arm64
When moving from the l1 index to l0 index we need to use the l1 shift value not the l0 shift value. With 4k pages they are identical, however with 16k pages we only have 2 l0 entries so the shift value is incorrect. Reviewed by: alc, markj Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D34517
-rw-r--r--sys/arm64/arm64/pmap.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/arm64/arm64/pmap.c b/sys/arm64/arm64/pmap.c
index 3ad50e57d8e0..1570bf3d0b9c 100644
--- a/sys/arm64/arm64/pmap.c
+++ b/sys/arm64/arm64/pmap.c
@@ -1945,7 +1945,7 @@ _pmap_alloc_l3(pmap_t pmap, vm_pindex_t ptepindex, struct rwlock **lockp)
pd_entry_t tl0;
l1index = ptepindex - NUL2E;
- l0index = l1index >> L0_ENTRIES_SHIFT;
+ l0index = l1index >> Ln_ENTRIES_SHIFT;
l0 = &pmap->pm_l0[l0index];
tl0 = pmap_load(l0);
@@ -1973,7 +1973,7 @@ _pmap_alloc_l3(pmap_t pmap, vm_pindex_t ptepindex, struct rwlock **lockp)
pd_entry_t tl0, tl1;
l1index = ptepindex >> Ln_ENTRIES_SHIFT;
- l0index = l1index >> L0_ENTRIES_SHIFT;
+ l0index = l1index >> Ln_ENTRIES_SHIFT;
l0 = &pmap->pm_l0[l0index];
tl0 = pmap_load(l0);