Re: [Qemu-devel] [for-2.6 PATCH 1/3] target-i386: Define structs for layout of xsave area

2015-12-01 Thread Richard Henderson
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). r~ -- To unsubscribe from this list: send the

Re: [Qemu-devel] [for-2.6 PATCH 1/3] target-i386: Define structs for layout of xsave area

2015-12-01 Thread Eduardo Habkost
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

Re: [Qemu-devel] [for-2.6 PATCH 1/3] target-i386: Define structs for layout of xsave area

2015-12-01 Thread Richard Henderson
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

Re: [Qemu-devel] [for-2.6 PATCH 1/3] target-i386: Define structs for layout of xsave area

2015-12-01 Thread Paolo Bonzini
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.

Re: [Qemu-devel] [for-2.6 PATCH 1/3] target-i386: Define structs for layout of xsave area

2015-12-01 Thread Eduardo Habkost
On Tue, Dec 01, 2015 at 06:27:17PM +0100, Paolo Bonzini wrote: > 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? > > > >

Re: [Qemu-devel] [for-2.6 PATCH 1/3] target-i386: Define structs for layout of xsave area

2015-12-01 Thread Richard Henderson
On 12/01/2015 10:34 AM, Eduardo Habkost wrote: BTW, if we are going to implement xsave in TCG, the X86CPU<->xsave translation logic in kvm_{get,put}_xsave() could be moved to generic code and reused by TCG instead of being reimplemented. That's not trivial. In particular, stq_p isn't what the

Re: [for-2.6 PATCH 1/3] target-i386: Define structs for layout of xsave area

2015-11-30 Thread Paolo Bonzini
On 28/11/2015 20:56, Eduardo Habkost wrote: > +/* Ext. save area 2: AVX State */ > +typedef struct XSaveAVX { > +uint64_t ymmh[16][2]; > +} XSaveAVX; > + Because this is always little endian, I would write it as uint8_t[16][16]. > +/* Ext. save area 6: ZMM_Hi256 */ > +typedef struct

Re: [for-2.6 PATCH 1/3] target-i386: Define structs for layout of xsave area

2015-11-30 Thread Eduardo Habkost
On Mon, Nov 30, 2015 at 12:18:33PM +0100, Paolo Bonzini wrote: > On 28/11/2015 20:56, Eduardo Habkost wrote: > > +/* Ext. save area 2: AVX State */ > > +typedef struct XSaveAVX { > > +uint64_t ymmh[16][2]; > > +} XSaveAVX; > > + > > Because this is always little endian, I would write it as

[for-2.6 PATCH 1/3] target-i386: Define structs for layout of xsave area

2015-11-28 Thread Eduardo Habkost
Add structs that define the layout of the xsave areas used by Intel processors. Add some QEMU_BUILD_BUG_ON lines to ensure the structs match the XSAVE_* macros in target-i386/kvm.c and the offsets and sizes at target-i386/cpu.c:ext_save_areas. Signed-off-by: Eduardo Habkost