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
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 W. Rozycki, Technical University of Gdansk, Poland +
+ e-mail: firstname.lastname@example.org, PGP key available +
--- 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
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
+dep_bool 'Run uncached' CONFIG_MIPS_UNCACHED $CONFIG_NONCOHERENT_IO