]> git.ipfire.org Git - thirdparty/glibc.git/commit
x86: Use separate variable for TLSDESC XSAVE/XSAVEC state size (bug 32810)
authorFlorian Weimer <fweimer@redhat.com>
Fri, 28 Mar 2025 08:26:59 +0000 (09:26 +0100)
committerFlorian Weimer <fweimer@redhat.com>
Sat, 29 Mar 2025 08:17:38 +0000 (09:17 +0100)
commit145097dff170507fe73190e8e41194f5b5f7e6bf
tree1c8665d5bc4921d5c12e51273cee7d46a4a12ab8
parent59585ddaa2d44f22af04bb4b8bd4ad1e302c4c02
x86: Use separate variable for TLSDESC XSAVE/XSAVEC state size (bug 32810)

Previously, the initialization code reused the xsave_state_full_size
member of struct cpu_features for the TLSDESC state size.  However,
the tunable processing code assumes that this member has the
original XSAVE (non-compact) state size, so that it can use its
value if XSAVEC is disabled via tunable.

This change uses a separate variable and not a struct member because
the value is only needed in ld.so and the static libc, but not in
libc.so.  As a result, struct cpu_features layout does not change,
helping a future backport of this change.

Fixes commit 9b7091415af47082664717210ac49d51551456ab ("x86-64:
Update _dl_tlsdesc_dynamic to preserve AMX registers").

Reviewed-by: H.J. Lu <hjl.tools@gmail.com>
sysdeps/x86/Makefile
sysdeps/x86/cpu-features.c
sysdeps/x86/cpu-tunables.c
sysdeps/x86/dl-diagnostics-cpu.c
sysdeps/x86/include/cpu-features.h
sysdeps/x86/tst-gnu2-tls2-x86-noxsave.c [new file with mode: 0644]
sysdeps/x86/tst-gnu2-tls2-x86-noxsavec.c [new file with mode: 0644]
sysdeps/x86/tst-gnu2-tls2-x86-noxsavexsavec.c [new file with mode: 0644]
sysdeps/x86_64/dl-tlsdesc-dynamic.h