19 SMM_CPU_PRIVATE_DATA_SIGNATURE,
37 mSmmCpuPrivateData.SmmReservedSmramRegion,
45 CPU_HOT_PLUG_DATA_REVISION_1,
83volatile BOOLEAN *mSmmInitialized =
NULL;
89UINTN mSmmStackArrayBase;
90UINTN mSmmStackArrayEnd;
93UINTN mSmmShadowStackSize;
94BOOLEAN mCetSupported =
TRUE;
96UINTN mMaxNumberOfCpus = 0;
97UINTN mNumberOfCpus = 0;
102BOOLEAN mSmmCodeAccessCheckEnable =
FALSE;
107BOOLEAN mSmmDebugAgentSupport =
FALSE;
112UINT64 mAddressEncMask = 0;
123UINTN mSmmCpuSmramRangeCount;
125UINT8 mPhysicalAddressBits;
137 BOOLEAN InterruptState;
138 IA32_DESCRIPTOR DxeIdtr;
144 gcSmiIdtr.Limit = (
sizeof (IA32_IDT_GATE_DESCRIPTOR) * 32) - 1;
149 ASSERT (gcSmiIdtr.Base != 0);
150 ZeroMem ((VOID *)gcSmiIdtr.Base, gcSmiIdtr.Limit + 1);
165 Status = InitializeCpuExceptionHandlers (
NULL);
193 DEBUG ((DEBUG_ERROR,
"It is invoked from the instruction before IP(0x%p)", (VOID *)CallerIpAddress));
194 PdbPointer = PeCoffLoaderGetPdbPointer ((VOID *)Pe32Data);
195 if (PdbPointer !=
NULL) {
196 DEBUG ((DEBUG_ERROR,
" in module (%a)\n", PdbPointer));
231 return EFI_INVALID_PARAMETER;
243 if (
Register == EFI_SMM_SAVE_STATE_REGISTER_PROCESSOR_ID) {
247 if (Width !=
sizeof (UINT64)) {
248 return EFI_INVALID_PARAMETER;
256 if (*(mSmmMpSyncData->CpuData[CpuIndex].Present)) {
257 *(UINT64 *)Buffer = gSmmCpuPrivate->ProcessorInfo[CpuIndex].
ProcessorId;
260 return EFI_NOT_FOUND;
264 if (!(*(mSmmMpSyncData->CpuData[CpuIndex].Present))) {
265 return EFI_INVALID_PARAMETER;
303 return EFI_INVALID_PARAMETER;
309 if (
Register == EFI_SMM_SAVE_STATE_REGISTER_PROCESSOR_ID) {
313 if (!mSmmMpSyncData->CpuData[CpuIndex].Present) {
314 return EFI_INVALID_PARAMETER;
337 IsBsp = (BOOLEAN)(mBspApicId == ApicId);
339 ASSERT (mNumberOfCpus <= mMaxNumberOfCpus);
341 for (Index = 0; Index < mNumberOfCpus; Index++) {
342 if (ApicId == (UINT32)gSmmCpuPrivate->ProcessorInfo[Index].
ProcessorId) {
352 gSmmCpuPrivate->ProcessorInfo,
362 if (mIsStandaloneMm) {
406 if (mSmmInitialized ==
NULL) {
407 mSmmInitialized = (BOOLEAN *)
AllocatePool (
sizeof (BOOLEAN) * mMaxNumberOfCpus);
410 ASSERT (mSmmInitialized !=
NULL);
411 if (mSmmInitialized ==
NULL) {
419 ZeroMem ((VOID *)mSmmInitialized,
sizeof (BOOLEAN) * mMaxNumberOfCpus);
440 for (Index = 0; Index < mNumberOfCpus; Index++) {
441 while (!(BOOLEAN)mSmmInitialized[Index]) {
497 UINTN NumberOfProcessors;
502 UINTN ProcessorIndex;
503 UINT64 PrevProcessorIndex;
506 SmmBaseHobData =
NULL;
510 NumberOfProcessors = 0;
513 if (FirstSmmBaseGuidHob ==
NULL) {
514 return EFI_NOT_FOUND;
517 GuidHob = FirstSmmBaseGuidHob;
518 while (GuidHob !=
NULL) {
520 SmmBaseHobData = GET_GUID_HOB_DATA (GuidHob);
523 if (NumberOfProcessors >= MaxNumberOfCpus) {
527 GuidHob =
GetNextGuidHob (&gSmmBaseHobGuid, GET_NEXT_HOB (GuidHob));
530 ASSERT (NumberOfProcessors == MaxNumberOfCpus);
531 if (NumberOfProcessors != MaxNumberOfCpus) {
536 if (SmBaseHobs ==
NULL) {
537 return EFI_OUT_OF_RESOURCES;
545 GuidHob = FirstSmmBaseGuidHob;
546 while (HobIndex < HobCount) {
547 SmBaseHobs[HobIndex++] = GET_GUID_HOB_DATA (GuidHob);
548 GuidHob =
GetNextGuidHob (&gSmmBaseHobGuid, GET_NEXT_HOB (GuidHob));
552 ASSERT (SmBaseBuffer !=
NULL);
553 if (SmBaseBuffer ==
NULL) {
555 return EFI_OUT_OF_RESOURCES;
559 PrevProcessorIndex = 0;
560 for (HobIndex = 0; HobIndex < HobCount; HobIndex++) {
564 ASSERT (SmBaseHobs[HobIndex]->ProcessorIndex == PrevProcessorIndex);
569 for (ProcessorIndex = 0; ProcessorIndex < SmBaseHobs[HobIndex]->
NumberOfProcessors; ProcessorIndex++) {
570 SmBaseBuffer[PrevProcessorIndex + ProcessorIndex] = (
UINTN)SmBaseHobs[HobIndex]->SmBase[ProcessorIndex];
577 *AllocatedSmBaseBuffer = SmBaseBuffer;
628 UINTN ProcessorIndex;
629 UINT64 PrevProcessorIndex;
634 MpInformation2HobData =
NULL;
635 FirstMpInfo2Hob =
NULL;
642 if (mIsStandaloneMm) {
643 ASSERT (FirstMpInfo2Hob !=
NULL);
645 if (FirstMpInfo2Hob ==
NULL) {
646 DEBUG ((DEBUG_INFO,
"%a: [INFO] gMpInformation2HobGuid HOB not found.\n", __func__));
651 GuidHob = FirstMpInfo2Hob;
652 while (GuidHob !=
NULL) {
653 MpInformation2HobData = GET_GUID_HOB_DATA (GuidHob);
658 if (MpInformation2HobData->NumberOfProcessors == 0) {
659 ASSERT (HobCount != 0);
664 *NumberOfCpus += MpInformation2HobData->NumberOfProcessors;
665 GuidHob =
GetNextGuidHob (&gMpInformation2HobGuid, GET_NEXT_HOB (GuidHob));
668 *MaxNumberOfCpus = *NumberOfCpus;
670 if (!mIsStandaloneMm) {
682 ASSERT (MpInfo2Hobs !=
NULL);
683 if (MpInfo2Hobs ==
NULL) {
692 GuidHob = FirstMpInfo2Hob;
693 while (HobIndex < HobCount) {
694 MpInfo2Hobs[HobIndex++] = GET_GUID_HOB_DATA (GuidHob);
695 GuidHob =
GetNextGuidHob (&gMpInformation2HobGuid, GET_NEXT_HOB (GuidHob));
699 ASSERT (ProcessorInfo !=
NULL);
700 if (ProcessorInfo ==
NULL) {
706 PrevProcessorIndex = 0;
707 for (HobIndex = 0; HobIndex < HobCount; HobIndex++) {
711 ASSERT (MpInfo2Hobs[HobIndex]->ProcessorIndex == PrevProcessorIndex);
716 for (ProcessorIndex = 0; ProcessorIndex < MpInfo2Hobs[HobIndex]->NumberOfProcessors; ProcessorIndex++) {
717 MpInformation2Entry = GET_MP_INFORMATION_ENTRY (MpInfo2Hobs[HobIndex], ProcessorIndex);
719 &ProcessorInfo[PrevProcessorIndex + ProcessorIndex],
720 &MpInformation2Entry->ProcessorInfo,
725 PrevProcessorIndex += MpInfo2Hobs[HobIndex]->NumberOfProcessors;
729 return ProcessorInfo;
776 EFI_COMPUTING_UNIT_HOST_PROCESSOR | EFI_CU_HP_PC_SMM_INIT
782 FindSmramInfo (&mCpuHotPlugData.SmrrBase, &mCpuHotPlugData.SmrrSize);
787 gSmmCpuPrivate->ProcessorInfo =
GetMpInformation (&mNumberOfCpus, &mMaxNumberOfCpus);
788 ASSERT (gSmmCpuPrivate->ProcessorInfo !=
NULL);
804 mSmmCodeAccessCheckEnable =
PcdGetBool (PcdCpuSmmCodeAccessCheckEnable);
805 DEBUG ((DEBUG_INFO,
"PcdCpuSmmCodeAccessCheckEnable = %d\n", mSmmCodeAccessCheckEnable));
807 gSmmCpuPrivate->SmmCoreEntryContext.
NumberOfCpus = mMaxNumberOfCpus;
887 FamilyId = (RegEax >> 8) & 0xf;
888 ModelId = (RegEax >> 4) & 0xf;
889 if ((FamilyId == 0x06) || (FamilyId == 0x0f)) {
890 ModelId = ModelId | ((RegEax >> 12) & 0xf0);
905 if ((RegEdx & BIT29) != 0) {
909 if (FamilyId == 0x06) {
910 if ((ModelId == 0x17) || (ModelId == 0x0f) || (ModelId == 0x1c)) {
915 DEBUG ((DEBUG_INFO,
"PcdControlFlowEnforcementPropertyMask = %d\n",
PcdGet32 (PcdControlFlowEnforcementPropertyMask)));
916 if (
PcdGet32 (PcdControlFlowEnforcementPropertyMask) != 0) {
920 DEBUG ((DEBUG_INFO,
"CPUID[7/0] ECX - 0x%08x\n", RegEcx));
921 DEBUG ((DEBUG_INFO,
" CET_SS - 0x%08x\n", RegEcx & CPUID_CET_SS));
922 DEBUG ((DEBUG_INFO,
" CET_IBT - 0x%08x\n", RegEdx & CPUID_CET_IBT));
923 if ((RegEcx & CPUID_CET_SS) == 0) {
924 mCetSupported =
FALSE;
930 DEBUG ((DEBUG_INFO,
"CPUID[D/1] EBX - 0x%08x, ECX - 0x%08x\n", RegEbx, RegEcx));
932 DEBUG ((DEBUG_INFO,
"CPUID[D/11] EAX - 0x%08x, ECX - 0x%08x\n", RegEax, RegEcx));
934 DEBUG ((DEBUG_INFO,
"CPUID[D/12] EAX - 0x%08x, ECX - 0x%08x\n", RegEax, RegEcx));
937 mCetSupported =
FALSE;
941 mCetSupported =
FALSE;
949 ExtendedRegEdx.
Uint32 = 0;
951 if (RegEax <= CPUID_EXTENDED_FUNCTION) {
955 mXdSupported =
FALSE;
960 if (ExtendedRegEdx.
Bits.
NX == 0) {
964 mXdSupported =
FALSE;
981 TileCodeSize =
ALIGN_VALUE (TileCodeSize, SIZE_4KB);
983 TileDataSize =
ALIGN_VALUE (TileDataSize, SIZE_4KB);
984 TileSize = TileDataSize + TileCodeSize - 1;
986 DEBUG ((DEBUG_INFO,
"SMRAM TileSize = 0x%08x (0x%08x, 0x%08x)\n", TileSize, TileCodeSize, TileDataSize));
1000 if (TileSize > SIZE_8KB) {
1001 DEBUG ((DEBUG_ERROR,
"The Range of Smbase in SMRAM is not enough -- Required TileSize = 0x%08x, Actual TileSize = 0x%08x\n", TileSize, SIZE_8KB));
1002 FreePool (gSmmCpuPrivate->ProcessorInfo);
1011 mCpuHotPlugData.SmBase =
NULL;
1012 Status =
GetSmBase (mMaxNumberOfCpus, &mCpuHotPlugData.SmBase);
1013 ASSERT (!EFI_ERROR (Status));
1014 if (EFI_ERROR (Status)) {
1021 ASSERT (mCpuHotPlugData.SmBase !=
NULL);
1026 gSmmCpuPrivate->Operation = (SMM_CPU_OPERATION *)
AllocatePool (
sizeof (SMM_CPU_OPERATION) * mMaxNumberOfCpus);
1027 ASSERT (gSmmCpuPrivate->Operation !=
NULL);
1030 ASSERT (gSmmCpuPrivate->CpuSaveStateSize !=
NULL);
1032 gSmmCpuPrivate->CpuSaveState = (VOID **)
AllocatePool (
sizeof (VOID *) * mMaxNumberOfCpus);
1033 ASSERT (gSmmCpuPrivate->CpuSaveState !=
NULL);
1035 mSmmCpuPrivateData.SmmCoreEntryContext.
CpuSaveStateSize = gSmmCpuPrivate->CpuSaveStateSize;
1036 mSmmCpuPrivateData.SmmCoreEntryContext.
CpuSaveState = gSmmCpuPrivate->CpuSaveState;
1041 mCpuHotPlugData.ApicId = (UINT64 *)
AllocatePool (
sizeof (UINT64) * mMaxNumberOfCpus);
1042 ASSERT (mCpuHotPlugData.ApicId !=
NULL);
1043 mCpuHotPlugData.ArrayLength = (UINT32)mMaxNumberOfCpus;
1050 for (Index = 0; Index < mMaxNumberOfCpus; Index++) {
1053 gSmmCpuPrivate->Operation[Index] = SmmCpuNone;
1055 if (Index < mNumberOfCpus) {
1056 mCpuHotPlugData.ApicId[Index] = gSmmCpuPrivate->ProcessorInfo[Index].
ProcessorId;
1060 "CPU[%03x] APIC ID=%04x SMBASE=%08x SaveState=%08x Size=%08x\n",
1062 (UINT32)gSmmCpuPrivate->ProcessorInfo[Index].
ProcessorId,
1063 mCpuHotPlugData.SmBase[Index],
1064 gSmmCpuPrivate->CpuSaveState[Index],
1065 gSmmCpuPrivate->CpuSaveStateSize[Index]
1068 gSmmCpuPrivate->ProcessorInfo[Index].
ProcessorId = INVALID_APIC_ID;
1069 mCpuHotPlugData.ApicId[Index] = INVALID_APIC_ID;
1093 mSmmShadowStackSize = 0;
1094 if ((
PcdGet32 (PcdControlFlowEnforcementPropertyMask) != 0) && mCetSupported) {
1135 ASSERT (Stacks !=
NULL);
1136 mSmmStackArrayBase = (
UINTN)Stacks;
1137 mSmmStackArrayEnd = mSmmStackArrayBase + gSmmCpuPrivate->SmmCoreEntryContext.
NumberOfCpus * (mSmmStackSize + mSmmShadowStackSize) - 1;
1139 DEBUG ((DEBUG_INFO,
"Stacks - 0x%x\n", Stacks));
1140 DEBUG ((DEBUG_INFO,
"mSmmStackSize - 0x%x\n", mSmmStackSize));
1141 DEBUG ((DEBUG_INFO,
"PcdCpuSmmStackGuard - 0x%x\n",
FeaturePcdGet (PcdCpuSmmStackGuard)));
1142 if ((
PcdGet32 (PcdControlFlowEnforcementPropertyMask) != 0) && mCetSupported) {
1143 DEBUG ((DEBUG_INFO,
"mSmmShadowStackSize - 0x%x\n", mSmmShadowStackSize));
1166 if ((
PcdGet32 (PcdControlFlowEnforcementPropertyMask) != 0) && mCetSupported) {
1167 for (Index = 0; Index < gSmmCpuPrivate->SmmCoreEntryContext.
NumberOfCpus; Index++) {
1200 DEBUG ((DEBUG_INFO,
"mXdSupported - 0x%x\n", mXdSupported));
1213 &gEfiSmmCpuProtocolGuid,
1224 &gEdkiiSmmMemoryAttributeProtocolGuid,
1245 &gEfiMmMpProtocolGuid,
1265 DEBUG ((DEBUG_INFO,
"SMM CPU Module exit from SMRAM with EFI_SUCCESS\n"));
1306 OUT UINT32 *SmrrBase,
1307 OUT UINT32 *SmrrSize
1318 ASSERT (SmrrBase !=
NULL && SmrrSize !=
NULL);
1324 ASSERT (GuidHob !=
NULL);
1327 mSmmCpuSmramRanges = DescriptorBlock->
Descriptor;
1337 CurrentSmramRange =
NULL;
1338 for (Index = 0, MaxSize = SIZE_256KB - EFI_PAGE_SIZE; Index < mSmmCpuSmramRangeCount; Index++) {
1342 if ((mSmmCpuSmramRanges[Index].RegionState & (EFI_ALLOCATED | EFI_NEEDS_TESTING | EFI_NEEDS_ECC_INITIALIZATION)) != 0) {
1346 if (mSmmCpuSmramRanges[Index].CpuStart >= BASE_1MB) {
1347 if ((mSmmCpuSmramRanges[Index].CpuStart + mSmmCpuSmramRanges[Index].PhysicalSize) <= SMRR_MAX_ADDRESS) {
1348 if (mSmmCpuSmramRanges[Index].PhysicalSize >= MaxSize) {
1350 CurrentSmramRange = &mSmmCpuSmramRanges[Index];
1356 ASSERT (CurrentSmramRange !=
NULL);
1358 *SmrrBase = (UINT32)CurrentSmramRange->
CpuStart;
1363 for (Index = 0; Index < mSmmCpuSmramRangeCount; Index++) {
1364 if ((mSmmCpuSmramRanges[Index].CpuStart < *SmrrBase) &&
1367 *SmrrBase = (UINT32)mSmmCpuSmramRanges[Index].CpuStart;
1368 *SmrrSize = (UINT32)(*SmrrSize + mSmmCpuSmramRanges[Index].PhysicalSize);
1370 }
else if (((*SmrrBase + *SmrrSize) == mSmmCpuSmramRanges[Index].
CpuStart) && (mSmmCpuSmramRanges[Index].PhysicalSize > 0)) {
1371 *SmrrSize = (UINT32)(*SmrrSize + mSmmCpuSmramRanges[Index].PhysicalSize);
1377 DEBUG ((DEBUG_INFO,
"%a: SMRR Base = 0x%x, SMRR Size = 0x%x\n", __func__, *SmrrBase, *SmrrSize));
1393 UINT64 SmmFeatureControlMsr;
1394 UINT64 NewSmmFeatureControlMsr;
1399 CpuIndex = *(
UINTN *)Buffer;
1409 NewSmmFeatureControlMsr = SmmFeatureControlMsr;
1410 if (mSmmCodeAccessCheckEnable) {
1411 NewSmmFeatureControlMsr |= SMM_CODE_CHK_EN_BIT;
1413 NewSmmFeatureControlMsr |= SMM_FEATURE_CONTROL_LOCK_BIT;
1420 if (NewSmmFeatureControlMsr != SmmFeatureControlMsr) {
1463 for (Index = 0; Index < gMmst->
NumberOfCpus; Index++) {
1465 if (gSmmCpuPrivate->ProcessorInfo[Index].
ProcessorId == INVALID_APIC_ID) {
1521 if (EFI_ERROR (Status)) {
1525 return (VOID *)(
UINTN)Memory;
STATIC UINT8 mSmmSaveStateRegisterLma
VOID *EFIAPI GetFirstGuidHob(IN CONST EFI_GUID *Guid)
VOID *EFIAPI GetNextGuidHob(IN CONST EFI_GUID *Guid, IN CONST VOID *HobStart)
BOOLEAN EFIAPI SetInterruptState(IN BOOLEAN InterruptState)
INTN(EFIAPI * BASE_SORT_COMPARE)(IN CONST VOID *Buffer1, IN CONST VOID *Buffer2)
BOOLEAN EFIAPI SaveAndDisableInterrupts(VOID)
UINT32 EFIAPI GetPowerOfTwo32(IN UINT32 Operand)
VOID EFIAPI CpuDeadLoop(VOID)
VOID EFIAPI QuickSort(IN OUT VOID *BufferToSort, IN CONST UINTN Count, IN CONST UINTN ElementSize, IN BASE_SORT_COMPARE CompareFunction, OUT VOID *BufferOneElement)
VOID EFIAPI CpuPause(VOID)
VOID EFIAPI SpeculationBarrier(VOID)
VOID *EFIAPI CopyMem(OUT VOID *DestinationBuffer, IN CONST VOID *SourceBuffer, IN UINTN Length)
VOID *EFIAPI ZeroMem(OUT VOID *Buffer, IN UINTN Length)
VOID(EFIAPI * EFI_CPU_INTERRUPT_HANDLER)(IN CONST EFI_EXCEPTION_TYPE InterruptType, IN CONST EFI_SYSTEM_CONTEXT SystemContext)
UINT32 EFIAPI AsmCpuidEx(IN UINT32 Index, IN UINT32 SubIndex, OUT UINT32 *RegisterEax OPTIONAL, OUT UINT32 *RegisterEbx OPTIONAL, OUT UINT32 *RegisterEcx OPTIONAL, OUT UINT32 *RegisterEdx OPTIONAL)
RETURN_STATUS ConvertMemoryPageAttributes(IN PAGE_TABLE_LIB_PAGING_CONTEXT *PagingContext OPTIONAL, IN PHYSICAL_ADDRESS BaseAddress, IN UINT64 Length, IN UINT64 Attributes, IN PAGE_ACTION PageAction, IN PAGE_TABLE_LIB_ALLOCATE_PAGES AllocatePagesFunc OPTIONAL, OUT BOOLEAN *IsSplitted OPTIONAL, OUT BOOLEAN *IsModified OPTIONAL)
VOID InitSmmS3ResumeState(VOID)
VOID RestoreSmmConfigurationInS3(VOID)
EFI_STATUS InitializeSmmCpuServices(IN EFI_HANDLE Handle)
VOID EFIAPI InitializeDebugAgent(IN UINT32 InitFlag, IN VOID *Context OPTIONAL, IN DEBUG_AGENT_CONTINUE Function OPTIONAL)
VOID EFIAPI FreePool(IN VOID *Buffer)
VOID EFIAPI SendSmiIpi(IN UINT32 ApicId)
UINT32 EFIAPI GetApicId(VOID)
VOID EFIAPI SendSmiIpiAllExcludingSelf(VOID)
#define RETURN_BUFFER_TOO_SMALL
#define ALIGN_VALUE(Value, Alignment)
#define ASSERT_EFI_ERROR(StatusParameter)
#define DEBUG_CODE_BEGIN()
#define DEBUG(Expression)
#define REPORT_STATUS_CODE(Type, Value)
#define SMM_HANDLER_OFFSET
#define CPUID_STRUCTURED_EXTENDED_FEATURE_FLAGS
#define CPUID_VERSION_INFO
#define CPUID_EXTENDED_STATE
#define CPUID_EXTENDED_STATE_SUB_LEAF
#define CPUID_STRUCTURED_EXTENDED_FEATURE_FLAGS_SUB_LEAF_INFO
#define CPUID_EXTENDED_CPU_SIG
#define SMRAM_SAVE_STATE_MAP_OFFSET
UINT32 EFIAPI AsmCpuid(IN UINT32 Index, OUT UINT32 *RegisterEax OPTIONAL, OUT UINT32 *RegisterEbx OPTIONAL, OUT UINT32 *RegisterEcx OPTIONAL, OUT UINT32 *RegisterEdx OPTIONAL)
EFI_MM_SAVE_STATE_REGISTER
EFI_STATUS EFIAPI MmSaveStateWriteRegister(IN UINTN CpuIndex, IN EFI_MM_SAVE_STATE_REGISTER Register, IN UINTN Width, IN CONST VOID *Buffer)
EFI_STATUS EFIAPI MmSaveStateReadRegister(IN UINTN CpuIndex, IN EFI_MM_SAVE_STATE_REGISTER Register, IN UINTN Width, OUT VOID *Buffer)
UINT64 EFIAPI SmmCpuFeaturesGetSmmRegister(IN UINTN CpuIndex, IN SMM_REG_NAME RegName)
VOID EFIAPI SmmCpuFeaturesSmmRelocationComplete(VOID)
VOID EFIAPI SmmCpuFeaturesInitializeProcessor(IN UINTN CpuIndex, IN BOOLEAN IsMonarch, IN EFI_PROCESSOR_INFORMATION *ProcessorInfo, IN CPU_HOT_PLUG_DATA *CpuHotPlugData)
VOID EFIAPI SmmCpuFeaturesSetSmmRegister(IN UINTN CpuIndex, IN SMM_REG_NAME RegName, IN UINT64 Value)
#define PcdGet32(TokenName)
#define PcdGetBool(TokenName)
#define FeaturePcdGet(TokenName)
UINTN EFIAPI PeCoffSearchImageBase(IN UINTN Address)
VOID FindSmramInfo(OUT UINT32 *SmrrBase, OUT UINT32 *SmrrSize)
VOID ConfigSmmCodeAccessCheck(VOID)
EFI_PROCESSOR_INFORMATION * GetMpInformation(OUT UINTN *NumberOfCpus, OUT UINTN *MaxNumberOfCpus)
EFI_STATUS EFIAPI SmmWriteSaveState(IN CONST EFI_SMM_CPU_PROTOCOL *This, IN UINTN Width, IN EFI_SMM_SAVE_STATE_REGISTER Register, IN UINTN CpuIndex, IN CONST VOID *Buffer)
VOID InitializeSmmIdt(VOID)
EFI_STATUS PiSmmCpuEntryCommon(VOID)
VOID EFIAPI ConfigSmmCodeAccessCheckOnCurrentProcessor(IN OUT VOID *Buffer)
INTN EFIAPI CpuSmramRangeCompare(IN CONST VOID *Buffer1, IN CONST VOID *Buffer2)
STATIC EFI_STATUS GetSmBase(IN UINTN MaxNumberOfCpus, OUT UINTN **AllocatedSmBaseBuffer)
EDKII_SMM_MEMORY_ATTRIBUTE_PROTOCOL mSmmMemoryAttribute
VOID * AllocateCodePages(IN UINTN Pages)
VOID ExecuteFirstSmiInit(VOID)
VOID DumpModuleInfoByIp(IN UINTN CallerIpAddress)
VOID PerformPreTasks(VOID)
EFI_SMM_CPU_PROTOCOL mSmmCpu
INTN EFIAPI MpInformation2HobCompare(IN CONST VOID *Buffer1, IN CONST VOID *Buffer2)
EFI_STATUS EFIAPI SmmReadSaveState(IN CONST EFI_SMM_CPU_PROTOCOL *This, IN UINTN Width, IN EFI_SMM_SAVE_STATE_REGISTER Register, IN UINTN CpuIndex, OUT VOID *Buffer)
INTN EFIAPI SmBaseHobCompare(IN CONST VOID *Buffer1, IN CONST VOID *Buffer2)
VOID GetAcpiS3EnableFlag(VOID)
EFI_STATUS EFIAPI EdkiiSmmGetMemoryAttributes(IN EDKII_SMM_MEMORY_ATTRIBUTE_PROTOCOL *This, IN EFI_PHYSICAL_ADDRESS BaseAddress, IN UINT64 Length, IN UINT64 *Attributes)
EFI_PROCESSOR_INFORMATION * GetMpInformationFromMpServices(OUT UINTN *NumberOfCpus, OUT UINTN *MaxNumberOfCpus)
VOID EFIAPI PiSmmCpuSmiEntryFixupAddress()
EFI_STATUS SetShadowStack(IN UINTN Cr3, IN EFI_PHYSICAL_ADDRESS BaseAddress, IN UINT64 Length)
EFI_STATUS EFIAPI EdkiiSmmSetMemoryAttributes(IN EDKII_SMM_MEMORY_ATTRIBUTE_PROTOCOL *This, IN EFI_PHYSICAL_ADDRESS BaseAddress, IN UINT64 Length, IN UINT64 Attributes)
UINTN EFIAPI GetSmiHandlerSize(VOID)
VOID InitializeSmmTimer(VOID)
BOOLEAN IsSmmProfileEnabled(VOID)
UINTN GetSupportedMaxLogicalProcessorNumber(VOID)
EFI_MM_MP_PROTOCOL mSmmMp
EFI_STATUS EFIAPI EdkiiSmmClearMemoryAttributes(IN EDKII_SMM_MEMORY_ATTRIBUTE_PROTOCOL *This, IN EFI_PHYSICAL_ADDRESS BaseAddress, IN UINT64 Length, IN UINT64 Attributes)
#define EFI_PROGRESS_CODE
VOID *EFIAPI AllocatePool(IN UINTN AllocationSize)
VOID *EFIAPI AllocatePages(IN UINTN Pages)
EFI_STATUS EFIAPI Register(IN EFI_PEI_RSC_HANDLER_CALLBACK Callback)
VOID MpPerfBegin(IN UINTN CpuIndex, IN UINTN MpProcedureId)
VOID MpPerfEnd(IN UINTN CpuIndex, IN UINTN MpProcedureId)
VOID InitializeMpPerf(UINTN NumberofCpus)
VOID CheckFeatureSupported(IN UINTN CpuIndex)
VOID InitSmmProfile(UINT32 Cr3)
SPIN_LOCK *EFIAPI AcquireSpinLock(IN OUT SPIN_LOCK *SpinLock)
SPIN_LOCK *EFIAPI InitializeSpinLock(OUT SPIN_LOCK *SpinLock)
SPIN_LOCK *EFIAPI ReleaseSpinLock(IN OUT SPIN_LOCK *SpinLock)
BOOLEAN EFIAPI AcquireSpinLockOrFail(IN OUT SPIN_LOCK *SpinLock)
UINT64 EFI_PHYSICAL_ADDRESS
#define EFI_PAGES_TO_SIZE(Pages)
#define EFI_SIZE_TO_PAGES(Size)
VOID InitializeDataForMmMp(VOID)
EFI_STATUS EFIAPI SmmStartupThisAp(IN EFI_AP_PROCEDURE Procedure, IN UINTN CpuIndex, IN OUT VOID *ProcArguments OPTIONAL)
VOID InitPackageFirstThreadIndexInfo(VOID)
UINT32 InitializeMpServiceData(IN VOID *Stacks, IN UINTN StackSize, IN UINTN ShadowStackSize)
EFI_STATUS EFIAPI RegisterSmmEntry(IN CONST EFI_SMM_CONFIGURATION_PROTOCOL *This, IN EFI_SMM_ENTRY_POINT SmmEntryPoint)
VOID EFIAPI InitializeMpSyncData(VOID)
BOOLEAN EFIAPI StandardSignatureIsAuthenticAMD(VOID)
VOID EFIAPI PatchInstructionX86(OUT X86_ASSEMBLY_PATCH_LABEL *InstructionEnd, IN UINT64 PatchValue, IN UINTN ValueSize)
VOID EFIAPI AsmReadIdtr(OUT IA32_DESCRIPTOR *Idtr)
VOID EFIAPI AsmWriteIdtr(IN CONST IA32_DESCRIPTOR *Idtr)
EFI_INSTALL_PROTOCOL_INTERFACE MmInstallProtocolInterface
EFI_MM_STARTUP_THIS_AP MmStartupThisAp
UINTN CurrentlyExecutingCpu
EFI_PHYSICAL_ADDRESS SmramReservedStart
EFI_PHYSICAL_ADDRESS CpuStart
UINT32 NumberOfSmmReservedRegions
EFI_SMRAM_DESCRIPTOR Descriptor[1]
UINT32 NumberOfProcessors
struct CPUID_EXTENDED_CPU_SIG_EDX::@750 Bits