[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 14/28] target/i386: Add {hw, sw}_reserved to X86LegacyXSaveAre
|
From: |
Richard Henderson |
|
Subject: |
[PATCH v2 14/28] target/i386: Add {hw, sw}_reserved to X86LegacyXSaveArea |
|
Date: |
Mon, 8 Apr 2024 19:02:48 -1000 |
This completes the 512 byte structure, allowing the union to
be removed. Assert that the structure layout is as expected.
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
target/i386/cpu.h | 39 +++++++++++++++++++++++++--------------
1 file changed, 25 insertions(+), 14 deletions(-)
diff --git a/target/i386/cpu.h b/target/i386/cpu.h
index 5860acb0c3..5f9c420084 100644
--- a/target/i386/cpu.h
+++ b/target/i386/cpu.h
@@ -1419,23 +1419,34 @@ typedef struct {
*/
#define UNASSIGNED_APIC_ID 0xFFFFFFFF
-typedef union X86LegacyXSaveArea {
- struct {
- uint16_t fcw;
- uint16_t fsw;
- uint8_t ftw;
- uint8_t reserved;
- uint16_t fpop;
- uint64_t fpip;
- uint64_t fpdp;
- uint32_t mxcsr;
- uint32_t mxcsr_mask;
- FPReg fpregs[8];
- uint8_t xmm_regs[16][16];
+typedef struct X86LegacyXSaveArea {
+ uint16_t fcw;
+ uint16_t fsw;
+ uint8_t ftw;
+ uint8_t reserved;
+ uint16_t fpop;
+ union {
+ struct {
+ uint64_t fpip;
+ uint64_t fpdp;
+ };
+ struct {
+ uint32_t fip;
+ uint32_t fcs;
+ uint32_t foo;
+ uint32_t fos;
+ };
};
- uint8_t data[512];
+ uint32_t mxcsr;
+ uint32_t mxcsr_mask;
+ FPReg fpregs[8];
+ uint8_t xmm_regs[16][16];
+ uint32_t hw_reserved[12];
+ uint32_t sw_reserved[12];
} X86LegacyXSaveArea;
+QEMU_BUILD_BUG_ON(sizeof(X86LegacyXSaveArea) != 512);
+
typedef struct X86XSaveHeader {
uint64_t xstate_bv;
uint64_t xcomp_bv;
--
2.34.1
- [PATCH v2 05/28] target/i386: Convert do_fstenv to X86Access, (continued)
- [PATCH v2 05/28] target/i386: Convert do_fstenv to X86Access, Richard Henderson, 2024/04/09
- [PATCH v2 06/28] target/i386: Convert do_fsave, do_frstor to X86Access, Richard Henderson, 2024/04/09
- [PATCH v2 07/28] target/i386: Convert do_xsave_{fpu, mxcr, sse} to X86Access, Richard Henderson, 2024/04/09
- [PATCH v2 08/28] target/i386: Convert do_xrstor_{fpu, mxcr, sse} to X86Access, Richard Henderson, 2024/04/09
- [PATCH v2 09/28] tagret/i386: Convert do_fxsave, do_fxrstor to X86Access, Richard Henderson, 2024/04/09
- [PATCH v2 10/28] target/i386: Convert do_xsave_* to X86Access, Richard Henderson, 2024/04/09
- [PATCH v2 11/28] target/i386: Convert do_xrstor_* to X86Access, Richard Henderson, 2024/04/09
- [PATCH v2 12/28] target/i386: Split out do_xsave_chk, Richard Henderson, 2024/04/09
- [PATCH v2 13/28] target/i386: Add rbfm argument to cpu_x86_{xsave, xrstor}, Richard Henderson, 2024/04/09
- [PATCH v2 15/28] linux-user/i386: Drop xfeatures_size from sigcontext arithmetic, Richard Henderson, 2024/04/09
- [PATCH v2 14/28] target/i386: Add {hw, sw}_reserved to X86LegacyXSaveArea,
Richard Henderson <=
- [PATCH v2 16/28] linux-user/i386: Remove xfeatures from target_fpstate_fxsave, Richard Henderson, 2024/04/09
- [PATCH v2 17/28] linux-user/i386: Replace target_fpstate_fxsave with X86LegacyXSaveArea, Richard Henderson, 2024/04/09
- [PATCH v2 18/28] linux-user/i386: Split out struct target_fregs_state, Richard Henderson, 2024/04/09
- [PATCH v2 20/28] linux-user/i386: Return boolean success from restore_sigcontext, Richard Henderson, 2024/04/09
- [PATCH v2 19/28] linux-user/i386: Fix -mregparm=3 for signal delivery, Richard Henderson, 2024/04/09
- [PATCH v2 21/28] linux-user/i386: Return boolean success from xrstor_sigcontext, Richard Henderson, 2024/04/09
- [PATCH v2 23/28] target/i386: Honor xfeatures in xrstor_sigcontext, Richard Henderson, 2024/04/09