[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 10/40] target/i386: Clarify the padding requirements of X86XSaveAr
|
From: |
Paolo Bonzini |
|
Subject: |
[PULL 10/40] target/i386: Clarify the padding requirements of X86XSaveArea |
|
Date: |
Tue, 6 Jul 2021 12:01:11 +0200 |
From: David Edmondson <david.edmondson@oracle.com>
Replace the hard-coded size of offsets or structure elements with
defined constants or sizeof().
Signed-off-by: David Edmondson <david.edmondson@oracle.com>
Message-Id: <20210705104632.2902400-4-david.edmondson@oracle.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
target/i386/cpu.h | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/target/i386/cpu.h b/target/i386/cpu.h
index 6590ad6391..92f9ca264c 100644
--- a/target/i386/cpu.h
+++ b/target/i386/cpu.h
@@ -1329,7 +1329,13 @@ typedef struct X86XSaveArea {
/* AVX State: */
XSaveAVX avx_state;
- uint8_t padding[960 - 576 - sizeof(XSaveAVX)];
+
+ /* Ensure that XSaveBNDREG is properly aligned. */
+ uint8_t padding[XSAVE_BNDREG_OFFSET
+ - sizeof(X86LegacyXSaveArea)
+ - sizeof(X86XSaveHeader)
+ - sizeof(XSaveAVX)];
+
/* MPX State: */
XSaveBNDREG bndreg_state;
XSaveBNDCSR bndcsr_state;
--
2.31.1
- [PULL 00/40] Misc patches for 2021-07-06, Paolo Bonzini, 2021/07/06
- [PULL 04/40] ui: Mark the '-no-quit' option as deprecated, Paolo Bonzini, 2021/07/06
- [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 <=
- [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, 2021/07/06
- [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