From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43945) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a3oi5-0001qR-GR for qemu-devel@nongnu.org; Tue, 01 Dec 2015 12:27:26 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a3oi2-0002Rw-As for qemu-devel@nongnu.org; Tue, 01 Dec 2015 12:27:25 -0500 Received: from mail-wm0-x234.google.com ([2a00:1450:400c:c09::234]:35499) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a3oi2-0002Rh-46 for qemu-devel@nongnu.org; Tue, 01 Dec 2015 12:27:22 -0500 Received: by wmuu63 with SMTP id u63so182717477wmu.0 for ; Tue, 01 Dec 2015 09:27:21 -0800 (PST) Sender: Paolo Bonzini 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> <565DD6E9.1040906@twiddle.net> From: Paolo Bonzini Message-ID: <565DD875.7090108@redhat.com> Date: Tue, 1 Dec 2015 18:27:17 +0100 MIME-Version: 1.0 In-Reply-To: <565DD6E9.1040906@twiddle.net> Content-Type: text/plain; charset=windows-1252 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: Richard Henderson , Eduardo Habkost Cc: Huaitong Han , qemu-devel@nongnu.org, kvm@vger.kernel.org On 01/12/2015 18:20, Richard Henderson wrote: >> >> 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/ Right, but that's a helper anyway. >> 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. Yes, you can use byte moves with XMM_B (more obvious), or stq_le_p with XMM_Q (faster I guess---though the compiler might optimize the former on little-endian hosts). Either works with an uint8_t[] destination. Paolo