[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[RFC PATCH 3/8] target/i386: Clarify the padding requirements of X86XSav
From: |
David Edmondson |
Subject: |
[RFC PATCH 3/8] target/i386: Clarify the padding requirements of X86XSaveArea |
Date: |
Mon, 5 Jul 2021 11:46:27 +0100 |
Replace the hard-coded size of offsets or structure elements with
defined constants or sizeof().
Signed-off-by: David Edmondson <david.edmondson@oracle.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.30.2
- [RFC PATCH 0/8] Derive XSAVE state component offsets from CPUID leaf 0xd where possible, David Edmondson, 2021/07/05
- [RFC PATCH 1/8] target/i386: Declare constants for XSAVE offsets, David Edmondson, 2021/07/05
- [RFC PATCH 2/8] target/i386: Consolidate the X86XSaveArea offset checks, David Edmondson, 2021/07/05
- [RFC PATCH 4/8] target/i386: Pass buffer and length to XSAVE helper, David Edmondson, 2021/07/05
- [RFC PATCH 3/8] target/i386: Clarify the padding requirements of X86XSaveArea,
David Edmondson <=
- [RFC PATCH 7/8] target/i386: Populate x86_ext_save_areas offsets using cpuid where possible, David Edmondson, 2021/07/05
- [RFC PATCH 5/8] target/i386: Make x86_ext_save_areas visible outside cpu.c, David Edmondson, 2021/07/05
- [RFC PATCH 6/8] target/i386: Observe XSAVE state area offsets, David Edmondson, 2021/07/05
- [RFC PATCH 8/8] target/i386: Move X86XSaveArea into TCG, David Edmondson, 2021/07/05
- Re: [RFC PATCH 8/8] target/i386: Move X86XSaveArea into TCG, Richard Henderson, 2021/07/06
- Re: [RFC PATCH 8/8] target/i386: Move X86XSaveArea into TCG, Paolo Bonzini, 2021/07/07
- Re: [RFC PATCH 8/8] target/i386: Move X86XSaveArea into TCG, David Edmondson, 2021/07/07
- Re: [RFC PATCH 8/8] target/i386: Move X86XSaveArea into TCG, David Edmondson, 2021/07/08
- Re: [RFC PATCH 8/8] target/i386: Move X86XSaveArea into TCG, Richard Henderson, 2021/07/08
- Re: [RFC PATCH 8/8] target/i386: Move X86XSaveArea into TCG, David Edmondson, 2021/07/08