Skip to content

Commit

Permalink
arm64: fix L1 pindex calculation in pmap_growkernel()
Browse files Browse the repository at this point in the history
Use the pmap_l1_pindex() macro which accounts for the NUL2E offset.
While here, use pmap_l2_pindex() macro further down (no change).

Prompted by pull request and commit 2e33abc, making the change for
the riscv pmap.
  • Loading branch information
mhorne committed Aug 30, 2024
1 parent 080c851 commit 38a08e4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions sys/arm64/arm64/pmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -2962,7 +2962,7 @@ pmap_growkernel(vm_offset_t addr)
VM_ALLOC_NOFREE | VM_ALLOC_WIRED | VM_ALLOC_ZERO);
if (nkpg == NULL)
panic("pmap_growkernel: no memory to grow kernel");
nkpg->pindex = kernel_vm_end >> L1_SHIFT;
nkpg->pindex = pmap_l1_pindex(kernel_vm_end);
/* See the dmb() in _pmap_alloc_l3(). */
dmb(ishst);
pmap_store(l1, VM_PAGE_TO_PTE(nkpg) | L1_TABLE);
Expand All @@ -2982,7 +2982,7 @@ pmap_growkernel(vm_offset_t addr)
VM_ALLOC_NOFREE | VM_ALLOC_WIRED | VM_ALLOC_ZERO);
if (nkpg == NULL)
panic("pmap_growkernel: no memory to grow kernel");
nkpg->pindex = kernel_vm_end >> L2_SHIFT;
nkpg->pindex = pmap_l2_pindex(kernel_vm_end);
/* See the dmb() in _pmap_alloc_l3(). */
dmb(ishst);
pmap_store(l2, VM_PAGE_TO_PTE(nkpg) | L2_TABLE);
Expand Down

0 comments on commit 38a08e4

Please sign in to comment.