TianoCore EDK2 master
Loading...
Searching...
No Matches
DxeMpLib.c
Go to the documentation of this file.
1
10#include "MpLib.h"
11
12#include <Library/UefiLib.h>
16#include <Library/CcExitLib.h>
18#include <Register/Amd/Ghcb.h>
19
20#include <Protocol/Timer.h>
21
22#define AP_SAFE_STACK_SIZE 128
23
24CPU_MP_DATA *mCpuMpData = NULL;
25EFI_EVENT mCheckAllApsEvent = NULL;
26EFI_EVENT mMpInitExitBootServicesEvent = NULL;
27EFI_EVENT mLegacyBootEvent = NULL;
28volatile BOOLEAN mStopCheckAllApsStatus = TRUE;
29
30//
31// Begin wakeup buffer allocation below 0x88000
32//
33STATIC EFI_PHYSICAL_ADDRESS mSevEsDxeWakeupBuffer = 0x88000;
34
39VOID
41 VOID
42 )
43{
44 //
45 // Initialize Debug Agent to support source level debug in DXE phase
46 //
47 InitializeDebugAgent (DEBUG_AGENT_INIT_DXE_AP, NULL, NULL);
48}
49
57 VOID
58 )
59{
60 ASSERT (mCpuMpData != NULL);
61 return mCpuMpData;
62}
63
69VOID
71 IN CPU_MP_DATA *CpuMpData
72 )
73{
74 mCpuMpData = CpuMpData;
75}
76
87 IN UINTN WakeupBufferSize
88 )
89{
90 EFI_STATUS Status;
91 EFI_PHYSICAL_ADDRESS StartAddress;
92 EFI_MEMORY_TYPE MemoryType;
93
94 if (ConfidentialComputingGuestHas (CCAttrAmdSevEs) &&
95 !ConfidentialComputingGuestHas (CCAttrAmdSevSnp))
96 {
97 //
98 // An SEV-ES-only guest requires the memory to be reserved. SEV-SNP, which
99 // is also considered SEV-ES, uses a different AP startup method, though,
100 // which does not have the same requirement.
101 //
102 MemoryType = EfiReservedMemoryType;
103 } else {
104 MemoryType = EfiBootServicesData;
105 }
106
107 //
108 // Try to allocate buffer below 1M for waking vector.
109 // LegacyBios driver only reports warning when page allocation in range
110 // [0x60000, 0x88000) fails.
111 // This library is consumed by CpuDxe driver to produce CPU Arch protocol.
112 // LagacyBios driver depends on CPU Arch protocol which guarantees below
113 // allocation runs earlier than LegacyBios driver.
114 //
115 if (ConfidentialComputingGuestHas (CCAttrAmdSevEs)) {
116 //
117 // SEV-ES Wakeup buffer should be under 0x88000 and under any previous one
118 //
119 StartAddress = mSevEsDxeWakeupBuffer;
120 } else {
121 StartAddress = 0x88000;
122 }
123
124 Status = gBS->AllocatePages (
126 MemoryType,
127 EFI_SIZE_TO_PAGES (WakeupBufferSize),
128 &StartAddress
129 );
130 ASSERT_EFI_ERROR (Status);
131 if (EFI_ERROR (Status)) {
132 StartAddress = (EFI_PHYSICAL_ADDRESS)-1;
133 } else if (ConfidentialComputingGuestHas (CCAttrAmdSevEs)) {
134 //
135 // Next SEV-ES wakeup buffer allocation must be below this allocation
136 //
137 mSevEsDxeWakeupBuffer = StartAddress;
138 }
139
140 DEBUG ((
141 DEBUG_INFO,
142 "WakeupBufferStart = %x, WakeupBufferSize = %x\n",
143 (UINTN)StartAddress,
144 WakeupBufferSize
145 ));
146
147 return (UINTN)StartAddress;
148}
149
162UINTN
164 IN UINTN BufferSize
165 )
166{
167 EFI_STATUS Status;
168 EFI_PHYSICAL_ADDRESS StartAddress;
169
170 StartAddress = BASE_4GB - 1;
171 Status = gBS->AllocatePages (
174 EFI_SIZE_TO_PAGES (BufferSize),
175 &StartAddress
176 );
177 if (EFI_ERROR (Status)) {
178 StartAddress = 0;
179 }
180
181 return (UINTN)StartAddress;
182}
183
192UINTN
194 VOID
195 )
196{
197 EFI_STATUS Status;
198 EFI_PHYSICAL_ADDRESS StartAddress;
200 GHCB *Ghcb;
201 BOOLEAN InterruptState;
202
203 //
204 // Allocate 1 page for AP jump table page
205 //
206 StartAddress = BASE_4GB - 1;
207 Status = gBS->AllocatePages (
210 1,
211 &StartAddress
212 );
213 ASSERT_EFI_ERROR (Status);
214
215 DEBUG ((DEBUG_INFO, "Dxe: SevEsAPMemory = %lx\n", (UINTN)StartAddress));
216
217 //
218 // Save the SevEsAPMemory as the AP jump table.
219 //
220 Msr.GhcbPhysicalAddress = AsmReadMsr64 (MSR_SEV_ES_GHCB);
221 Ghcb = Msr.Ghcb;
222
223 CcExitVmgInit (Ghcb, &InterruptState);
224 CcExitVmgExit (Ghcb, SVM_EXIT_AP_JUMP_TABLE, 0, (UINT64)(UINTN)StartAddress);
225 CcExitVmgDone (Ghcb, InterruptState);
226
227 return (UINTN)StartAddress;
228}
229
234VOID
236 VOID
237 )
238{
239 UINTN ProcessorNumber;
240 EFI_STATUS Status;
241 CPU_MP_DATA *CpuMpData;
242
243 CpuMpData = GetCpuMpData ();
244
245 //
246 // First, check whether pending StartupAllAPs() exists.
247 //
248 if (CpuMpData->WaitEvent != NULL) {
249 Status = CheckAllAPs ();
250 //
251 // If all APs finish for StartupAllAPs(), signal the WaitEvent for it.
252 //
253 if (Status != EFI_NOT_READY) {
254 Status = gBS->SignalEvent (CpuMpData->WaitEvent);
255 CpuMpData->WaitEvent = NULL;
256 }
257 }
258
259 //
260 // Second, check whether pending StartupThisAPs() callings exist.
261 //
262 for (ProcessorNumber = 0; ProcessorNumber < CpuMpData->CpuCount; ProcessorNumber++) {
263 if (CpuMpData->CpuData[ProcessorNumber].WaitEvent == NULL) {
264 continue;
265 }
266
267 Status = CheckThisAP (ProcessorNumber);
268
269 if (Status != EFI_NOT_READY) {
270 gBS->SignalEvent (CpuMpData->CpuData[ProcessorNumber].WaitEvent);
271 CpuMpData->CpuData[ProcessorNumber].WaitEvent = NULL;
272 }
273 }
274}
275
287VOID
288EFIAPI
290 IN EFI_EVENT Event,
291 IN VOID *Context
292 )
293{
294 //
295 // If CheckApsStatus() is not stopped, otherwise return immediately.
296 //
297 if (!mStopCheckAllApsStatus) {
299 }
300}
301
308UINT16
310 VOID
311 )
312{
313 IA32_DESCRIPTOR GdtrDesc;
314 IA32_SEGMENT_DESCRIPTOR *GdtEntry;
315 UINTN GdtEntryCount;
316 UINTN Index;
317 UINT16 CodeSegmentValue;
318 EFI_STATUS Status;
319
320 Index = (UINT16)-1;
321 AsmReadGdtr (&GdtrDesc);
322 GdtEntryCount = (GdtrDesc.Limit + 1) / sizeof (IA32_SEGMENT_DESCRIPTOR);
323 GdtEntry = (IA32_SEGMENT_DESCRIPTOR *)GdtrDesc.Base;
324 for (Index = 0; Index < GdtEntryCount; Index++) {
325 if (GdtEntry->Bits.L == 0) {
326 if ((GdtEntry->Bits.Type > 8) && (GdtEntry->Bits.DB == 0)) {
327 break;
328 }
329 }
330
331 GdtEntry++;
332 }
333
334 Status = SafeUintnToUint16 (Index, &CodeSegmentValue);
335 if (EFI_ERROR (Status)) {
336 ASSERT_EFI_ERROR (Status);
337 return 0;
338 }
339
340 Status = SafeUint16Mult (CodeSegmentValue, 8, &CodeSegmentValue);
341 if (EFI_ERROR (Status)) {
342 ASSERT_EFI_ERROR (Status);
343 return 0;
344 }
345
346 return CodeSegmentValue;
347}
348
354UINT16
356 VOID
357 )
358{
359 IA32_DESCRIPTOR GdtrDesc;
360 IA32_SEGMENT_DESCRIPTOR *GdtEntry;
361 UINTN GdtEntryCount;
362 UINTN Index;
363 UINT16 CodeSegmentValue;
364 EFI_STATUS Status;
365
366 AsmReadGdtr (&GdtrDesc);
367 GdtEntryCount = (GdtrDesc.Limit + 1) / sizeof (IA32_SEGMENT_DESCRIPTOR);
368 GdtEntry = (IA32_SEGMENT_DESCRIPTOR *)GdtrDesc.Base;
369 for (Index = 0; Index < GdtEntryCount; Index++) {
370 if (GdtEntry->Bits.L == 0) {
371 if ((GdtEntry->Bits.Type > 8) && (GdtEntry->Bits.DB == 1)) {
372 break;
373 }
374 }
375
376 GdtEntry++;
377 }
378
379 Status = SafeUintnToUint16 (Index, &CodeSegmentValue);
380 if (EFI_ERROR (Status)) {
381 ASSERT_EFI_ERROR (Status);
382 return 0;
383 }
384
385 Status = SafeUint16Mult (CodeSegmentValue, 8, &CodeSegmentValue);
386 if (EFI_ERROR (Status)) {
387 ASSERT_EFI_ERROR (Status);
388 return 0;
389 }
390
391 return CodeSegmentValue;
392}
393
400VOID
402 IN UINTN Pages,
404 )
405{
406 EFI_STATUS Status;
407
408 Status = gBS->AllocatePages (
411 Pages,
412 Address
413 );
414 ASSERT_EFI_ERROR (Status);
415}
416
426VOID
428 IN EFI_PHYSICAL_ADDRESS BaseAddress,
429 IN UINTN Length
430 )
431{
432 EFI_STATUS Status;
434
435 //
436 // TODO: Check EFI_MEMORY_XP bit set or not once it's available in DXE GCD
437 // service.
438 //
439 Status = gDS->GetMemorySpaceDescriptor (BaseAddress, &MemDesc);
440 if (!EFI_ERROR (Status)) {
441 gDS->SetMemorySpaceAttributes (
442 BaseAddress,
443 Length,
444 MemDesc.Attributes & (~EFI_MEMORY_XP)
445 );
446 }
447}
448
457VOID
458EFIAPI
460 IN EFI_EVENT Event,
461 IN VOID *Context
462 )
463{
464 CPU_MP_DATA *CpuMpData;
465
466 CpuMpData = GetCpuMpData ();
467 CpuMpData->PmCodeSegment = GetProtectedModeCS ();
468 CpuMpData->Pm16CodeSegment = GetProtectedMode16CS ();
469 CpuMpData->ApLoopMode = PcdGet8 (PcdCpuApLoopMode);
470 mNumberToFinish = CpuMpData->CpuCount - 1;
471 WakeUpAP (CpuMpData, TRUE, 0, RelocateApLoop, NULL, TRUE);
472 while (mNumberToFinish > 0) {
473 CpuPause ();
474 }
475
476 if (CpuMpData->UseSevEsAPMethod && (CpuMpData->WakeupBuffer != (UINTN)-1)) {
477 //
478 // There are APs present. Re-use reserved memory area below 1MB from
479 // WakeupBuffer as the area to be used for transitioning to 16-bit mode
480 // in support of booting of the AP by an OS.
481 //
482 CopyMem (
483 (VOID *)CpuMpData->WakeupBuffer,
484 (VOID *)(CpuMpData->AddressMap.RendezvousFunnelAddress +
485 CpuMpData->AddressMap.SwitchToRealPM16ModeOffset),
486 CpuMpData->AddressMap.SwitchToRealPM16ModeSize
487 );
488 }
489
490 DEBUG ((DEBUG_INFO, "%a() done!\n", __func__));
491}
492
498VOID
500 IN CPU_MP_DATA *CpuMpData
501 )
502{
503 EFI_STATUS Status;
504 UINTN Index;
506 UINTN StackBase;
507 CPU_INFO_IN_HOB *CpuInfoInHob;
508
509 SaveCpuMpData (CpuMpData);
510
511 if (CpuMpData->CpuCount == 1) {
512 //
513 // If only BSP exists, return
514 //
515 return;
516 }
517
518 if (PcdGetBool (PcdCpuStackGuard)) {
519 //
520 // One extra page at the bottom of the stack is needed for Guard page.
521 //
522 if (CpuMpData->CpuApStackSize <= EFI_PAGE_SIZE) {
523 DEBUG ((DEBUG_ERROR, "PcdCpuApStackSize is not big enough for Stack Guard!\n"));
524 ASSERT (FALSE);
525 }
526
527 //
528 // DXE will reuse stack allocated for APs at PEI phase if it's available.
529 // Let's check it here.
530 //
531 // Note: BSP's stack guard is set at DxeIpl phase. But for the sake of
532 // BSP/AP exchange, stack guard for ApTopOfStack of cpu 0 will still be
533 // set here.
534 //
535 CpuInfoInHob = (CPU_INFO_IN_HOB *)(UINTN)CpuMpData->CpuInfoInHob;
536 for (Index = 0; Index < CpuMpData->CpuCount; ++Index) {
537 if ((CpuInfoInHob != NULL) && (CpuInfoInHob[Index].ApTopOfStack != 0)) {
538 StackBase = (UINTN)CpuInfoInHob[Index].ApTopOfStack - CpuMpData->CpuApStackSize;
539 } else {
540 StackBase = CpuMpData->Buffer + Index * CpuMpData->CpuApStackSize;
541 }
542
543 Status = gDS->GetMemorySpaceDescriptor (StackBase, &MemDesc);
544 ASSERT_EFI_ERROR (Status);
545
546 Status = gDS->SetMemorySpaceAttributes (
547 StackBase,
549 MemDesc.Attributes | EFI_MEMORY_RP
550 );
551 ASSERT_EFI_ERROR (Status);
552
553 DEBUG ((
554 DEBUG_INFO,
555 "Stack Guard set at %lx [cpu%lu]!\n",
556 (UINT64)StackBase,
557 (UINT64)Index
558 ));
559 }
560 }
561
562 PrepareApLoopCode (CpuMpData);
563
564 Status = gBS->CreateEvent (
565 EVT_TIMER | EVT_NOTIFY_SIGNAL,
566 TPL_NOTIFY,
568 NULL,
569 &mCheckAllApsEvent
570 );
571 ASSERT_EFI_ERROR (Status);
572
573 //
574 // Set timer to check all APs status.
575 //
576 Status = gBS->SetTimer (
577 mCheckAllApsEvent,
580 PcdGet32 (PcdCpuApStatusCheckIntervalInMicroSeconds)
581 )
582 );
583 ASSERT_EFI_ERROR (Status);
584
585 Status = gBS->CreateEvent (
586 EVT_SIGNAL_EXIT_BOOT_SERVICES,
587 TPL_CALLBACK,
589 NULL,
590 &mMpInitExitBootServicesEvent
591 );
592 ASSERT_EFI_ERROR (Status);
593
594 Status = gBS->CreateEventEx (
595 EVT_NOTIFY_SIGNAL,
596 TPL_CALLBACK,
598 NULL,
599 &gEfiEventLegacyBootGuid,
600 &mLegacyBootEvent
601 );
602 ASSERT_EFI_ERROR (Status);
603}
604
681EFIAPI
683 IN EFI_AP_PROCEDURE Procedure,
684 IN BOOLEAN SingleThread,
685 IN EFI_EVENT WaitEvent OPTIONAL,
686 IN UINTN TimeoutInMicroseconds,
687 IN VOID *ProcedureArgument OPTIONAL,
688 OUT UINTN **FailedCpuList OPTIONAL
689 )
690{
691 EFI_STATUS Status;
692
693 //
694 // Temporarily stop checkAllApsStatus for avoid resource dead-lock.
695 //
696 mStopCheckAllApsStatus = TRUE;
697
698 Status = StartupAllCPUsWorker (
699 Procedure,
700 SingleThread,
701 TRUE,
702 WaitEvent,
703 TimeoutInMicroseconds,
704 ProcedureArgument,
705 FailedCpuList
706 );
707
708 //
709 // Start checkAllApsStatus
710 //
711 mStopCheckAllApsStatus = FALSE;
712
713 return Status;
714}
715
788EFIAPI
790 IN EFI_AP_PROCEDURE Procedure,
791 IN UINTN ProcessorNumber,
792 IN EFI_EVENT WaitEvent OPTIONAL,
793 IN UINTN TimeoutInMicroseconds,
794 IN VOID *ProcedureArgument OPTIONAL,
795 OUT BOOLEAN *Finished OPTIONAL
796 )
797{
798 EFI_STATUS Status;
799
800 //
801 // temporarily stop checkAllApsStatus for avoid resource dead-lock.
802 //
803 mStopCheckAllApsStatus = TRUE;
804
805 Status = StartupThisAPWorker (
806 Procedure,
807 ProcessorNumber,
808 WaitEvent,
809 TimeoutInMicroseconds,
810 ProcedureArgument,
811 Finished
812 );
813
814 mStopCheckAllApsStatus = FALSE;
815
816 return Status;
817}
818
846EFIAPI
848 IN UINTN ProcessorNumber,
849 IN BOOLEAN EnableOldBSP
850 )
851{
852 EFI_STATUS Status;
854 UINT64 TimerPeriod;
855
856 TimerPeriod = 0;
857 //
858 // Locate Timer Arch Protocol
859 //
860 Status = gBS->LocateProtocol (&gEfiTimerArchProtocolGuid, NULL, (VOID **)&Timer);
861 if (EFI_ERROR (Status)) {
862 Timer = NULL;
863 }
864
865 if (Timer != NULL) {
866 //
867 // Save current rate of DXE Timer
868 //
869 Timer->GetTimerPeriod (Timer, &TimerPeriod);
870 //
871 // Disable DXE Timer and drain pending interrupts
872 //
873 Timer->SetTimerPeriod (Timer, 0);
874 }
875
876 Status = SwitchBSPWorker (ProcessorNumber, EnableOldBSP);
877
878 if (Timer != NULL) {
879 //
880 // Enable and restore rate of DXE Timer
881 //
882 Timer->SetTimerPeriod (Timer, TimerPeriod);
883 }
884
885 return Status;
886}
887
919EFIAPI
921 IN UINTN ProcessorNumber,
922 IN BOOLEAN EnableAP,
923 IN UINT32 *HealthFlag OPTIONAL
924 )
925{
926 EFI_STATUS Status;
927 BOOLEAN TempStopCheckState;
928
929 TempStopCheckState = FALSE;
930 //
931 // temporarily stop checkAllAPsStatus for initialize parameters.
932 //
933 if (!mStopCheckAllApsStatus) {
934 mStopCheckAllApsStatus = TRUE;
935 TempStopCheckState = TRUE;
936 }
937
938 Status = EnableDisableApWorker (ProcessorNumber, EnableAP, HealthFlag);
939
940 if (TempStopCheckState) {
941 mStopCheckAllApsStatus = FALSE;
942 }
943
944 return Status;
945}
946
960 IN OUT CPU_MP_DATA *CpuMpData
961 )
962{
963 //
964 // There is no DXE version of platform shadow microcode protocol so far.
965 // A platform which only uses DxeMpInitLib instance could only supports
966 // the PCD based microcode shadowing.
967 //
968 return EFI_UNSUPPORTED;
969}
UINT64 UINTN
VOID EFIAPI CpuPause(VOID)
VOID *EFIAPI CopyMem(OUT VOID *DestinationBuffer, IN CONST VOID *SourceBuffer, IN UINTN Length)
UINT64 EFIAPI CcExitVmgExit(IN OUT GHCB *Ghcb, IN UINT64 ExitCode, IN UINT64 ExitInfo1, IN UINT64 ExitInfo2)
Definition: CcExitLib.c:106
VOID EFIAPI CcExitVmgInit(IN OUT GHCB *Ghcb, IN OUT BOOLEAN *InterruptState)
Definition: CcExitLib.c:146
VOID EFIAPI CcExitVmgDone(IN OUT GHCB *Ghcb, IN BOOLEAN InterruptState)
Definition: CcExitLib.c:176
VOID EFIAPI InitializeDebugAgent(IN UINT32 InitFlag, IN VOID *Context OPTIONAL, IN DEBUG_AGENT_CONTINUE Function OPTIONAL)
STATIC BOOLEAN EFIAPI ConfidentialComputingGuestHas(IN CONFIDENTIAL_COMPUTING_GUEST_ATTR Attr)
EFI_STATUS EFIAPI MpInitLibEnableDisableAP(IN UINTN ProcessorNumber, IN BOOLEAN EnableAP, IN UINT32 *HealthFlag OPTIONAL)
Definition: DxeMpLib.c:920
UINT16 GetProtectedModeCS(VOID)
Definition: DxeMpLib.c:355
EFI_STATUS EFIAPI MpInitLibStartupAllAPs(IN EFI_AP_PROCEDURE Procedure, IN BOOLEAN SingleThread, IN EFI_EVENT WaitEvent OPTIONAL, IN UINTN TimeoutInMicroseconds, IN VOID *ProcedureArgument OPTIONAL, OUT UINTN **FailedCpuList OPTIONAL)
Definition: DxeMpLib.c:682
VOID EFIAPI MpInitChangeApLoopCallback(IN EFI_EVENT Event, IN VOID *Context)
Definition: DxeMpLib.c:459
VOID CheckAndUpdateApsStatus(VOID)
Definition: DxeMpLib.c:235
VOID RemoveNxprotection(IN EFI_PHYSICAL_ADDRESS BaseAddress, IN UINTN Length)
Definition: DxeMpLib.c:427
UINTN GetWakeupBuffer(IN UINTN WakeupBufferSize)
Definition: DxeMpLib.c:86
UINT16 GetProtectedMode16CS(VOID)
Definition: DxeMpLib.c:309
EFI_STATUS EFIAPI MpInitLibSwitchBSP(IN UINTN ProcessorNumber, IN BOOLEAN EnableOldBSP)
Definition: DxeMpLib.c:847
VOID EFIAPI CheckApsStatus(IN EFI_EVENT Event, IN VOID *Context)
Definition: DxeMpLib.c:289
VOID AllocateApLoopCodeBuffer(IN UINTN Pages, IN OUT EFI_PHYSICAL_ADDRESS *Address)
Definition: DxeMpLib.c:401
UINTN AllocateCodeBuffer(IN UINTN BufferSize)
Definition: DxeMpLib.c:163
CPU_MP_DATA * GetCpuMpData(VOID)
Definition: DxeMpLib.c:56
EFI_STATUS PlatformShadowMicrocode(IN OUT CPU_MP_DATA *CpuMpData)
Definition: DxeMpLib.c:959
UINTN GetSevEsAPMemory(VOID)
Definition: DxeMpLib.c:193
VOID InitMpGlobalData(IN CPU_MP_DATA *CpuMpData)
Definition: DxeMpLib.c:499
VOID EnableDebugAgent(VOID)
Definition: DxeMpLib.c:40
EFI_STATUS EFIAPI MpInitLibStartupThisAP(IN EFI_AP_PROCEDURE Procedure, IN UINTN ProcessorNumber, IN EFI_EVENT WaitEvent OPTIONAL, IN UINTN TimeoutInMicroseconds, IN VOID *ProcedureArgument OPTIONAL, OUT BOOLEAN *Finished OPTIONAL)
Definition: DxeMpLib.c:789
VOID SaveCpuMpData(IN CPU_MP_DATA *CpuMpData)
Definition: DxeMpLib.c:70
EFI_DXE_SERVICES * gDS
UINT64 EFIAPI AsmReadMsr64(IN UINT32 Index)
Definition: GccInlinePriv.c:60
EFI_STATUS StartupThisAPWorker(IN EFI_AP_PROCEDURE Procedure, IN UINTN ProcessorNumber, IN EFI_EVENT WaitEvent OPTIONAL, IN UINTN TimeoutInMicroseconds, IN VOID *ProcedureArgument OPTIONAL, OUT BOOLEAN *Finished OPTIONAL)
Definition: MpLib.c:1176
VOID WakeUpAP(IN CPU_MP_DATA *CpuMpData, IN BOOLEAN Broadcast, IN UINTN ProcessorNumber, IN EFI_AP_PROCEDURE Procedure OPTIONAL, IN VOID *ProcedureArgument OPTIONAL, IN BOOLEAN WakeUpDisabledAps)
Definition: MpLib.c:672
EFI_STATUS StartupAllCPUsWorker(IN EFI_AP_PROCEDURE Procedure, IN BOOLEAN SingleThread, IN BOOLEAN ExcludeBsp, IN EFI_EVENT WaitEvent OPTIONAL, IN UINTN TimeoutInMicroseconds, IN VOID *ProcedureArgument OPTIONAL, OUT UINTN **FailedCpuList OPTIONAL)
Definition: MpLib.c:1019
EFI_STATUS CheckThisAP(IN UINTN ProcessorNumber)
Definition: MpLib.c:863
EFI_STATUS CheckAllAPs(VOID)
Definition: MpLib.c:910
EFI_STATUS EnableDisableApWorker(IN UINTN ProcessorNumber, IN BOOLEAN EnableAP, IN UINT32 *HealthFlag OPTIONAL)
Definition: MpLib.c:2745
#define NULL
Definition: Base.h:319
#define STATIC
Definition: Base.h:264
#define TRUE
Definition: Base.h:301
#define FALSE
Definition: Base.h:307
#define IN
Definition: Base.h:279
#define OUT
Definition: Base.h:284
#define ASSERT_EFI_ERROR(StatusParameter)
Definition: DebugLib.h:462
#define DEBUG(Expression)
Definition: DebugLib.h:434
VOID EFIAPI RelocateApLoop(IN OUT VOID *Buffer)
Definition: MpLib.c:3364
VOID PrepareApLoopCode(IN CPU_MP_DATA *CpuMpData)
Definition: MpLib.c:3424
EFI_STATUS SwitchBSPWorker(IN UINTN ProcessorNumber, IN BOOLEAN EnableOldBSP)
Definition: MpLib.c:2581
#define PcdGet8(TokenName)
Definition: PcdLib.h:336
#define PcdGet32(TokenName)
Definition: PcdLib.h:362
#define PcdGetBool(TokenName)
Definition: PcdLib.h:401
VOID(EFIAPI * EFI_AP_PROCEDURE)(IN OUT VOID *Buffer)
Definition: PiMultiPhase.h:198
RETURN_STATUS EFIAPI SafeUint16Mult(IN UINT16 Multiplicand, IN UINT16 Multiplier, OUT UINT16 *Result)
Definition: SafeIntLib.c:3247
RETURN_STATUS EFIAPI SafeUintnToUint16(IN UINTN Operand, OUT UINT16 *Result)
Definition: SafeIntLib.c:1950
#define MSR_SEV_ES_GHCB
Definition: SevSnpMsr.h:24
UINT64 EFI_PHYSICAL_ADDRESS
Definition: UefiBaseType.h:50
#define EFI_PAGES_TO_SIZE(Pages)
Definition: UefiBaseType.h:213
RETURN_STATUS EFI_STATUS
Definition: UefiBaseType.h:29
VOID * EFI_EVENT
Definition: UefiBaseType.h:37
#define EFI_SIZE_TO_PAGES(Size)
Definition: UefiBaseType.h:200
EFI_BOOT_SERVICES * gBS
#define EFI_TIMER_PERIOD_MICROSECONDS(Microseconds)
Definition: UefiLib.h:74
EFI_MEMORY_TYPE
@ EfiBootServicesData
@ EfiReservedMemoryType
@ EfiBootServicesCode
@ TimerPeriodic
Definition: UefiSpec.h:535
@ AllocateMaxAddress
Definition: UefiSpec.h:38
VOID EFIAPI AsmReadGdtr(OUT IA32_DESCRIPTOR *Gdtr)
Definition: X86ReadGdtr.c:24