When expanding the non-secure call instruction we are emiting code to clear the secure floating-point registers only if the targeted architecture has floating-point support. The potential problem is when the source code containing non-secure calls are built with -mfloat-abi=soft but some other part of the system has been built with -mfloat-abi=softfp (soft and softfp are compatible as they use the same procedure calling standard). In this case floating-point registers could leak to non-secure state as the non-secure won't have cleared them assuming no floating-point has been used.
Details
Details
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Comment Actions
Looks reasonable. Could we, please, add a comment which explains why it's correct to emit vlldm/vllsm (e.g. "they behave as NOPs") and various other instrucvtion that access FP regfisters (e.g. "we are passing parameters in FP-regs anyway")?
Comment Actions
Added an assertion for when fpregs are passed or returned, and a comment about vlstm/vlldm being NOP in the absence of FPU.