From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15725 invoked by alias); 26 Jan 2017 14:46:12 -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 15710 invoked by uid 89); 26 Jan 2017 14:46:11 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-5.1 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=Meanwhile, fitting 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 ESMTP; Thu, 26 Jan 2017 14:46:10 +0000 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) (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 155867FB7C; Thu, 26 Jan 2017 14:46:10 +0000 (UTC) Received: from [127.0.0.1] (ovpn04.gateway.prod.ext.phx2.redhat.com [10.5.9.4]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v0QEk0km026362; Thu, 26 Jan 2017 09:46:08 -0500 Subject: Re: [PATCH v3 2/5] Change xstate_bv handling to use 8 bytes of data. To: Michael Sturm , mark.kettenis@xs4all.nl, eliz@gnu.org References: <1481021894-29471-1-git-send-email-michael.sturm@intel.com> <1481021894-29471-3-git-send-email-michael.sturm@intel.com> Cc: gdb-patches@sourceware.org From: Pedro Alves Message-ID: Date: Thu, 26 Jan 2017 14:46:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: <1481021894-29471-3-git-send-email-michael.sturm@intel.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-SW-Source: 2017-01/txt/msg00575.txt.bz2 On 12/06/2016 10:58 AM, 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 xsave buffer to use the endianess-aware > functions extract_unsigned_integer and store_unsigned_integer. The typing is a bit inconsistent, with some places using unsigned long long, while others ULONGEST. It'd be nice to use uint64_t if we exactly mean 64-bit. But that's for another day. Meanwhile, this LGTM. > * i387-tdep.c (i387_supply_xsave): Change type > of clear_bv to ULONGEST. Replace gdb_byte *xstate_bv_p > with ULONGEST xstate_bv and use extract_unsigned_integer > and store_unsigned_integer to read/write its value from > the xsave buffer. This is required to make sure that > eventual differences in endianess between host and > target are taken care off. The "This is required ..." part belongs in the commit log. The ChangeLogs only mention the "what", not the "why". Thanks, Pedro Alves