Hi Roman,
many thanks for sharing those findings and fixes. I'll try my best to take a look soon.
Can you please in the meantime open a gitlab issue: https://github.com/TrustedFirmware-M/trusted-firmware-m/issues such that we can track its progress and port it to LTS?
Many thanks in advance. Best regards, Nick
________________________________ From: Roman.Mazurak--- via TF-M tf-m@lists.trustedfirmware.org Sent: 20 December 2024 18:25 To: tf-m@lists.trustedfirmware.org tf-m@lists.trustedfirmware.org Subject: [TF-M] FPU S16-S31 registers
Hi all,
We found the problem with FPU S16-S31 registers if FPU is enabled and compiler uses S16-S31 FPU registers on CM33 non-secure code with TZ agent. SPM doesn’t save/restore S16-S31 registers properly nor by PendSV neither by FLIH SVC handler. I created a patch for this problem:
https://review.trustedfirmware.org/c/TF-M/trusted-firmware-m/+/34202
The second problem I found is related to lazy stacking. It’s possible that float point context will be stacked by MCU when FLIH is switching to/from background thread after a new boundary is applied. As result it’s possible that the non-privileged code will no have access to PSP stack of suspended partition because a new MPU settings are applied. Please review a patch for this problem:
https://review.trustedfirmware.org/c/TF-M/trusted-firmware-m/+/34203
Regards,
Roman.