]> git.ipfire.org Git - thirdparty/glibc.git/commit
aarch64: tests for SME
authorYury Khrustalev <yury.khrustalev@arm.com>
Fri, 26 Sep 2025 09:03:45 +0000 (10:03 +0100)
committerYury Khrustalev <yury.khrustalev@arm.com>
Tue, 14 Oct 2025 08:42:46 +0000 (09:42 +0100)
commitecb0fc2f0f839f36cd2a106283142c9df8ea8214
treef0f806c91f3268d5e4189204917de9f849131fa9
parent27effb3d50424fb9634be77a2acd614b0386ff25
aarch64: tests for SME

This commit adds tests for the following use cases relevant to handing of
the SME state:

 - fork() and vfork()
 - clone() and clone3()
 - signal handler

While most cases are trivial, the case of clone3() is more complicated since
the clone3() symbol is not public in Glibc.

To avoid having to check all possible ways clone3() may be called via other
public functions (e.g. vfork() or pthread_create()), we put together a test
that links directly with clone3.o. All the existing functions that have calls
to clone3() may not actually use it, in which case the outcome of such tests
would be unexpected. Having a direct call to the clone3() symbol in the test
allows to check precisely what we need to test: that the __arm_za_disable()
function is indeed called and has the desired effect.

Linking to clone3.o also requires linking to __arm_za_disable.o that in
turn requires the _dl_hwcap2 hidden symbol which to provide in the test
and initialise it before using.

Co-authored-by: Adhemerval Zanella Netto <adhemerval.zanella@linaro.org>
Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
sysdeps/aarch64/Makefile
sysdeps/aarch64/tst-sme-clone.c [new file with mode: 0644]
sysdeps/aarch64/tst-sme-clone3.c [new file with mode: 0644]
sysdeps/aarch64/tst-sme-fork.c [new file with mode: 0644]
sysdeps/aarch64/tst-sme-helper.h
sysdeps/aarch64/tst-sme-jmp.c
sysdeps/aarch64/tst-sme-signal.c [new file with mode: 0644]
sysdeps/aarch64/tst-sme-skeleton.c [new file with mode: 0644]
sysdeps/aarch64/tst-sme-vfork.c [new file with mode: 0644]
sysdeps/aarch64/tst-sme-za-state.c