From 13fbc16556d05a70d1bbef2e673f1b16b22dd6c6 Mon Sep 17 00:00:00 2001 From: Gerd Hoffmann Date: Thu, 22 Feb 2024 11:54:06 +0100 Subject: MdeModulePkg/DxeIplPeim: rename variable Rename Page5LevelSupported to Page5LevelEnabled. The variable is set to true in case 5-paging level is enabled (64-bit PEI) or will be enabled (32-bit PEI), it does *not* tell whenever the 5-level paging is supported by the CPU. Signed-off-by: Gerd Hoffmann Reviewed-by: Laszlo Ersek Acked-by: Ard Biesheuvel Message-Id: <20240222105407.75735-3-kraxel@redhat.com> Cc: Michael Roth Cc: Jiewen Yao Cc: Liming Gao Cc: Laszlo Ersek Cc: Tom Lendacky Cc: Paolo Bonzini Cc: Ard Biesheuvel Cc: Gerd Hoffmann Cc: Min Xu Cc: Erdem Aktas Cc: Oliver Steffen Cc: Ard Biesheuvel [lersek@redhat.com: turn the "Cc:" message headers from Gerd's on-list posting into "Cc:" tags in the commit message, in order to pacify "PatchCheck.py"] --- MdeModulePkg/Core/DxeIplPeim/X64/VirtualMemory.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/MdeModulePkg/Core/DxeIplPeim/X64/VirtualMemory.c b/MdeModulePkg/Core/DxeIplPeim/X64/VirtualMemory.c index 1d240e9596..df6196a41c 100644 --- a/MdeModulePkg/Core/DxeIplPeim/X64/VirtualMemory.c +++ b/MdeModulePkg/Core/DxeIplPeim/X64/VirtualMemory.c @@ -696,7 +696,7 @@ CreateIdentityMappingPageTables ( UINTN TotalPagesNum; UINTN BigPageAddress; VOID *Hob; - BOOLEAN Page5LevelSupport; + BOOLEAN Page5LevelEnabled; BOOLEAN Page1GSupport; PAGE_TABLE_1G_ENTRY *PageDirectory1GEntry; UINT64 AddressEncMask; @@ -744,15 +744,15 @@ CreateIdentityMappingPageTables ( // If cpu has already run in 64bit long mode PEI, Page table Level in DXE must align with previous level. // Cr4.UintN = AsmReadCr4 (); - Page5LevelSupport = (Cr4.Bits.LA57 != 0); - if (Page5LevelSupport) { + Page5LevelEnabled = (Cr4.Bits.LA57 != 0); + if (Page5LevelEnabled) { ASSERT (PcdGetBool (PcdUse5LevelPageTable)); } } else { // // If cpu runs in 32bit protected mode PEI, Page table Level in DXE is decided by PCD and feature capability. // - Page5LevelSupport = FALSE; + Page5LevelEnabled = FALSE; if (PcdGetBool (PcdUse5LevelPageTable)) { AsmCpuidEx ( CPUID_STRUCTURED_EXTENDED_FEATURE_FLAGS, @@ -763,12 +763,12 @@ CreateIdentityMappingPageTables ( NULL ); if (EcxFlags.Bits.FiveLevelPage != 0) { - Page5LevelSupport = TRUE; + Page5LevelEnabled = TRUE; } } } - DEBUG ((DEBUG_INFO, "AddressBits=%u 5LevelPaging=%u 1GPage=%u\n", PhysicalAddressBits, Page5LevelSupport, Page1GSupport)); + DEBUG ((DEBUG_INFO, "AddressBits=%u 5LevelPaging=%u 1GPage=%u\n", PhysicalAddressBits, Page5LevelEnabled, Page1GSupport)); // // IA-32e paging translates 48-bit linear addresses to 52-bit physical addresses @@ -776,7 +776,7 @@ CreateIdentityMappingPageTables ( // due to either unsupported by HW, or disabled by PCD. // ASSERT (PhysicalAddressBits <= 52); - if (!Page5LevelSupport && (PhysicalAddressBits > 48)) { + if (!Page5LevelEnabled && (PhysicalAddressBits > 48)) { PhysicalAddressBits = 48; } @@ -811,7 +811,7 @@ CreateIdentityMappingPageTables ( // // Substract the one page occupied by PML5 entries if 5-Level Paging is disabled. // - if (!Page5LevelSupport) { + if (!Page5LevelEnabled) { TotalPagesNum--; } @@ -831,7 +831,7 @@ CreateIdentityMappingPageTables ( // By architecture only one PageMapLevel4 exists - so lets allocate storage for it. // PageMap = (VOID *)BigPageAddress; - if (Page5LevelSupport) { + if (Page5LevelEnabled) { // // By architecture only one PageMapLevel5 exists - so lets allocate storage for it. // @@ -853,7 +853,7 @@ CreateIdentityMappingPageTables ( PageMapLevel4Entry = (VOID *)BigPageAddress; BigPageAddress += SIZE_4KB; - if (Page5LevelSupport) { + if (Page5LevelEnabled) { // // Make a PML5 Entry // @@ -947,7 +947,7 @@ CreateIdentityMappingPageTables ( ZeroMem (PageMapLevel4Entry, (512 - IndexOfPml4Entries) * sizeof (PAGE_MAP_AND_DIRECTORY_POINTER)); } - if (Page5LevelSupport) { + if (Page5LevelEnabled) { Cr4.UintN = AsmReadCr4 (); Cr4.Bits.LA57 = 1; AsmWriteCr4 (Cr4.UintN); -- cgit v1.2.3