Hello,
I was wondering how is the cost/ slow-down of communication between secure world and normal world. How many CPU cycles on average?
Thank you.
The switch requires just one instruction, SG.
The Cortex-M is for embedded applications where real time and low latency are key requirements so TrustZone for Armv8-M was designed with that in mind.
On the Cortex-M33 the SG instruction takes one cycle.
The result is that non trusted code can call into trusted code with no penalty.
Having trusted and non trusted resources allows the developer to remove many layers of sw that would have virtualised resources before to protect them. This makes Armv8-M based code more efficient
for proper security you still need to do more work in all exported functions to check the parameters passed among other items.
The main impact to think about would be on interrupt handling in non-trusted mode whilst in Trusted mode. The interrupt would have to be enabled in Trusted mode and more registers need to be saved.