From e1b09dfca45cc48519fde2259461879b44659efc Mon Sep 17 00:00:00 2001 From: Jiaxin Wu Date: Tue, 22 Oct 2024 11:50:03 +0800 Subject: UefiCpuPkg/UefiCpuPkg.dec: Add PcdMaxMappingAddressBeforeTempRamExit This change is made for boot performance considerations. Before the Temporary RAM is disabled, the permanent memory is in UC state, causing the creation of the page table in permanent memory to take more time with larger page table sizes. Therefore, this patch adds the PcdMaxMappingAddressBeforeTempRamExit to provide the platform with the capability to control the max mapping address in page table before Temp Ram Exit. The value of 0xFFFFFFFFFFFFFFFF, then firmware will map entire physical address space. Signed-off-by: Jiaxin Wu --- UefiCpuPkg/UefiCpuPkg.dec | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/UefiCpuPkg/UefiCpuPkg.dec b/UefiCpuPkg/UefiCpuPkg.dec index 4e71a11ae0..5d5342ded6 100644 --- a/UefiCpuPkg/UefiCpuPkg.dec +++ b/UefiCpuPkg/UefiCpuPkg.dec @@ -262,6 +262,14 @@ # @Prompt BSP Broadcast Method for the first-time wakeup of APs gUefiCpuPkgTokenSpaceGuid.PcdFirstTimeWakeUpAPsBySipi|TRUE|BOOLEAN|0x30002007 + ## The max mapping address in page table before Temp Ram Exit. + # After physical memory is initialized and before Temp Ram Exit, the physical memory is in UC state. + # The PCD controls the page table max mapping address in physical memory before Temp Ram Exit + # because creating a big page table in UC physical memory to cover the entire memory space + # is slow. The value of 0xFFFFFFFFFFFFFFFF, then firmware will map entire physical address space. + # @Prompt Configure max mapping address in page table before Temp Ram Exit. + gUefiCpuPkgTokenSpaceGuid.PcdMaxMappingAddressBeforeTempRamExit|0xFFFFFFFFFFFFFFFF|UINT64|0x30002008 + [PcdsFixedAtBuild, PcdsPatchableInModule] ## This value is the CPU Local APIC base address, which aligns the address on a 4-KByte boundary. # @Prompt Configure base address of CPU Local APIC -- cgit v1.2.3