target-i386: Use xsave structs for ext_save_area

This doesn't introduce any change in the code, as the offsets and
struct sizes match what was present in the table. This can be
validated by the QEMU_BUILD_BUG_ON lines on target-i386/cpu.h,
which ensures the struct sizes and offsets match the existing
values in ext_save_area.

Backports commit ee1b09f695dcd8532f470e53297473bd3bc88718 from qemu
This commit is contained in:
Eduardo Habkost 2018-02-24 03:13:08 -05:00 committed by Lioncash
parent 05963470a2
commit 923dcf1cb8
No known key found for this signature in database
GPG key ID: 4E3C3CC1031BA9C7

View file

@ -535,44 +535,44 @@ static const X86RegisterInfo32 x86_reg_info_32[CPU_NB_REGS32] = {
// XSTATE_YMM_BIT // XSTATE_YMM_BIT
{ {
FEAT_1_ECX, CPUID_EXT_AVX, FEAT_1_ECX, CPUID_EXT_AVX,
0x240, offsetof(X86XSaveArea, avx_state),
0x100, sizeof(XSaveAVX),
}, },
// XSTATE_BNDREGS_BIT // XSTATE_BNDREGS_BIT
{ {
FEAT_7_0_EBX, CPUID_7_0_EBX_MPX, FEAT_7_0_EBX, CPUID_7_0_EBX_MPX,
0x3c0, offsetof(X86XSaveArea, bndreg_state),
0x40, sizeof(XSaveBNDREG),
}, },
// XSTATE_BNDCSR_BIT // XSTATE_BNDCSR_BIT
{ {
FEAT_7_0_EBX, CPUID_7_0_EBX_MPX, FEAT_7_0_EBX, CPUID_7_0_EBX_MPX,
0x400, offsetof(X86XSaveArea, bndcsr_state),
0x40, sizeof(XSaveBNDCSR),
}, },
// XSTATE_OPMASK_BIT // XSTATE_OPMASK_BIT
{ {
FEAT_7_0_EBX, CPUID_7_0_EBX_AVX512F, FEAT_7_0_EBX, CPUID_7_0_EBX_AVX512F,
0x440, offsetof(X86XSaveArea, opmask_state),
0x40, sizeof(XSaveOpmask),
}, },
// XSTATE_ZMM_Hi256_BIT // XSTATE_ZMM_Hi256_BIT
{ {
FEAT_7_0_EBX, CPUID_7_0_EBX_AVX512F, FEAT_7_0_EBX, CPUID_7_0_EBX_AVX512F,
0x480, offsetof(X86XSaveArea, zmm_hi256_state),
0x200, sizeof(XSaveZMM_Hi256),
}, },
// XSTATE_Hi16_ZMM_BIT // XSTATE_Hi16_ZMM_BIT
{ {
FEAT_7_0_EBX, CPUID_7_0_EBX_AVX512F, FEAT_7_0_EBX, CPUID_7_0_EBX_AVX512F,
0x680, offsetof(X86XSaveArea, hi16_zmm_state),
0x400, sizeof(XSaveHi16_ZMM),
}, },
// XSTATE_PKRU_BIT // XSTATE_PKRU_BIT
{ {
FEAT_7_0_ECX, .bits = CPUID_7_0_ECX_PKU, FEAT_7_0_ECX, CPUID_7_0_ECX_PKU,
0xA80, offsetof(X86XSaveArea, pkru_state),
0x8, sizeof(XSavePKRU),
}, },
}; };