32BOOLEAN mSmmCpuFeaturesSmmRelocated;
96 if (!mSmmCpuFeaturesSmmRelocated) {
101 CpuState->x64.SMBASE = (UINT32)CpuHotPlugData->SmBase[CpuIndex];
121 if ((CpuHotPlugData->SmrrSize < SIZE_4KB) ||
122 (CpuHotPlugData->SmrrSize !=
GetPowerOfTwo32 (CpuHotPlugData->SmrrSize)) ||
123 ((CpuHotPlugData->SmrrBase & ~(CpuHotPlugData->SmrrSize - 1)) != CpuHotPlugData->SmrrBase))
129 DEBUG ((DEBUG_ERROR,
"SMM Base/Size does not meet alignment/size requirement!\n"));
134 AsmWriteMsr64 (AMD_64_SMM_MASK, ((~(UINT64)(CpuHotPlugData->SmrrSize - 1)) | 0x6600));
175 IN UINT64 NewInstructionPointer32,
176 IN UINT64 NewInstructionPointer
179 UINT64 OriginalInstructionPointer;
184 OriginalInstructionPointer = AmdCpuState->x64._RIP;
186 if ((AmdCpuState->x64.EFER & LMA) == 0) {
187 AmdCpuState->x64._RIP = NewInstructionPointer32;
189 AmdCpuState->x64._RIP = NewInstructionPointer;
196 if ((AmdCpuState->x64.AutoHALTRestart & BIT0) != 0) {
197 AmdCpuState->x64.AutoHALTRestart &= ~BIT0;
200 return OriginalInstructionPointer;
UINT64 EFIAPI SmmCpuFeaturesGetSmmRegister(IN UINTN CpuIndex, IN SMM_REG_NAME RegName)
UINT64 EFIAPI SmmCpuFeaturesHookReturnFromSmm(IN UINTN CpuIndex, IN SMRAM_SAVE_STATE_MAP *CpuState, IN UINT64 NewInstructionPointer32, IN UINT64 NewInstructionPointer)
STATIC UINT8 mSmmSaveStateRegisterLma
VOID EFIAPI SmmCpuFeaturesInitializeProcessor(IN UINTN CpuIndex, IN BOOLEAN IsMonarch, IN EFI_PROCESSOR_INFORMATION *ProcessorInfo, IN CPU_HOT_PLUG_DATA *CpuHotPlugData)
VOID EFIAPI SmmCpuFeaturesRendezvousEntry(IN UINTN CpuIndex)
VOID EFIAPI SmmCpuFeaturesReenableSmrr(VOID)
BOOLEAN EFIAPI SmmCpuFeaturesIsSmmRegisterSupported(IN UINTN CpuIndex, IN SMM_REG_NAME RegName)
VOID EFIAPI SmmCpuFeaturesSetSmmRegister(IN UINTN CpuIndex, IN SMM_REG_NAME RegName, IN UINT64 Value)
BOOLEAN EFIAPI SmmCpuFeaturesNeedConfigureMtrrs(VOID)
VOID EFIAPI SmmCpuFeaturesInstallSmiHandler(IN UINTN CpuIndex, IN UINT32 SmBase, IN VOID *SmiStack, IN UINTN StackSize, IN UINTN GdtBase, IN UINTN GdtSize, IN UINTN IdtBase, IN UINTN IdtSize, IN UINT32 Cr3)
VOID CpuFeaturesLibInitialization(VOID)
VOID EFIAPI SmmCpuFeaturesDisableSmrr(VOID)
UINTN EFIAPI SmmCpuFeaturesGetSmiHandlerSize(VOID)
VOID *EFIAPI GetFirstGuidHob(IN CONST EFI_GUID *Guid)
UINT32 EFIAPI GetPowerOfTwo32(IN UINT32 Operand)
VOID EFIAPI CpuDeadLoop(VOID)
UINT64 EFIAPI AsmWriteMsr64(IN UINT32 Index, IN UINT64 Value)
#define DEBUG(Expression)
#define SMM_DEFAULT_SMBASE
#define SMRAM_SAVE_STATE_MAP_OFFSET
#define FeaturePcdGet(TokenName)