ARM: 7099/1: futex: preserve oldval in SMP __futex_atomic_op
commit28d5b74edcc0819cefa66256fd804c8420aff19f
authorWill Deacon <will.deacon@arm.com>
Fri, 23 Sep 2011 13:34:12 +0000 (23 14:34 +0100)
committerGreg Kroah-Hartman <gregkh@suse.de>
Mon, 3 Oct 2011 18:41:06 +0000 (3 11:41 -0700)
tree1f184e320f55982fab0fd6d953502744fb7dfd82
parent85fd323003d5fe4d5c798688f016ab0eda0c9dcf
ARM: 7099/1: futex: preserve oldval in SMP __futex_atomic_op

commit df77abcafc8dc881b6c9347548651777088e4b27 upstream.

The SMP implementation of __futex_atomic_op clobbers oldval with the
status flag from the exclusive store. This causes it to always read as
zero when performing the FUTEX_OP_CMP_* operation.

This patch updates the ARM __futex_atomic_op implementations to take a
tmp argument, allowing us to store the strex status flag without
overwriting the register containing oldval.

Reported-by: Minho Ban <mhban@samsung.com>
Reviewed-by: Nicolas Pitre <nicolas.pitre@linaro.org>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
arch/arm/include/asm/futex.h