On 10/09/2017 22:24, Joshua Kinard wrote: [snip] > This raises the question of why was the standard "kernel_uses_llsc" case > changed but not the R10000_LLSC_WAR case? The changes seem like they would be > applicable to the older R10K CPUs regardless, since this is before a lot of the > code for the newer ISAs (R2+) was added. I am getting a funny feeling that a > lot of these templates need to be re-written (maybe even in plain C, given > newer gcc's better intelligence) and other useful cleanups done. I am not > fluent in MIPS asm enough, though, to know what to change. Answered one of my own questions via this buried commit from ~2006/2007 that has a commit message, but no changed files: https://git.linux-mips.org/cgit/ralf/linux.git/commit/arch/mips/include/asm/atomic.h?id=5999eca25c1fd4b9b9aca7833b04d10fe4bc877d > [MIPS] Improve branch prediction in ll/sc atomic operations. > Now that finally all supported versions of binutils have functioning > support for .subsection use .subsection to tweak the branch prediction > > I did not modify the R10000 errata variants because it seems unclear if > this will invalidate the workaround which actually relies on the cheesy > prediction of branch likely to cause a misspredict if the sc was > successful. > > Signed-off-by: Ralf Baechle <ralf@xxxxxxxxxxxxxx> Seems like that second paragraph is a ripe candidate for a comment block so this is better documented :) -- Joshua Kinard Gentoo/MIPS kumba@xxxxxxxxxx 6144R/F5C6C943 2015-04-27 177C 1972 1FB8 F254 BAD0 3E72 5C63 F4E3 F5C6 C943 "The past tempts us, the present confuses us, the future frightens us. And our lives slip away, moment by moment, lost in that vast, terrible in-between." --Emperor Turhan, Centauri Republic