Page MenuHomePhabricator

Trusted Firmware MUmbrella
ActivePublic

Recent Activity

Tue, Jun 8

federliangarm closed T921: Supporting Non-Secure RTOS applications, integrated with Trusted Firmware-M, which want to use the FPU as Resolved.
Tue, Jun 8, 3:24 AM · Trusted Firmware M
davidwang claimed T910: Interactive tests fail to return to main thread after test has ran and sit in osRtxIdleThread() function.
Tue, Jun 8, 3:07 AM · Trusted Firmware M

Mon, Jun 7

KenLSoft created an object: Development.
Mon, Jun 7, 2:23 AM · Trusted Firmware M
KenLSoft deleted Design.
Mon, Jun 7, 2:10 AM · Trusted Firmware M

Fri, Jun 4

shebuk edited the content of TF-M Videos.
Fri, Jun 4, 9:44 AM · Trusted Firmware M
KenLSoft edited the content of Design.
Fri, Jun 4, 8:54 AM · Trusted Firmware M

Thu, Jun 3

adeaarm added a comment to T929: Optimise SPM operations in Library mode.

Note that as part of this activity the following bug in the Qemu porting o the mps2-an521 board has been found and fixed with the following pull request:

Thu, Jun 3, 6:32 PM · Trusted Firmware M
adeaarm added a comment to T929: Optimise SPM operations in Library mode.

Patches available here:

Thu, Jun 3, 6:18 PM · Trusted Firmware M
adeaarm triaged T929: Optimise SPM operations in Library mode as Normal priority.
Thu, Jun 3, 6:17 PM · Trusted Firmware M
ioannisg added a comment to T921: Supporting Non-Secure RTOS applications, integrated with Trusted Firmware-M, which want to use the FPU.

As you know, for secure and non-secure side are closely related in TF-M. In latest TF-M v1.3 release, FP support (in secure side either non-secure side) are not official announced, so the problem you reported is not a TF-M bug.

Thu, Jun 3, 8:05 AM · Trusted Firmware M
matetothpal changed the edit policy for Non-Secure Interrupt Handling.
Thu, Jun 3, 7:53 AM · Trusted Firmware M
federliangarm added a comment to T921: Supporting Non-Secure RTOS applications, integrated with Trusted Firmware-M, which want to use the FPU.

Thank you for letting us know the problem when you are using TF-M, this is helpful for all stakeholder of TF-M.

Thu, Jun 3, 7:40 AM · Trusted Firmware M

Tue, Jun 1

ioannisg added a comment to T921: Supporting Non-Secure RTOS applications, integrated with Trusted Firmware-M, which want to use the FPU.

Hi Feder,
Honestly, I've only faced this issue when doing some advance scheduling manipulations on the Non-Secure side (modifying LSPACT, FPCA, etc.), so not in mainline TF-M/RTOS use-cases. Please disregard it for now.

Tue, Jun 1, 12:08 PM · Trusted Firmware M
federliangarm added a comment to T921: Supporting Non-Secure RTOS applications, integrated with Trusted Firmware-M, which want to use the FPU.

However, this is only a partial solution. That is because a Secure thread re-scheduling will clear the .FPCA flag, but leave the LSPACT set, meaning that a NS IRQ with FP instructions will trigger again an FP stacking. But this FP stacking will be done on the memory where FPCAR is pointing at, and FPCAR is only updated in exception entry, if .FPCA is set. As a result, it does not seem that you avoid a stack corruption.

Let me know if you've understood this argumentation, or you need more information.

Tue, Jun 1, 1:35 AM · Trusted Firmware M

Mon, May 31

ioannisg added a comment to T921: Supporting Non-Secure RTOS applications, integrated with Trusted Firmware-M, which want to use the FPU.

Any updates here, Feder?

Mon, May 31, 9:15 AM · Trusted Firmware M

Thu, May 27

ioannisg added a comment to T921: Supporting Non-Secure RTOS applications, integrated with Trusted Firmware-M, which want to use the FPU.

However, this is only a partial solution. That is because a Secure thread re-scheduling will clear the .FPCA flag, but leave the LSPACT set, meaning that a NS IRQ with FP instructions will trigger again an FP stacking. But this FP stacking will be done on the memory where FPCAR is pointing at, and FPCAR is only updated in exception entry, if .FPCA is set. As a result, it does not seem that you avoid a stack corruption.

Thu, May 27, 8:06 AM · Trusted Firmware M
ioannisg added a comment to T921: Supporting Non-Secure RTOS applications, integrated with Trusted Firmware-M, which want to use the FPU.

Hi Feder, correct; setting CPACR_S solves the problem of Secure No-Coprocessor Usage Fault.

Thu, May 27, 7:36 AM · Trusted Firmware M
federliangarm added a comment to T921: Supporting Non-Secure RTOS applications, integrated with Trusted Firmware-M, which want to use the FPU.

Please try to add code below just before setting NSACR in tfm_arch_config_extensions() and let me know the result. Thanks!

Thu, May 27, 7:00 AM · Trusted Firmware M

