[PATCH v3 0/2] aarch64: Disable ZA state of SME in setjmp and sigsetjmp

Yury Khrustalev yury.khrustalev@arm.com
Wed May 14 08:50:01 GMT 2025


Due to the nature of the ZA state, setjmp() should clear it in the
same manner as it is already done by longjmp().

Also add test that checks that ZA state is disabled after setjmp() and
sigsetjmp() and update existing SME test that uses setjmp().

This change can be tested on the FVP model as described in [1].

base commit: ad966bc4ef

Note that there is a corresponding change in the kernel [2], however
it's not a prerequisite for the Glibc change, so the latter can be
merged right now.

[1]: https://inbox.sourceware.org/libc-help/Z9grjmNzxsuPu7iD@arm.com/
[2]: https://lore.kernel.org/linux-arm-kernel/20250508132644.1395904-2-mark.rutland@arm.com/

Changes in v3:
 - Changed new test to set SME state before setjmp() and longjmp()
   so that disabling the state later can be observable.
 - Rebase onto master.
 - Link to v2: https://patchwork.sourceware.org/project/glibc/list/?series=47104

Changes in v2:
 - Moved call to __libc_arm_za_disable() to the start of __sigsetjmp().
 - Rebase onto master.
 - Link to v1: https://patchwork.sourceware.org/project/glibc/list/?series=46857

---

Yury Khrustalev (2):
  aarch64: Disable ZA state of SME in setjmp and sigsetjmp
  aarch64: update tests for SME

 sysdeps/aarch64/Makefile           |   4 +-
 sysdeps/aarch64/setjmp.S           |  23 ++++++
 sysdeps/aarch64/tst-sme-helper.h   |  97 +++++++++++++++++++++++
 sysdeps/aarch64/tst-sme-jmp.c      |  81 +-------------------
 sysdeps/aarch64/tst-sme-za-state.c | 119 +++++++++++++++++++++++++++++
 5 files changed, 245 insertions(+), 79 deletions(-)
 create mode 100644 sysdeps/aarch64/tst-sme-helper.h
 create mode 100644 sysdeps/aarch64/tst-sme-za-state.c

-- 
2.39.5



More information about the Libc-alpha mailing list