diff options
author | Lingkai Dong <lingkai.dong@arm.com> | 2022-07-13 09:52:44 +0100 |
---|---|---|
committer | David Hu <david.hu@arm.com> | 2022-08-11 04:19:15 +0200 |
commit | 900ce938b0bbb1b7a3fef10973a3481fd1b8e8e0 (patch) | |
tree | 180750579f5cee17b488f65fc125cfb04cfc805e /secure_fw/partitions | |
parent | 6f39ad037a6b5ea7b00cb7eb48ace97380811df9 (diff) | |
download | trusted-firmware-m-900ce938b0bbb1b7a3fef10973a3481fd1b8e8e0.tar.gz |
SPM: Fix macro checks for clearing floating point context
The SPM only needs to clear FP context if it is compiled to use hard
FP, i.e. `CONFIG_TFM_FP >= 1`. If `CONFIG_TFM_ENABLE_FPU` is defined
while `CONFIG_TFM_FP == 0`, the SPM itself does not use the FPU but only
enables CP10 and CP11 and makes them accessible to the NSPE. In this
case, clearing of FP context is not needed because the SPM never uses
the FPU, and the code that does the clearing fails to compile because
instructions and registers for floating point are not allowed by the
compiler when not compiling with hard FP.
Change-Id: Ib659119aedb8eb5a0b2543686bec40677091a4af
Signed-off-by: Lingkai Dong <lingkai.dong@arm.com>
Diffstat (limited to 'secure_fw/partitions')
-rw-r--r-- | secure_fw/partitions/ns_agent_tz/ns_agent_tz.c | 2 | ||||
-rw-r--r-- | secure_fw/partitions/ns_agent_tz/ns_agent_tz_v80m.c | 2 | ||||
-rw-r--r-- | secure_fw/partitions/ns_agent_tz/psa_api_veneers_v80m.c | 2 |
3 files changed, 3 insertions, 3 deletions
diff --git a/secure_fw/partitions/ns_agent_tz/ns_agent_tz.c b/secure_fw/partitions/ns_agent_tz/ns_agent_tz.c index 4cccf61c3a..f0046f3b54 100644 --- a/secure_fw/partitions/ns_agent_tz/ns_agent_tz.c +++ b/secure_fw/partitions/ns_agent_tz/ns_agent_tz.c @@ -26,7 +26,7 @@ __naked void ns_agent_tz_main(void) " ldr r3, ="M2S(STACK_SEAL_PATTERN)" \n" /* SEAL double-check */ " cmp r2, r3 \n" " bne ns_agent_nspe_jump_panic \n" -#if defined(CONFIG_TFM_ENABLE_FPU) +#if (CONFIG_TFM_FP >= 1) " vscclrm {s0-s31, vpr} \n" " mov r1, #0 \n" " vmsr fpscr_nzcvqc, r1 \n" diff --git a/secure_fw/partitions/ns_agent_tz/ns_agent_tz_v80m.c b/secure_fw/partitions/ns_agent_tz/ns_agent_tz_v80m.c index f4aa594bd1..60a25f82c0 100644 --- a/secure_fw/partitions/ns_agent_tz/ns_agent_tz_v80m.c +++ b/secure_fw/partitions/ns_agent_tz/ns_agent_tz_v80m.c @@ -29,7 +29,7 @@ __naked void ns_agent_tz_main(void) " movs r2, #1 \n" /* For NS execution */ " bics r0, r2 \n" " mov r1, r0 \n" -#if defined(CONFIG_TFM_ENABLE_FPU) +#if (CONFIG_TFM_FP >= 1) " vmov d0, r0, r1 \n" " vmov d1, r0, r1 \n" " vmov d2, r0, r1 \n" diff --git a/secure_fw/partitions/ns_agent_tz/psa_api_veneers_v80m.c b/secure_fw/partitions/ns_agent_tz/psa_api_veneers_v80m.c index f12e51713a..93dcaa18bb 100644 --- a/secure_fw/partitions/ns_agent_tz/psa_api_veneers_v80m.c +++ b/secure_fw/partitions/ns_agent_tz/psa_api_veneers_v80m.c @@ -58,7 +58,7 @@ __attribute__((naked, used)) static void clear_caller_context(void) { __ASM volatile( -#if defined(CONFIG_TFM_ENABLE_FPU) +#if (CONFIG_TFM_FP >= 1) " vmov.f32 s0, #1.0 \n" " vmov.f32 s1, #1.0 \n" " vmov.f32 s2, #1.0 \n" |