Skip to content

Commit d137272

Browse files
makubackimergify[bot]
authored andcommitted
ArmVirtPkg/MemoryInitPei: Remove Non-RT Types from Mem Type Info HOB
Removes the following types from the memory type information HOBs produced in the MemoryInitPei PEIM: - `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 7da3dcd commit d137272

File tree

2 files changed

+3
-16
lines changed

2 files changed

+3
-16
lines changed

ArmVirtPkg/MemoryInitPei/MemoryInitPeim.c

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ BuildMemoryTypeInformationHob (
3333
VOID
3434
)
3535
{
36-
EFI_MEMORY_TYPE_INFORMATION Info[10];
36+
EFI_MEMORY_TYPE_INFORMATION Info[6];
3737

3838
Info[0].Type = EfiACPIReclaimMemory;
3939
Info[0].NumberOfPages = FixedPcdGet32 (PcdMemoryTypeEfiACPIReclaimMemory);
@@ -45,18 +45,9 @@ BuildMemoryTypeInformationHob (
4545
Info[3].NumberOfPages = FixedPcdGet32 (PcdMemoryTypeEfiRuntimeServicesData);
4646
Info[4].Type = EfiRuntimeServicesCode;
4747
Info[4].NumberOfPages = FixedPcdGet32 (PcdMemoryTypeEfiRuntimeServicesCode);
48-
Info[5].Type = EfiBootServicesCode;
49-
Info[5].NumberOfPages = FixedPcdGet32 (PcdMemoryTypeEfiBootServicesCode);
50-
Info[6].Type = EfiBootServicesData;
51-
Info[6].NumberOfPages = FixedPcdGet32 (PcdMemoryTypeEfiBootServicesData);
52-
Info[7].Type = EfiLoaderCode;
53-
Info[7].NumberOfPages = FixedPcdGet32 (PcdMemoryTypeEfiLoaderCode);
54-
Info[8].Type = EfiLoaderData;
55-
Info[8].NumberOfPages = FixedPcdGet32 (PcdMemoryTypeEfiLoaderData);
56-
5748
// Terminator for the list
58-
Info[9].Type = EfiMaxMemoryType;
59-
Info[9].NumberOfPages = 0;
49+
Info[5].Type = EfiMaxMemoryType;
50+
Info[5].NumberOfPages = 0;
6051

6152
BuildGuidDataHob (&gEfiMemoryTypeInformationGuid, &Info, sizeof (Info));
6253
}

ArmVirtPkg/MemoryInitPei/MemoryInitPeim.inf

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,6 @@
5050
gEmbeddedTokenSpaceGuid.PcdMemoryTypeEfiReservedMemoryType
5151
gEmbeddedTokenSpaceGuid.PcdMemoryTypeEfiRuntimeServicesData
5252
gEmbeddedTokenSpaceGuid.PcdMemoryTypeEfiRuntimeServicesCode
53-
gEmbeddedTokenSpaceGuid.PcdMemoryTypeEfiBootServicesCode
54-
gEmbeddedTokenSpaceGuid.PcdMemoryTypeEfiBootServicesData
55-
gEmbeddedTokenSpaceGuid.PcdMemoryTypeEfiLoaderCode
56-
gEmbeddedTokenSpaceGuid.PcdMemoryTypeEfiLoaderData
5753

5854
[Depex]
5955
TRUE

0 commit comments

Comments
 (0)