mirror of
https://github.com/freebsd/freebsd-src
synced 2024-10-17 22:04:40 +00:00
If the PDE is known, then use the direct mapping instead of the recursive
mapping to access the PTE.
This commit is contained in:
parent
d1864afbac
commit
767a6e258b
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=189454
|
@ -3801,7 +3801,9 @@ pmap_remove_pages(pmap_t pmap)
|
|||
if ((tpte & PG_PS) != 0)
|
||||
pte = pde;
|
||||
else {
|
||||
pte = vtopte(pv->pv_va);
|
||||
pte = (pt_entry_t *)PHYS_TO_DMAP(tpte &
|
||||
PG_FRAME);
|
||||
pte = &pte[pmap_pte_index(pv->pv_va)];
|
||||
tpte = *pte & ~PG_PTE_PAT;
|
||||
}
|
||||
|
||||
|
@ -4494,7 +4496,7 @@ pmap_change_attr_locked(vm_offset_t va, vm_size_t size, int mode)
|
|||
if (!pmap_demote_pde(kernel_pmap, pde, tmpva))
|
||||
return (ENOMEM);
|
||||
}
|
||||
pte = vtopte(tmpva);
|
||||
pte = pmap_pde_to_pte(pde, tmpva);
|
||||
if (*pte == 0)
|
||||
return (EINVAL);
|
||||
tmpva += PAGE_SIZE;
|
||||
|
@ -4570,7 +4572,7 @@ pmap_change_attr_locked(vm_offset_t va, vm_size_t size, int mode)
|
|||
} else {
|
||||
if (cache_bits_pte < 0)
|
||||
cache_bits_pte = pmap_cache_bits(mode, 0);
|
||||
pte = vtopte(tmpva);
|
||||
pte = pmap_pde_to_pte(pde, tmpva);
|
||||
if ((*pte & PG_PTE_CACHE) != cache_bits_pte) {
|
||||
pmap_pte_attr(pte, cache_bits_pte);
|
||||
if (!changed)
|
||||
|
|
Loading…
Reference in a new issue