The lazy saving scheme has some requirements on the calling function, documented in https://github.com/ARM-software/abi-aa/blob/main/aapcs64/aapcs64.rst#67types-of-subroutine-interface
We should be explicit that not following these requirements is undefined behaviour. This includes the SME support routines like https://github.com/ARM-software/abi-aa/blob/main/aapcs64/aapcs64.rst#arm-za-disable which has a private-ZA streaming-compatible interface and the text:
The subroutine behaves as follows:
If the current thread does not have access to SME, the subroutine does nothing.
Otherwise, the subroutine behaves as if it did the following:
- Call __arm_tpidr2_save.
- Set TPIDR2_EL0 to null.
- Set PSTATE.ZA to 0.
These only apply if the function is called with ZA state "dormant or off", and do not override the private ZA interface requirements.
Suggestion is that we add a clarification in https://github.com/ARM-software/abi-aa/blob/main/aapcs64/aapcs64.rst#67types-of-subroutine-interface as this affects all ZA lazy saving scheme functions.
The lazy saving scheme has some requirements on the calling function, documented in https://github.com/ARM-software/abi-aa/blob/main/aapcs64/aapcs64.rst#67types-of-subroutine-interface
We should be explicit that not following these requirements is undefined behaviour. This includes the SME support routines like https://github.com/ARM-software/abi-aa/blob/main/aapcs64/aapcs64.rst#arm-za-disable which has a private-ZA streaming-compatible interface and the text:
These only apply if the function is called with ZA state "dormant or off", and do not override the private ZA interface requirements.
Suggestion is that we add a clarification in https://github.com/ARM-software/abi-aa/blob/main/aapcs64/aapcs64.rst#67types-of-subroutine-interface as this affects all ZA lazy saving scheme functions.