aboutsummaryrefslogtreecommitdiff
path: root/include/arch
diff options
context:
space:
mode:
authorMark Dykes <mardyk01@review.trustedfirmware.org>2020-03-09 16:02:06 +0000
committerTrustedFirmware Code Review <review@review.trustedfirmware.org>2020-03-09 16:02:06 +0000
commitefe30cb1b445bb08e114cd0681fa3f845c64ea57 (patch)
tree25af03d7602e6aea109a3e5fc7d4e37e4cd8c3b2 /include/arch
parent091576e7f1fa0ca7360732d290a28ff2dc2a16e6 (diff)
parent6bc243825f561e87ef7af7f51b218c6b0dab9b78 (diff)
downloadtrusted-firmware-a-efe30cb1b445bb08e114cd0681fa3f845c64ea57.tar.gz
Merge "aarch32: stop speculative execution past exception returns" into integration
Diffstat (limited to 'include/arch')
-rw-r--r--include/arch/aarch32/asm_macros.S15
-rw-r--r--include/arch/aarch32/smccc_macros.S2
2 files changed, 15 insertions, 2 deletions
diff --git a/include/arch/aarch32/asm_macros.S b/include/arch/aarch32/asm_macros.S
index 8cfa21231a..ea1636e245 100644
--- a/include/arch/aarch32/asm_macros.S
+++ b/include/arch/aarch32/asm_macros.S
@@ -95,11 +95,24 @@
#if ARM_ARCH_MAJOR == 7 && !defined(ARMV7_SUPPORTS_VIRTUALIZATION)
/*
+ * Macro for mitigating against speculative execution.
* ARMv7 cores without Virtualization extension do not support the
* eret instruction.
*/
- .macro eret
+ .macro exception_return
movs pc, lr
+ dsb nsh
+ isb
+ .endm
+
+#else
+ /*
+ * Macro for mitigating against speculative execution beyond ERET.
+ */
+ .macro exception_return
+ eret
+ dsb nsh
+ isb
.endm
#endif
diff --git a/include/arch/aarch32/smccc_macros.S b/include/arch/aarch32/smccc_macros.S
index 4ec229218f..ea7835a425 100644
--- a/include/arch/aarch32/smccc_macros.S
+++ b/include/arch/aarch32/smccc_macros.S
@@ -235,7 +235,7 @@
/* Restore the rest of the general purpose registers */
ldm r0, {r0-r12}
- eret
+ exception_return
.endm
#endif /* SMCCC_MACROS_S */