amd64 pmap: preset A and M bits for pmap_qenter() and pmap_kenter() mappings
This removes one or two atomic update of the pte on access. Also it makes the pte constant during its lifecycle. Reviewed by: alc, markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D33778
This commit is contained in:
parent
720a892ac6
commit
15964f1cb3
@ -3897,7 +3897,8 @@ pmap_kenter(vm_offset_t va, vm_paddr_t pa)
|
||||
pt_entry_t *pte;
|
||||
|
||||
pte = vtopte(va);
|
||||
pte_store(pte, pa | X86_PG_RW | X86_PG_V | pg_g | pg_nx);
|
||||
pte_store(pte, pa | pg_g | pg_nx | X86_PG_A | X86_PG_M |
|
||||
X86_PG_RW | X86_PG_V);
|
||||
}
|
||||
|
||||
static __inline void
|
||||
@ -3908,7 +3909,8 @@ pmap_kenter_attr(vm_offset_t va, vm_paddr_t pa, int mode)
|
||||
|
||||
pte = vtopte(va);
|
||||
cache_bits = pmap_cache_bits(kernel_pmap, mode, 0);
|
||||
pte_store(pte, pa | X86_PG_RW | X86_PG_V | pg_g | pg_nx | cache_bits);
|
||||
pte_store(pte, pa | pg_g | pg_nx | X86_PG_A | X86_PG_M |
|
||||
X86_PG_RW | X86_PG_V | cache_bits);
|
||||
}
|
||||
|
||||
/*
|
||||
@ -3967,7 +3969,8 @@ pmap_qenter(vm_offset_t sva, vm_page_t *ma, int count)
|
||||
pa = VM_PAGE_TO_PHYS(m) | cache_bits;
|
||||
if ((*pte & (PG_FRAME | X86_PG_PTE_CACHE)) != pa) {
|
||||
oldpte |= *pte;
|
||||
pte_store(pte, pa | pg_g | pg_nx | X86_PG_RW | X86_PG_V);
|
||||
pte_store(pte, pa | pg_g | pg_nx | X86_PG_A |
|
||||
X86_PG_M | X86_PG_RW | X86_PG_V);
|
||||
}
|
||||
pte++;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user