mirror of
https://github.com/freebsd/freebsd-src.git
synced 2024-12-04 21:09:28 +00:00
Don't invalidate the TLB in pmap_qenter() unless the old mapping was valid.
Most often, it isn't. Reviewed by: tegge@
This commit is contained in:
parent
ed0b0e826e
commit
b74a62d602
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=159546
@ -1006,17 +1006,22 @@ pmap_map(vm_offset_t *virt, vm_paddr_t start, vm_paddr_t end, int prot)
|
||||
* Note: SMP coherent. Uses a ranged shootdown IPI.
|
||||
*/
|
||||
void
|
||||
pmap_qenter(vm_offset_t sva, vm_page_t *m, int count)
|
||||
pmap_qenter(vm_offset_t sva, vm_page_t *ma, int count)
|
||||
{
|
||||
vm_offset_t va;
|
||||
pt_entry_t *endpte, oldpte, *pte;
|
||||
|
||||
va = sva;
|
||||
while (count-- > 0) {
|
||||
pmap_kenter(va, VM_PAGE_TO_PHYS(*m));
|
||||
va += PAGE_SIZE;
|
||||
m++;
|
||||
oldpte = 0;
|
||||
pte = vtopte(sva);
|
||||
endpte = pte + count;
|
||||
while (pte < endpte) {
|
||||
oldpte |= *pte;
|
||||
pte_store(pte, VM_PAGE_TO_PHYS(*ma) | PG_G | PG_RW | PG_V);
|
||||
pte++;
|
||||
ma++;
|
||||
}
|
||||
pmap_invalidate_range(kernel_pmap, sva, va);
|
||||
if ((oldpte & PG_V) != 0)
|
||||
pmap_invalidate_range(kernel_pmap, sva, sva + count *
|
||||
PAGE_SIZE);
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -1057,17 +1057,22 @@ pmap_map(vm_offset_t *virt, vm_paddr_t start, vm_paddr_t end, int prot)
|
||||
* Note: SMP coherent. Uses a ranged shootdown IPI.
|
||||
*/
|
||||
void
|
||||
pmap_qenter(vm_offset_t sva, vm_page_t *m, int count)
|
||||
pmap_qenter(vm_offset_t sva, vm_page_t *ma, int count)
|
||||
{
|
||||
vm_offset_t va;
|
||||
pt_entry_t *endpte, oldpte, *pte;
|
||||
|
||||
va = sva;
|
||||
while (count-- > 0) {
|
||||
pmap_kenter(va, VM_PAGE_TO_PHYS(*m));
|
||||
va += PAGE_SIZE;
|
||||
m++;
|
||||
oldpte = 0;
|
||||
pte = vtopte(sva);
|
||||
endpte = pte + count;
|
||||
while (pte < endpte) {
|
||||
oldpte |= *pte;
|
||||
pte_store(pte, VM_PAGE_TO_PHYS(*ma) | pgeflag | PG_RW | PG_V);
|
||||
pte++;
|
||||
ma++;
|
||||
}
|
||||
pmap_invalidate_range(kernel_pmap, sva, va);
|
||||
if ((oldpte & PG_V) != 0)
|
||||
pmap_invalidate_range(kernel_pmap, sva, sva + count *
|
||||
PAGE_SIZE);
|
||||
}
|
||||
|
||||
/*
|
||||
|
Loading…
Reference in New Issue
Block a user