From patchwork Fri Jul 1 13:51:02 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "H.J. Lu" X-Patchwork-Id: 13550 Received: (qmail 66714 invoked by alias); 1 Jul 2016 13:51:16 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 66693 invoked by uid 89); 1 Jul 2016 13:51:15 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.4 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 spammy=usable X-HELO: mail-qk0-f195.google.com X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=8f4Kd7tFD6FUr+QwYpt0wtyGA0LvnMmEZDRRy+uZRhA=; b=EUFUzl68eIkOxDEFxzsC2SqwdHa6VjQdiZd8hK3a1H/1ChN8/xY+w/SJzzrGCUpbmr /x5o7VOBjJCmUDz5h5stF8oZp4yHUbVfswmmgKEQ84SwINbB5K0cuCPrZK1WagbCW7pj VCt9c158Mex6/vLGcYgv8n+pdpoTdqW+Dv9jbGcaOhoG4Qj2wgSmj1OSVOt/U5KYP07b XflMX8bjwYWOVu10DVkfmrgxdqC9kKAJPfi8cdoPMy2mFz8HshVC96mwTXAbBGl97O3p 5REsHoKdxJlV6QagspchNcZVwI87tXqE49RwUCKTJQrQnmpOH/DWXdo6A6iKllJKFrjj 02Tg== X-Gm-Message-State: ALyK8tJirjBe2yK/PqEPoaTW9vX0MBv5Tr+gLxkhJJ2OnKSVJXTry8MyXhSbLGXF5x6AdmEjV6WcKJ7cv3dIKg== X-Received: by 10.55.137.71 with SMTP id l68mr27812948qkd.17.1467381063726; Fri, 01 Jul 2016 06:51:03 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: References: <96d24e9d-bf84-a43b-2860-c49d4fe341a4@redhat.com> <53986bbf-b12c-7d68-01de-5506ddf6d6e0@redhat.com> <0fb8e559-e812-7e23-8080-67314fa486e1@redhat.com> From: "H.J. Lu" Date: Fri, 1 Jul 2016 06:51:02 -0700 Message-ID: Subject: Re: [PATCH x86_64][BZ #20139] Don't allow configure with not supporting AVX512 assembler w/o --disable-avx512. To: Florian Weimer Cc: Andrew Senkevich , Joseph Myers , libc-alpha On Fri, Jul 1, 2016 at 5:57 AM, H.J. Lu wrote: > On Fri, Jul 1, 2016 at 5:40 AM, Florian Weimer wrote: >> On 07/01/2016 02:28 PM, Andrew Senkevich wrote: >> >>>> I have no objections to the patch as such (but also see my other comment >>>> about aligning the XGETBV values with what the dynamic linker supports). >>> >>> >>> Have we decided how to fix it in 2.23 release (which contains this bug)? >> >> >> Not to my knowledge. >> >> Please also consider >> . >> >> I would like to see a conceptual fix, not just papering over the current >> problem. >> > > FWIW, glibc 2.23 requires binutils 2.24 for s390. > We can do something like this for 2.23. diff --git a/sysdeps/x86/cpu-features.c b/sysdeps/x86/cpu-features.c index 218ff2b..abf38e4 100644 --- a/sysdeps/x86/cpu-features.c +++ b/sysdeps/x86/cpu-features.c @@ -211,14 +211,30 @@ init_cpu_features (struct cpu_features *cpu_features) /* Determine if AVX512F is usable. */ if (HAS_CPU_FEATURE (AVX512F)) { +#ifdef HAVE_AVX512_ASM_SUPPORT cpu_features->feature[index_AVX512F_Usable] |= bit_AVX512F_Usable; /* Determine if AVX512DQ is usable. */ if (HAS_CPU_FEATURE (AVX512DQ)) cpu_features->feature[index_AVX512DQ_Usable] |= bit_AVX512DQ_Usable; +#else +# if index_AVX2_Usable != index_AVX_Usable +# error index_AVX2_Usable != index_AVX_Usable +# endif + /* Turn off AVX support since dynamic linker can only + save and restore YMM registers, which clobbers the + upper 256 bits ofr ZMM registers. */ + cpu_features->feature[index_AVX_Usable] + &= ~(bit_AVX_Usable + | bit_AVX2_Usable + | bit_AVX_Fast_Unaligned_Load); +#endif } } +#ifndef HAVE_AVX512_ASM_SUPPORT + if (HAS_ARCH_FEATURE (AVX_Usable)) +#endif /* Determine if FMA is usable. */ if (HAS_CPU_FEATURE (FMA)) cpu_features->feature[index_FMA_Usable] |= bit_FMA_Usable;