This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH x86_64][BZ #20139] Don't allow configure with not supporting AVX512 assembler w/o --disable-avx512.
- From: Florian Weimer <fweimer at redhat dot com>
- To: Andrew Senkevich <andrew dot n dot senkevich at gmail dot com>
- Cc: libc-alpha <libc-alpha at sourceware dot org>
- Date: Tue, 28 Jun 2016 13:46:03 +0200
- Subject: Re: [PATCH x86_64][BZ #20139] Don't allow configure with not supporting AVX512 assembler w/o --disable-avx512.
- Authentication-results: sourceware.org; auth=none
- References: <CAMXFM3tJkhW78PPe4=FUhbm=8HoOY4iouSqXxLObA0GEMTxoZA at mail dot gmail dot com>
On 06/27/2016 07:40 PM, Andrew Senkevich wrote:
Hi,
this patch adds new configure option --enable-avx512 and defaults it for x86_64.
To fix BZ #20139 we need don't let to configure with not supporting
AVX512 assembler w/o --disable-avx512.
2016-06-27 Andrew Senkevich <andrew.senkevich@intel.com>
[BZ #20139]
* configure.ac: Added --enable-avx512.
* sysdeps/x86_64/configure.ac: Check for --disable-avx512
if no AVX512 assembler support.
* configure: Regenerated.
* sysdeps/x86_64/configure: Likewise.
* manual/install.texi (Configuring and compiling): Document
--enable-avx512.
* INSTALL: Regenerated.
I thought about this some more, and we have to either of two things:
(a) Tell the kernel to set the feature support mask using XSETBV to the
AND of what is supported by the hardware, the kernel, and the dynamic
linker. This likely needs kernel changes (new prctl interface).
or
(b) Use XSAVE/XRSTOR to save and restore the extended CPU state around
the call to _dl_fixup, instead of guessing what the kernel and
application code expects.
If we don't anything here, we will keep running into the same issue,
which is not acceptable IMHO.
Option (b) seems to be rather costly both in terms of stack space (2688
bytes) and cycles. So we would probably keep the existing wrappers
which save registers selectively, and use approach (b) only in case when
XGETBV with ECX=0 returns feature bits we know nothing about (or cannot
build support into glibc, as with !HAVE_AVX512_ASM_SUPPORT).
Comments?
Thanks,
Florian