help, trying to invalidate entire icache on 970

Chris Friesen cfriesen at
Wed Apr 6 03:33:23 EST 2005

I'm having issues with some code that is supposed to invalidate the 
entire icache on a 970.

I have a little test app in userspace that overwrites an instruction and 
calls some kernel code to invalidate the whole cache.  Unfortunately, 
sometimes the new instruction doesn't get run, and if I start a kernel 
build in the background, it occurs quite frequently.

The kernel code is accessed via an ioctl() on a device node, and it 
looks like this:


repeated 513 times:
b 128
<31 nops>


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?


More information about the Linuxppc64-dev mailing list