From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42092) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a3obg-00008w-Pl for qemu-devel@nongnu.org; Tue, 01 Dec 2015 12:20:49 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a3obc-0000V2-Jf for qemu-devel@nongnu.org; Tue, 01 Dec 2015 12:20:48 -0500 Received: from mail-qg0-x230.google.com ([2607:f8b0:400d:c04::230]:36425) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a3obc-0000Uy-FO for qemu-devel@nongnu.org; Tue, 01 Dec 2015 12:20:44 -0500 Received: by qgcc31 with SMTP id c31so10600908qgc.3 for ; Tue, 01 Dec 2015 09:20:44 -0800 (PST) Sender: Richard Henderson References: <1448740611-3096-1-git-send-email-ehabkost@redhat.com> <1448740611-3096-2-git-send-email-ehabkost@redhat.com> <565C3089.4070101@redhat.com> <565DD45B.3070505@twiddle.net> <20151201171550.GN23717@thinpad.lan.raisama.net> From: Richard Henderson Message-ID: <565DD6E9.1040906@twiddle.net> Date: Tue, 1 Dec 2015 09:20:41 -0800 MIME-Version: 1.0 In-Reply-To: <20151201171550.GN23717@thinpad.lan.raisama.net> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [for-2.6 PATCH 1/3] target-i386: Define structs for layout of xsave area List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eduardo Habkost Cc: Paolo Bonzini , qemu-devel@nongnu.org, kvm@vger.kernel.org, Huaitong Han On 12/01/2015 09:15 AM, Eduardo Habkost wrote: > On Tue, Dec 01, 2015 at 09:09:47AM -0800, Richard Henderson wrote: >> On 11/30/2015 03:18 AM, Paolo Bonzini wrote: >>> Because this is always little endian, I would write it as uint8_t[16][16]. >> >> Maybe. That isn't altogether handy for TCG, since we'll be wanting to bswap >> these buffers (probably in uint64_t chunks). > > X86XSaveArea will be used only when loading/saving state using > xsave, not for executing regular instructions. ... like the regular instruction xsave? https://patchwork.ozlabs.org/patch/493318/ > In X86CPU, the > data is already stored as XMMReg unions (the one with the > XMM_[BWDQ] helpers). Of course. But those unions are arranged to be in big-endian format on big-endian hosts. So we need to swap the data back to little-endian format for storage into guest memory. r~