Subject: Re: compartmentalization of kernel memory
To: None <Richard.Earnshaw@buzzard.freeserve.co.uk>
From: Jason Thorpe <thorpej@wasabisystems.com>
List: tech-kern
Date: 04/08/2003 17:27:31
On Tuesday, April 8, 2003, at 04:28  PM, Richard Earnshaw wrote:

> Unless you are going to limit yourself to 15 processes maximum, then 
> you
> are going to have to support multiple L1s.   So most of the benefit of
> domains (fast context switching, since the virtually-addressed cache
> doesn't need flushing) are lost as soon as you have 3 or 4 L1s that are
> active in the system.

In the pmap that Steve is referring to, multiple L1s are allocated, but 
each L1 can be shared by multiple processes.  The Domain facility is 
used as a "PID" of sorts, and the L1 table is used almost like a 
second-level TLB.

> Finally, domains are rarely used and there are rumours that some chips
> don't implement them properly -- I've no personal experience of using
> them, so I can't be sure of this.

Now that sucks.

There is another problem with using Domains, as well... that is, 
multiple processor support is difficult unless the core supports high 
vectors (there is a race condition when fixing up the DACR on any other 
CPU that is using a L1 table that a process is switching to).

Probably the best solution would be to somehow make the use of Domains 
in Steve's new pmap be conditional.  That way, they can be skipped (and 
the benefits of using them lost, of course) on platforms where using 
them is Hard or where the core is Broken.

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