[edk2-platforms][PATCH V1 1/1] WhitleySiliconPkg/PchPolicyPpi: Fix binary structure layout


Oram, Isaac W
 

Disambiguate the PCH_DMI_CONFIG and PCH_TRACE_HUB_CONFIG structure
definitions such that compilers generate same binary layouts.

Cc: Nate DeSimone <nathaniel.l.desimone@...>
Cc: Chasel Chiu <chasel.chiu@...>
Signed-off-by: Isaac Oram <isaac.w.oram@...>
---
.../Pch/SouthClusterLbg/Include/PchPolicyCommon.h | 3 +++
1 file changed, 3 insertions(+)

diff --git a/Silicon/Intel/WhitleySiliconPkg/Pch/SouthClusterLbg/Include/PchPolicyCommon.h b/Silicon/Intel/WhitleySiliconPkg/Pch/SouthClusterLbg/Include/PchPolicyCommon.h
index 0e10d0b8f0..c95481bf1d 100644
--- a/Silicon/Intel/WhitleySiliconPkg/Pch/SouthClusterLbg/Include/PchPolicyCommon.h
+++ b/Silicon/Intel/WhitleySiliconPkg/Pch/SouthClusterLbg/Include/PchPolicyCommon.h
@@ -1351,7 +1351,9 @@ typedef struct {
**/
UINT32 DmiAspm : 1;
UINT32 PwrOptEnable : 1; ///< <b>0: Disable</b>; 1: Enable DMI Power Optimizer on PCH side.
+ UINT32 Rsvdbits1 : 30;
BOOLEAN DmiStopAndScreamEnable : 1;
+ BOOLEAN Rsvdbits2 : 7;
UINT32 DmiLinkDownHangBypass : 1;
UINT32 Rsvdbits : 29;
UINT32 Rsvd0[6]; ///< Reserved bytes
@@ -1447,6 +1449,7 @@ typedef struct {
TRACE_HUB_CONFIG TraceHub;
UINT32 AetEnableMode : 2;
UINT32 PchTraceHubHide : 1;
+ UINT32 Rsvdbits : 29;
} PCH_TRACE_HUB_CONFIG;


--
2.36.1.windows.1


Nate DeSimone
 

Hi Isaac,

Please see feedback inline.

Thanks,
Nate

-----Original Message-----
From: Oram, Isaac W <isaac.w.oram@...>
Sent: Friday, May 27, 2022 2:47 PM
To: devel@edk2.groups.io
Cc: Desimone, Nathaniel L <nathaniel.l.desimone@...>; Chiu, Chasel
<chasel.chiu@...>
Subject: [edk2-devel][edk2-platforms][PATCH V1 1/1]
WhitleySiliconPkg/PchPolicyPpi: Fix binary structure layout

Disambiguate the PCH_DMI_CONFIG and PCH_TRACE_HUB_CONFIG
structure definitions such that compilers generate same binary layouts.

Cc: Nate DeSimone <nathaniel.l.desimone@...>
Cc: Chasel Chiu <chasel.chiu@...>
Signed-off-by: Isaac Oram <isaac.w.oram@...>
---
.../Pch/SouthClusterLbg/Include/PchPolicyCommon.h | 3 +++
1 file changed, 3 insertions(+)

diff --git
a/Silicon/Intel/WhitleySiliconPkg/Pch/SouthClusterLbg/Include/PchPolicyCo
mmon.h
b/Silicon/Intel/WhitleySiliconPkg/Pch/SouthClusterLbg/Include/PchPolicyCo
mmon.h
index 0e10d0b8f0..c95481bf1d 100644
---
a/Silicon/Intel/WhitleySiliconPkg/Pch/SouthClusterLbg/Include/PchPolicyCo
mmon.h
+++ b/Silicon/Intel/WhitleySiliconPkg/Pch/SouthClusterLbg/Include/PchPol
+++ icyCommon.h
@@ -1351,7 +1351,9 @@ typedef struct {
**/
UINT32 DmiAspm : 1;
UINT32 PwrOptEnable : 1; ///< <b>0: Disable</b>; 1: Enable DMI
Power Optimizer on PCH side.
+ UINT32 Rsvdbits1 : 30;
BOOLEAN DmiStopAndScreamEnable : 1;
+ BOOLEAN Rsvdbits2 : 7;
Please convert this from BOOLEAN to UINT8. Since there is an strong requirement that the bitfield be exactly 8 bits long it is best to use a data type that is explicitly 8 bit.

UINT32 DmiLinkDownHangBypass : 1;
UINT32 Rsvdbits : 29;
UINT32 Rsvd0[6]; ///< Reserved bytes
@@ -1447,6 +1449,7 @@ typedef struct {
TRACE_HUB_CONFIG TraceHub;
UINT32 AetEnableMode : 2;
UINT32 PchTraceHubHide : 1;
+ UINT32 Rsvdbits : 29;
} PCH_TRACE_HUB_CONFIG;


--
2.36.1.windows.1