From 08bfa41e1ba0b2222aba2676510e4bdd02c9b2dd Mon Sep 17 00:00:00 2001 From: Eduardo Habkost Date: Mon, 26 Feb 2018 09:36:54 -0500 Subject: [PATCH] target-i386: xsave: Add FP and SSE bits to x86_ext_save_areas Instead of treating the FP and SSE bits as special cases, add them to the x86_ext_save_areas array. This will simplify the code that calculates the supported xsave components and the size of the xsave area. Backports commit e3c9022b4e2b6a4deb6518361d2bbf33522b9198 from qemu --- qemu/target-i386/cpu.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/qemu/target-i386/cpu.c b/qemu/target-i386/cpu.c index b94e12a0..928ccb50 100644 --- a/qemu/target-i386/cpu.c +++ b/qemu/target-i386/cpu.c @@ -578,13 +578,19 @@ typedef struct ExtSaveArea { static const ExtSaveArea x86_ext_save_areas[] = { // XSTATE_FP_BIT { - 0, 0, - 0, 0 + /* x87 FP state component is always enabled if XSAVE is supported */ + FEAT_1_ECX, CPUID_EXT_XSAVE, + /* x87 state is in the legacy region of the XSAVE area */ + 0, + sizeof(X86LegacyXSaveArea) + sizeof(X86XSaveHeader), }, // XSTATE_SSE_BIT { - 0, 0, - 0, 0, + /* SSE state component is always enabled if XSAVE is supported */ + FEAT_1_ECX, CPUID_EXT_XSAVE, + /* SSE state is in the legacy region of the XSAVE area */ + 0, + sizeof(X86LegacyXSaveArea) + sizeof(X86XSaveHeader), }, // XSTATE_YMM_BIT {