> By the way, in case you are not familiar with the problem, watch
> out for the R4600 errata in regard to index invalidate. Basically,
> you need to disable interrupts while using the index invalidate
> and index writeback invalidate instructions on R4600 Rev. 1.7, so that
> invalidating a given line in one set is atomic with invalidating
> the corresponding line in the second set. You can turn on interrupts
> periodically, but it is important to do both sets for a given index
> at the same time, without the possibility of an interrupt or exception.
> The errata can result in the same line winding up in both sets,
> leading to stale data. The bug is not present in the R4600 Rev. 2.0
> or the R5000.
There is a more elegant solution for this bug. Just leave the interrupts
as they are and invalidate set b before set a. Anyway, Linux currently
still handles this erratum by disabling interrupts.