help, trying to invalidate entire icache on 970

Linas Vepstas linas at austin.ibm.com
Wed Apr 6 07:43:03 EST 2005


On Tue, Apr 05, 2005 at 03:15:42PM -0600, Chris Friesen was heard to remark:
> Friesen, Christopher [CAR:VC21:EXCH] wrote:
> 
> >Basically, I'm trying to do the brute-force method of flushing it, as 
> >described in the 970 manual.  Obviously I'm missing something, but I'm 
> >not sure what.  In case it matters, the machine is dual-cpu.
> >
> >Anyone have any ideas?  Anyone have any such code that works?
> 
> I've switched over to using the en_icbi method of invalidation.  It 
> seems to work, but I'm calling icbi once for every cacheline and that 
> seems suboptimal.
> 
> The manual says that 4 bits of the address are used to index the icache, 
> and thus each icbi call with en_icbi enabled will result in 16 


I'm not quite clear on what you are doing ... but some general remarks:

In general, the caches tend to be n-way set associative. So
invalidating a given cache line will invalidate only one of 
the n ways.  This might explain why you first attempt didn't work. 
I don't know what n is for the 970.  Typically is 2 or 4 for this class
of cpu. It tends to vary from one model to another.

Which "4 bits" are involved tends to vary from one core to another.
Even if you found somethingthat worked on the 970, it might not work on
the next generation, since the address lines would be wired differntly.

Similar remarks apply for the assumption that theres only 16 or 32 cache
blocks or lines or whatever ... 

I'm not sure I know what en_icbi is (have never scanned the 970 docs).
Maybe its invalidating all cache lines that alias to the same address
tag.

Why, again, is it that you can't just call icbi with the address of the
instruction that has been changed? 

--linas



More information about the Linuxppc64-dev mailing list