From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 59573 invoked by alias); 27 May 2016 11:04:30 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 59547 invoked by uid 89); 27 May 2016 11:04:29 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.3 required=5.0 tests=BAYES_00,KAM_LAZY_DOMAIN_SECURITY,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=2014-2016, 20142016, falling, Includes X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Fri, 27 May 2016 11:04:18 +0000 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 8330A633; Fri, 27 May 2016 11:04:17 +0000 (UTC) Received: from [127.0.0.1] (ovpn01.gateway.prod.ext.ams2.redhat.com [10.39.146.11]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u4RB4EEM000699; Fri, 27 May 2016 07:04:14 -0400 Subject: Re: [PATCH 3/4] Add target descriptor for avx-avx512. To: Michael Sturm , mark.kettenis@xs4all.nl, eliz@gnu.org References: <1463143833-24399-1-git-send-email-michael.sturm@intel.com> <1463143833-24399-4-git-send-email-michael.sturm@intel.com> Cc: gdb-patches@sourceware.org From: Pedro Alves Message-ID: <8479799b-8ce7-4d0a-5654-e6128ebd4684@redhat.com> Date: Fri, 27 May 2016 11:04:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.1.0 MIME-Version: 1.0 In-Reply-To: <1463143833-24399-4-git-send-email-michael.sturm@intel.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-SW-Source: 2016-05/txt/msg00483.txt.bz2 s/descriptor/description/g On 05/13/2016 01:50 PM, Michael Sturm wrote: > Add a dedicated target descriptor for the feature combination > avx-avx512 as implemented by certain IA CPU models. > > The corresponding X86_XSTATE_AVX_AVX512_MASK already exists, but shared > the tdesc with X86_XSTATE_AVX_MPX_AVX512_MASK. This caused MPX registers > displayed as undefined on CPUs that only implemented > X86_XSTATE_AVX_AVX512_MASK, which is undesired. This patch solves this issue. > > This patch also corrects the wrong usage of x32-avx-mpx-avx512, which is > replaced by x32-avx-avx512. The MPX feature is not implemented in x32 mode. > > gdb/Changelog: > 2016-04-18 Michael Sturm > > * amd64-linux-tdep.c (features/i386/amd64-avx-avx512-linux.c): > New include. > (features/i386/x32-avx-mpx-avx512-linux.c): Renamed include. > (amd64_linux_core_read_description): Add dedicated cases for > X86_XSTATE_AVX_AVX512_MASK and return appropriate tdesc. > (_initialize_amd64_linux_tdep): Add calls to > initialize_tdesc_amd64_avx_avx512_linux () and > initialize_tdesc_x32_avx_avx512_linux (). Don't add " ()" when you mention names of functions. Here and throughout (the series). > * amd64-linux.tdep.h (tdesc_amd64_avx_avx512_linux): New prototype. > (tdesc_x32_avx_mpx_avx512_linux): Renamed prototype. Is that old or new name? Renames should say both. E.g., this is a frequently used style: (foo): Rename to ... (bar): ... this. > * features/i386/x32-avx-mpx-avx512-linux.c: Regenerated from renamed XML > file. This is incorrect -- it must be that x32-avx-mpx-avx512-linux.c was deleted, and features/i386/x32-avx-avx512-linux.c is a new file. > * features/i386/x32-avx-mpx-avx512-linux.xml: Renamed to > features/i386/x32-avx-avx512-linux.xml Missing period. > * Makefile.in (clean): Added handling new source files ^^ spurious double space. "handling of" ? Or just say "Remove i386-avx-avx512.c, ..." > i386-avx-avx512.c, i386-avx-avx512-linux.c, amd64-avx-avx512.c, > amd64-avx-avx512-linux.c. > (initialize_low_tracepoint): Added init_registers_amd64_avx_avx512_linux. > * linux-i386-ipa.c (get_ipa_tdesc): Added dedicated case for > X86_TDESC_AVX_AVX512 and returne appropriate tdesc. typo "returne". The comments above apply to multiple places, but I just pointed out one of each. > diff --git a/gdb/amd64-linux-tdep.c b/gdb/amd64-linux-tdep.c > index d70c4b0..7e54a8f 100644 > --- a/gdb/amd64-linux-tdep.c > +++ b/gdb/amd64-linux-tdep.c > @@ -44,11 +44,12 @@ > #include "features/i386/amd64-avx-linux.c" > #include "features/i386/amd64-mpx-linux.c" > #include "features/i386/amd64-avx-mpx-linux.c" > +#include "features/i386/amd64-avx-avx512-linux.c" > #include "features/i386/amd64-avx-mpx-avx512-linux.c" > > #include "features/i386/x32-linux.c" > #include "features/i386/x32-avx-linux.c" > -#include "features/i386/x32-avx-mpx-avx512-linux.c" > +#include "features/i386/x32-avx-avx512-linux.c" > > /* The syscall's XML filename for i386. */ > #define XML_SYSCALL_FILENAME_AMD64 "syscalls/amd64-linux.xml" > @@ -1581,11 +1582,16 @@ amd64_linux_core_read_description (struct gdbarch *gdbarch, > switch (xcr0 & X86_XSTATE_ALL_MASK) > { > case X86_XSTATE_AVX_MPX_AVX512_MASK: > - case X86_XSTATE_AVX_AVX512_MASK: > if (gdbarch_ptr_bit (gdbarch) == 32) > - return tdesc_x32_avx_mpx_avx512_linux; > + /* No x32 MPX falling back to AVX-AVX512. */ I know this string appears in other places already, but I'd like to point out that it sounds quite odd to me. I suggest saying what appears on the gdbserver hunk: /* No MPX on x32, fallback to AVX-AVX512. */ > diff --git a/gdb/features/i386/x32-avx-avx512-linux.xml b/gdb/features/i386/x32-avx-avx512-linux.xml > new file mode 100644 > index 0000000..36bcbb7 > --- /dev/null > +++ b/gdb/features/i386/x32-avx-avx512-linux.xml > @@ -0,0 +1,19 @@ > + > + > + > + MPX shouldn't be here, I believe. > diff --git a/gdb/features/i386/x32-avx-avx512.xml b/gdb/features/i386/x32-avx-avx512.xml > new file mode 100644 > index 0000000..9e17826 > --- /dev/null > +++ b/gdb/features/i386/x32-avx-avx512.xml > @@ -0,0 +1,17 @@ > + > + > + > + Ditto. Thanks, Pedro Alves