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 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 write unit tests for the new > > code. Maybe I will just copy and paste the new and old functions, > > and test them locally (checking if they give the same results > > when translating blobs of random bytes). > > 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 exact moment the guest code is using that register. Do we have something that helps us repeatedly save/load CPU state while kvm-unit-tests is running? -- Eduardo -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html