Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/arm32/arm32 Fix the vunmapbuf() problem, by zeroing...



details:   https://anonhg.NetBSD.org/src/rev/4765a217f178
branches:  trunk
changeset: 467732:4765a217f178
user:      mycroft <mycroft%NetBSD.org@localhost>
date:      Sun Mar 28 06:35:38 1999 +0000

description:
Fix the vunmapbuf() problem, by zeroing out the PTEs before freeing the VA
range.  This is reasonable given that we inserted the PTEs manually in the
first place.
Also try to use specific cache/TLB purges.

diffstat:

 sys/arch/arm32/arm32/vm_machdep.c |  36 ++++++++++++++++++++++++++++--------
 1 files changed, 28 insertions(+), 8 deletions(-)

diffs (80 lines):

diff -r dce72f84ca7f -r 4765a217f178 sys/arch/arm32/arm32/vm_machdep.c
--- a/sys/arch/arm32/arm32/vm_machdep.c Sun Mar 28 06:17:40 1999 +0000
+++ b/sys/arch/arm32/arm32/vm_machdep.c Sun Mar 28 06:35:38 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: vm_machdep.c,v 1.36 1999/03/26 22:00:25 mycroft Exp $  */
+/*     $NetBSD: vm_machdep.c,v 1.37 1999/03/28 06:35:38 mycroft Exp $  */
 
 /*
  * Copyright (c) 1994-1998 Mark Brinicombe.
@@ -338,10 +338,12 @@
        if ((bp->b_flags & B_PHYS) == 0)
                panic("vmapbuf");
 
-       faddr = trunc_page(bp->b_saveaddr = bp->b_data);
+       taddr = uvm_km_valloc_wait(phys_map, len);
+
+       faddr = trunc_page(bp->b_data);
        off = (vm_offset_t)bp->b_data - faddr;
        len = round_page(off + len);
-       taddr = uvm_km_valloc_wait(phys_map, len);
+       bp->b_saveaddr = bp->b_data;
        bp->b_data = (caddr_t)(taddr + off);
 
        /*
@@ -362,11 +364,14 @@
                cpu_cache_purgeID();
 
        do {
-               *fpte = (*fpte) & ~(PT_C | PT_B);
                *tpte++ = *fpte++;
                len -= PAGE_SIZE;
        } while (len > 0);
-       cpu_tlb_flushID();
+
+       if (len <= 0x1000)
+               cpu_tlb_flushID_SE(taddr);
+       else
+               cpu_tlb_flushID();
 }
 
 /*
@@ -380,6 +385,7 @@
        vm_size_t len;
 {
        vm_offset_t addr, off;
+       pt_entry_t *pte;
 
 #ifdef PMAP_DEBUG
        if (pmap_debug_level >= 0)
@@ -397,13 +403,27 @@
        addr = trunc_page(bp->b_data);
        off = (vm_offset_t)bp->b_data - addr;
        len = round_page(off + len);
-       uvm_km_free_wakeup(phys_map, addr, len);
        bp->b_data = bp->b_saveaddr;
        bp->b_saveaddr = 0;
 
-       cpu_cache_purgeID_rng(addr, len);
+       pte = pmap_pte(vm_map_pmap(phys_map), addr);
+
+       if (len <= 0x2000)
+               cpu_cache_purgeID_rng(addr, len);
+       else
+               cpu_cache_purgeID();
 
-       cpu_tlb_flushID();
+       do {
+               *pte++ = 0;
+               len -= PAGE_SIZE;
+       } while (len > 0);
+
+       if (len <= 0x1000)
+               cpu_tlb_flushID_SE(addr);
+       else
+               cpu_tlb_flushID();
+
+       uvm_km_free_wakeup(phys_map, addr, len);
 }
 
 /*



Home | Main Index | Thread Index | Old Index