19const BOOLEAN mIsStandaloneMm =
FALSE;
24BOOLEAN mSmmReadyToLock =
FALSE;
52 if (mSmmReadyToLock) {
58 if (mSmmProfileEnabled) {
72 DEBUG ((DEBUG_ERROR,
"PerformRemainingTasks: fail to wait for all AP check in SMM!\n"));
78 if (mSmmProfileEnabled) {
94 if (MemoryAttributesTable !=
NULL) {
119 mSmmReadyToLock =
FALSE;
141 ASSERT (Fadt !=
NULL);
145 mSmiCommandPort = Fadt->SmiCmd;
146 DEBUG ((DEBUG_INFO,
"mSmiCommandPort = %x\n", mSmiCommandPort));
177 if (mSmmProfileEnabled) {
192 mSmmReadyToLock =
TRUE;
207 IN OUT BOOLEAN *RelaxedMode, OPTIONAL
208 IN OUT UINT64 *SyncTimeout, OPTIONAL
209 IN OUT UINT64 *SyncTimeout2 OPTIONAL
212 if (RelaxedMode !=
NULL) {
213 *RelaxedMode = (BOOLEAN)(
PcdGet8 (PcdCpuSmmSyncMode) == MmCpuSyncModeRelaxedAp);
216 if (SyncTimeout !=
NULL) {
217 *SyncTimeout =
PcdGet64 (PcdCpuSmmApSyncTimeout);
220 if (SyncTimeout2 !=
NULL) {
221 *SyncTimeout2 =
PcdGet64 (PcdCpuSmmApSyncTimeout2);
248 return PcdGet32 (PcdCpuMaxLogicalProcessorNumber);
267 UINTN NumberOfEnabledProcessors;
268 UINTN NumberOfProcessors;
272 if ((NumberOfCpus ==
NULL) || (MaxNumberOfCpus ==
NULL)) {
277 ProcessorInfo =
NULL;
279 *MaxNumberOfCpus = 0;
282 Status =
gBS->LocateProtocol (&gEfiMpServiceProtocolGuid,
NULL, (VOID **)&MpService);
283 if (EFI_ERROR (Status)) {
289 Status = MpService->GetNumberOfProcessors (MpService, &NumberOfProcessors, &NumberOfEnabledProcessors);
290 if (EFI_ERROR (Status)) {
299 if (ProcessorInfo ==
NULL) {
305 for (Index = 0; Index < NumberOfProcessors; Index++) {
307 if (EFI_ERROR (Status)) {
309 DEBUG ((DEBUG_ERROR,
"%a: Failed to get processor information for processor %d\n", __func__, Index));
315 *NumberOfCpus = NumberOfEnabledProcessors;
324 *MaxNumberOfCpus = *NumberOfCpus;
327 return ProcessorInfo;
354 mAddressEncMask =
PcdGet64 (PcdPteMemoryEncryptionAddressOrMask) & PAGING_1G_ADDRESS_MASK_64;
355 DEBUG ((DEBUG_INFO,
"mAddressEncMask = 0x%lx\n", mAddressEncMask));
366 Status = SystemTable->BootServices->InstallMultipleProtocolInterfaces (
367 &gSmmCpuPrivate->SmmCpuHandle,
368 &gEfiSmmConfigurationProtocolGuid,
369 &gSmmCpuPrivate->SmmConfiguration,
378 Status =
PcdSet64S (PcdCpuHotPlugDataAddress, (UINT64)(
UINTN)&mCpuHotPlugData);
385 Status = gMmst->MmRegisterProtocolNotify (
386 &gEfiSmmReadyToLockProtocolGuid,
#define EFI_ACPI_2_0_FIXED_ACPI_DESCRIPTION_TABLE_SIGNATURE
EFI_STATUS EFIAPI SmmCpuRendezvous(IN EDKII_SMM_CPU_RENDEZVOUS_PROTOCOL *This, IN BOOLEAN BlockingMode)
VOID *EFIAPI AllocateZeroPool(IN UINTN AllocationSize)
VOID EFIAPI FreePool(IN VOID *Buffer)
#define ASSERT_EFI_ERROR(StatusParameter)
#define DEBUG(Expression)
#define CPU_V2_EXTENDED_TOPOLOGY
VOID UpdateUefiMemMapAttributes(VOID)
VOID GetUefiMemoryMap(VOID)
VOID EFIAPI SmmCpuFeaturesCompleteSmmReadyToLock(VOID)
#define PcdGet64(TokenName)
#define PcdGet8(TokenName)
#define PcdGet32(TokenName)
#define PcdGetBool(TokenName)
#define PcdSet64S(TokenName, Value)
#define FeaturePcdGet(TokenName)
VOID ConfigSmmCodeAccessCheck(VOID)
EFI_STATUS PiSmmCpuEntryCommon(VOID)
EFI_STATUS EFIAPI SmmGetSystemConfigurationTable(IN EFI_GUID *TableGuid, OUT VOID **Table)
VOID SetMemMapAttributes(EDKII_PI_SMM_MEMORY_ATTRIBUTES_TABLE *MemoryAttributesTable)
VOID SetPageTableAttributes(VOID)
VOID GetAcpiS3EnableFlag(VOID)
VOID PerformRemainingTasks(VOID)
EFI_PROCESSOR_INFORMATION * GetMpInformationFromMpServices(OUT UINTN *NumberOfCpus, OUT UINTN *MaxNumberOfCpus)
EFI_STATUS EFIAPI SmmReadyToLockEventNotify(IN CONST EFI_GUID *Protocol, IN VOID *Interface, IN EFI_HANDLE Handle)
VOID GetSmmCpuSyncConfigData(IN OUT BOOLEAN *RelaxedMode, OPTIONAL IN OUT UINT64 *SyncTimeout, OPTIONAL IN OUT UINT64 *SyncTimeout2 OPTIONAL)
BOOLEAN IsSmmProfileEnabled(VOID)
EFI_STATUS EFIAPI PiCpuSmmEntry(IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable)
VOID GetSmiCommandPort(VOID)
UINTN GetSupportedMaxLogicalProcessorNumber(VOID)
VOID SmmProfileStart(VOID)
VOID InitProtectedMemRange(VOID)
VOID SmmProfileUpdateMemoryAttributes(VOID)
EFI_ACPI_COMMON_HEADER *EFIAPI EfiLocateFirstAcpiTable(IN UINT32 Signature)