diff options
author | Jeff Fan <jeff.fan@intel.com> | 2017-04-21 11:00:59 +0800 |
---|---|---|
committer | Guo Mang <mang.guo@intel.com> | 2017-07-12 11:24:27 +0800 |
commit | 0e4475e59ecd2590230355c5994ac96e29a5132f (patch) | |
tree | 69975f3332938f305ab7e010ed7c7a36ea90db28 /Core | |
parent | 9e7a0b2a67c2a0b627e6ea136911f0faf5fff599 (diff) | |
download | edk2-platforms-0e4475e59ecd2590230355c5994ac96e29a5132f.tar.xz |
UefiCpuPkg/MpInitLib: needn't to allocate AP reset vector
Because we will always borrow the AP reset vector space for AP waking up. We
needn't allocate such range to prevent other module to use it. It could simply
the code.
https://bugzilla.tianocore.org/show_bug.cgi?id=500
Cc: Feng Tian <feng.tian@intel.com>
Cc: Michael Kinney <michael.d.kinney@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jeff Fan <jeff.fan@intel.com>
Reviewed-by: Feng Tian <feng.tian@intel.com>
(cherry picked from commit c934a0a5816e38ca5dbdb25936c4f841958a008e)
Diffstat (limited to 'Core')
-rw-r--r-- | Core/UefiCpuPkg/Library/MpInitLib/MpLib.h | 22 | ||||
-rw-r--r-- | Core/UefiCpuPkg/Library/MpInitLib/PeiMpInitLib.inf | 6 | ||||
-rw-r--r-- | Core/UefiCpuPkg/Library/MpInitLib/PeiMpLib.c | 93 |
3 files changed, 2 insertions, 119 deletions
diff --git a/Core/UefiCpuPkg/Library/MpInitLib/MpLib.h b/Core/UefiCpuPkg/Library/MpInitLib/MpLib.h index 7a272d78ec..989b3f8090 100644 --- a/Core/UefiCpuPkg/Library/MpInitLib/MpLib.h +++ b/Core/UefiCpuPkg/Library/MpInitLib/MpLib.h @@ -1,7 +1,7 @@ /** @file
Common header file for MP Initialize Library.
- Copyright (c) 2016, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2016 - 2017, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@@ -542,26 +542,6 @@ IsMwaitSupport ( );
/**
- Notify function on End Of PEI PPI.
-
- On S3 boot, this function will restore wakeup buffer data.
- On normal boot, this function will flag wakeup buffer to be un-used type.
-
- @param[in] PeiServices The pointer to the PEI Services Table.
- @param[in] NotifyDescriptor Address of the notification descriptor data structure.
- @param[in] Ppi Address of the PPI that was installed.
-
- @retval EFI_SUCCESS When everything is OK.
-**/
-EFI_STATUS
-EFIAPI
-CpuMpEndOfPeiCallback (
- IN EFI_PEI_SERVICES **PeiServices,
- IN EFI_PEI_NOTIFY_DESCRIPTOR *NotifyDescriptor,
- IN VOID *Ppi
- );
-
-/**
Get available system memory below 1MB by specified size.
@param[in] CpuMpData The pointer to CPU MP Data structure.
diff --git a/Core/UefiCpuPkg/Library/MpInitLib/PeiMpInitLib.inf b/Core/UefiCpuPkg/Library/MpInitLib/PeiMpInitLib.inf index 0c6873da79..fa84e392af 100644 --- a/Core/UefiCpuPkg/Library/MpInitLib/PeiMpInitLib.inf +++ b/Core/UefiCpuPkg/Library/MpInitLib/PeiMpInitLib.inf @@ -1,7 +1,7 @@ ## @file
# MP Initialize Library instance for PEI driver.
#
-# Copyright (c) 2016, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2016 - 2017, Intel Corporation. All rights reserved.<BR>
# This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License
# which accompanies this distribution. The full text of the license may be found at
@@ -50,15 +50,11 @@ LocalApicLib
MemoryAllocationLib
HobLib
- PeiServicesLib
MtrrLib
CpuLib
UefiCpuLib
SynchronizationLib
-[Ppis]
- gEfiEndOfPeiSignalPpiGuid ## NOTIFY
-
[Pcd]
gUefiCpuPkgTokenSpaceGuid.PcdCpuMaxLogicalProcessorNumber ## CONSUMES
gUefiCpuPkgTokenSpaceGuid.PcdCpuApInitTimeOutInMicroSeconds ## CONSUMES
diff --git a/Core/UefiCpuPkg/Library/MpInitLib/PeiMpLib.c b/Core/UefiCpuPkg/Library/MpInitLib/PeiMpLib.c index 5ce5788125..9ee5aca57b 100644 --- a/Core/UefiCpuPkg/Library/MpInitLib/PeiMpLib.c +++ b/Core/UefiCpuPkg/Library/MpInitLib/PeiMpLib.c @@ -13,18 +13,6 @@ **/
#include "MpLib.h"
-#include <Ppi/EndOfPeiPhase.h>
-#include <Library/PeiServicesLib.h>
-
-//
-// Global PEI notify function descriptor on EndofPei event
-//
-GLOBAL_REMOVE_IF_UNREFERENCED EFI_PEI_NOTIFY_DESCRIPTOR mMpInitLibNotifyList = {
- (EFI_PEI_PPI_DESCRIPTOR_NOTIFY_CALLBACK | EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST),
- &gEfiEndOfPeiSignalPpiGuid,
- CpuMpEndOfPeiCallback
-};
-
/**
Enable Debug Agent to support source debugging on AP function.
@@ -77,64 +65,6 @@ SaveCpuMpData ( }
/**
- Notify function on End Of PEI PPI.
-
- On S3 boot, this function will restore wakeup buffer data.
- On normal boot, this function will flag wakeup buffer to be un-used type.
-
- @param[in] PeiServices The pointer to the PEI Services Table.
- @param[in] NotifyDescriptor Address of the notification descriptor data structure.
- @param[in] Ppi Address of the PPI that was installed.
-
- @retval EFI_SUCCESS When everything is OK.
-**/
-EFI_STATUS
-EFIAPI
-CpuMpEndOfPeiCallback (
- IN EFI_PEI_SERVICES **PeiServices,
- IN EFI_PEI_NOTIFY_DESCRIPTOR *NotifyDescriptor,
- IN VOID *Ppi
- )
-{
- EFI_STATUS Status;
- EFI_BOOT_MODE BootMode;
- CPU_MP_DATA *CpuMpData;
- EFI_PEI_HOB_POINTERS Hob;
- EFI_HOB_MEMORY_ALLOCATION *MemoryHob;
-
- DEBUG ((DEBUG_INFO, "PeiMpInitLib: CpuMpEndOfPeiCallback () invoked\n"));
-
- Status = PeiServicesGetBootMode (&BootMode);
- ASSERT_EFI_ERROR (Status);
-
- CpuMpData = GetCpuMpData ();
- if (BootMode != BOOT_ON_S3_RESUME) {
- //
- // Get the HOB list for processing
- //
- Hob.Raw = GetHobList ();
- //
- // Collect memory ranges
- //
- while (!END_OF_HOB_LIST (Hob)) {
- if (Hob.Header->HobType == EFI_HOB_TYPE_MEMORY_ALLOCATION) {
- MemoryHob = Hob.MemoryAllocation;
- if (MemoryHob->AllocDescriptor.MemoryBaseAddress == CpuMpData->WakeupBuffer) {
- //
- // Flag this HOB type to un-used
- //
- GET_HOB_TYPE (Hob) = EFI_HOB_TYPE_UNUSED;
- break;
- }
- }
- Hob.Raw = GET_NEXT_HOB (Hob);
- }
- }
-
- return EFI_SUCCESS;
-}
-
-/**
Check if AP wakeup buffer is overlapped with existing allocated buffer.
@param[in] WakeupBufferStart AP wakeup buffer start address.
@@ -244,14 +174,6 @@ GetWakeupBuffer ( }
DEBUG ((DEBUG_INFO, "WakeupBufferStart = %x, WakeupBufferSize = %x\n",
WakeupBufferStart, WakeupBufferSize));
- //
- // Create a memory allocation HOB.
- //
- BuildMemoryAllocationHob (
- WakeupBufferStart,
- WakeupBufferSize,
- EfiBootServicesData
- );
return WakeupBufferStart;
}
}
@@ -322,22 +244,7 @@ InitMpGlobalData ( IN CPU_MP_DATA *CpuMpData
)
{
- EFI_STATUS Status;
-
SaveCpuMpData (CpuMpData);
-
- if (CpuMpData->CpuCount == 1) {
- //
- // If only BSP exists, return
- //
- return;
- }
-
- //
- // Register an event for EndOfPei
- //
- Status = PeiServicesNotifyPpi (&mMpInitLibNotifyList);
- ASSERT_EFI_ERROR (Status);
}
/**
|