34 Status =
TdCall (TDCALL_TDINFO, 0, 0, 0, &TdReturnData);
35 if (Status == TDX_EXIT_REASON_SUCCESS) {
36 return TdReturnData.TdInfo.NumVcpus;
38 DEBUG ((DEBUG_ERROR,
"Failed call TDCALL_TDINFO. %llx\n", Status));
68 IN UINT64 WakeupVector,
69 IN UINT64 WakeupArgs1,
70 IN UINT64 WakeupArgs2,
71 IN UINT64 WakeupArgs3,
78 MailBox->ApicId = MP_CPU_PROTECTED_MODE_MAILBOX_APICID_INVALID;
79 MailBox->WakeUpVector = 0;
80 MailBox->Command = MpProtectedModeWakeupCommandNoop;
81 MailBox->ApicId = MP_CPU_PROTECTED_MODE_MAILBOX_APICID_BROADCAST;
82 MailBox->WakeUpVector = WakeupVector;
83 MailBox->WakeUpArgs1 = WakeupArgs1;
84 MailBox->WakeUpArgs2 = WakeupArgs2;
85 MailBox->WakeUpArgs3 = WakeupArgs3;
86 MailBox->WakeUpArgs4 = WakeupArgs4;
88 MailBox->Command = Command;
108 DEBUG ((DEBUG_VERBOSE,
"Waiting for APs to arriving. NumOfCpus=%d, MailBox=%p\n", NumOfCpus, MailBox));
109 while (MailBox->NumCpusArriving != (NumOfCpus -1)) {
113 DEBUG ((DEBUG_VERBOSE,
"Releasing APs\n"));
114 MailBox->NumCpusExiting = NumOfCpus;
130 DEBUG ((DEBUG_VERBOSE,
"Waiting for APs to finish\n"));
131 while (MailBox->NumCpusExiting != 1 ) {
135 DEBUG ((DEBUG_VERBOSE,
"Restarting APs\n"));
136 MailBox->Command = MpProtectedModeWakeupCommandNoop;
137 MailBox->NumCpusArriving = 0;
UINTN EFIAPI TdCall(IN UINT64 Leaf, IN UINT64 Arg1, IN UINT64 Arg2, IN UINT64 Arg3, IN OUT VOID *Results)
VOID EFIAPI CpuPause(VOID)
#define DEBUG(Expression)
UINT32 EFIAPI AsmCpuid(IN UINT32 Index, OUT UINT32 *RegisterEax OPTIONAL, OUT UINT32 *RegisterEbx OPTIONAL, OUT UINT32 *RegisterEcx OPTIONAL, OUT UINT32 *RegisterEdx OPTIONAL)
#define PcdGet32(TokenName)
UINT32 EFIAPI InterlockedIncrement(IN volatile UINT32 *Value)
UINT32 EFIAPI InterlockedDecrement(IN volatile UINT32 *Value)
VOID EFIAPI MpSerializeStart(VOID)
volatile VOID *EFIAPI GetTdxMailBox(VOID)
VOID EFIAPI MpSendWakeupCommand(IN UINT16 Command, IN UINT64 WakeupVector, IN UINT64 WakeupArgs1, IN UINT64 WakeupArgs2, IN UINT64 WakeupArgs3, IN UINT64 WakeupArgs4)
VOID EFIAPI MpSerializeEnd(VOID)
UINT32 EFIAPI GetCpusNum(VOID)