]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
arm: add erratum mitigation to __gnu_cmse_nonsecure_call [PR102035]
authorRichard Earnshaw <rearnsha@arm.com>
Fri, 18 Jun 2021 16:16:25 +0000 (17:16 +0100)
committerRichard Earnshaw <rearnsha@arm.com>
Tue, 24 Aug 2021 10:45:13 +0000 (11:45 +0100)
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.

libgcc/config/arm/cmse_nonsecure_call.S

index 00830ade98ea650c328c709d5d308fbc96f7f21c..c8e0fbbe665d037bea532ceeb4faa4a4adace66f 100644 (file)
@@ -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 */