From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 59809 invoked by alias); 27 May 2016 10:36:03 -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 59796 invoked by uid 89); 27 May 2016 10:36:03 -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=fitting, Architectures, suspicious, highly 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 10:36:02 +0000 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (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 BC142627CF; Fri, 27 May 2016 10:36:00 +0000 (UTC) Received: from [127.0.0.1] (ovpn01.gateway.prod.ext.ams2.redhat.com [10.39.146.11]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u4RAZwvo017242; Fri, 27 May 2016 06:35:58 -0400 Subject: Re: [PATCH 1/4] Change xstate_bv handling to use 8 bytes of data. To: Michael Sturm , mark.kettenis@xs4all.nl, eliz@gnu.org References: <1463143833-24399-1-git-send-email-michael.sturm@intel.com> <1463143833-24399-2-git-send-email-michael.sturm@intel.com> Cc: gdb-patches@sourceware.org From: Pedro Alves Message-ID: Date: Fri, 27 May 2016 10:36: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-2-git-send-email-michael.sturm@intel.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-SW-Source: 2016-05/txt/msg00481.txt.bz2 On 05/13/2016 01:50 PM, Michael Sturm wrote: > The size of the state-component bitmap as specified in > Intel(R) 64 and IA-32 Architectures Software Developer's Manual, > Chapter 13.4.2 is 8 bytes. > So far, the data types used for xstate_bv_p (gdb_byte*), > clear_bv (unsigned int) and tdep->xcr0 (uint64_t) were > inconsistent. But, since the xstate components were still > fitting into a single byte, the code still worked > as expected. > However, with the addition of the PKU feature (bit 9), > using one byte for the bitmap will no longer be sufficient. > > This patch changes related code to use 64 bit data types > consistently and changes read/write acces of the XSAVE > header in the regcache to use memcpy, like already done > for register access. Does this work on a big endian host? The memcpy + logic on host type looks highly suspicious. Say, consider a x86-64 core dump loaded on a ppc64 gdb. Or remote debugging a x86-64 gdb from a ppc64 gdb. Thanks, Pedro Alves