diff --git a/sys/amd64/amd64/pmap.c b/sys/amd64/amd64/pmap.c index 13b40b2f6aab..06003c98f517 100644 --- a/sys/amd64/amd64/pmap.c +++ b/sys/amd64/amd64/pmap.c @@ -39,7 +39,7 @@ * SUCH DAMAGE. * * from: @(#)pmap.c 7.7 (Berkeley) 5/12/91 - * $Id: pmap.c,v 1.29 1994/08/06 10:25:36 davidg Exp $ + * $Id: pmap.c,v 1.30 1994/08/07 13:10:19 davidg Exp $ */ /* @@ -695,7 +695,6 @@ pmap_alloc_pv_entry() * let the kernel see it */ pmap_kenter(pvva, VM_PAGE_TO_PHYS(m)); - tlbflush(); entry = (pv_entry_t) pvva; /* @@ -1345,9 +1344,17 @@ pmap_kenter(va, pa) register vm_offset_t pa; { register pt_entry_t *pte; + int wasvalid = 0; + pte = vtopte(va); + if (*pte) + wasvalid++; + *pte = (pt_entry_t) ( (int) (pa | PG_RW | PG_V | PG_W)); + + if (wasvalid) + tlbflush(); } /* diff --git a/sys/amd64/amd64/vm_machdep.c b/sys/amd64/amd64/vm_machdep.c index d570b6bd3098..906ea751623d 100644 --- a/sys/amd64/amd64/vm_machdep.c +++ b/sys/amd64/amd64/vm_machdep.c @@ -38,7 +38,7 @@ * * from: @(#)vm_machdep.c 7.3 (Berkeley) 5/13/91 * Utah $Hdr: vm_machdep.c 1.16.1.1 89/06/23$ - * $Id: vm_machdep.c,v 1.24 1994/08/06 10:25:37 davidg Exp $ + * $Id: vm_machdep.c,v 1.25 1994/08/07 03:31:52 davidg Exp $ */ #include "npx.h" @@ -243,7 +243,6 @@ int count; pa = vm_bounce_page_find(1); pmap_kenter(kva + i * NBPG, pa); } - pmap_update(); return kva; } @@ -356,7 +355,6 @@ vm_bounce_alloc(bp) * if we are writing, the copy the data into the page */ if ((bp->b_flags & B_READ) == 0) { - pmap_update(); bcopy((caddr_t) va, (caddr_t) kva + (NBPG * i), NBPG); } } else { @@ -367,7 +365,6 @@ vm_bounce_alloc(bp) } va += NBPG; } - pmap_update(); /* * flag the buffer as being bounced @@ -677,7 +674,6 @@ pagemove(from, to, size) to += PAGE_SIZE; size -= PAGE_SIZE; } - pmap_update(); } /* @@ -761,7 +757,6 @@ vmapbuf(bp) addr += PAGE_SIZE; kva += PAGE_SIZE; } - pmap_update(); } /* diff --git a/sys/i386/i386/pmap.c b/sys/i386/i386/pmap.c index 13b40b2f6aab..06003c98f517 100644 --- a/sys/i386/i386/pmap.c +++ b/sys/i386/i386/pmap.c @@ -39,7 +39,7 @@ * SUCH DAMAGE. * * from: @(#)pmap.c 7.7 (Berkeley) 5/12/91 - * $Id: pmap.c,v 1.29 1994/08/06 10:25:36 davidg Exp $ + * $Id: pmap.c,v 1.30 1994/08/07 13:10:19 davidg Exp $ */ /* @@ -695,7 +695,6 @@ pmap_alloc_pv_entry() * let the kernel see it */ pmap_kenter(pvva, VM_PAGE_TO_PHYS(m)); - tlbflush(); entry = (pv_entry_t) pvva; /* @@ -1345,9 +1344,17 @@ pmap_kenter(va, pa) register vm_offset_t pa; { register pt_entry_t *pte; + int wasvalid = 0; + pte = vtopte(va); + if (*pte) + wasvalid++; + *pte = (pt_entry_t) ( (int) (pa | PG_RW | PG_V | PG_W)); + + if (wasvalid) + tlbflush(); } /* diff --git a/sys/i386/i386/vm_machdep.c b/sys/i386/i386/vm_machdep.c index d570b6bd3098..906ea751623d 100644 --- a/sys/i386/i386/vm_machdep.c +++ b/sys/i386/i386/vm_machdep.c @@ -38,7 +38,7 @@ * * from: @(#)vm_machdep.c 7.3 (Berkeley) 5/13/91 * Utah $Hdr: vm_machdep.c 1.16.1.1 89/06/23$ - * $Id: vm_machdep.c,v 1.24 1994/08/06 10:25:37 davidg Exp $ + * $Id: vm_machdep.c,v 1.25 1994/08/07 03:31:52 davidg Exp $ */ #include "npx.h" @@ -243,7 +243,6 @@ int count; pa = vm_bounce_page_find(1); pmap_kenter(kva + i * NBPG, pa); } - pmap_update(); return kva; } @@ -356,7 +355,6 @@ vm_bounce_alloc(bp) * if we are writing, the copy the data into the page */ if ((bp->b_flags & B_READ) == 0) { - pmap_update(); bcopy((caddr_t) va, (caddr_t) kva + (NBPG * i), NBPG); } } else { @@ -367,7 +365,6 @@ vm_bounce_alloc(bp) } va += NBPG; } - pmap_update(); /* * flag the buffer as being bounced @@ -677,7 +674,6 @@ pagemove(from, to, size) to += PAGE_SIZE; size -= PAGE_SIZE; } - pmap_update(); } /* @@ -761,7 +757,6 @@ vmapbuf(bp) addr += PAGE_SIZE; kva += PAGE_SIZE; } - pmap_update(); } /* diff --git a/sys/kern/vfs_bio.c b/sys/kern/vfs_bio.c index 31f43eec73d4..61a347612e1c 100644 --- a/sys/kern/vfs_bio.c +++ b/sys/kern/vfs_bio.c @@ -16,7 +16,7 @@ * 4. Modifications may be freely made to this file if the above conditions * are met. * - * $Id: vfs_bio.c,v 1.5 1994/08/04 19:43:13 davidg Exp $ + * $Id: vfs_bio.c,v 1.6 1994/08/06 09:15:28 davidg Exp $ */ #include @@ -692,7 +692,6 @@ vm_hold_load_pages(vm_offset_t froma, vm_offset_t toa) { vm_page_wire(p); pmap_kenter( pg, VM_PAGE_TO_PHYS(p)); } - pmap_update(); } void @@ -707,7 +706,6 @@ vm_hold_free_pages(vm_offset_t froma, vm_offset_t toa) { pmap_kremove( pg); vm_page_free(p); } - pmap_update(); } void diff --git a/sys/vm/vm_kern.c b/sys/vm/vm_kern.c index 202ca631be0c..c64c2df99644 100644 --- a/sys/vm/vm_kern.c +++ b/sys/vm/vm_kern.c @@ -61,7 +61,7 @@ * any improvements or extensions that they make and grant Carnegie the * rights to redistribute these changes. * - * $Id: vm_kern.c,v 1.4 1994/08/06 09:15:38 davidg Exp $ + * $Id: vm_kern.c,v 1.5 1994/08/07 13:10:39 davidg Exp $ */ /* @@ -373,7 +373,6 @@ kmem_malloc(map, size, canwait) vm_object_unlock(kmem_object); pmap_kenter( addr + i, VM_PAGE_TO_PHYS(m)); } - pmap_update(); vm_map_unlock(map); vm_map_simplify(map, addr); diff --git a/sys/vm/vm_pager.c b/sys/vm/vm_pager.c index 1d39709a6eb9..47d3c3d0a65a 100644 --- a/sys/vm/vm_pager.c +++ b/sys/vm/vm_pager.c @@ -61,7 +61,7 @@ * any improvements or extensions that they make and grant Carnegie the * rights to redistribute these changes. * - * $Id: vm_pager.c,v 1.4 1994/08/06 09:15:40 davidg Exp $ + * $Id: vm_pager.c,v 1.5 1994/08/07 13:10:42 davidg Exp $ */ /* @@ -281,7 +281,6 @@ vm_pager_map_page(m) kva = kmem_alloc_wait(pager_map, PAGE_SIZE); pmap_kenter(kva, VM_PAGE_TO_PHYS(m)); - pmap_update(); return(kva); }