From 69d3901b9c8f136ac24543b7b2decf8a20b6d268 Mon Sep 17 00:00:00 2001 From: Levi Yun Date: Fri, 11 Oct 2024 09:01:19 +0100 Subject: [PATCH] StandaloneMmPkg: Move sanity check for comm buffer to entrypoint Arm has three types of communication buffer - Non secure communication buffer: shared buffer with NS partition - Secure communication buffer: shared buffer with Secure partition - Internal Misc service buffer: For misc service i.e. for services that do not use MmCommunication protocol, a buffer is created and populated internally. Since, internal Misc service buffer is allocated dynamically in StandaloneMm there is no additional check required for the Misc service buffer. This patch move sanity check of communication buffer from StandaloneMmCpu Driver to StandaloneMmEntryPoint. Signed-off-by: Levi Yun (cherry picked from commit 7680b51dcf2c7bfb0a54d868568f7ba91c5210ae) --- .../Include/Library/Arm/StandaloneMmCoreEntryPoint.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/StandaloneMmPkg/Include/Library/Arm/StandaloneMmCoreEntryPoint.h b/StandaloneMmPkg/Include/Library/Arm/StandaloneMmCoreEntryPoint.h index 0b5b8a2ea5..1549211613 100644 --- a/StandaloneMmPkg/Include/Library/Arm/StandaloneMmCoreEntryPoint.h +++ b/StandaloneMmPkg/Include/Library/Arm/StandaloneMmCoreEntryPoint.h @@ -30,6 +30,16 @@ #define CPU_INFO_FLAG_PRIMARY_CPU 0x00000001 +/* + * Index information for mm range descriptors in + * gEfiMmPeiMmramMemoryReserveGuid Guid Hob. + */ +#define MMRAM_DESC_IDX_IMAGE 0 +#define MMRAM_DESC_IDX_SECURE_SHARED_BUFFER 1 +#define MMRAM_DESC_IDX_NORMAL_SHARED_BUFFER 2 +#define MMRAM_DESC_IDX_HEAP 3 +#define MMRAM_DESC_MIN_COUNT 4 + /* * Communication ABI protocol to communicate between normal/secure partition. */