arm64: Implement array_index_mask_nospec()
commita17d329d36c81ccdc1cba58ac765dacbbac7d33b
authorRobin Murphy <robin.murphy@arm.com>
Mon, 5 Feb 2018 15:34:17 +0000 (5 15:34 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 16 Feb 2018 19:06:38 +0000 (16 20:06 +0100)
treea583df2b68f79d629b87a829a3d3bf50273768e7
parent83c5e4e3c63489bc6aa0aa4f9082786e4c2d0d28
arm64: Implement array_index_mask_nospec()

Commit 022620eed3d0 upstream.

Provide an optimised, assembly implementation of array_index_mask_nospec()
for arm64 so that the compiler is not in a position to transform the code
in ways which affect its ability to inhibit speculation (e.g. by introducing
conditional branches).

This is similar to the sequence used by x86, modulo architectural differences
in the carry/borrow flags.

Reviewed-by: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Robin Murphy <robin.murphy@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/arm64/include/asm/barrier.h