2 MP initialize support functions for DXE phase.
4 Copyright (c) 2016 - 2020, Intel Corporation. All rights reserved.<BR>
5 SPDX-License-Identifier: BSD-2-Clause-Patent
11 #include <Library/UefiLib.h>
12 #include <Library/UefiBootServicesTableLib.h>
13 #include <Library/DebugAgentLib.h>
14 #include <Library/DxeServicesTableLib.h>
16 #include <Protocol/Timer.h>
18 #define AP_CHECK_INTERVAL (EFI_TIMER_PERIOD_MILLISECONDS (100))
19 #define AP_SAFE_STACK_SIZE 128
21 CPU_MP_DATA
*mCpuMpData
= NULL
;
22 EFI_EVENT mCheckAllApsEvent
= NULL
;
23 EFI_EVENT mMpInitExitBootServicesEvent
= NULL
;
24 EFI_EVENT mLegacyBootEvent
= NULL
;
25 volatile BOOLEAN mStopCheckAllApsStatus
= TRUE
;
26 VOID
*mReservedApLoopFunc
= NULL
;
27 UINTN mReservedTopOfApStack
;
28 volatile UINT32 mNumberToFinish
= 0;
31 Enable Debug Agent to support source debugging on AP function.
40 // Initialize Debug Agent to support source level debug in DXE phase
42 InitializeDebugAgent (DEBUG_AGENT_INIT_DXE_AP
, NULL
, NULL
);
46 Get the pointer to CPU MP Data structure.
48 @return The pointer to CPU MP Data structure.
55 ASSERT (mCpuMpData
!= NULL
);
60 Save the pointer to CPU MP Data structure.
62 @param[in] CpuMpData The pointer to CPU MP Data structure will be saved.
66 IN CPU_MP_DATA
*CpuMpData
69 mCpuMpData
= CpuMpData
;
73 Get available system memory below 0x88000 by specified size.
75 @param[in] WakeupBufferSize Wakeup buffer size required
77 @retval other Return wakeup buffer address below 1MB.
78 @retval -1 Cannot find free memory below 1MB.
82 IN UINTN WakeupBufferSize
86 EFI_PHYSICAL_ADDRESS StartAddress
;
89 // Try to allocate buffer below 1M for waking vector.
90 // LegacyBios driver only reports warning when page allocation in range
91 // [0x60000, 0x88000) fails.
92 // This library is consumed by CpuDxe driver to produce CPU Arch protocol.
93 // LagacyBios driver depends on CPU Arch protocol which guarantees below
94 // allocation runs earlier than LegacyBios driver.
96 StartAddress
= 0x88000;
97 Status
= gBS
->AllocatePages (
100 EFI_SIZE_TO_PAGES (WakeupBufferSize
),
103 ASSERT_EFI_ERROR (Status
);
104 if (EFI_ERROR (Status
)) {
105 StartAddress
= (EFI_PHYSICAL_ADDRESS
) -1;
108 DEBUG ((DEBUG_INFO
, "WakeupBufferStart = %x, WakeupBufferSize = %x\n",
109 (UINTN
) StartAddress
, WakeupBufferSize
));
111 return (UINTN
) StartAddress
;
115 Get available EfiBootServicesCode memory below 4GB by specified size.
117 This buffer is required to safely transfer AP from real address mode to
118 protected mode or long mode, due to the fact that the buffer returned by
119 GetWakeupBuffer() may be marked as non-executable.
121 @param[in] BufferSize Wakeup transition buffer size.
123 @retval other Return wakeup transition buffer address below 4GB.
124 @retval 0 Cannot find free memory below 4GB.
127 GetModeTransitionBuffer (
132 EFI_PHYSICAL_ADDRESS StartAddress
;
134 StartAddress
= BASE_4GB
- 1;
135 Status
= gBS
->AllocatePages (
138 EFI_SIZE_TO_PAGES (BufferSize
),
141 if (EFI_ERROR (Status
)) {
145 return (UINTN
)StartAddress
;
149 Checks APs status and updates APs status if needed.
153 CheckAndUpdateApsStatus (
157 UINTN ProcessorNumber
;
159 CPU_MP_DATA
*CpuMpData
;
161 CpuMpData
= GetCpuMpData ();
164 // First, check whether pending StartupAllAPs() exists.
166 if (CpuMpData
->WaitEvent
!= NULL
) {
168 Status
= CheckAllAPs ();
170 // If all APs finish for StartupAllAPs(), signal the WaitEvent for it.
172 if (Status
!= EFI_NOT_READY
) {
173 Status
= gBS
->SignalEvent (CpuMpData
->WaitEvent
);
174 CpuMpData
->WaitEvent
= NULL
;
179 // Second, check whether pending StartupThisAPs() callings exist.
181 for (ProcessorNumber
= 0; ProcessorNumber
< CpuMpData
->CpuCount
; ProcessorNumber
++) {
183 if (CpuMpData
->CpuData
[ProcessorNumber
].WaitEvent
== NULL
) {
187 Status
= CheckThisAP (ProcessorNumber
);
189 if (Status
!= EFI_NOT_READY
) {
190 gBS
->SignalEvent (CpuMpData
->CpuData
[ProcessorNumber
].WaitEvent
);
191 CpuMpData
->CpuData
[ProcessorNumber
].WaitEvent
= NULL
;
197 Checks APs' status periodically.
199 This function is triggered by timer periodically to check the
200 state of APs for StartupAllAPs() and StartupThisAP() executed
201 in non-blocking mode.
203 @param[in] Event Event triggered.
204 @param[in] Context Parameter passed with the event.
215 // If CheckApsStatus() is not stopped, otherwise return immediately.
217 if (!mStopCheckAllApsStatus
) {
218 CheckAndUpdateApsStatus ();
223 Get Protected mode code segment from current GDT table.
225 @return Protected mode code segment value.
232 IA32_DESCRIPTOR GdtrDesc
;
233 IA32_SEGMENT_DESCRIPTOR
*GdtEntry
;
237 AsmReadGdtr (&GdtrDesc
);
238 GdtEntryCount
= (GdtrDesc
.Limit
+ 1) / sizeof (IA32_SEGMENT_DESCRIPTOR
);
239 GdtEntry
= (IA32_SEGMENT_DESCRIPTOR
*) GdtrDesc
.Base
;
240 for (Index
= 0; Index
< GdtEntryCount
; Index
++) {
241 if (GdtEntry
->Bits
.L
== 0) {
242 if (GdtEntry
->Bits
.Type
> 8 && GdtEntry
->Bits
.L
== 0) {
248 ASSERT (Index
!= GdtEntryCount
);
255 @param[in, out] Buffer Pointer to private data buffer.
263 CPU_MP_DATA
*CpuMpData
;
264 BOOLEAN MwaitSupport
;
265 ASM_RELOCATE_AP_LOOP AsmRelocateApLoopFunc
;
266 UINTN ProcessorNumber
;
268 MpInitLibWhoAmI (&ProcessorNumber
);
269 CpuMpData
= GetCpuMpData ();
270 MwaitSupport
= IsMwaitSupport ();
271 AsmRelocateApLoopFunc
= (ASM_RELOCATE_AP_LOOP
) (UINTN
) mReservedApLoopFunc
;
272 AsmRelocateApLoopFunc (
274 CpuMpData
->ApTargetCState
,
275 CpuMpData
->PmCodeSegment
,
276 mReservedTopOfApStack
- ProcessorNumber
* AP_SAFE_STACK_SIZE
,
277 (UINTN
) &mNumberToFinish
280 // It should never reach here
286 Callback function for ExitBootServices.
288 @param[in] Event Event whose notification function is being invoked.
289 @param[in] Context The pointer to the notification function's context,
290 which is implementation-dependent.
295 MpInitChangeApLoopCallback (
300 CPU_MP_DATA
*CpuMpData
;
302 CpuMpData
= GetCpuMpData ();
303 CpuMpData
->PmCodeSegment
= GetProtectedModeCS ();
304 CpuMpData
->ApLoopMode
= PcdGet8 (PcdCpuApLoopMode
);
305 mNumberToFinish
= CpuMpData
->CpuCount
- 1;
306 WakeUpAP (CpuMpData
, TRUE
, 0, RelocateApLoop
, NULL
, TRUE
);
307 while (mNumberToFinish
> 0) {
310 DEBUG ((DEBUG_INFO
, "%a() done!\n", __FUNCTION__
));
314 Initialize global data for MP support.
316 @param[in] CpuMpData The pointer to CPU MP Data structure.
320 IN CPU_MP_DATA
*CpuMpData
324 EFI_PHYSICAL_ADDRESS Address
;
325 UINTN ApSafeBufferSize
;
327 EFI_GCD_MEMORY_SPACE_DESCRIPTOR MemDesc
;
329 CPU_INFO_IN_HOB
*CpuInfoInHob
;
331 SaveCpuMpData (CpuMpData
);
333 if (CpuMpData
->CpuCount
== 1) {
335 // If only BSP exists, return
340 if (PcdGetBool (PcdCpuStackGuard
)) {
342 // One extra page at the bottom of the stack is needed for Guard page.
344 if (CpuMpData
->CpuApStackSize
<= EFI_PAGE_SIZE
) {
345 DEBUG ((DEBUG_ERROR
, "PcdCpuApStackSize is not big enough for Stack Guard!\n"));
350 // DXE will reuse stack allocated for APs at PEI phase if it's available.
351 // Let's check it here.
353 // Note: BSP's stack guard is set at DxeIpl phase. But for the sake of
354 // BSP/AP exchange, stack guard for ApTopOfStack of cpu 0 will still be
357 CpuInfoInHob
= (CPU_INFO_IN_HOB
*)(UINTN
)CpuMpData
->CpuInfoInHob
;
358 for (Index
= 0; Index
< CpuMpData
->CpuCount
; ++Index
) {
359 if (CpuInfoInHob
!= NULL
&& CpuInfoInHob
[Index
].ApTopOfStack
!= 0) {
360 StackBase
= (UINTN
)CpuInfoInHob
[Index
].ApTopOfStack
- CpuMpData
->CpuApStackSize
;
362 StackBase
= CpuMpData
->Buffer
+ Index
* CpuMpData
->CpuApStackSize
;
365 Status
= gDS
->GetMemorySpaceDescriptor (StackBase
, &MemDesc
);
366 ASSERT_EFI_ERROR (Status
);
368 Status
= gDS
->SetMemorySpaceAttributes (
370 EFI_PAGES_TO_SIZE (1),
371 MemDesc
.Attributes
| EFI_MEMORY_RP
373 ASSERT_EFI_ERROR (Status
);
375 DEBUG ((DEBUG_INFO
, "Stack Guard set at %lx [cpu%lu]!\n",
376 (UINT64
)StackBase
, (UINT64
)Index
));
381 // Avoid APs access invalid buffer data which allocated by BootServices,
382 // so we will allocate reserved data for AP loop code. We also need to
383 // allocate this buffer below 4GB due to APs may be transferred to 32bit
384 // protected mode on long mode DXE.
385 // Allocating it in advance since memory services are not available in
386 // Exit Boot Services callback function.
388 ApSafeBufferSize
= EFI_PAGES_TO_SIZE (EFI_SIZE_TO_PAGES (
389 CpuMpData
->AddressMap
.RelocateApLoopFuncSize
391 Address
= BASE_4GB
- 1;
392 Status
= gBS
->AllocatePages (
394 EfiReservedMemoryType
,
395 EFI_SIZE_TO_PAGES (ApSafeBufferSize
),
398 ASSERT_EFI_ERROR (Status
);
400 mReservedApLoopFunc
= (VOID
*) (UINTN
) Address
;
401 ASSERT (mReservedApLoopFunc
!= NULL
);
404 // Make sure that the buffer memory is executable if NX protection is enabled
405 // for EfiReservedMemoryType.
407 // TODO: Check EFI_MEMORY_XP bit set or not once it's available in DXE GCD
410 Status
= gDS
->GetMemorySpaceDescriptor (Address
, &MemDesc
);
411 if (!EFI_ERROR (Status
)) {
412 gDS
->SetMemorySpaceAttributes (
415 MemDesc
.Attributes
& (~EFI_MEMORY_XP
)
419 ApSafeBufferSize
= EFI_PAGES_TO_SIZE (EFI_SIZE_TO_PAGES (
420 CpuMpData
->CpuCount
* AP_SAFE_STACK_SIZE
422 Address
= BASE_4GB
- 1;
423 Status
= gBS
->AllocatePages (
425 EfiReservedMemoryType
,
426 EFI_SIZE_TO_PAGES (ApSafeBufferSize
),
429 ASSERT_EFI_ERROR (Status
);
431 mReservedTopOfApStack
= (UINTN
) Address
+ ApSafeBufferSize
;
432 ASSERT ((mReservedTopOfApStack
& (UINTN
)(CPU_STACK_ALIGNMENT
- 1)) == 0);
435 CpuMpData
->AddressMap
.RelocateApLoopFuncAddress
,
436 CpuMpData
->AddressMap
.RelocateApLoopFuncSize
439 Status
= gBS
->CreateEvent (
440 EVT_TIMER
| EVT_NOTIFY_SIGNAL
,
446 ASSERT_EFI_ERROR (Status
);
449 // Set timer to check all APs status.
451 Status
= gBS
->SetTimer (
456 ASSERT_EFI_ERROR (Status
);
458 Status
= gBS
->CreateEvent (
459 EVT_SIGNAL_EXIT_BOOT_SERVICES
,
461 MpInitChangeApLoopCallback
,
463 &mMpInitExitBootServicesEvent
465 ASSERT_EFI_ERROR (Status
);
467 Status
= gBS
->CreateEventEx (
470 MpInitChangeApLoopCallback
,
472 &gEfiEventLegacyBootGuid
,
475 ASSERT_EFI_ERROR (Status
);
479 This service executes a caller provided function on all enabled APs.
481 @param[in] Procedure A pointer to the function to be run on
482 enabled APs of the system. See type
484 @param[in] SingleThread If TRUE, then all the enabled APs execute
485 the function specified by Procedure one by
486 one, in ascending order of processor handle
487 number. If FALSE, then all the enabled APs
488 execute the function specified by Procedure
490 @param[in] WaitEvent The event created by the caller with CreateEvent()
491 service. If it is NULL, then execute in
492 blocking mode. BSP waits until all APs finish
493 or TimeoutInMicroSeconds expires. If it's
494 not NULL, then execute in non-blocking mode.
495 BSP requests the function specified by
496 Procedure to be started on all the enabled
497 APs, and go on executing immediately. If
498 all return from Procedure, or TimeoutInMicroSeconds
499 expires, this event is signaled. The BSP
500 can use the CheckEvent() or WaitForEvent()
501 services to check the state of event. Type
502 EFI_EVENT is defined in CreateEvent() in
503 the Unified Extensible Firmware Interface
505 @param[in] TimeoutInMicroseconds Indicates the time limit in microseconds for
506 APs to return from Procedure, either for
507 blocking or non-blocking mode. Zero means
508 infinity. If the timeout expires before
509 all APs return from Procedure, then Procedure
510 on the failed APs is terminated. All enabled
511 APs are available for next function assigned
512 by MpInitLibStartupAllAPs() or
513 MPInitLibStartupThisAP().
514 If the timeout expires in blocking mode,
515 BSP returns EFI_TIMEOUT. If the timeout
516 expires in non-blocking mode, WaitEvent
517 is signaled with SignalEvent().
518 @param[in] ProcedureArgument The parameter passed into Procedure for
520 @param[out] FailedCpuList If NULL, this parameter is ignored. Otherwise,
521 if all APs finish successfully, then its
522 content is set to NULL. If not all APs
523 finish before timeout expires, then its
524 content is set to address of the buffer
525 holding handle numbers of the failed APs.
526 The buffer is allocated by MP Initialization
527 library, and it's the caller's responsibility to
528 free the buffer with FreePool() service.
529 In blocking mode, it is ready for consumption
530 when the call returns. In non-blocking mode,
531 it is ready when WaitEvent is signaled. The
532 list of failed CPU is terminated by
535 @retval EFI_SUCCESS In blocking mode, all APs have finished before
537 @retval EFI_SUCCESS In non-blocking mode, function has been dispatched
539 @retval EFI_UNSUPPORTED A non-blocking mode request was made after the
540 UEFI event EFI_EVENT_GROUP_READY_TO_BOOT was
542 @retval EFI_UNSUPPORTED WaitEvent is not NULL if non-blocking mode is not
544 @retval EFI_DEVICE_ERROR Caller processor is AP.
545 @retval EFI_NOT_STARTED No enabled APs exist in the system.
546 @retval EFI_NOT_READY Any enabled APs are busy.
547 @retval EFI_NOT_READY MP Initialize Library is not initialized.
548 @retval EFI_TIMEOUT In blocking mode, the timeout expired before
549 all enabled APs have finished.
550 @retval EFI_INVALID_PARAMETER Procedure is NULL.
555 MpInitLibStartupAllAPs (
556 IN EFI_AP_PROCEDURE Procedure
,
557 IN BOOLEAN SingleThread
,
558 IN EFI_EVENT WaitEvent OPTIONAL
,
559 IN UINTN TimeoutInMicroseconds
,
560 IN VOID
*ProcedureArgument OPTIONAL
,
561 OUT UINTN
**FailedCpuList OPTIONAL
567 // Temporarily stop checkAllApsStatus for avoid resource dead-lock.
569 mStopCheckAllApsStatus
= TRUE
;
571 Status
= StartupAllCPUsWorker (
576 TimeoutInMicroseconds
,
582 // Start checkAllApsStatus
584 mStopCheckAllApsStatus
= FALSE
;
590 This service lets the caller get one enabled AP to execute a caller-provided
593 @param[in] Procedure A pointer to the function to be run on the
594 designated AP of the system. See type
596 @param[in] ProcessorNumber The handle number of the AP. The range is
597 from 0 to the total number of logical
598 processors minus 1. The total number of
599 logical processors can be retrieved by
600 MpInitLibGetNumberOfProcessors().
601 @param[in] WaitEvent The event created by the caller with CreateEvent()
602 service. If it is NULL, then execute in
603 blocking mode. BSP waits until this AP finish
604 or TimeoutInMicroSeconds expires. If it's
605 not NULL, then execute in non-blocking mode.
606 BSP requests the function specified by
607 Procedure to be started on this AP,
608 and go on executing immediately. If this AP
609 return from Procedure or TimeoutInMicroSeconds
610 expires, this event is signaled. The BSP
611 can use the CheckEvent() or WaitForEvent()
612 services to check the state of event. Type
613 EFI_EVENT is defined in CreateEvent() in
614 the Unified Extensible Firmware Interface
616 @param[in] TimeoutInMicroseconds Indicates the time limit in microseconds for
617 this AP to finish this Procedure, either for
618 blocking or non-blocking mode. Zero means
619 infinity. If the timeout expires before
620 this AP returns from Procedure, then Procedure
621 on the AP is terminated. The
622 AP is available for next function assigned
623 by MpInitLibStartupAllAPs() or
624 MpInitLibStartupThisAP().
625 If the timeout expires in blocking mode,
626 BSP returns EFI_TIMEOUT. If the timeout
627 expires in non-blocking mode, WaitEvent
628 is signaled with SignalEvent().
629 @param[in] ProcedureArgument The parameter passed into Procedure on the
631 @param[out] Finished If NULL, this parameter is ignored. In
632 blocking mode, this parameter is ignored.
633 In non-blocking mode, if AP returns from
634 Procedure before the timeout expires, its
635 content is set to TRUE. Otherwise, the
636 value is set to FALSE. The caller can
637 determine if the AP returned from Procedure
638 by evaluating this value.
640 @retval EFI_SUCCESS In blocking mode, specified AP finished before
642 @retval EFI_SUCCESS In non-blocking mode, the function has been
643 dispatched to specified AP.
644 @retval EFI_UNSUPPORTED A non-blocking mode request was made after the
645 UEFI event EFI_EVENT_GROUP_READY_TO_BOOT was
647 @retval EFI_UNSUPPORTED WaitEvent is not NULL if non-blocking mode is not
649 @retval EFI_DEVICE_ERROR The calling processor is an AP.
650 @retval EFI_TIMEOUT In blocking mode, the timeout expired before
651 the specified AP has finished.
652 @retval EFI_NOT_READY The specified AP is busy.
653 @retval EFI_NOT_READY MP Initialize Library is not initialized.
654 @retval EFI_NOT_FOUND The processor with the handle specified by
655 ProcessorNumber does not exist.
656 @retval EFI_INVALID_PARAMETER ProcessorNumber specifies the BSP or disabled AP.
657 @retval EFI_INVALID_PARAMETER Procedure is NULL.
662 MpInitLibStartupThisAP (
663 IN EFI_AP_PROCEDURE Procedure
,
664 IN UINTN ProcessorNumber
,
665 IN EFI_EVENT WaitEvent OPTIONAL
,
666 IN UINTN TimeoutInMicroseconds
,
667 IN VOID
*ProcedureArgument OPTIONAL
,
668 OUT BOOLEAN
*Finished OPTIONAL
674 // temporarily stop checkAllApsStatus for avoid resource dead-lock.
676 mStopCheckAllApsStatus
= TRUE
;
678 Status
= StartupThisAPWorker (
682 TimeoutInMicroseconds
,
687 mStopCheckAllApsStatus
= FALSE
;
693 This service switches the requested AP to be the BSP from that point onward.
694 This service changes the BSP for all purposes. This call can only be performed
697 @param[in] ProcessorNumber The handle number of AP that is to become the new
698 BSP. The range is from 0 to the total number of
699 logical processors minus 1. The total number of
700 logical processors can be retrieved by
701 MpInitLibGetNumberOfProcessors().
702 @param[in] EnableOldBSP If TRUE, then the old BSP will be listed as an
703 enabled AP. Otherwise, it will be disabled.
705 @retval EFI_SUCCESS BSP successfully switched.
706 @retval EFI_UNSUPPORTED Switching the BSP cannot be completed prior to
707 this service returning.
708 @retval EFI_UNSUPPORTED Switching the BSP is not supported.
709 @retval EFI_DEVICE_ERROR The calling processor is an AP.
710 @retval EFI_NOT_FOUND The processor with the handle specified by
711 ProcessorNumber does not exist.
712 @retval EFI_INVALID_PARAMETER ProcessorNumber specifies the current BSP or
714 @retval EFI_NOT_READY The specified AP is busy.
715 @retval EFI_NOT_READY MP Initialize Library is not initialized.
721 IN UINTN ProcessorNumber
,
722 IN BOOLEAN EnableOldBSP
726 EFI_TIMER_ARCH_PROTOCOL
*Timer
;
731 // Locate Timer Arch Protocol
733 Status
= gBS
->LocateProtocol (&gEfiTimerArchProtocolGuid
, NULL
, (VOID
**) &Timer
);
734 if (EFI_ERROR (Status
)) {
740 // Save current rate of DXE Timer
742 Timer
->GetTimerPeriod (Timer
, &TimerPeriod
);
744 // Disable DXE Timer and drain pending interrupts
746 Timer
->SetTimerPeriod (Timer
, 0);
749 Status
= SwitchBSPWorker (ProcessorNumber
, EnableOldBSP
);
753 // Enable and restore rate of DXE Timer
755 Timer
->SetTimerPeriod (Timer
, TimerPeriod
);
762 This service lets the caller enable or disable an AP from this point onward.
763 This service may only be called from the BSP.
765 @param[in] ProcessorNumber The handle number of AP.
766 The range is from 0 to the total number of
767 logical processors minus 1. The total number of
768 logical processors can be retrieved by
769 MpInitLibGetNumberOfProcessors().
770 @param[in] EnableAP Specifies the new state for the processor for
771 enabled, FALSE for disabled.
772 @param[in] HealthFlag If not NULL, a pointer to a value that specifies
773 the new health status of the AP. This flag
774 corresponds to StatusFlag defined in
775 EFI_MP_SERVICES_PROTOCOL.GetProcessorInfo(). Only
776 the PROCESSOR_HEALTH_STATUS_BIT is used. All other
777 bits are ignored. If it is NULL, this parameter
780 @retval EFI_SUCCESS The specified AP was enabled or disabled successfully.
781 @retval EFI_UNSUPPORTED Enabling or disabling an AP cannot be completed
782 prior to this service returning.
783 @retval EFI_UNSUPPORTED Enabling or disabling an AP is not supported.
784 @retval EFI_DEVICE_ERROR The calling processor is an AP.
785 @retval EFI_NOT_FOUND Processor with the handle specified by ProcessorNumber
787 @retval EFI_INVALID_PARAMETER ProcessorNumber specifies the BSP.
788 @retval EFI_NOT_READY MP Initialize Library is not initialized.
793 MpInitLibEnableDisableAP (
794 IN UINTN ProcessorNumber
,
796 IN UINT32
*HealthFlag OPTIONAL
800 BOOLEAN TempStopCheckState
;
802 TempStopCheckState
= FALSE
;
804 // temporarily stop checkAllAPsStatus for initialize parameters.
806 if (!mStopCheckAllApsStatus
) {
807 mStopCheckAllApsStatus
= TRUE
;
808 TempStopCheckState
= TRUE
;
811 Status
= EnableDisableApWorker (ProcessorNumber
, EnableAP
, HealthFlag
);
813 if (TempStopCheckState
) {
814 mStopCheckAllApsStatus
= FALSE
;
821 This funtion will try to invoke platform specific microcode shadow logic to
822 relocate microcode update patches into memory.
824 @param[in] CpuMpData The pointer to CPU MP Data structure.
826 @retval EFI_SUCCESS Shadow microcode success.
827 @retval EFI_OUT_OF_RESOURCES No enough resource to complete the operation.
828 @retval EFI_UNSUPPORTED Can't find platform specific microcode shadow
832 PlatformShadowMicrocode (
833 IN OUT CPU_MP_DATA
*CpuMpData
837 // There is no DXE version of platform shadow microcode protocol so far.
838 // A platform which only uses DxeMpInitLib instance could only supports
839 // the PCD based microcode shadowing.
841 return EFI_UNSUPPORTED
;