MIPS: futex: Emit Loongson3 sync workarounds within asm
authorPaul Burton <paul.burton@mips.com>
Tue, 1 Oct 2019 21:53:38 +0000 (21:53 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 31 Dec 2019 15:43:48 +0000 (16:43 +0100)
commitd754a529a8be55f009c6679d772c472c1632cd5b
tree4426634c42cddeb1ef11f4d1a0185f20dfbef05e
parentbe30e550a54c4b088a0b6f4e1ac4b27b72decd41
MIPS: futex: Emit Loongson3 sync workarounds within asm

[ Upstream commit 3c1d3f0979721a39dd2980c97466127ce65aa130 ]

Generate the sync instructions required to workaround Loongson3 LL/SC
errata within inline asm blocks, which feels a little safer than doing
it from C where strictly speaking the compiler would be well within its
rights to insert a memory access between the separate asm statements we
previously had, containing sync & ll instructions respectively.

Signed-off-by: Paul Burton <paul.burton@mips.com>
Cc: linux-mips@vger.kernel.org
Cc: Huacai Chen <chenhc@lemote.com>
Cc: Jiaxun Yang <jiaxun.yang@flygoat.com>
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Sasha Levin <sashal@kernel.org>
arch/mips/include/asm/barrier.h
arch/mips/include/asm/futex.h