[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 08/40] target/i386: Declare constants for XSAVE offsets
From: |
Paolo Bonzini |
Subject: |
[PULL 08/40] target/i386: Declare constants for XSAVE offsets |
Date: |
Tue, 6 Jul 2021 12:01:09 +0200 |
From: David Edmondson <david.edmondson@oracle.com>
Declare and use manifest constants for the XSAVE state component
offsets.
Signed-off-by: David Edmondson <david.edmondson@oracle.com>
Message-Id: <20210705104632.2902400-2-david.edmondson@oracle.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
target/i386/cpu.h | 30 +++++++++++++++++++++++-------
1 file changed, 23 insertions(+), 7 deletions(-)
diff --git a/target/i386/cpu.h b/target/i386/cpu.h
index f7fa5870b1..aedb8f2e01 100644
--- a/target/i386/cpu.h
+++ b/target/i386/cpu.h
@@ -1305,6 +1305,22 @@ typedef struct XSavePKRU {
uint32_t padding;
} XSavePKRU;
+#define XSAVE_FCW_FSW_OFFSET 0x000
+#define XSAVE_FTW_FOP_OFFSET 0x004
+#define XSAVE_CWD_RIP_OFFSET 0x008
+#define XSAVE_CWD_RDP_OFFSET 0x010
+#define XSAVE_MXCSR_OFFSET 0x018
+#define XSAVE_ST_SPACE_OFFSET 0x020
+#define XSAVE_XMM_SPACE_OFFSET 0x0a0
+#define XSAVE_XSTATE_BV_OFFSET 0x200
+#define XSAVE_AVX_OFFSET 0x240
+#define XSAVE_BNDREG_OFFSET 0x3c0
+#define XSAVE_BNDCSR_OFFSET 0x400
+#define XSAVE_OPMASK_OFFSET 0x440
+#define XSAVE_ZMM_HI256_OFFSET 0x480
+#define XSAVE_HI16_ZMM_OFFSET 0x680
+#define XSAVE_PKRU_OFFSET 0xa80
+
typedef struct X86XSaveArea {
X86LegacyXSaveArea legacy;
X86XSaveHeader header;
@@ -1325,19 +1341,19 @@ typedef struct X86XSaveArea {
XSavePKRU pkru_state;
} X86XSaveArea;
-QEMU_BUILD_BUG_ON(offsetof(X86XSaveArea, avx_state) != 0x240);
+QEMU_BUILD_BUG_ON(offsetof(X86XSaveArea, avx_state) != XSAVE_AVX_OFFSET);
QEMU_BUILD_BUG_ON(sizeof(XSaveAVX) != 0x100);
-QEMU_BUILD_BUG_ON(offsetof(X86XSaveArea, bndreg_state) != 0x3c0);
+QEMU_BUILD_BUG_ON(offsetof(X86XSaveArea, bndreg_state) != XSAVE_BNDREG_OFFSET);
QEMU_BUILD_BUG_ON(sizeof(XSaveBNDREG) != 0x40);
-QEMU_BUILD_BUG_ON(offsetof(X86XSaveArea, bndcsr_state) != 0x400);
+QEMU_BUILD_BUG_ON(offsetof(X86XSaveArea, bndcsr_state) != XSAVE_BNDCSR_OFFSET);
QEMU_BUILD_BUG_ON(sizeof(XSaveBNDCSR) != 0x40);
-QEMU_BUILD_BUG_ON(offsetof(X86XSaveArea, opmask_state) != 0x440);
+QEMU_BUILD_BUG_ON(offsetof(X86XSaveArea, opmask_state) != XSAVE_OPMASK_OFFSET);
QEMU_BUILD_BUG_ON(sizeof(XSaveOpmask) != 0x40);
-QEMU_BUILD_BUG_ON(offsetof(X86XSaveArea, zmm_hi256_state) != 0x480);
+QEMU_BUILD_BUG_ON(offsetof(X86XSaveArea, zmm_hi256_state) !=
XSAVE_ZMM_HI256_OFFSET);
QEMU_BUILD_BUG_ON(sizeof(XSaveZMM_Hi256) != 0x200);
-QEMU_BUILD_BUG_ON(offsetof(X86XSaveArea, hi16_zmm_state) != 0x680);
+QEMU_BUILD_BUG_ON(offsetof(X86XSaveArea, hi16_zmm_state) !=
XSAVE_HI16_ZMM_OFFSET);
QEMU_BUILD_BUG_ON(sizeof(XSaveHi16_ZMM) != 0x400);
-QEMU_BUILD_BUG_ON(offsetof(X86XSaveArea, pkru_state) != 0xA80);
+QEMU_BUILD_BUG_ON(offsetof(X86XSaveArea, pkru_state) != XSAVE_PKRU_OFFSET);
QEMU_BUILD_BUG_ON(sizeof(XSavePKRU) != 0x8);
typedef enum TPRAccess {
--
2.31.1
- [PULL 03/40] ui: Fix the "-display sdl,window_close=..." parameter, (continued)
- [PULL 03/40] ui: Fix the "-display sdl,window_close=..." parameter, Paolo Bonzini, 2021/07/06
- [PULL 02/40] softmmu/vl: Remove obsolete comment about the "frame" parameter, Paolo Bonzini, 2021/07/06
- [PULL 05/40] qemu-options: Improve the documentation of the -display options, Paolo Bonzini, 2021/07/06
- [PULL 07/40] coverity-scan: switch to vpath build, Paolo Bonzini, 2021/07/06
- [PULL 06/40] coverity-scan: Remove lm32 / unicore32 targets, Paolo Bonzini, 2021/07/06
- [PULL 10/40] target/i386: Clarify the padding requirements of X86XSaveArea, Paolo Bonzini, 2021/07/06
- [PULL 11/40] target/i386: Pass buffer and length to XSAVE helper, Paolo Bonzini, 2021/07/06
- [PULL 12/40] target/i386: Make x86_ext_save_areas visible outside cpu.c, Paolo Bonzini, 2021/07/06
- [PULL 09/40] target/i386: Consolidate the X86XSaveArea offset checks, Paolo Bonzini, 2021/07/06
- [PULL 13/40] target/i386: Observe XSAVE state area offsets, Paolo Bonzini, 2021/07/06
- [PULL 08/40] target/i386: Declare constants for XSAVE offsets,
Paolo Bonzini <=
- [PULL 17/40] configure, meson: convert vte detection to meson, Paolo Bonzini, 2021/07/06
- [PULL 18/40] configure, meson: convert virgl detection to meson, Paolo Bonzini, 2021/07/06
- [PULL 23/40] meson: sort existing compiler tests, Paolo Bonzini, 2021/07/06
- [PULL 01/40] Makefile: Remove /usr/bin/env wrapper from the SHELL variable, Paolo Bonzini, 2021/07/06
- [PULL 16/40] configure: drop vte-2.90 check, Paolo Bonzini, 2021/07/06
- [PULL 19/40] configure, meson: convert libdaxctl detection to meson, Paolo Bonzini, 2021/07/06
- [PULL 14/40] target/i386: Populate x86_ext_save_areas offsets using cpuid where possible, Paolo Bonzini, 2021/07/06
- [PULL 20/40] configure, meson: convert libpmem detection to meson, Paolo Bonzini, 2021/07/06
- [PULL 21/40] configure, meson: convert liburing detection to meson, Paolo Bonzini, 2021/07/06
- [PULL 25/40] configure, meson: move CONFIG_IVSHMEM to meson, Paolo Bonzini, 2021/07/06