Revert "UefiCpuPkg/PiSmmCpu: Enable 5 level paging when CPU supports"
This reverts commit7365eb2c8c
. Commit7c5010c7f8
MdePkg/BaseLib.h: Update IA32_CR4 structure for 5-level paging technically breaks the EDKII development process documented in https://github.com/tianocore/tianocore.github.io/wiki/EDK-II-Development-Process and Maintainers.txt in EDKII repo root directory. The voilation is commit7c5010c7f8
doesn't have a Reviewed-by or Acked-by from MdePkg maintainers. In order to revert7c5010c7f8
,7365eb2c8
needs to revert first otherwise simply reverting7c5010c7f8
will cause build break. Signed-off-by: Ray Ni <ray.ni@intel.com>
This commit is contained in:
@@ -125,36 +125,18 @@ GetPageTableEntry (
|
||||
UINTN Index2;
|
||||
UINTN Index3;
|
||||
UINTN Index4;
|
||||
UINTN Index5;
|
||||
UINT64 *L1PageTable;
|
||||
UINT64 *L2PageTable;
|
||||
UINT64 *L3PageTable;
|
||||
UINT64 *L4PageTable;
|
||||
UINT64 *L5PageTable;
|
||||
IA32_CR4 Cr4;
|
||||
BOOLEAN Enable5LevelPaging;
|
||||
|
||||
Index5 = ((UINTN)RShiftU64 (Address, 48)) & PAGING_PAE_INDEX_MASK;
|
||||
Index4 = ((UINTN)RShiftU64 (Address, 39)) & PAGING_PAE_INDEX_MASK;
|
||||
Index3 = ((UINTN)Address >> 30) & PAGING_PAE_INDEX_MASK;
|
||||
Index2 = ((UINTN)Address >> 21) & PAGING_PAE_INDEX_MASK;
|
||||
Index1 = ((UINTN)Address >> 12) & PAGING_PAE_INDEX_MASK;
|
||||
|
||||
Cr4.UintN = AsmReadCr4 ();
|
||||
Enable5LevelPaging = (BOOLEAN) (Cr4.Bits.LA57 == 1);
|
||||
|
||||
if (sizeof(UINTN) == sizeof(UINT64)) {
|
||||
if (Enable5LevelPaging) {
|
||||
L5PageTable = (UINT64 *)GetPageTableBase ();
|
||||
if (L5PageTable[Index5] == 0) {
|
||||
*PageAttribute = PageNone;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
L4PageTable = (UINT64 *)(UINTN)(L5PageTable[Index5] & ~mAddressEncMask & PAGING_4K_ADDRESS_MASK_64);
|
||||
} else {
|
||||
L4PageTable = (UINT64 *)GetPageTableBase ();
|
||||
}
|
||||
L4PageTable = (UINT64 *)GetPageTableBase ();
|
||||
if (L4PageTable[Index4] == 0) {
|
||||
*PageAttribute = PageNone;
|
||||
return NULL;
|
||||
|
Reference in New Issue
Block a user