powerpc/64s: Add barrier_nospec
authorMichal Suchanek <msuchanek@suse.de>
Tue, 24 Apr 2018 04:15:54 +0000 (14:15 +1000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 3 Aug 2018 05:50:24 +0000 (07:50 +0200)
commit04cda3ac3312f16ef8bbffa06c55dd1b04d3aad6
tree4437b50ad580c02b4482f7dd9f9a18630d018b76
parent47b3561450178b538b99ba26a4989e0f846f2e8e
powerpc/64s: Add barrier_nospec

[ Upstream commit a6b3964ad71a61bb7c61d80a60bea7d42187b2eb ]

A no-op form of ori (or immediate of 0 into r31 and the result stored
in r31) has been re-tasked as a speculation barrier. The instruction
only acts as a barrier on newer machines with appropriate firmware
support. On older CPUs it remains a harmless no-op.

Implement barrier_nospec using this instruction.

mpe: The semantics of the instruction are believed to be that it
prevents execution of subsequent instructions until preceding branches
have been fully resolved and are no longer executing speculatively.
There is no further documentation available at this time.

Signed-off-by: Michal Suchanek <msuchanek@suse.de>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/powerpc/include/asm/barrier.h