[llvm] [ARM] CMSE security mitigation on function arguments and returned values (PR #89944)

Victor Campos via llvm-commits llvm-commits at lists.llvm.org
Mon May 20 07:53:03 PDT 2024


vhscampos wrote:

> Codegen logic seems reasonable, but I lack familiarity with CMSE - the only thing that gives me pause is the comment explaining the behaviour talks about extending <i32 but conceptually this applies to any integer return with a different bit width than the resultant register, and the codegen does appear to correctly handle that

@ojhunt The [AAPCS32](https://github.com/ARM-software/abi-aa/blob/main/aapcs32/aapcs32.rst) mandates that arguments and return values that are <i32 must be extended by the caller and the callee respectively. However for types greater than i32 it's not specified, hence LLVM treats them as not having been extended beforehand. Therefore, no special treatment is required here.

In any case, I have added extra tests to ensure that this behaviour does not change silently in the future.

https://github.com/llvm/llvm-project/pull/89944


More information about the llvm-commits mailing list