]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
powerpc/64s: Add barrier_nospec
authorMichal Suchanek <msuchanek@suse.de>
Thu, 11 Apr 2019 11:45:57 +0000 (21:45 +1000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 17 Apr 2019 06:36:39 +0000 (08:36 +0200)
commit4314e774ce40e08e763996fc6f6220a1ef1dbc2c
tree4df99aa72da2e8120bc5f74c8052dd4eb16b5cbd
parent10f1dea70f7ed207b5f0f05416bcae2eaf4672ef
powerpc/64s: Add barrier_nospec

commit a6b3964ad71a61bb7c61d80a60bea7d42187b2eb upstream.

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 <sashal@kernel.org>
arch/powerpc/include/asm/barrier.h