kernel_optimize_test/arch/sparc
Mikael Pettersson 3f6aa0b113 sparc32: unbreak arch_write_unlock()
The sparc32 version of arch_write_unlock() is just a plain assignment.
Unfortunately this allows the compiler to schedule side-effects in a
protected region to occur after the HW-level unlock, which is broken.
E.g., the following trivial test case gets miscompiled:

	#include <linux/spinlock.h>
	rwlock_t lock;
	int counter;
	void foo(void) { write_lock(&lock); ++counter; write_unlock(&lock); }

Fixed by adding a compiler memory barrier to arch_write_unlock().  The
sparc64 version combines the barrier and assignment into a single asm(),
and implements the operation as a static inline, so that's what I did too.

Compile-tested with sparc32_defconfig + CONFIG_SMP=y.

Signed-off-by: Mikael Pettersson <mikpe@it.uu.se>
Signed-off-by: David S. Miller <davem@davemloft.net>
2011-08-15 14:35:19 -07:00
..
boot sparc32: added U-Boot build target: uImage 2011-03-16 18:19:04 -07:00
configs
include/asm sparc32: unbreak arch_write_unlock() 2011-08-15 14:35:19 -07:00
kernel sparc: Don't do hypervisor calls on non-sun4v in DS driver. 2011-08-11 17:58:59 -07:00
lib sparc: Fix __atomic_add_unless() return value. 2011-08-04 02:47:40 -07:00
math-emu perf: Remove the nmi parameter from the swevent and overflow interface 2011-07-01 11:06:35 +02:00
mm sparc: Fix build with DEBUG_PAGEALLOC enabled. 2011-08-06 05:26:35 -07:00
oprofile
prom sparc: Remove unnecessary semicolons 2011-06-07 16:06:34 -07:00
Kconfig Merge branch 'apei' into apei-release 2011-08-03 11:30:42 -04:00
Kconfig.debug lib: consolidate DEBUG_STACK_USAGE option 2011-05-25 08:39:54 -07:00
Makefile sparc32: added U-Boot build target: uImage 2011-03-16 18:19:04 -07:00