arm64: Implement array_index_mask_nospec()
authorRobin Murphy <robin.murphy@arm.com>
Mon, 5 Feb 2018 15:34:17 +0000 (15:34 +0000)
committerMatthew Pedro <mapedro@nvidia.com>
Tue, 10 Apr 2018 05:15:15 +0000 (22:15 -0700)
commit4fe0af8ff6f8e2e42d8850aff6a94b14bcb60573
tree9aae53626708dd9042b7f29a1600c4dd148c763e
parent9d7d0e7e6fcc2730603f1c9216bc51ed378ca7f0
arm64: Implement array_index_mask_nospec()

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>
Change-Id: I168000d0f3c718902ffd7ca1ad2147d914f19e94
Reviewed-on: https://git-master.nvidia.com/r/1662099
(cherry picked from commit 39c48ac56f2d7db8c291e16c9a1bc53898f86ba5)
Signed-off-by: Jeetesh Burman <jburman@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1687455
Reviewed-by: Matthew Pedro <mapedro@nvidia.com>
arch/arm64/include/asm/barrier.h