x86-64: Update _dl_tlsdesc_dynamic to preserve AMX registers
commit9b7091415af47082664717210ac49d51551456ab
authorH.J. Lu <hjl.tools@gmail.com>
Wed, 28 Feb 2024 20:08:03 +0000 (28 12:08 -0800)
committerH.J. Lu <hjl.tools@gmail.com>
Thu, 29 Feb 2024 12:30:01 +0000 (29 04:30 -0800)
treeb2754fd0f298085481c5ebcac55721a4eb09ef53
parenta1735e0aa858f0c8b15e5ee9975bff4279423680
x86-64: Update _dl_tlsdesc_dynamic to preserve AMX registers

_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.
Reviewed-by: Sunil K Pandey <skpgkp2@gmail.com>
14 files changed:
sysdeps/unix/sysv/linux/x86_64/Makefile
sysdeps/unix/sysv/linux/x86_64/include/asm/prctl.h
sysdeps/unix/sysv/linux/x86_64/tst-gnu2-tls2-amx-mod0.c [new file with mode: 0644]
sysdeps/unix/sysv/linux/x86_64/tst-gnu2-tls2-amx-mod1.c [new file with mode: 0644]
sysdeps/unix/sysv/linux/x86_64/tst-gnu2-tls2-amx-mod2.c [new file with mode: 0644]
sysdeps/unix/sysv/linux/x86_64/tst-gnu2-tls2-amx.c [new file with mode: 0644]
sysdeps/unix/sysv/linux/x86_64/tst-gnu2-tls2-amx.h [new file with mode: 0644]
sysdeps/x86/cpu-features-offsets.sym
sysdeps/x86/cpu-features.c
sysdeps/x86/include/cpu-features.h
sysdeps/x86/sysdep.h
sysdeps/x86_64/configure
sysdeps/x86_64/configure.ac
sysdeps/x86_64/dl-tlsdesc-dynamic.h