summaryrefslogtreecommitdiffstats
path: root/UefiCpuPkg/CpuDxe/CpuMp.c
diff options
context:
space:
mode:
Diffstat (limited to 'UefiCpuPkg/CpuDxe/CpuMp.c')
-rw-r--r--UefiCpuPkg/CpuDxe/CpuMp.c50
1 files changed, 30 insertions, 20 deletions
diff --git a/UefiCpuPkg/CpuDxe/CpuMp.c b/UefiCpuPkg/CpuDxe/CpuMp.c
index e7575d9b80..b90312e863 100644
--- a/UefiCpuPkg/CpuDxe/CpuMp.c
+++ b/UefiCpuPkg/CpuDxe/CpuMp.c
@@ -622,8 +622,15 @@ InitializeExceptionStackSwitchHandlers (
{
EXCEPTION_STACK_SWITCH_CONTEXT *SwitchStackData;
UINTN Index;
+ EFI_STATUS Status;
+
+ Status = MpInitLibWhoAmI (&Index);
+
+ if (EFI_ERROR (Status)) {
+ DEBUG ((DEBUG_ERROR, "[%a] - Failed to get processor number. The exception stack was not initialized.\n", __func__));
+ return;
+ }
- MpInitLibWhoAmI (&Index);
SwitchStackData = (EXCEPTION_STACK_SWITCH_CONTEXT *)Buffer;
//
@@ -758,25 +765,28 @@ InitializeMpSupport (
Status = MpInitLibInitialize ();
ASSERT_EFI_ERROR (Status);
- MpInitLibGetNumberOfProcessors (&NumberOfProcessors, &NumberOfEnabledProcessors);
- mNumberOfProcessors = NumberOfProcessors;
- DEBUG ((DEBUG_INFO, "Detect CPU count: %d\n", mNumberOfProcessors));
+ Status = MpInitLibGetNumberOfProcessors (&NumberOfProcessors, &NumberOfEnabledProcessors);
+ ASSERT_EFI_ERROR (Status);
+ if (!EFI_ERROR (Status)) {
+ mNumberOfProcessors = NumberOfProcessors;
+ DEBUG ((DEBUG_INFO, "Detect CPU count: %d\n", mNumberOfProcessors));
- //
- // Initialize special exception handlers for each logic processor.
- //
- InitializeMpExceptionHandlers ();
+ //
+ // Initialize special exception handlers for each logic processor.
+ //
+ InitializeMpExceptionHandlers ();
- //
- // Update CPU healthy information from Guided HOB
- //
- CollectBistDataFromHob ();
-
- Status = gBS->InstallMultipleProtocolInterfaces (
- &mMpServiceHandle,
- &gEfiMpServiceProtocolGuid,
- &mMpServicesTemplate,
- NULL
- );
- ASSERT_EFI_ERROR (Status);
+ //
+ // Update CPU healthy information from Guided HOB
+ //
+ CollectBistDataFromHob ();
+
+ Status = gBS->InstallMultipleProtocolInterfaces (
+ &mMpServiceHandle,
+ &gEfiMpServiceProtocolGuid,
+ &mMpServicesTemplate,
+ NULL
+ );
+ ASSERT_EFI_ERROR (Status);
+ }
}