Subject: Re: map_page() and pinned TLB entries

From: Marcelo Tosatti <[email-masked]>
Date: Thu, 16 Jun 2005 13:47:17 -0300

On Thu, Jun 16, 2005 at 05:13:19PM -0400, Dan Malek wrote:
> 
> On Jun 16, 2005, at 10:47 AM, Marcelo Tosatti wrote:
> 
> >What would be an elegant way of dealing with this? We can insert
> >a conditional there such that only addresses not covered
> >by other mappings (in this case the 8Mbyte entry) get flushed.
> 
> I'd like to make _tlbie() a macro on 8xx that simply tests the VA
> and doesn't invalidate anything in the pinned space.  Of course,
> the code shouldn't be doing this anyway, and I think this
> should be treated as a bug if it happens. 

Well it is expected that mapin_ram() flushes the va for the 
PTE's being created.

That is the only well known occurence of _tlbie() on 
a possibly pinned region. 

I agree that adding a debugging check on _tlbie() to 
catch invalidations in pinned space is a good thing.

> If the Linux VM thinks it needs to be doing this, pinned space 
> isn't going to work. 

Well the VM does that now, but it can be changed to skip the
pinned region. 

>The _tlbie() is an exported symbol, I suspect for MOL, so
> we have to accommodate that.

What does MOL stand for? 

> Thanks.

There are two separate approaches:

a) Fix mapin_ram() to skip pinned regions
b) Fix _tlbie() to skip pinned regions and warn about such
misusage.

If b) is chosen alone, which is what you seem to suggest, we
will get tons of warnings (or traps) anyway from mapin_ram(). 

So having that said, isnt the correct way out of this to change
both a) and b)?