Re: [PATCH v2 0/3] target-i386: Use C struct for xsave area layout, offsets & sizes

2015-12-01 Thread Paolo Bonzini
On 30/11/2015 18:34, Eduardo Habkost wrote: > target-i386/cpu.c:ext_save_area uses magic numbers for the xsave > area offets and sizes, and target-i386/kvm.c:kvm_{put,get}_xsave() > uses offset macros and bit manipulation to access the xsave area. > This series changes both to use C structs for

Re: [PATCH v2 0/3] target-i386: Use C struct for xsave area layout, offsets & sizes

2015-12-01 Thread Paolo Bonzini
On 30/11/2015 18:34, Eduardo Habkost wrote: > target-i386/cpu.c:ext_save_area uses magic numbers for the xsave > area offets and sizes, and target-i386/kvm.c:kvm_{put,get}_xsave() > uses offset macros and bit manipulation to access the xsave area. > This series changes both to use C structs for

Re: [PATCH v2 0/3] target-i386: Use C struct for xsave area layout, offsets & sizes

2015-12-01 Thread Eduardo Habkost
On Tue, Dec 01, 2015 at 11:22:31AM +0100, Paolo Bonzini wrote: > On 30/11/2015 18:34, Eduardo Habkost wrote: > > target-i386/cpu.c:ext_save_area uses magic numbers for the xsave > > area offets and sizes, and target-i386/kvm.c:kvm_{put,get}_xsave() > > uses offset macros and bit manipulation to

Re: [PATCH v2 0/3] target-i386: Use C struct for xsave area layout, offsets & sizes

2015-12-01 Thread Paolo Bonzini
On 01/12/2015 16:25, Eduardo Habkost wrote: > > I think it's easier to use small guests (i.e. kvm-unit-tests) to test > > this code. > > I agree it's easier, but how likely it is to catch bugs in the > save/load code? If the code corrupts a register, we need to > trigger a save/load cycle at the

Re: [PATCH v2 0/3] target-i386: Use C struct for xsave area layout, offsets & sizes

2015-12-01 Thread Eduardo Habkost
On Tue, Dec 01, 2015 at 04:09:44PM +0100, Paolo Bonzini wrote: > > > On 30/11/2015 18:34, Eduardo Habkost wrote: > > target-i386/cpu.c:ext_save_area uses magic numbers for the xsave > > area offets and sizes, and target-i386/kvm.c:kvm_{put,get}_xsave() > > uses offset macros and bit manipulation

[PATCH v2 0/3] target-i386: Use C struct for xsave area layout, offsets & sizes

2015-11-30 Thread Eduardo Habkost
target-i386/cpu.c:ext_save_area uses magic numbers for the xsave area offets and sizes, and target-i386/kvm.c:kvm_{put,get}_xsave() uses offset macros and bit manipulation to access the xsave area. This series changes both to use C structs for those operations. I still need to figure out a way to