On Fri, 29 Nov 2002, Ralf Baechle wrote: > That's a consequence of the simplemost way to implement ll/sc in hardware. > ll puts the physicall address of the the memory reference into c0_lladdr > and sets the ll-bit. eret clears the ll-bit and finally sc fails if the > ll-bit is cleared. That's the simplest implementation for a non-coherent > uniprocessor, there is not much more needed that a flip-flop and due to > every designers desire for simplicity a different implementation seem > unlikely. Btw, c0_lladdr is just a useless gadget here. Hmm, MIPS doesn't support external invalidation requests for non-coherent areas, so eret/rfe appears to be the only way to reset the LLbit. So we may simply make the option depend on CONFIG_NONCOHERENT_IO=y. It would simplify the CML hassle, too. > It's different for coherent processors, those actually need to snoop on > the bus interface. On those the simplest implementation is ll generates > a cache line in exclusive state; sc then fails if either the ll-bit has > been cleared; the snooping logic clears the ll-bit if the cache-line's > state changes or an eret is executed. So the mechanism fails without > caches. Oh, I think a comparator using CP0.LLAddr for any bus cycles wouldn't be much more complicated if at all. But it would then spuriously fail for noncoherent areas, so the actual implementation is better. So how about the following patch? And yes, the Carsten's argument is valid, too. The option need not necessarily be used to debug Linux -- it may be used to debug hardware or to run on an incomplete implementation. Maciej -- + Maciej W. Rozycki, Technical University of Gdansk, Poland + +--------------------------------------------------------------+ + e-mail: macro@ds2.pg.gda.pl, PGP key available + patch-2.4.20-pre6-20021129-mips-uncached-0 --- linux/arch/mips/config-shared.in.macro Fri Nov 22 13:28:35 2002 +++ linux/arch/mips/config-shared.in Fri Nov 29 14:13:53 2002 @@ -836,9 +836,7 @@ if [ "$CONFIG_AU1000_UART" = "y" -o "$CO fi bool 'Enable run-time debugging' CONFIG_DEBUG bool 'Magic SysRq key' CONFIG_MAGIC_SYSRQ -if [ "$CONFIG_SMP" != "y" ]; then - bool 'Run uncached' CONFIG_MIPS_UNCACHED -fi +dep_bool 'Run uncached' CONFIG_MIPS_UNCACHED $CONFIG_NONCOHERENT_IO endmenu source lib/Config.in