In PI Spec v1.7 Errata A, Vol.4, Sec 5.7 MM Communication Protocol, the MessageLength field of EFI_MM_COMMUNICATE_HEADER (also defined as EFI_SMM_COMMUNICATE_HEADER) is currently defined as type UINTN. But this structure, as a generic definition, could be used for both PEI and DXE MM communication. Thus for a system that supports PEI MM launch, but operates PEI in 32bit mode and MM foundation in 64bit, the current EFI_MM_COMMUNICATE_HEADER definition will cause structure parse error due to UINTN used. The suggested change is to make the MessageLength field defined with definitive size as below: ``` typedef struct { EFI_GUID HeaderGuid; UINT64 MessageLength; UINT8 Data[ANYSIZE_ARRAY]; } EFI_MM_COMMUNICATE_HEADER; ``` This change will impact the structure consumers including: MdeModulePkg/Core/PiSmmCore MdeModulePkg/Application/SmiHandlerProfileInfo MdeModulePkg/Application/MemoryProfileInfo Note: MdeModulePkg/Library/SmmLockBoxLib/SmmLockBoxPeiLib is also consuming this structure, but it handled this size discrepancy internally. (Without the spec change in this ticket, all applicable PEI MM communicate callers will need to engage the same routine) The reference implementation is tracked by ticket: https://bugzilla.tianocore.org/show_bug.cgi?id=3398.
Kun is working on it.
(In reply to gaoliming from comment #1) > Kun is working on it. First round of review is sent here: https://edk2.groups.io/g/devel/message/76303. I cannot seem to push edk2-staging repo, so this round of code patches are still based off the personal branch on github. Please advise if any. Thanks.
v2 patch sent here: https://edk2.groups.io/g/devel/message/76738
v4 patch sent here to request change of PI spec: https://edk2.groups.io/g/devel/message/85308