**/\r
\r
#include "DxeIpl.h"\r
+#include "X64/VirtualMemory.h"\r
\r
\r
\r
VOID *BaseOfStack;\r
VOID *TopOfStack;\r
EFI_STATUS Status;\r
+ UINTN PageTables;\r
\r
//\r
// Allocate 128KB for the Stack\r
TopOfStack = (VOID *) ((UINTN) BaseOfStack + EFI_SIZE_TO_PAGES (STACK_SIZE) * EFI_PAGE_SIZE - CPU_STACK_ALIGNMENT);\r
TopOfStack = ALIGN_POINTER (TopOfStack, CPU_STACK_ALIGNMENT);\r
\r
+ //\r
+ // Create page table and save PageMapLevel4 to CR3\r
+ //\r
+ PageTables = CreateIdentityMappingPageTables ();\r
+\r
//\r
// End of PEI phase singal\r
//\r
Status = PeiServicesInstallPpi (&gEndOfPeiSignalPpi);\r
ASSERT_EFI_ERROR (Status);\r
\r
+ AsmWriteCr3 (PageTables);\r
+\r
//\r
// Update the contents of BSP stack HOB to reflect the real stack info passed to DxeCore.\r
// \r