Subject: Re: panic: pmap_remove_pv: lost entry
To: Matthias Scheler <tron@lyssa.owl.de>
From: Bill Sommerfeld <sommerfeld@orchard.arlington.ma.us>
List: port-arm32
Date: 03/28/1999 15:32:33
> In article <199903271756.RAA20495@orchard.arlington.ma.us>,
> 	Bill Sommerfeld <sommerfeld@orchard.arlington.ma.us> writes:
> > I'm seeing the panic reported in PR7259 by Matthias Scheler.
> 
> Charles last change to "src/sys/arch/arm32/arm32/vm_machdep.c" fixes
> it.

Well, it cured the panic, but it also ended up leaking kernel VA
space.  fsck would run for a while and then block in
uvm_km_valloc_wait..

It turns out that the fix wound up zeroing `len' as a side effect,
when it was still needed later on in the function...

I just committed the following, which appears to fix the problem:

diff -u -r1.37 -r1.38
--- vm_machdep.c        1999/03/28 06:35:38     1.37
+++ vm_machdep.c        1999/03/28 20:21:51     1.38
@@ -386,6 +386,7 @@
 {
        vm_offset_t addr, off;
        pt_entry_t *pte;
+       int tlen;
 
 #ifdef PMAP_DEBUG
        if (pmap_debug_level >= 0)
@@ -413,10 +414,11 @@
        else
                cpu_cache_purgeID();
 
+       tlen = len;
        do {
                *pte++ = 0;
-               len -= PAGE_SIZE;
-       } while (len > 0);
+               tlen -= PAGE_SIZE;
+       } while (tlen > 0);
 
        if (len <= 0x1000)
                cpu_tlb_flushID_SE(addr);