48 lines
1.6 KiB
Diff
48 lines
1.6 KiB
Diff
From 4da53939a51a5a834fae3fb8687603598d811269 Mon Sep 17 00:00:00 2001
|
|
From: David Edmondson <david.edmondson@oracle.com>
|
|
Date: Mon, 5 Jul 2021 11:46:27 +0100
|
|
Subject: [PATCH 3/7] target/i386: Clarify the padding requirements of
|
|
X86XSaveArea
|
|
|
|
RH-Author: Dr. David Alan Gilbert <dgilbert@redhat.com>
|
|
RH-MergeRequest: 113: non-av 8.5z: Fix XSAVE on newer CPUs
|
|
RH-Commit: [3/7] 789cb79b4ae08bd78479b0399821adba67139c76
|
|
RH-Bugzilla: 2065239
|
|
RH-Acked-by: Jon Maloy <jmaloy@redhat.com>
|
|
RH-Acked-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
RH-Acked-by: Bandan Das <None>
|
|
|
|
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>
|
|
(cherry picked from commit fde74821006472f40fee9a094e6da86cd39b5623)
|
|
---
|
|
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 7c81d4bd6d..d586b5508d 100644
|
|
--- a/target/i386/cpu.h
|
|
+++ b/target/i386/cpu.h
|
|
@@ -1296,7 +1296,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.27.0
|
|
|