Subject: bug in uvm_fault_unwire() and pmap_pageable()
To: Jason Thorpe <thorpej@nas.nasa.gov>
From: Chuck Cranor <chuck@research.att.com>
List: tech-kern
Date: 06/21/1999 10:28:00
On Wed, Jun 16, 1999 at 12:25:23PM -0700, Jason Thorpe wrote:
> I think I've discovered a bug in uvm_fault_unwire(), but I think it will
> be fairly straight-forward to fix.
 
> I think the fix is fairly simple:  Make uvm_fault_unwire() lookup the
> map entry or entries for the region being unwired.  Only call
> pmap_change_wiring(..., FALSE) if the entry for the region is not
> wired.
 
hi:  i looked over your problem description and solution and they
both look good to me.   the one thing that confused me are the 
DIAGNOSTIC checks.   you've got:

                /*
                 * make sure the current entry is for the address we're
                 * dealing with.  if not, grab the next entry.
                 */
#ifdef DIAGNOSTIC
                if (va < entry->start)
                        panic("uvm_fault_unwire_locked: hole 1");
#endif
                if (va >= entry->end) {
#ifdef DIAGNOSTIC
                        if (entry->next == &map->header ||
                            entry->next->start > entry->end)
                                panic("uvm_fault_unwire_locked: hole 2");
#endif
                        entry = entry->next;



i was expecting something more like:

		/* make sure the current entry is still valid for the
		 * address we are dealing with.  note that if we hit
		 * a hole in the map then the pmap_extract() call for 
		 * this va failed above and we called panic.
		 */
		if (va >= entry->end) {

#ifdef DIAGNOSTIC
			if (entry->next == &map->header ||
				va != entry->next->start)
				panic("uvm_fault_wired_locked: hole");
#endif
			entry = entry->next;
		}

i think the odds of getting a mis-sorted vm_map_entry chain at this
level are very low since we are not playing games with the chain (unlike,
say in the uvm_map_extract code where we are playing those sorts of games).




On Wed, Jun 16, 1999 at 03:48:02PM -0700, Jason Thorpe wrote:
> Currently, no pmap (except for the Amiga and Atari pmaps which have not yet
> been updated to the other hp300-derived pmaps) implements pmap_pageable().
> ...it's unnecessary (and incorrect in its current use; see my previous mail).
 
i think this is a case where the mach guys were trying to keep options
open for the MD code, but it seems that pmap_pageable() turned out to be
less than useful, so i think nuking it and renaming pmap_change_wiring()
to pmap_unwire() is fine.

chuck