Skip to content

Commit 7da3dcd

Browse files
makubackimergify[bot]
authored andcommitted
ArmPlatformPkg/MemoryInitPei: Remove Non-RT Types from Mem Type Info HOB
Removes the following types from the memory type information HOBs produced in the MemoryInitPei code: - `EfiBootServicesCode` - `EfiBootServicesData` - `EfiLoaderCode` - `EfiLoaderData` Our platform has a memory type information validation routine that currently expects those types to be excluded as they would not impact the UEFI memory map since they are not runtime memory types. This follows the guidance in the whitepaper "A Tour Beyond BIOS Memory Map and Practices in UEFI BIOS". https://github.com/tianocore-docs/Docs/raw/master/White_Papers/A_Tour_Beyond_BIOS_Memory_Map_And_Practices_in_UEFI_BIOS_V2.pdf "NOTE: We recommend a platform only define the ReservedMemory, ACPINvs, ACPIReclaim, RuntimeCode, RuntimeData in Memory Type Information table, because OSes only request these regions to be consistent. There is no need to add BootServicesCode, BootServicesData, LoaderCode, LoaderData in memory type information table, because these regions will not be reserved during S4 resume." Since these memory types are not tracked in memory type information any longer it also reduces the number of resets that may need to occur to update memory type buckets that are not needed. Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
1 parent d8984e8 commit 7da3dcd

File tree

3 files changed

+3
-20
lines changed

3 files changed

+3
-20
lines changed

ArmPlatformPkg/MemoryInitPei/MemoryInitPeiLib.inf

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,6 @@
4747
gEmbeddedTokenSpaceGuid.PcdMemoryTypeEfiReservedMemoryType
4848
gEmbeddedTokenSpaceGuid.PcdMemoryTypeEfiRuntimeServicesData
4949
gEmbeddedTokenSpaceGuid.PcdMemoryTypeEfiRuntimeServicesCode
50-
gEmbeddedTokenSpaceGuid.PcdMemoryTypeEfiBootServicesCode
51-
gEmbeddedTokenSpaceGuid.PcdMemoryTypeEfiBootServicesData
52-
gEmbeddedTokenSpaceGuid.PcdMemoryTypeEfiLoaderCode
53-
gEmbeddedTokenSpaceGuid.PcdMemoryTypeEfiLoaderData
5450

5551
[Pcd]
5652
gArmTokenSpaceGuid.PcdSystemMemoryBase

ArmPlatformPkg/MemoryInitPei/MemoryInitPeim.c

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ BuildMemoryTypeInformationHob (
3737
VOID
3838
)
3939
{
40-
EFI_MEMORY_TYPE_INFORMATION Info[10];
40+
EFI_MEMORY_TYPE_INFORMATION Info[6];
4141

4242
Info[0].Type = EfiACPIReclaimMemory;
4343
Info[0].NumberOfPages = PcdGet32 (PcdMemoryTypeEfiACPIReclaimMemory);
@@ -49,18 +49,9 @@ BuildMemoryTypeInformationHob (
4949
Info[3].NumberOfPages = PcdGet32 (PcdMemoryTypeEfiRuntimeServicesData);
5050
Info[4].Type = EfiRuntimeServicesCode;
5151
Info[4].NumberOfPages = PcdGet32 (PcdMemoryTypeEfiRuntimeServicesCode);
52-
Info[5].Type = EfiBootServicesCode;
53-
Info[5].NumberOfPages = PcdGet32 (PcdMemoryTypeEfiBootServicesCode);
54-
Info[6].Type = EfiBootServicesData;
55-
Info[6].NumberOfPages = PcdGet32 (PcdMemoryTypeEfiBootServicesData);
56-
Info[7].Type = EfiLoaderCode;
57-
Info[7].NumberOfPages = PcdGet32 (PcdMemoryTypeEfiLoaderCode);
58-
Info[8].Type = EfiLoaderData;
59-
Info[8].NumberOfPages = PcdGet32 (PcdMemoryTypeEfiLoaderData);
60-
6152
// Terminator for the list
62-
Info[9].Type = EfiMaxMemoryType;
63-
Info[9].NumberOfPages = 0;
53+
Info[5].Type = EfiMaxMemoryType;
54+
Info[5].NumberOfPages = 0;
6455

6556
BuildGuidDataHob (&gEfiMemoryTypeInformationGuid, &Info, sizeof (Info));
6657
}

ArmPlatformPkg/MemoryInitPei/MemoryInitPeim.inf

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,6 @@
5656
gEmbeddedTokenSpaceGuid.PcdMemoryTypeEfiReservedMemoryType
5757
gEmbeddedTokenSpaceGuid.PcdMemoryTypeEfiRuntimeServicesData
5858
gEmbeddedTokenSpaceGuid.PcdMemoryTypeEfiRuntimeServicesCode
59-
gEmbeddedTokenSpaceGuid.PcdMemoryTypeEfiBootServicesCode
60-
gEmbeddedTokenSpaceGuid.PcdMemoryTypeEfiBootServicesData
61-
gEmbeddedTokenSpaceGuid.PcdMemoryTypeEfiLoaderCode
62-
gEmbeddedTokenSpaceGuid.PcdMemoryTypeEfiLoaderData
6359

6460
[Pcd]
6561
gArmTokenSpaceGuid.PcdSystemMemoryBase

0 commit comments

Comments
 (0)