[PATCH v2 0/1] x86-64: Update _dl_tlsdesc_dynamic to preserve AMX registers
H.J. Lu
hjl.tools@gmail.com
Wed Feb 28 20:08:02 GMT 2024
Changes in v2:
1. Unroll the first loop in init_tile_config in AMX test.
---
_dl_tlsdesc_dynamic should also preserve AMX registers which are
caller-saved. Add X86_XSTATE_TILECFG_ID and X86_XSTATE_TILEDATA_ID
to x86-64 TLSDESC_CALL_STATE_SAVE_MASK. Compute the AMX state size
and save it in xsave_state_full_size which is only used by
_dl_tlsdesc_dynamic_xsave and _dl_tlsdesc_dynamic_xsavec. This fixes
the AMX part of BZ #31372. Tested on AMX processor.
AMX test is enabled only for compilers with the fix for
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114098
GCC 14 and GCC 11/12/13 branches have the bug fix.
---
H.J. Lu (1):
x86-64: Update _dl_tlsdesc_dynamic to preserve AMX registers
sysdeps/unix/sysv/linux/x86_64/Makefile | 27 ++++++
.../sysv/linux/x86_64/include/asm/prctl.h | 5 ++
.../linux/x86_64/tst-gnu2-tls2-amx-mod0.c | 2 +
.../linux/x86_64/tst-gnu2-tls2-amx-mod1.c | 2 +
.../linux/x86_64/tst-gnu2-tls2-amx-mod2.c | 2 +
.../sysv/linux/x86_64/tst-gnu2-tls2-amx.c | 83 +++++++++++++++++++
.../sysv/linux/x86_64/tst-gnu2-tls2-amx.h | 63 ++++++++++++++
sysdeps/x86/cpu-features-offsets.sym | 1 +
sysdeps/x86/cpu-features.c | 55 +++++++++++-
sysdeps/x86/include/cpu-features.h | 2 +
sysdeps/x86/sysdep.h | 18 +++-
sysdeps/x86_64/configure | 28 +++++++
sysdeps/x86_64/configure.ac | 15 ++++
sysdeps/x86_64/dl-tlsdesc-dynamic.h | 2 +-
14 files changed, 299 insertions(+), 6 deletions(-)
create mode 100644 sysdeps/unix/sysv/linux/x86_64/tst-gnu2-tls2-amx-mod0.c
create mode 100644 sysdeps/unix/sysv/linux/x86_64/tst-gnu2-tls2-amx-mod1.c
create mode 100644 sysdeps/unix/sysv/linux/x86_64/tst-gnu2-tls2-amx-mod2.c
create mode 100644 sysdeps/unix/sysv/linux/x86_64/tst-gnu2-tls2-amx.c
create mode 100644 sysdeps/unix/sysv/linux/x86_64/tst-gnu2-tls2-amx.h
--
2.43.2
More information about the Libc-alpha
mailing list