summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--UefiCpuPkg/Library/RegisterCpuFeaturesLib/CpuFeaturesInitialize.c10
-rw-r--r--UefiCpuPkg/Library/RegisterCpuFeaturesLib/DxeRegisterCpuFeaturesLib.c43
-rw-r--r--UefiCpuPkg/Library/RegisterCpuFeaturesLib/PeiRegisterCpuFeaturesLib.c11
3 files changed, 37 insertions, 27 deletions
diff --git a/UefiCpuPkg/Library/RegisterCpuFeaturesLib/CpuFeaturesInitialize.c b/UefiCpuPkg/Library/RegisterCpuFeaturesLib/CpuFeaturesInitialize.c
index aff7ad600c..1746f4f07f 100644
--- a/UefiCpuPkg/Library/RegisterCpuFeaturesLib/CpuFeaturesInitialize.c
+++ b/UefiCpuPkg/Library/RegisterCpuFeaturesLib/CpuFeaturesInitialize.c
@@ -1071,10 +1071,12 @@ CpuFeaturesDetect (
CpuInitDataInitialize ();
- //
- // Wakeup all APs for data collection.
- //
- StartupAPsWorker (CollectProcessorData, NULL);
+ if (CpuFeaturesData->NumberOfCpus > 1) {
+ //
+ // Wakeup all APs for data collection.
+ //
+ StartupAPsWorker (CollectProcessorData, NULL);
+ }
//
// Collect data on BSP
diff --git a/UefiCpuPkg/Library/RegisterCpuFeaturesLib/DxeRegisterCpuFeaturesLib.c b/UefiCpuPkg/Library/RegisterCpuFeaturesLib/DxeRegisterCpuFeaturesLib.c
index 9c78a2d993..ffd99046a6 100644
--- a/UefiCpuPkg/Library/RegisterCpuFeaturesLib/DxeRegisterCpuFeaturesLib.c
+++ b/UefiCpuPkg/Library/RegisterCpuFeaturesLib/DxeRegisterCpuFeaturesLib.c
@@ -229,31 +229,36 @@ CpuFeaturesInitialize (
OldBspNumber = GetProcessorIndex (CpuFeaturesData);
CpuFeaturesData->BspNumber = OldBspNumber;
- Status = gBS->CreateEvent (
- EVT_NOTIFY_WAIT,
- TPL_CALLBACK,
- EfiEventEmptyFunction,
- NULL,
- &MpEvent
- );
- ASSERT_EFI_ERROR (Status);
+ if (CpuFeaturesData->NumberOfCpus > 1) {
+ Status = gBS->CreateEvent (
+ EVT_NOTIFY_WAIT,
+ TPL_CALLBACK,
+ EfiEventEmptyFunction,
+ NULL,
+ &MpEvent
+ );
+ ASSERT_EFI_ERROR (Status);
+
+ //
+ // Wakeup all APs for programming.
+ //
+ StartupAPsWorker (SetProcessorRegister, MpEvent);
+ }
//
- // Wakeup all APs for programming.
- //
- StartupAPsWorker (SetProcessorRegister, MpEvent);
- //
// Programming BSP
//
SetProcessorRegister (CpuFeaturesData);
- //
- // Wait all processors to finish the task.
- //
- do {
- Status = gBS->CheckEvent (MpEvent);
- } while (Status == EFI_NOT_READY);
- ASSERT_EFI_ERROR (Status);
+ if (CpuFeaturesData->NumberOfCpus > 1) {
+ //
+ // Wait all processors to finish the task.
+ //
+ do {
+ Status = gBS->CheckEvent (MpEvent);
+ } while (Status == EFI_NOT_READY);
+ ASSERT_EFI_ERROR (Status);
+ }
//
// Switch to new BSP if required
diff --git a/UefiCpuPkg/Library/RegisterCpuFeaturesLib/PeiRegisterCpuFeaturesLib.c b/UefiCpuPkg/Library/RegisterCpuFeaturesLib/PeiRegisterCpuFeaturesLib.c
index 2b1553f9b8..8ad5a40e5a 100644
--- a/UefiCpuPkg/Library/RegisterCpuFeaturesLib/PeiRegisterCpuFeaturesLib.c
+++ b/UefiCpuPkg/Library/RegisterCpuFeaturesLib/PeiRegisterCpuFeaturesLib.c
@@ -273,10 +273,13 @@ CpuFeaturesInitialize (
// DXE type instance.
//
- //
- // Wakeup all APs for programming.
- //
- StartupAPsWorker (SetProcessorRegister, NULL);
+ if (CpuFeaturesData->NumberOfCpus > 1) {
+ //
+ // Wakeup all APs for programming.
+ //
+ StartupAPsWorker (SetProcessorRegister, NULL);
+ }
+
//
// Programming BSP
//