edk2/MdeModulePkg
Levi Yun b336d9b87a MdeModulePkg/Library: fix memory leak Rx/Tx Buffer in ArmFfaPeiLib
The commit e15fe06603
("MdeModulePkg/Library: make ArmFfaPeiLib available early PEIM stage")
uses ArmFfaPeiLib in the early PEIM stage.

However, the Rx/Tx buffer allocated in the early PEIM stage uses
temporary memory. This results in a memory leak when the temporary
memory's heap is relocated to permanent memory.

For example, if the Rx/Tx buffer memory is allocated at 0x20006000
in temporary memory, and if offset between temporary memory and
permanent is 0x40000000, then:

 - Once permanent memory installed the temporary memory at 0x20006000
   is migrated to 0x60006000.
 - However, ArmFfaPeiLib allocates new Rx/Tx buffer without freeing
   the migrated Rx/Tx buffers, i.e. the buffers at 0x60006000.

This results in a memory leak as the migrated Rx/Tx buffer area is
lost.
To address this memory leak, use the MemoryAllocationHob's name, so
that the migrated memory area will be reused as Rx/Tx buffer.

This patch also includes rename ArmFfaRxTxStmm.c to
ArmFfaStandaloneMmRxTxMap.c to keep the file name convention in
ArmFfaLib with ArmFfa{Phase}{...}.c

Fixes: e15fe06603 ("MdeModulePkg/Library: ...")
Signed-off-by: Yeoreum Yun <yeoreum.yun@arm.com>
Continuous-integration-options: PatchCheck.ignore-multi-package
2025-07-14 11:59:38 +00:00
..
Application MdeModulePkg: Add help for Reset menu item, and fix French strings 2025-06-16 23:03:46 +00:00
Bus MdeModulePkg: UsbBusDxe Reset USB port GetPortStatus returns device error. 2025-07-10 09:06:35 +08:00
Core MdeModulePkg: Leak Memory if Not RW on FreePages 2025-07-09 00:59:56 +00:00
Include MdeModulePkg/Library: fix memory leak Rx/Tx Buffer in ArmFfaPeiLib 2025-07-14 11:59:38 +00:00
Library MdeModulePkg/Library: fix memory leak Rx/Tx Buffer in ArmFfaPeiLib 2025-07-14 11:59:38 +00:00
Logo MdeModulePkg/Logo: Add LoongArch64 architecture. 2022-10-14 02:16:33 +00:00
Test MdeModulePkg: Removed Pei, Dxe, Smm and mm header files 2025-05-28 08:01:10 +00:00
Universal MdeModulePkg/GraphicsConsoleDxe UGA 2025-07-08 15:42:03 +00:00
MdeModulePkg.ci.yaml MdeModulePkg: Add duplicate exception for gUiAppFileGuid 2025-03-06 14:18:10 +01:00
MdeModulePkg.dec MdeModulePkg: MdeModulePkg.dec update PcdDxeNxMemoryProtectionPolicy. 2025-07-09 07:39:31 +00:00
MdeModulePkg.dsc ArmPkg: ArmFfaLib: Move ArmFfaLib implementation to MdeModulePkg 2025-04-10 17:52:48 +00:00
MdeModulePkg.uni MdeModulePkg: Remove UGA support 2025-07-08 15:42:03 +00:00
MdeModulePkgExtra.uni MdeModulePkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:08 -07:00