Subject: Re: panic: pmap_enter onto myself
To: Anders Magnusson <ragge@ludd.luth.se>
From: Jason R Thorpe <thorpej@zembu.com>
List: port-vax
Date: 08/26/2000 09:55:04
On Sat, Aug 26, 2000 at 06:27:11PM +0200, Anders Magnusson wrote:

 > Yes, so do the VAX, but this panic only happens if it is _the_same_ page
 > with the same permissions that it is trying to map on top of the old one.

Ah, well, you have to deal with this, too :-)

From the Alpha pmap_enter():

        if (opa == pa) { 
                /*
                 * Mapping has not changed; must be a protection or
                 * wiring change.
                 */
                if (pmap_pte_w_chg(pte, wired ? PG_WIRED : 0)) {
#ifdef DEBUG    
                        if (pmapdebug & PDB_ENTER)
                                printf("pmap_enter: wiring change -> %d\n",
                                    wired);
#endif                   
                        /*
                         * Adjust the wiring count.
                         */
                        if (wired)
                                PMAP_STAT_INCR(pmap->pm_stats.wired_count, 1);
                        else
                                PMAP_STAT_DECR(pmap->pm_stats.wired_count, 1);
                }

                /*
                 * Set the PTE.
                 */
                goto validate;
        }

So, the thing that could have changed is the "wired" attribute.  This
is a purely software attribute, that communicates "this mapping is not
forgettable" to the pmap layer.

-- 
        -- Jason R. Thorpe <thorpej@zembu.com>