TianoCore EDK2 master
|
#include "PiSmmCpuCommon.h"
Go to the source code of this file.
Variables | |
SMM_CPU_PRIVATE_DATA | mSmmCpuPrivateData |
CPU_HOT_PLUG_DATA | mCpuHotPlugData |
SMM_CPU_PRIVATE_DATA * | gSmmCpuPrivate = &mSmmCpuPrivateData |
EFI_HANDLE | mSmmCpuHandle = NULL |
EFI_SMM_CPU_PROTOCOL | mSmmCpu |
EDKII_SMM_MEMORY_ATTRIBUTE_PROTOCOL | mSmmMemoryAttribute |
EFI_CPU_INTERRUPT_HANDLER | mExternalVectorTable [EXCEPTION_VECTOR_NUMBER] |
volatile BOOLEAN * | mSmmInitialized = NULL |
UINT32 | mBspApicId = 0 |
UINTN | mSmmStackArrayBase |
UINTN | mSmmStackArrayEnd |
UINTN | mSmmStackSize |
UINTN | mSmmShadowStackSize |
BOOLEAN | mCetSupported = TRUE |
UINTN | mMaxNumberOfCpus = 0 |
UINTN | mNumberOfCpus = 0 |
BOOLEAN | mSmmCodeAccessCheckEnable = FALSE |
BOOLEAN | mSmmDebugAgentSupport = FALSE |
UINT64 | mAddressEncMask = 0 |
SPIN_LOCK * | mConfigSmmCodeAccessCheckLock = NULL |
EFI_SMRAM_DESCRIPTOR * | mSmmCpuSmramRanges |
UINTN | mSmmCpuSmramRangeCount |
UINT8 | mPhysicalAddressBits |
Agent Module to load other modules to deploy SMM Entry Vector for X86 CPU.
Copyright (c) 2009 - 2024, Intel Corporation. All rights reserved.
Copyright (c) 2017, AMD Incorporated. All rights reserved.
Copyright (C) 2023 - 2024 Advanced Micro Devices, Inc. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent
Definition in file PiSmmCpuCommon.c.
Allocate pages for code.
[in] | Pages | Number of pages to be allocated. |
Definition at line 1509 of file PiSmmCpuCommon.c.
VOID ConfigSmmCodeAccessCheck | ( | VOID | ) |
Configure SMM Code Access Check feature for all processors. SMM Feature Control MSR will be locked after configuration.
Definition at line 1435 of file PiSmmCpuCommon.c.
Configure SMM Code Access Check feature on an AP. SMM Feature Control MSR will be locked after configuration.
[in,out] | Buffer | Pointer to private data buffer. |
Definition at line 1388 of file PiSmmCpuCommon.c.
Function to compare 2 EFI_SMRAM_DESCRIPTOR based on CpuStart.
[in] | Buffer1 | pointer to Device Path poiner to compare |
[in] | Buffer2 | pointer to second DevicePath pointer to compare |
0 | Buffer1 equal to Buffer2 |
<0 | Buffer1 is less than Buffer2 |
>0 | Buffer1 is greater than Buffer2 |
Definition at line 1283 of file PiSmmCpuCommon.c.
Search module name by input IP address and output it.
CallerIpAddress | Caller instruction pointer. |
Definition at line 181 of file PiSmmCpuCommon.c.
VOID ExecuteFirstSmiInit | ( | VOID | ) |
Issue SMI IPI (All Excluding Self SMM IPI + BSP SMM IPI) to execute first SMI init.
Definition at line 398 of file PiSmmCpuCommon.c.
Find out SMRAM information including SMRR base and SMRR size.
SmrrBase | SMRR base |
SmrrSize | SMRR size |
Definition at line 1305 of file PiSmmCpuCommon.c.
EFI_PROCESSOR_INFORMATION * GetMpInformation | ( | OUT UINTN * | NumberOfCpus, |
OUT UINTN * | MaxNumberOfCpus | ||
) |
Extract NumberOfCpus, MaxNumberOfCpus and EFI_PROCESSOR_INFORMATION for all CPU from MpInformation2 HOB.
[out] | NumberOfCpus | Pointer to NumberOfCpus. |
[out] | MaxNumberOfCpus | Pointer to MaxNumberOfCpus. |
ProcessorInfo | Pointer to EFI_PROCESSOR_INFORMATION buffer. |
Definition at line 616 of file PiSmmCpuCommon.c.
Extract SmBase for all CPU from SmmBase HOB.
[in] | MaxNumberOfCpus | Max NumberOfCpus. |
[out] | AllocatedSmBaseBuffer | Pointer to SmBase Buffer allocated by this function. Only set if the function returns EFI_SUCCESS. |
EFI_SUCCESS | SmBase Buffer output successfully. |
EFI_OUT_OF_RESOURCES | Memory allocation failed. |
EFI_NOT_FOUND | gSmmBaseHobGuid was never created. |
Definition at line 489 of file PiSmmCpuCommon.c.
VOID InitializeSmm | ( | VOID | ) |
Initialize SMM environment.
Definition at line 327 of file PiSmmCpuCommon.c.
VOID InitializeSmmIdt | ( | VOID | ) |
Initialize IDT to setup exception handlers for SMM.
Definition at line 132 of file PiSmmCpuCommon.c.
Function to compare 2 MP_INFORMATION2_HOB_DATA pointer based on ProcessorIndex.
[in] | Buffer1 | pointer to MP_INFORMATION2_HOB_DATA poiner to compare |
[in] | Buffer2 | pointer to second MP_INFORMATION2_HOB_DATA pointer to compare |
0 | Buffer1 equal to Buffer2 |
<0 | Buffer1 is less than Buffer2 |
>0 | Buffer1 is greater than Buffer2 |
Definition at line 593 of file PiSmmCpuCommon.c.
VOID PerformPreTasks | ( | VOID | ) |
Perform the pre tasks.
Definition at line 1533 of file PiSmmCpuCommon.c.
EFI_STATUS PiSmmCpuEntryCommon | ( | VOID | ) |
The module Entry Point of the CPU SMM driver.
EFI_SUCCESS | The common entry point is executed successfully. |
Other | Some error occurs when executing this entry point. |
Definition at line 740 of file PiSmmCpuCommon.c.
Function to compare 2 SMM_BASE_HOB_DATA pointer based on ProcessorIndex.
[in] | Buffer1 | pointer to SMM_BASE_HOB_DATA poiner to compare |
[in] | Buffer2 | pointer to second SMM_BASE_HOB_DATA pointer to compare |
0 | Buffer1 equal to Buffer2 |
<0 | Buffer1 is less than Buffer2 |
>0 | Buffer1 is greater than Buffer2 |
Definition at line 460 of file PiSmmCpuCommon.c.
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 | ||
) |
Read information from the CPU save state.
This | EFI_SMM_CPU_PROTOCOL instance |
Width | The number of bytes to read from the CPU save state. |
Register | Specifies the CPU register to read form the save state. |
CpuIndex | Specifies the zero-based index of the CPU save state. |
Buffer | Upon return, this holds the CPU register value read from the save state. |
EFI_SUCCESS | The register was read from Save State |
EFI_NOT_FOUND | The register is not defined for the Save State of Processor |
EFI_INVALID_PARAMETER | This or Buffer is NULL. |
Definition at line 217 of file PiSmmCpuCommon.c.
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 | ||
) |
Write data to the CPU save state.
This | EFI_SMM_CPU_PROTOCOL instance |
Width | The number of bytes to read from the CPU save state. |
Register | Specifies the CPU register to write to the save state. |
CpuIndex | Specifies the zero-based index of the CPU save state |
Buffer | Upon entry, this holds the new CPU register value. |
EFI_SUCCESS | The register was written from Save State |
EFI_NOT_FOUND | The register is not defined for the Save State of Processor |
EFI_INVALID_PARAMETER | ProcessorIndex or Width is not correct |
Definition at line 289 of file PiSmmCpuCommon.c.
SMM_CPU_PRIVATE_DATA* gSmmCpuPrivate = &mSmmCpuPrivateData |
Definition at line 57 of file PiSmmCpuCommon.c.
UINT64 mAddressEncMask = 0 |
Definition at line 112 of file PiSmmCpuCommon.c.
UINT32 mBspApicId = 0 |
Definition at line 84 of file PiSmmCpuCommon.c.
BOOLEAN mCetSupported = TRUE |
Definition at line 94 of file PiSmmCpuCommon.c.
Definition at line 117 of file PiSmmCpuCommon.c.
CPU_HOT_PLUG_DATA mCpuHotPlugData |
Definition at line 44 of file PiSmmCpuCommon.c.
EFI_CPU_INTERRUPT_HANDLER mExternalVectorTable[EXCEPTION_VECTOR_NUMBER] |
Definition at line 81 of file PiSmmCpuCommon.c.
UINTN mMaxNumberOfCpus = 0 |
Definition at line 96 of file PiSmmCpuCommon.c.
UINTN mNumberOfCpus = 0 |
Definition at line 97 of file PiSmmCpuCommon.c.
UINT8 mPhysicalAddressBits |
Definition at line 125 of file PiSmmCpuCommon.c.
BOOLEAN mSmmCodeAccessCheckEnable = FALSE |
Definition at line 102 of file PiSmmCpuCommon.c.
EFI_SMM_CPU_PROTOCOL mSmmCpu |
SMM CPU Protocol instance
Definition at line 67 of file PiSmmCpuCommon.c.
EFI_HANDLE mSmmCpuHandle = NULL |
Handle for the SMM CPU Protocol
Definition at line 62 of file PiSmmCpuCommon.c.
SMM_CPU_PRIVATE_DATA mSmmCpuPrivateData |
Definition at line 18 of file PiSmmCpuCommon.c.
UINTN mSmmCpuSmramRangeCount |
Definition at line 123 of file PiSmmCpuCommon.c.
EFI_SMRAM_DESCRIPTOR* mSmmCpuSmramRanges |
Definition at line 122 of file PiSmmCpuCommon.c.
BOOLEAN mSmmDebugAgentSupport = FALSE |
Definition at line 107 of file PiSmmCpuCommon.c.
volatile BOOLEAN* mSmmInitialized = NULL |
Definition at line 83 of file PiSmmCpuCommon.c.
EDKII_SMM_MEMORY_ATTRIBUTE_PROTOCOL mSmmMemoryAttribute |
SMM Memory Attribute Protocol instance
Definition at line 75 of file PiSmmCpuCommon.c.
UINTN mSmmShadowStackSize |
Definition at line 93 of file PiSmmCpuCommon.c.
UINTN mSmmStackArrayBase |
Definition at line 89 of file PiSmmCpuCommon.c.
UINTN mSmmStackArrayEnd |
Definition at line 90 of file PiSmmCpuCommon.c.
UINTN mSmmStackSize |
Definition at line 91 of file PiSmmCpuCommon.c.