New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
arch: arm: Add code for swapping threads between secure and non-secure #26414
arch: arm: Add code for swapping threads between secure and non-secure #26414
Commits on May 4, 2021
-
arch: arm: Add config for non-blocking secure calls
Introduce a Kconfig option to allow Secure function calls to be pre-empted. Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no> Signed-off-by: Øyvind Rønningstad <oyvind.ronningstad@nordicsemi.no>
Configuration menu - View commit details
-
Copy full SHA for bf223ff - Browse repository at this point
Copy the full SHA bf223ffView commit details -
arch: arm: Add code for swapping threads between secure and non-secure
This adds code to swap_helper.S which does special handling of LR when the interrupt came from secure. The LR value is stored to memory, and put back into LR when swapping back to the relevant thread. Also, add special handling of FP state when switching from secure to non-secure, since we don't know whether the original non-secure thread (which called a secure service) was using FP registers, so we always store them, just in case. Signed-off-by: Øyvind Rønningstad <oyvind.ronningstad@nordicsemi.no>
Configuration menu - View commit details
-
Copy full SHA for 9242e22 - Browse repository at this point
Copy the full SHA 9242e22View commit details -
trusted-firmware-m: Store FP context before entering secure calls
When ARM_NONSECURE_PREEMPTIBLE_SECURE_CALLS is enabled, if FPU is being used (CONTROL.FPCA == 1), store all FP registers before entering the secure function, and restore them afterwards. This is needed if any NS thread or ISR that interrupts the secure function uses FP registers. If they do, a secure UsageFault occurs unless this change is applied. This allows k_sched_lock() and k_sched_unlock() to be dropped when ARM_NONSECURE_PREEMPTIBLE_SECURE_CALLS is enabled. Enable ARM_NONSECURE_PREEMPTIBLE_SECURE_CALLS by default when building TF-M. Signed-off-by: Øyvind Rønningstad <oyvind.ronningstad@nordicsemi.no>
Configuration menu - View commit details
-
Copy full SHA for d51cba0 - Browse repository at this point
Copy the full SHA d51cba0View commit details -
tests: arm: Add arm_thread_swap_tz test
For testing secure->non-secure thread swapping. This also tests that the FP context is correctly preserved when calling a secure function. Signed-off-by: Øyvind Rønningstad <oyvind.ronningstad@nordicsemi.no>
Configuration menu - View commit details
-
Copy full SHA for 0c29fc5 - Browse repository at this point
Copy the full SHA 0c29fc5View commit details -
doc: release notes: release notes entry for non-blocking secure calls
Add an entry in the release notes regarding the support for non-blocking secure calls in Zephyr. Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
Configuration menu - View commit details
-
Copy full SHA for e8a3996 - Browse repository at this point
Copy the full SHA e8a3996View commit details
Commits on May 5, 2021
-
tests: arm_thread_swap_tz: decrease work delay to ensure test passing
Decrease the submitted work delay, to ensure that the PSA crypto operation will be preempted when the work fires. The modification is required for devices with fast crypto operations. Also minor corrections to the test ase name, so it is not the same with the other arm_thread_swap test. Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
Configuration menu - View commit details
-
Copy full SHA for dcfc666 - Browse repository at this point
Copy the full SHA dcfc666View commit details -
tests: arm_thread_swap_tz: correct dt overlays for stm32 boards
Correct thee dt overlays for the STM32 boards, so the Zephyr image starting address is in accordance with what TF-m expects it to be. Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
Configuration menu - View commit details
-
Copy full SHA for bda970a - Browse repository at this point
Copy the full SHA bda970aView commit details