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

Yury Khrustalev yury.khrustalev@arm.com
Thu May 8 14:04:21 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: b4495bd405

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 2:
 - 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   | 39 +++++++++++++++++
 sysdeps/aarch64/tst-sme-jmp.c      | 28 ++----------
 sysdeps/aarch64/tst-sme-za-state.c | 68 ++++++++++++++++++++++++++++++
 5 files changed, 137 insertions(+), 25 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