-
Notifications
You must be signed in to change notification settings - Fork 8.2k
Description
This is an umbrella issue for fixing the floating point implementation for the ARM stack in Zephyr.
In high-level description, we will focus on the following issues
-
When only
CONFIG_FLOATis defined, FP co-processor is not shared between threads. Therefore, we won't be in need of stacking/un-stacking the FP context. The ESF structure can, additionally, skip reserving space for the FP context. FInally, we should not need to initialize the FP context in system boot. Changes will improve interrupt latency and memory consumption. (ARM: Cortex-M: enhance non-sharing floating point services #15115)
Un-shared FP Service mode is vulnerable to accidental use of FP context by multiple entities. We could provide a test-mode for Ushared FP that detects multi-usage. See ARM: FPU: implement ASSERT-based testing of multi-usage in Unshared FP Services mode #15292 -
When
CONFIG_FLOATandCONFIG_FP_SHARINGare both defined, FP co-processor is shared between threads. The changes, here, will focus on increasing implementation robustness and performance (see ARM: Cortex-M: enhance Sharing Floating-Point Registers Mode #15964):- Activate FP context only on the threads that actually use the FP registers
- Enable lazy stacking for FPU capable threads (Enable ARM M4F FPU lazy stacking #2049)
- Implement FP context saving only for FP-active threads
- Implement stack protection for FPU capable supervisor threads properly (ARM: MPU-based HW thread stack protection not working properly when building with CONFIG_FLOAT #14828, ARM: Implement configurable MPU-based stack overflow guards #16360)
- Allow threads to disable FP activation (after their work with FP is completed) (ARM: k_float_disable() as system call #15981 )
-
Finally, we need to fix documentation of FP Services for ARM, to comply with the new, improved design (ARM: k_float_disable() as system call #15981).