summaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorJeetesh Burman <jburman@nvidia.com>2018-02-14 11:50:57 +0530
committerWinnie Hsu <whsu@nvidia.com>2018-04-03 10:44:10 -0700
commitaba332e1dc32edfed73448364f2a88457738a270 (patch)
tree158df8249e81a98259f47a137843e67297aa9126 /arch
parent763ada650d0d24dde8d4ec90f665f16c8d7edab7 (diff)
arm: define speculation barrier
The instruction sequency "dsb sy" followed by "isb" functions as a speculation barrier, which prevents the instructions after that from being speculatively executed. bug 2039126 Change-Id: I898aab771ff82b26b08214a06814d2e6e78969a7 Signed-off-by: Bo Yan <byan@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/1618222 Signed-off-by: James Huang <jamehuang@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/1650093 Signed-off-by: Jeetesh Burman <jburman@nvidia.com> (cherry picked from commit f125c60045878513902cac4a084fde9a516eb3e2) Reviewed-on: https://git-master.nvidia.com/r/1660771 GVS: Gerrit_Virtual_Submit Reviewed-by: Bibek Basu <bbasu@nvidia.com>
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/include/asm/barrier.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/arch/arm/include/asm/barrier.h b/arch/arm/include/asm/barrier.h
index b00ef075bc2e..6af46bfa9837 100644
--- a/arch/arm/include/asm/barrier.h
+++ b/arch/arm/include/asm/barrier.h
@@ -79,5 +79,9 @@ do { \
#define set_mb(var, value) do { var = value; smp_mb(); } while (0)
+#define speculation_barrier() \
+ asm volatile( "dsb sy\n" \
+ "isb\n" : : : "memory")
+
#endif /* !__ASSEMBLY__ */
#endif /* __ASM_BARRIER_H */