diff --git a/sys/amd64/amd64/pmap.c b/sys/amd64/amd64/pmap.c index c72f5d3882bb..ef5839c8bdc3 100644 --- a/sys/amd64/amd64/pmap.c +++ b/sys/amd64/amd64/pmap.c @@ -4270,13 +4270,10 @@ pmap_pte_attr(vm_offset_t va, int mode) /* Adjust the cache mode for a 2MB page mapped via a PDE. */ static __inline void -pmap_pde_attr(vm_offset_t va, int mode) +pmap_pde_attr(pd_entry_t *pde, int mode) { - pd_entry_t *pde; u_int opde, npde; - pde = pmap_pde(kernel_pmap, va); - /* * The cache mode bits are all in the low 32-bits of the * PDE, so we can just spin on updating the low 32-bits. @@ -4420,7 +4417,7 @@ pmap_change_attr(vm_offset_t va, vm_size_t size, int mode) for (tmpva = base; size > 0; ) { pde = pmap_pde(kernel_pmap, tmpva); if (*pde & PG_PS) { - pmap_pde_attr(tmpva, mode); + pmap_pde_attr(pde, mode); tmpva += NBPDR; size -= NBPDR; } else {