[PATCH] ARM: SWP emulation: Restore original *data when failed
From: Shengjiu Wang
Date: Tue Oct 13 2015 - 22:51:10 EST
__user_swpX_asm maybe failed in first STREX operation, emulate_swpX
will try again, but the *data has been changed in first time. which
cause the result is wrong. So need to recover the *data when failed.
Signed-off-by: Shengjiu Wang <shengjiu.wang@xxxxxxxxxxxxx>
---
arch/arm/kernel/swp_emulate.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/arch/arm/kernel/swp_emulate.c b/arch/arm/kernel/swp_emulate.c
index 5b26e7e..c61fbf92 100644
--- a/arch/arm/kernel/swp_emulate.c
+++ b/arch/arm/kernel/swp_emulate.c
@@ -41,6 +41,7 @@
"1: strex"B" %0, %2, [%3]\n" \
" cmp %0, #0\n" \
" movne %0, %4\n" \
+ " movne %1, %2\n" \
"2:\n" \
" .section .text.fixup,\"ax\"\n" \
" .align 2\n" \
--
1.9.1
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/