Bug ID: 22641
Summary: Merge error in x86 XSAVE dynamic linker trampoline
commit in 2.23
Assignee: unassigned at sourceware dot org
Reporter: fweimer at redhat dot com
Target Milestone: ---
The check for the availability of XSAVE is incorrectly nested under that for
AVX YMM registers:
185 /* Can we call xgetbv? */
186 if (HAS_CPU_FEATURE (OSXSAVE))
188 unsigned int xcrlow;
189 unsigned int xcrhigh;
190 asm ("xgetbv" : "=a" (xcrlow), "=d" (xcrhigh) : "c" (0));
191 /* Is YMM and XMM state usable? */
192 if ((xcrlow & (bit_YMM_state | bit_XMM_state)) ==
193 (bit_YMM_state | bit_XMM_state))
195 /* Determine if AVX is usable. */
196 if (HAS_CPU_FEATURE (AVX))
230 /* For _dl_runtime_resolve, set xsave_state_size to xsave
231 size + integer register save size and align it to 64
232 if (cpu_features->max_cpuid >= 0xd)
234 unsigned int eax, ebx, ecx, edx;
236 __cpuid_count (0xd, 0, eax, ebx, ecx, edx);
237 if (ebx != 0)
240 = ALIGN_UP (ebx + STATE_SAVE_OFFSET, 64);
As far as I can see, this only affects the 2.23 release branch.
We are still investigating the practical impact of this change (without AVX,
FXSAVE should be good enough, unless the configuration is very special and MPX
or pkeys support is present).
You are receiving this mail because:
You are on the CC list for the bug.
--- Comment #1 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot gnu.org> ---
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU C Library master sources".
The branch, release/2.23/master has been updated
via fbd72f14904b8a81816528e0cc5bb3315fc70a47 (commit)
from 26d289bb92b6d1125536644f607c73617463477d (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
x86: Fix mis-merge of XSAVE ld.so trampoline selection [BZ #22641]
The change is best viewed with “diff -w”:
@@ -226,6 +226,7 @@ init_cpu_features (struct cpu_features *cpu_features)
/* Determine if FMA4 is usable. */
if (HAS_CPU_FEATURE (FMA4))
cpu_features->feature[index_FMA4_Usable] |= bit_FMA4_Usable;
/* For _dl_runtime_resolve, set xsave_state_size to xsave area
size + integer register save size and align it to 64 bytes. */
@@ -292,7 +293,6 @@ init_cpu_features (struct cpu_features *cpu_features)
Without this change, XSAVE support will never be selected unless the CPU
also supports AVX, which is not what we want. For example, if AVX is
disabled, but MPX is supported, the BND registers are not preserved if
we use FXSAVE instead of XSAVE.
This fixes commit 26d289bb92b6d1125536644f607c73617463477d (x86-64:
Use fxsave/xsave/xsavec in _dl_runtime_resolve).