Subject: Re: VM change for R4000
To: Toru Nishimura <locore64@alkyltechnology.com>
From: Jason Thorpe <thorpej@shagadelic.org>
List: port-mips
Date: 03/12/2005 17:46:15
On Mar 11, 2005, at 8:59 AM, Toru Nishimura wrote:

> It's impossible to implement 64bit mips pmap.c by porting NetBSD/alpha
> code since alpha cache has never been VIPT.

Another strategy you could use is to always access user pmaps via a 
linear PTE array (recursively mapped like the Alpha VPT), and set up an 
"APTEbase" for accessing non-current pmaps (like i386 does), just 
arrange to have APTEbase at a virtual address such that all of the 
mappings of that array are cache-compatible with PTEbase.  Then PTEbase 
gets switched at context switch time.

For kernel pmaps, you could either do a KSEG table-walk as necessary or 
use another virtually linear PTE array.

> As far as VM forces "index match rule" to all VA (including 2nd or more
> sharing VA) and PA, mixing KSEG access and VA access will make no
> virtual alias condition.

Unfortunately, it is very difficult to enforce at what VA a PA will be 
mapped, and very hard to be that selective about PA if a VA has already 
been selected.  Consider two different programs that map libc at 
different addresses.

-- thorpej