Wed, May 26

ioannisg added a comment to T921: Supporting Non-Secure RTOS applications, integrated with Trusted Firmware-M, which want to use the FPU.

Hi Feder,

Wed, May 26, 10:42 AM · Trusted Firmware M
KenLSoft edited the content of Recyclebin.
Wed, May 26, 8:36 AM · Trusted Firmware M
KenLSoft edited the content of Recyclebin.
Wed, May 26, 8:36 AM · Trusted Firmware M
KenLSoft edited the content of Recyclebin.
Wed, May 26, 8:35 AM · Trusted Firmware M
KenLSoft created an object: Recyclebin.
Wed, May 26, 8:33 AM · Trusted Firmware M

Mon, May 24

adilahbisar added a comment to T398: Initial support for IAR Embedded Workbench for Arm tool chain.

IAR Embedded Workbench for Arm is an integrated development work environment and the included IAR C/C++ Compiler generates the fastest performing, although there are tons of projects like CV Makers which are based on IAR.

Mon, May 24, 9:48 AM · Trusted Firmware M

May 21 2021

federliangarm added a comment to T921: Supporting Non-Secure RTOS applications, integrated with Trusted Firmware-M, which want to use the FPU.

I tried on my side with steps above, and I still cannot reproduce your issue.
Please confirm NSACR register is configured correctly, and check the FP related registers before the FP instruction causing crash.

May 21 2021, 8:22 AM · Trusted Firmware M

May 18 2021

ioannisg added a comment to T921: Supporting Non-Secure RTOS applications, integrated with Trusted Firmware-M, which want to use the FPU.

I tried this on my side on STM32L562e_dk board with TF-M repo: enable "-mfloat-abi=softfp" in NS side and use TF-M default "-mfloat-abi=soft" option, and changed FP registers in non-secure thread first, then do PSA call. When system is in secure thread mode, no crash found even FPCCR_S.LSPACT = 1.

May 18 2021, 8:50 AM · Trusted Firmware M
ioannisg added a comment to T921: Supporting Non-Secure RTOS applications, integrated with Trusted Firmware-M, which want to use the FPU.

Do you have FP instruction in secure thread? If there is no FP instruction, the processor will not stack FP registers even LSPACT flag is set.
I tried this on my side on STM32L562e_dk board with TF-M repo: enable "-mfloat-abi=softfp" in NS side and use TF-M default "-mfloat-abi=soft" option, and changed FP registers in non-secure thread first, then do PSA call. When system is in secure thread mode, no crash found even FPCCR_S.LSPACT = 1.

May 18 2021, 8:45 AM · Trusted Firmware M

May 17 2021

federliangarm added a comment to T921: Supporting Non-Secure RTOS applications, integrated with Trusted Firmware-M, which want to use the FPU.

TF-M currently support "-mfloat-abi=soft" as default, but doesn't support the setting in Zephyr "-mfloat-abi=softfp". Because they are totally different things.

But why? These ABIs are link-compatible, I do not see the problem. GCC allows these binaries to link successfully.

I mean TF-M itself current FP option is "-mfloat-abi=soft", not the "-mfloat-abi=softfp" which is used in Zephyr. It doesn't matter with setting for Zephyr.

May 17 2021, 10:33 AM · Trusted Firmware M

May 13 2021

ioannisg added a comment to T921: Supporting Non-Secure RTOS applications, integrated with Trusted Firmware-M, which want to use the FPU.

TF-M currently support "-mfloat-abi=soft" as default, but doesn't support the setting in Zephyr "-mfloat-abi=softfp". Because they are totally different things.

May 13 2021, 5:56 PM · Trusted Firmware M
federliangarm added a comment to T921: Supporting Non-Secure RTOS applications, integrated with Trusted Firmware-M, which want to use the FPU.

This is the explanation for "FP_SOFTABI" in Zephyr.
"config FP_SOFTABI
bool "Floating point Soft ABI"
help

	  This option selects the Floating point ABI in which hardware floating
	  point instructions are generated but soft-float calling conventions."
May 13 2021, 9:28 AM · Trusted Firmware M
ioannisg added a comment to T921: Supporting Non-Secure RTOS applications, integrated with Trusted Firmware-M, which want to use the FPU.

Yes, it crashes even without Lazy Stacking. It is a bit more deterministic as is. It crashes in the first secure exception entry, after the transition to secure domain from non-secure.

May 13 2021, 8:26 AM · Trusted Firmware M
ioannisg added a comment to T921: Supporting Non-Secure RTOS applications, integrated with Trusted Firmware-M, which want to use the FPU.

But for Zephyr, are you using soft FP or hardware FP?

May 13 2021, 8:12 AM · Trusted Firmware M
federliangarm added a comment to T921: Supporting Non-Secure RTOS applications, integrated with Trusted Firmware-M, which want to use the FPU.

