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 the same 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). Eduardo Habkost (3): target-i386: Define structs for layout of xsave area target-i386: Use xsave structs for ext_save_area target-i386: kvm: Use X86XSaveArea struct for xsave save/load target-i386/cpu.c | 18 +++++--- target-i386/cpu.h | 85 ++++++++++++++++++++++++++++++++++++++ target-i386/kvm.c | 121 +++++++++++++++++++++++------------------------------- 3 files changed, 149 insertions(+), 75 deletions(-) -- 2.1.0 -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html