diff --git a/EdkModulePkg/Core/DxeIplPeim/DxeIpl.h b/EdkModulePkg/Core/DxeIplPeim/DxeIpl.h index eadcffa3d9..2c711ed97b 100644 --- a/EdkModulePkg/Core/DxeIplPeim/DxeIpl.h +++ b/EdkModulePkg/Core/DxeIplPeim/DxeIpl.h @@ -89,7 +89,8 @@ DxeLoadCore ( VOID HandOffToDxeCore ( IN EFI_PHYSICAL_ADDRESS DxeCoreEntryPoint, - IN EFI_PEI_HOB_POINTERS HobList + IN EFI_PEI_HOB_POINTERS HobList, + IN EFI_PEI_PPI_DESCRIPTOR *EndOfPeiSignal ); EFI_STATUS diff --git a/EdkModulePkg/Core/DxeIplPeim/DxeLoad.c b/EdkModulePkg/Core/DxeIplPeim/DxeLoad.c index 6a4c53b922..53be7d932e 100644 --- a/EdkModulePkg/Core/DxeIplPeim/DxeLoad.c +++ b/EdkModulePkg/Core/DxeIplPeim/DxeLoad.c @@ -241,14 +241,6 @@ Returns: ); ASSERT_EFI_ERROR (Status); - // - // Transfer control to the DXE Core - // The handoff state is simply a pointer to the HOB list - // - - Status = PeiServicesInstallPpi (&mPpiSignal); - ASSERT_EFI_ERROR (Status); - // // Add HOB for the DXE Core // @@ -309,8 +301,13 @@ Returns: ); } + // + // Transfer control to the DXE Core + // The handoff state is simply a pointer to the HOB list + // + DEBUG ((EFI_D_INFO, "DXE Core Entry Point 0x%08x\n", (UINTN) DxeCoreEntryPoint)); - HandOffToDxeCore (DxeCoreEntryPoint, HobList); + HandOffToDxeCore (DxeCoreEntryPoint, HobList, &mPpiSignal); // // If we get here, then the DXE Core returned. This is an error // Dxe Core should not return. diff --git a/EdkModulePkg/Core/DxeIplPeim/Ia32/DxeLoadFunc.c b/EdkModulePkg/Core/DxeIplPeim/Ia32/DxeLoadFunc.c index f66798ed56..7c9beff5f6 100644 --- a/EdkModulePkg/Core/DxeIplPeim/Ia32/DxeLoadFunc.c +++ b/EdkModulePkg/Core/DxeIplPeim/Ia32/DxeLoadFunc.c @@ -22,7 +22,7 @@ Abstract: #include "DxeIpl.h" #include "VirtualMemory.h" -// +// // Global Descriptor Table (GDT) // GLOBAL_REMOVE_IF_UNREFERENCED IA32_GDT gGdtEntries [] = { @@ -49,7 +49,8 @@ GLOBAL_REMOVE_IF_UNREFERENCED CONST IA32_DESCRIPTOR gGdt = { VOID HandOffToDxeCore ( IN EFI_PHYSICAL_ADDRESS DxeCoreEntryPoint, - IN EFI_PEI_HOB_POINTERS HobList + IN EFI_PEI_HOB_POINTERS HobList, + IN EFI_PEI_PPI_DESCRIPTOR *EndOfPeiSignal ) { EFI_STATUS Status; @@ -86,6 +87,13 @@ HandOffToDxeCore ( // Create page table and save PageMapLevel4 to CR3 // PageTables = CreateIdentityMappingPageTables (); + + // + // End of PEI phase singal + // + Status = PeiServicesInstallPpi (EndOfPeiSignal); + ASSERT_EFI_ERROR (Status); + AsmWriteCr3 (PageTables); // // Go to Long Mode. Interrupts will not get turned on until the CPU AP is loaded. @@ -106,6 +114,12 @@ HandOffToDxeCore ( TopOfStack = BaseOfStack + EFI_SIZE_TO_PAGES (STACK_SIZE) * EFI_PAGE_SIZE - CPU_STACK_ALIGNMENT; TopOfStack = (EFI_PHYSICAL_ADDRESS) (UINTN) ALIGN_POINTER (TopOfStack, CPU_STACK_ALIGNMENT); + // + // End of PEI phase singal + // + Status = PeiServicesInstallPpi (EndOfPeiSignal); + ASSERT_EFI_ERROR (Status); + SwitchStack ( (SWITCH_STACK_ENTRY_POINT)(UINTN)DxeCoreEntryPoint, HobList.Raw, diff --git a/EdkModulePkg/Core/DxeIplPeim/Ipf/DxeLoadFunc.c b/EdkModulePkg/Core/DxeIplPeim/Ipf/DxeLoadFunc.c index e53f708fd4..ea88b774f8 100644 --- a/EdkModulePkg/Core/DxeIplPeim/Ipf/DxeLoadFunc.c +++ b/EdkModulePkg/Core/DxeIplPeim/Ipf/DxeLoadFunc.c @@ -24,7 +24,8 @@ Abstract: VOID HandOffToDxeCore ( IN EFI_PHYSICAL_ADDRESS DxeCoreEntryPoint, - IN EFI_PEI_HOB_POINTERS HobList + IN EFI_PEI_HOB_POINTERS HobList, + IN EFI_PEI_PPI_DESCRIPTOR *EndOfPeiSignal ) { VOID *BaseOfStack; @@ -54,6 +55,12 @@ HandOffToDxeCore ( TopOfStack = (VOID *) ((UINTN) BaseOfStack + EFI_SIZE_TO_PAGES (STACK_SIZE) * EFI_PAGE_SIZE - CPU_STACK_ALIGNMENT); TopOfStack = ALIGN_POINTER (TopOfStack, CPU_STACK_ALIGNMENT); + // + // End of PEI phase singal + // + Status = PeiServicesInstallPpi (EndOfPeiSignal); + ASSERT_EFI_ERROR (Status); + AsmSwitchStackAndBackingStore ( (SWITCH_STACK_ENTRY_POINT)(UINTN)DxeCoreEntryPoint, HobList.Raw, diff --git a/EdkModulePkg/Core/DxeIplPeim/X64/DxeLoadFunc.c b/EdkModulePkg/Core/DxeIplPeim/X64/DxeLoadFunc.c index 02de14987f..83b00bb486 100644 --- a/EdkModulePkg/Core/DxeIplPeim/X64/DxeLoadFunc.c +++ b/EdkModulePkg/Core/DxeIplPeim/X64/DxeLoadFunc.c @@ -24,7 +24,8 @@ Abstract: VOID HandOffToDxeCore ( IN EFI_PHYSICAL_ADDRESS DxeCoreEntryPoint, - IN EFI_PEI_HOB_POINTERS HobList + IN EFI_PEI_HOB_POINTERS HobList, + IN EFI_PEI_PPI_DESCRIPTOR *EndOfPeiSignal ) { VOID *BaseOfStack; @@ -43,6 +44,12 @@ HandOffToDxeCore ( TopOfStack = (VOID *) ((UINTN) BaseOfStack + EFI_SIZE_TO_PAGES (STACK_SIZE) * EFI_PAGE_SIZE - CPU_STACK_ALIGNMENT); TopOfStack = ALIGN_POINTER (TopOfStack, CPU_STACK_ALIGNMENT); + // + // End of PEI phase singal + // + Status = PeiServicesInstallPpi (EndOfPeiSignal); + ASSERT_EFI_ERROR (Status); + SwitchStack ( (SWITCH_STACK_ENTRY_POINT)(UINTN)DxeCoreEntryPoint, HobList.Raw,