A thread may not have access to SME or TPIDR2_EL0, so in order to
safely query PSTATE.SM in a streaming-compatible function, the
code should call __arm_sme_state(), as described in the ABI:
https://github.com/ARM-software/abi-aa/pull/123/commits/c2bb09c4d4ee60a5787baf1ccc7e92e67e4240b7
This means that the value of pstate.sm is:
- 0 if the function is non-streaming.
- 1 if the function has arm_streaming or arm_locally_streaming.
- evaluated at runtime by a call to __arm_sme_state() otherwise.
Is this right? The ABI document in github suggests:
for __arm_sme_state, which is different to the comment, specifically the X0-X13 bit.