summaryrefslogtreecommitdiff
path: root/libgcc
diff options
context:
space:
mode:
authorRichard Earnshaw <rearnsha@arm.com>2021-06-18 17:16:25 +0100
committerRichard Earnshaw <rearnsha@arm.com>2021-08-24 11:45:13 +0100
commit574e7950bd6b34e9e2cacce18c802b45505d1d0a (patch)
tree5c7752f47e18236e7c7b84e7727b191eadf0eb25 /libgcc
parent3929bca9ca95de9d35e82ae8828b188029e3eb70 (diff)
downloadgcc-574e7950bd6b34e9e2cacce18c802b45505d1d0a.tar.gz
arm: add erratum mitigation to __gnu_cmse_nonsecure_call [PR102035]
Add the recommended erratum mitigation sequence to __gnu_cmse_nonsecure_call for use on Armv8-m.main devices. Since this is in the library code we cannot know in advance whether the core we are running on will be affected by this, so always enable it. libgcc: PR target/102035 * config/arm/cmse_nonsecure_call.S (__gnu_cmse_nonsecure_call): Add vlldm erratum work-around.
Diffstat (limited to 'libgcc')
-rw-r--r--libgcc/config/arm/cmse_nonsecure_call.S5
1 files changed, 5 insertions, 0 deletions
diff --git a/libgcc/config/arm/cmse_nonsecure_call.S b/libgcc/config/arm/cmse_nonsecure_call.S
index 00830ade98e..c8e0fbbe665 100644
--- a/libgcc/config/arm/cmse_nonsecure_call.S
+++ b/libgcc/config/arm/cmse_nonsecure_call.S
@@ -102,6 +102,11 @@ blxns r4
#ifdef __ARM_PCS_VFP
vpop.f64 {d8-d15}
#else
+/* VLLDM erratum mitigation sequence. */
+mrs r5, control
+tst r5, #8 /* CONTROL_S.SFPA */
+it ne
+.inst.w 0xeeb00a40 /* vmovne s0, s0 */
vlldm sp /* Lazy restore of d0-d16 and FPSCR. */
add sp, sp, #0x88 /* Free space used to save floating point registers. */
#endif /* __ARM_PCS_VFP */