Subject: Re: pmap_protect() implementation
To: None <port-mips@netbsd.org>
From: Toru Nishimura <nisimura@itc.aist-nara.ac.jp>
List: port-mips
Date: 03/30/2000 09:53:15
>>                         MachTLBUpdate(sva | asid, entry);
>>                 }
>>         }
>> 
>> When pmap_protect() is called by uvmspace_fork1(), code above fills a
>> bunch of entries into TLB which has only the capacity of 56, I think.
>
> Perhaps we need a different TLBUpdate that only updates current entries,
> but does not enter new ones?

The code above does TBIA() on fork operation in effect.  oh, boy,
that's too bad. 

Following sequence could be done here, instead. 

    [1] bump parent's (probably it's the process executing the code) ASID  
    [2] reset processor's current ASID with new one in the case

It's unfortunate we has to invalidate _all_ of possible TLB entry in
TLB, but, it's asked for COW.

The real issue resides in pmap_protect() and pmap_page_protect().  I
would rather want to have, pmap_tighten_protect() and
pmap_loosen_protect() in symmetry.  pmap_tighten_protect() potentially
requires TLB invalidation (the way would vary in processors) while
latter won't (potentillay, too). 

Tohru Nishimura