The first thing I want to confirm is "I compile zephyr and Tf-M with soft FP". As you know, TF-M is default with soft FP.

  1. But for Zephyr, are you using soft FP or hardware FP?
  2. Is it possible for you to share the compile options and linker options for the source file including the "Non-Secure interrupt" crashing?
  3. Is it possible to show the assembly code for the "Non-Secure interrupt"?
  4. Please have a try to disable lazy FP stacking, to see whether still crash.
May 13 2021, 1:35 AM · Trusted Firmware M

May 12 2021

ioannisg added a comment to T921: Supporting Non-Secure RTOS applications, integrated with Trusted Firmware-M, which want to use the FPU.

Hi Feder,

May 12 2021, 12:36 PM · Trusted Firmware M

May 11 2021

federliangarm added a comment to T921: Supporting Non-Secure RTOS applications, integrated with Trusted Firmware-M, which want to use the FPU.

If you didn't change TF-M while integrating into your project, PSA call(handler mode) cannot be interrupted by non-secure interrupt like you mentioned, the reason is non-secure exceptions are de-prioritized (AIRCR.PRIS = 1) in TF-M.
Non-secure interrupt can only be active when system in thread mode.

May 11 2021, 8:01 AM · Trusted Firmware M

May 7 2021

KenLSoft closed T911: Build warnings as Resolved.
May 7 2021, 2:32 AM · Trusted Firmware M
KenLSoft added a comment to T911: Build warnings.

Merged.

May 7 2021, 2:32 AM · Trusted Firmware M

May 6 2021

davidwang added a comment to T921: Supporting Non-Secure RTOS applications, integrated with Trusted Firmware-M, which want to use the FPU.

Hi @ioannisg,
FYI. Feder is on holiday and will back to office on 10th May.
Thanks.

May 6 2021, 6:05 AM · Trusted Firmware M

May 4 2021

andvib created T924: Protected Storage Non-Secure Client Identification test cases failing.
May 4 2021, 2:54 PM · Trusted Firmware M

May 3 2021

ioannisg triaged T921: Supporting Non-Secure RTOS applications, integrated with Trusted Firmware-M, which want to use the FPU as High priority.

Setting this to High for now - but feel free to re-triage this was not appropriate.

May 3 2021, 8:21 AM · Trusted Firmware M
ioannisg added a comment to T921: Supporting Non-Secure RTOS applications, integrated with Trusted Firmware-M, which want to use the FPU.

Hi Feder,

May 3 2021, 8:04 AM · Trusted Firmware M

Apr 30 2021

federliangarm added a comment to T921: Supporting Non-Secure RTOS applications, integrated with Trusted Firmware-M, which want to use the FPU.

For the concern you mentioned, yes, we need to add extra steps in secure scheduler, I am still working on this part.

  1. When secure doing secure calls: a. if lazy fp is disabled, hardware will push/pop FP context automatically during exception entry/return. b. if lazy fp is enable, for isolation 1, secure scheduler will save and restore FP context, but not invalidate FP context; for isolation 2 and 3, secure scheduler will trigger lazy fp stacking, hardware will push FP context to thread' stack and invalidate them automatically.
  2. When non-secure doing secure calls, non-secure side will SG to secure world in tfm_nspm_thread_entry, then doing secure calls as same as above. FP context of non-secure can be restored when bxns lr to non-secure side.
Apr 30 2021, 3:57 AM · Trusted Firmware M

Apr 28 2021

davidwang reassigned T921: Supporting Non-Secure RTOS applications, integrated with Trusted Firmware-M, which want to use the FPU from Anton-TF to federliangarm.
Apr 28 2021, 2:23 AM · Trusted Firmware M

Apr 27 2021

ioannisg created T921: Supporting Non-Secure RTOS applications, integrated with Trusted Firmware-M, which want to use the FPU.
Apr 27 2021, 9:12 AM · Trusted Firmware M

Apr 21 2021

KenLSoft added a comment to T911: Build warnings.

The first patch for this:
https://review.trustedfirmware.org/c/TF-M/trusted-firmware-m/+/9730

Apr 21 2021, 9:49 AM · Trusted Firmware M
davidhuziji added a comment to T911: Build warnings.

Currently GNU 10-2020-q4-major cannot support CMSE well (https://git.trustedfirmware.org/TF-M/trusted-firmware-m.git/tree/docs/getting_started/tfm_sw_requirement.rst#n54).
So this GNU version won't be supported in TF-M.

Apr 21 2021, 9:46 AM · Trusted Firmware M

Apr 13 2021

shebuk edited the content of TF-M Videos.
Apr 13 2021, 12:21 PM · Trusted Firmware M

Apr 12 2021

oyvindronningstad added a comment to T911: Build warnings.

I built with

Apr 12 2021, 7:21 AM · Trusted Firmware M
KenLSoft added a comment to T911: Build warnings.

I will run the GCC version later to check if there are more warnings. Will collect all the warnings and fix them in one shot later.

Apr 12 2021, 5:41 AM · Trusted Firmware M
KenLSoft added a comment to T911: Build warnings.

Would fix after the release. Mark as a long term goal.

Apr 12 2021, 5:10 AM · Trusted Firmware M