mips32_flush_cache routine corrupts CP0_STATUS with gcc-2.96
Quoted 3 lines · Gleb O. Raiko
instruction. CPU knows the stalled instruction is in I-cache, but, unfortunately, caches have been swapped already. The same cacheline in the D-cache was valid bit set. CPU get data instead of code.
I'm glad this cache swapping mess is not necessary for mips32 chips. I imagine that when the caches are swapped the instruction fetch will examine the D-cache so it will not 'know' the instruction is in the I-cache. If the address is present in both caches then the content should be the same. If the cache routines have some self-modifying code then this really is asking for trouble.
Jon