Skip to content

[AAPCS64] Clarify that calling a function outside of the requirements of the ZA lazy saving scheme is undefined behaviour #384

@smithp35

Description

@smithp35

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions