enforcing page color matches

2011-05-25 Thread Matt Thomas
I modified the mips pmap to drop into ddb if there was an attempt to map a page 
with an incorrect page color (color(VA) != color(PA)).  Then using UVMHIST I 
fixed each cause.  I can now boot a kernel on my matt-nb5-mips64 branch into 
sysinst with no bad color matches.  I'm sure I haven't found all the cases but 
it's a big step forward.

The diffs are relatively minor and are at 
www.netbsd.org/~matt/uvm-color-diffs.txt for your viewing enjoyment.  

I'm using a MIPS 74K which needs strict page-coloring enforcement (4 colors for 
its Icache and 2 colors for its Dcache) so this is important to me.  If this 
can be enforced, the code to deal with bad colors can be removed and that will 
greatly simplify the mips pmap code.



Re: enforcing page color matches

2011-05-25 Thread Masao Uebayashi
What happens if loaning is done?

Masao

On Wed, May 25, 2011 at 4:36 PM, Matt Thomas m...@3am-software.com wrote:
 I modified the mips pmap to drop into ddb if there was an attempt to map a 
 page with an incorrect page color (color(VA) != color(PA)).  Then using 
 UVMHIST I fixed each cause.  I can now boot a kernel on my matt-nb5-mips64 
 branch into sysinst with no bad color matches.  I'm sure I haven't found all 
 the cases but it's a big step forward.

 The diffs are relatively minor and are at 
 www.netbsd.org/~matt/uvm-color-diffs.txt for your viewing enjoyment.

 I'm using a MIPS 74K which needs strict page-coloring enforcement (4 colors 
 for its Icache and 2 colors for its Dcache) so this is important to me.  If 
 this can be enforced, the code to deal with bad colors can be removed and 
 that will greatly simplify the mips pmap code.




Re: enforcing page color matches

2011-05-25 Thread Eduardo Horvath
On Wed, 25 May 2011, Matt Thomas wrote:

 I'm using a MIPS 74K which needs strict page-coloring enforcement (4 colors 
 for its Icache and 2 colors for its Dcache) so this is important to me.  If 
 this can be enforced, the code to deal with bad colors can be removed and 
 that will greatly simplify the mips pmap code.

I don't think that you can get rid of the page coloring code.  What 
happens if you have two processes that have the same file mmap()ed to 
different page colors?  But reducing the need for it is good.

Eduardo


Re: enforcing page color matches

2011-05-25 Thread Matt Thomas

On May 25, 2011, at 8:11 AM, Eduardo Horvath wrote:

 On Wed, 25 May 2011, Matt Thomas wrote:
 
 I'm using a MIPS 74K which needs strict page-coloring enforcement (4 colors 
 for its Icache and 2 colors for its Dcache) so this is important to me.  If 
 this can be enforced, the code to deal with bad colors can be removed and 
 that will greatly simplify the mips pmap code.
 
 I don't think that you can get rid of the page coloring code.  What 
 happens if you have two processes that have the same file mmap()ed to 
 different page colors?  But reducing the need for it is good.

I think the mmap for one of those mappings should fail.

Re: enforcing page color matches

2011-05-25 Thread Matt Thomas

On May 25, 2011, at 7:35 AM, Masao Uebayashi wrote:

 What happens if loaning is done?

I've now fixed socket loaning and pipe loaning to do the right thing.


Re: enforcing page color matches

2011-05-25 Thread Izumi Tsutsui
 I'm using a MIPS 74K which needs strict page-coloring enforcement
 (4 colors for its Icache and 2 colors for its Dcache)
 so this is important to me.

VCEI/VCED handlers on R4400 would also be useful to catch aliases.

---
Izumi Tsutsui