TianoCore EDK2 master
MpLib.h File Reference

Go to the source code of this file.

Data Structures

struct  MICROCODE_PATCH_INFO
 
struct  CPU_EXCHANGE_ROLE_INFO
 
struct  CPU_VOLATILE_REGISTERS
 
struct  CPU_AP_DATA
 
struct  CPU_INFO_IN_HOB
 
struct  MP_ASSEMBLY_ADDRESS_MAP
 
struct  MP_CPU_EXCHANGE_INFO
 
struct  _CPU_MP_DATA
 
struct  SEV_ES_AP_JMP_FAR
 

Macros

#define WAKEUP_AP_SIGNAL   SIGNATURE_32 ('S', 'T', 'A', 'P')
 
#define CPU_INIT_MP_LIB_HOB_GUID
 
#define CPU_SWITCH_STATE_IDLE   0
 
#define CPU_SWITCH_STATE_STORED   1
 
#define CPU_SWITCH_STATE_LOADED   2
 
#define DEFAULT_MAX_MICROCODE_PATCH_NUM   8
 
#define AP_SAFE_STACK_SIZE   128
 
#define AP_RESET_STACK_SIZE   AP_SAFE_STACK_SIZE
 

Typedefs

typedef struct _CPU_MP_DATA CPU_MP_DATA
 
typedef IN UINT16 Code16
 
typedef IN UINT16 IN UINT16 Code32
 
typedef IN UINT16 IN UINT16 IN UINTN StackStart
 
typedef VOID(EFIAPIASM_RELOCATE_AP_LOOP) (IN BOOLEAN MwaitSupport, IN UINTN ApTargetCState, IN UINTN PmCodeSegment, IN UINTN TopOfApStack, IN UINTN NumberToFinish, IN UINTN Pm16CodeSegment, IN UINTN SevEsAPJumpTable, IN UINTN WakeupBuffer)
 

Enumerations

enum  AP_LOOP_MODE { ApInHltLoop = 1 , ApInMwaitLoop = 2 , ApInRunLoop = 3 }
 
enum  AP_INIT_STATE { ApInitConfig = 1 , ApInitReconfig = 2 , ApInitDone = 3 }
 
enum  CPU_STATE {
  CpuStateIdle , CpuStateReady , CpuStateBusy , CpuStateFinished ,
  CpuStateDisabled
}
 

Functions

typedef VOID (EFIAPI AP_RESET)(IN UINTN BufferStart
 
VOID EFIAPI AsmGetAddressMap (OUT MP_ASSEMBLY_ADDRESS_MAP *AddressMap)
 
VOID EFIAPI AsmExchangeRole (IN CPU_EXCHANGE_ROLE_INFO *MyInfo, IN CPU_EXCHANGE_ROLE_INFO *OthersInfo)
 
CPU_MP_DATAGetCpuMpData (VOID)
 
VOID SaveCpuMpData (IN CPU_MP_DATA *CpuMpData)
 
UINTN GetWakeupBuffer (IN UINTN WakeupBufferSize)
 
UINTN AllocateCodeBuffer (IN UINTN BufferSize)
 
UINTN GetSevEsAPMemory (VOID)
 
VOID WakeUpAP (IN CPU_MP_DATA *CpuMpData, IN BOOLEAN Broadcast, IN UINTN ProcessorNumber, IN EFI_AP_PROCEDURE Procedure OPTIONAL, IN VOID *ProcedureArgument OPTIONAL, IN BOOLEAN WakeUpDisabledAps)
 
VOID InitMpGlobalData (IN CPU_MP_DATA *CpuMpData)
 
EFI_STATUS StartupAllCPUsWorker (IN EFI_AP_PROCEDURE Procedure, IN BOOLEAN SingleThread, IN BOOLEAN ExcludeBsp, IN EFI_EVENT WaitEvent OPTIONAL, IN UINTN TimeoutInMicroseconds, IN VOID *ProcedureArgument OPTIONAL, OUT UINTN **FailedCpuList OPTIONAL)
 
EFI_STATUS StartupThisAPWorker (IN EFI_AP_PROCEDURE Procedure, IN UINTN ProcessorNumber, IN EFI_EVENT WaitEvent OPTIONAL, IN UINTN TimeoutInMicroseconds, IN VOID *ProcedureArgument OPTIONAL, OUT BOOLEAN *Finished OPTIONAL)
 
EFI_STATUS SwitchBSPWorker (IN UINTN ProcessorNumber, IN BOOLEAN EnableOldBSP)
 
EFI_STATUS EnableDisableApWorker (IN UINTN ProcessorNumber, IN BOOLEAN EnableAP, IN UINT32 *HealthFlag OPTIONAL)
 
CPU_MP_DATAGetCpuMpDataFromGuidedHob (VOID)
 
EFI_STATUS CheckThisAP (IN UINTN ProcessorNumber)
 
EFI_STATUS CheckAllAPs (VOID)
 
VOID CheckAndUpdateApsStatus (VOID)
 
VOID MicrocodeDetect (IN CPU_MP_DATA *CpuMpData, IN UINTN ProcessorNumber)
 
VOID ShadowMicrocodeUpdatePatch (IN OUT CPU_MP_DATA *CpuMpData)
 
BOOLEAN GetMicrocodePatchInfoFromHob (UINT64 *Address, UINT64 *RegionSize)
 
BOOLEAN IsMwaitSupport (VOID)
 
VOID EnableDebugAgent (VOID)
 
EFI_STATUS GetProcessorNumber (IN CPU_MP_DATA *CpuMpData, OUT UINTN *ProcessorNumber)
 
EFI_STATUS PlatformShadowMicrocode (IN OUT CPU_MP_DATA *CpuMpData)
 
VOID AllocateSevEsAPMemory (IN OUT CPU_MP_DATA *CpuMpData)
 
VOID SetSevEsJumpTable (IN UINTN SipiVector)
 
VOID SevEsPlaceApHlt (CPU_MP_DATA *CpuMpData)
 
BOOLEAN EFIAPI ConfidentialComputingGuestHas (CONFIDENTIAL_COMPUTING_GUEST_ATTR Attr)
 
VOID FillExchangeInfoDataSevEs (IN volatile MP_CPU_EXCHANGE_INFO *ExchangeInfo)
 
UINT32 SevSnpRmpAdjust (IN EFI_PHYSICAL_ADDRESS PageAddress, IN BOOLEAN VmsaPage)
 
VOID SevSnpCreateSaveArea (IN CPU_MP_DATA *CpuMpData, IN CPU_AP_DATA *CpuData, UINT32 ApicId)
 
VOID SevSnpCreateAP (IN CPU_MP_DATA *CpuMpData, IN INTN ProcessorNumber)
 

Variables

EFI_GUID mCpuInitMpLibHobGuid
 

Detailed Description

Common header file for MP Initialize Library.

Copyright (c) 2016 - 2022, Intel Corporation. All rights reserved.
Copyright (c) 2020, AMD Inc. All rights reserved.

SPDX-License-Identifier: BSD-2-Clause-Patent

Definition in file MpLib.h.

Macro Definition Documentation

◆ AP_RESET_STACK_SIZE

#define AP_RESET_STACK_SIZE   AP_SAFE_STACK_SIZE

Definition at line 306 of file MpLib.h.

◆ AP_SAFE_STACK_SIZE

#define AP_SAFE_STACK_SIZE   128

Definition at line 305 of file MpLib.h.

◆ CPU_INIT_MP_LIB_HOB_GUID

#define CPU_INIT_MP_LIB_HOB_GUID
Value:
{ \
0x58eb6a19, 0x3699, 0x4c68, { 0xa8, 0x36, 0xda, 0xcd, 0x8e, 0xdc, 0xad, 0x4a } \
}

Definition at line 46 of file MpLib.h.

◆ CPU_SWITCH_STATE_IDLE

#define CPU_SWITCH_STATE_IDLE   0

Definition at line 54 of file MpLib.h.

◆ CPU_SWITCH_STATE_LOADED

#define CPU_SWITCH_STATE_LOADED   2

Definition at line 56 of file MpLib.h.

◆ CPU_SWITCH_STATE_STORED

#define CPU_SWITCH_STATE_STORED   1

Definition at line 55 of file MpLib.h.

◆ DEFAULT_MAX_MICROCODE_PATCH_NUM

#define DEFAULT_MAX_MICROCODE_PATCH_NUM   8

Definition at line 61 of file MpLib.h.

◆ WAKEUP_AP_SIGNAL

#define WAKEUP_AP_SIGNAL   SIGNATURE_32 ('S', 'T', 'A', 'P')

Definition at line 44 of file MpLib.h.

Typedef Documentation

◆ ASM_RELOCATE_AP_LOOP

typedef VOID(EFIAPI * ASM_RELOCATE_AP_LOOP) (IN BOOLEAN MwaitSupport, IN UINTN ApTargetCState, IN UINTN PmCodeSegment, IN UINTN TopOfApStack, IN UINTN NumberToFinish, IN UINTN Pm16CodeSegment, IN UINTN SevEsAPJumpTable, IN UINTN WakeupBuffer)

Assembly code to place AP into safe loop mode.

Place AP into targeted C-State if MONITOR is supported, otherwise place AP into hlt state. Place AP in protected mode if the current is long mode. Due to AP maybe wakeup by some hardware event. It could avoid accessing page table that may not available during booting to OS.

Parameters
[in]MwaitSupportTRUE indicates MONITOR is supported. FALSE indicates MONITOR is not supported.
[in]ApTargetCStateTarget C-State value.
[in]PmCodeSegmentProtected mode code segment value.

Definition at line 357 of file MpLib.h.

◆ Code16

typedef IN UINT16 Code16

Definition at line 335 of file MpLib.h.

◆ Code32

typedef IN UINT16 IN UINT16 Code32

Definition at line 336 of file MpLib.h.

◆ CPU_MP_DATA

typedef struct _CPU_MP_DATA CPU_MP_DATA

Definition at line 189 of file MpLib.h.

◆ StackStart

typedef IN UINT16 IN UINT16 IN UINTN StackStart

Definition at line 337 of file MpLib.h.

Enumeration Type Documentation

◆ AP_INIT_STATE

enum AP_INIT_STATE

Definition at line 94 of file MpLib.h.

◆ AP_LOOP_MODE

enum AP_LOOP_MODE

Definition at line 85 of file MpLib.h.

◆ CPU_STATE

enum CPU_STATE

Definition at line 107 of file MpLib.h.

Function Documentation

◆ AllocateCodeBuffer()

UINTN AllocateCodeBuffer ( IN UINTN  BufferSize)

Get available EfiBootServicesCode memory below 4GB by specified size.

This buffer is required to safely transfer AP from real address mode to protected mode or long mode, due to the fact that the buffer returned by GetWakeupBuffer() may be marked as non-executable.

Parameters
[in]BufferSizeWakeup transition buffer size.
Return values
otherReturn wakeup transition buffer address below 4GB.
0Cannot find free memory below 4GB.

Definition at line 165 of file DxeMpLib.c.

◆ AllocateSevEsAPMemory()

VOID AllocateSevEsAPMemory ( IN OUT CPU_MP_DATA CpuMpData)

Allocate the SEV-ES AP jump table buffer.

Parameters
[in,out]CpuMpDataThe pointer to CPU MP Data structure.

Definition at line 131 of file AmdSev.c.

◆ AsmExchangeRole()

VOID EFIAPI AsmExchangeRole ( IN CPU_EXCHANGE_ROLE_INFO MyInfo,
IN CPU_EXCHANGE_ROLE_INFO OthersInfo 
)

This function is called by both the BSP and the AP which is to become the BSP to Exchange execution context including stack between them. After return from this function, the BSP becomes AP and the AP becomes the BSP.

Parameters
[in]MyInfoPointer to buffer holding the exchanging information for the executing processor.
[in]OthersInfoPointer to buffer holding the exchanging information for the peer.

◆ AsmGetAddressMap()

VOID EFIAPI AsmGetAddressMap ( OUT MP_ASSEMBLY_ADDRESS_MAP AddressMap)

Assembly code to get starting address and size of the rendezvous entry for APs. Information for fixing a jump instruction in the code is also returned.

Parameters
[out]AddressMapOutput buffer for address map information.

◆ CheckAllAPs()

EFI_STATUS CheckAllAPs ( VOID  )

Checks status of all APs.

This function checks whether all APs have finished task assigned by StartupAllAPs(), and whether timeout expires.

Return values
EFI_SUCCESSAll APs have finished task assigned by StartupAllAPs().
EFI_TIMEOUTThe timeout expires.
EFI_NOT_READYAPs have not finished task and timeout has not expired.

Definition at line 1641 of file MpLib.c.

◆ CheckAndUpdateApsStatus()

VOID CheckAndUpdateApsStatus ( VOID  )

Checks APs status and updates APs status if needed.

Definition at line 237 of file DxeMpLib.c.

◆ CheckThisAP()

EFI_STATUS CheckThisAP ( IN UINTN  ProcessorNumber)

Checks status of specified AP.

This function checks whether the specified AP has finished the task assigned by StartupThisAP(), and whether timeout expires.

Parameters
[in]ProcessorNumberThe handle number of processor.
Return values
EFI_SUCCESSSpecified AP has finished task assigned by StartupThisAPs().
EFI_TIMEOUTThe timeout expires.
EFI_NOT_READYSpecified AP has not finished task and timeout has not expired.

Definition at line 1584 of file MpLib.c.

◆ ConfidentialComputingGuestHas()

BOOLEAN EFIAPI ConfidentialComputingGuestHas ( CONFIDENTIAL_COMPUTING_GUEST_ATTR  Attr)

Check if the specified confidential computing attribute is active.

Return values
TRUEThe specified Attr is active.
FALSEThe specified Attr is not active.

◆ EnableDebugAgent()

VOID EnableDebugAgent ( VOID  )

Enable Debug Agent to support source debugging on AP function.

Definition at line 42 of file DxeMpLib.c.

◆ EnableDisableApWorker()

EFI_STATUS EnableDisableApWorker ( IN UINTN  ProcessorNumber,
IN BOOLEAN  EnableAP,
IN UINT32 *HealthFlag  OPTIONAL 
)

Worker function to let the caller enable or disable an AP from this point onward. This service may only be called from the BSP.

Parameters
[in]ProcessorNumberThe handle number of AP.
[in]EnableAPSpecifies the new state for the processor for enabled, FALSE for disabled.
[in]HealthFlagIf not NULL, a pointer to a value that specifies the new health status of the AP.
Return values
EFI_SUCCESSThe specified AP was enabled or disabled successfully.
othersFailed to Enable/Disable AP.

Definition at line 2295 of file MpLib.c.

◆ FillExchangeInfoDataSevEs()

VOID FillExchangeInfoDataSevEs ( IN volatile MP_CPU_EXCHANGE_INFO ExchangeInfo)

The function fills the exchange data for the AP.

Parameters
[in]ExchangeInfoThe pointer to CPU Exchange Data structure

Definition at line 249 of file AmdSev.c.

◆ GetCpuMpData()

CPU_MP_DATA * GetCpuMpData ( VOID  )

Get the pointer to CPU MP Data structure.

Returns
The pointer to CPU MP Data structure.

Get pointer to CPU MP Data structure. For BSP, the pointer is retrieved from HOB. For AP, the structure is just after IDT.

Returns
The pointer to CPU MP Data structure.

Definition at line 58 of file DxeMpLib.c.

◆ GetCpuMpDataFromGuidedHob()

CPU_MP_DATA * GetCpuMpDataFromGuidedHob ( VOID  )

Get pointer to CPU MP Data structure from GUIDed HOB.

Returns
The pointer to CPU MP Data structure.

Definition at line 2720 of file MpLib.c.

◆ GetMicrocodePatchInfoFromHob()

BOOLEAN GetMicrocodePatchInfoFromHob ( UINT64 Address,
UINT64 RegionSize 
)

Get the cached microcode patch base address and size from the microcode patch information cache HOB.

Parameters
[out]AddressBase address of the microcode patches data. It will be updated if the microcode patch information cache HOB is found.
[out]RegionSizeSize of the microcode patches data. It will be updated if the microcode patch information cache HOB is found.
Return values
TRUEThe microcode patch information cache HOB is found.
FALSEThe microcode patch information cache HOB is not found.

Definition at line 358 of file Microcode.c.

◆ GetProcessorNumber()

EFI_STATUS GetProcessorNumber ( IN CPU_MP_DATA CpuMpData,
OUT UINTN ProcessorNumber 
)

Find the current Processor number by APIC ID.

Parameters
[in]CpuMpDataPointer to PEI CPU MP Data
[out]ProcessorNumberReturn the pocessor number found
Return values
EFI_SUCCESSProcessorNumber is found and returned.
EFI_NOT_FOUNDProcessorNumber is not found.

Definition at line 445 of file MpLib.c.

◆ GetSevEsAPMemory()

UINTN GetSevEsAPMemory ( VOID  )

Return the address of the SEV-ES AP jump table.

This buffer is required in order for an SEV-ES guest to transition from UEFI into an OS.

Returns
Return SEV-ES AP jump table buffer

Definition at line 195 of file DxeMpLib.c.

◆ GetWakeupBuffer()

UINTN GetWakeupBuffer ( IN UINTN  WakeupBufferSize)

Get available system memory below 1MB by specified size.

Parameters
[in]WakeupBufferSizeWakeup buffer size required
Return values
otherReturn wakeup buffer address below 1MB.
-1Cannot find free memory below 1MB.

Get available system memory below 0x88000 by specified size.

Parameters
[in]WakeupBufferSizeWakeup buffer size required
Return values
otherReturn wakeup buffer address below 1MB.
-1Cannot find free memory below 1MB.

Definition at line 88 of file DxeMpLib.c.

◆ InitMpGlobalData()

VOID InitMpGlobalData ( IN CPU_MP_DATA CpuMpData)

Initialize global data for MP support.

Parameters
[in]CpuMpDataThe pointer to CPU MP Data structure.

Install Notify

Definition at line 463 of file DxeMpLib.c.

◆ IsMwaitSupport()

BOOLEAN IsMwaitSupport ( VOID  )

Detect whether Mwait-monitor feature is supported.

Return values
TRUEMwait-monitor feature is supported.
FALSEMwait-monitor feature is not supported.

Definition at line 260 of file MpLib.c.

◆ MicrocodeDetect()

VOID MicrocodeDetect ( IN CPU_MP_DATA CpuMpData,
IN UINTN  ProcessorNumber 
)

Detect whether specified processor can find matching microcode patch and load it.

Parameters
[in]CpuMpDataThe pointer to CPU MP Data structure.
[in]ProcessorNumberThe handle number of the processor. The range is from 0 to the total number of logical processors minus 1.

Definition at line 20 of file Microcode.c.

◆ PlatformShadowMicrocode()

EFI_STATUS PlatformShadowMicrocode ( IN OUT CPU_MP_DATA CpuMpData)

This funtion will try to invoke platform specific microcode shadow logic to relocate microcode update patches into memory.

Parameters
[in,out]CpuMpDataThe pointer to CPU MP Data structure.
Return values
EFI_SUCCESSShadow microcode success.
EFI_OUT_OF_RESOURCESNo enough resource to complete the operation.
EFI_UNSUPPORTEDCan't find platform specific microcode shadow PPI/Protocol.

Definition at line 986 of file DxeMpLib.c.

◆ SaveCpuMpData()

VOID SaveCpuMpData ( IN CPU_MP_DATA CpuMpData)

Save the pointer to CPU MP Data structure.

Parameters
[in]CpuMpDataThe pointer to CPU MP Data structure will be saved.

Definition at line 72 of file DxeMpLib.c.

◆ SetSevEsJumpTable()

VOID SetSevEsJumpTable ( IN UINTN  SipiVector)

Program the SEV-ES AP jump table buffer.

Parameters
[in]SipiVectorThe SIPI vector used for the AP Reset

Definition at line 147 of file AmdSev.c.

◆ SevEsPlaceApHlt()

VOID SevEsPlaceApHlt ( CPU_MP_DATA CpuMpData)

The function puts the AP in halt loop.

Parameters
[in]CpuMpDataThe pointer to CPU MP Data structure.

Definition at line 196 of file AmdSev.c.

◆ SevSnpCreateAP()

VOID SevSnpCreateAP ( IN CPU_MP_DATA CpuMpData,
IN INTN  ProcessorNumber 
)

Create SEV-SNP APs.

Parameters
[in]CpuMpDataPointer to CPU MP Data
[in]ProcessorNumberThe handle number of specified processor (-1 for all APs)

Definition at line 41 of file AmdSev.c.

◆ SevSnpCreateSaveArea()

VOID SevSnpCreateSaveArea ( IN CPU_MP_DATA CpuMpData,
IN CPU_AP_DATA CpuData,
UINT32  ApicId 
)

Create an SEV-SNP AP save area (VMSA) for use in running the vCPU.

Parameters
[in]CpuMpDataPointer to CPU MP Data
[in]CpuDataPointer to CPU AP Data
[in]ApicIdAPIC ID of the vCPU

Definition at line 21 of file AmdSev.c.

◆ SevSnpRmpAdjust()

UINT32 SevSnpRmpAdjust ( IN EFI_PHYSICAL_ADDRESS  PageAddress,
IN BOOLEAN  VmsaPage 
)

Issue RMPADJUST to adjust the VMSA attribute of an SEV-SNP page.

Parameters
[in]PageAddress
[in]VmsaPage
Returns
RMPADJUST return value

Definition at line 61 of file AmdSev.c.

◆ ShadowMicrocodeUpdatePatch()

VOID ShadowMicrocodeUpdatePatch ( IN OUT CPU_MP_DATA CpuMpData)

Shadow the required microcode patches data into memory.

Parameters
[in,out]CpuMpDataThe pointer to CPU MP Data structure.

Definition at line 330 of file Microcode.c.

◆ StartupAllCPUsWorker()

EFI_STATUS StartupAllCPUsWorker ( IN EFI_AP_PROCEDURE  Procedure,
IN BOOLEAN  SingleThread,
IN BOOLEAN  ExcludeBsp,
IN EFI_EVENT WaitEvent  OPTIONAL,
IN UINTN  TimeoutInMicroseconds,
IN VOID *ProcedureArgument  OPTIONAL,
OUT UINTN **FailedCpuList  OPTIONAL 
)

Worker function to execute a caller provided function on all enabled APs.

Parameters
[in]ProcedureA pointer to the function to be run on enabled APs of the system.
[in]SingleThreadIf TRUE, then all the enabled APs execute the function specified by Procedure one by one, in ascending order of processor handle number. If FALSE, then all the enabled APs execute the function specified by Procedure simultaneously.
[in]ExcludeBspWhether let BSP also trig this task.
[in]WaitEventThe event created by the caller with CreateEvent() service.
[in]TimeoutInMicrosecondsIndicates the time limit in microseconds for APs to return from Procedure, either for blocking or non-blocking mode.
[in]ProcedureArgumentThe parameter passed into Procedure for all APs.
[out]FailedCpuListIf all APs finish successfully, then its content is set to NULL. If not all APs finish before timeout expires, then its content is set to address of the buffer holding handle numbers of the failed APs.
Return values
EFI_SUCCESSIn blocking mode, all APs have finished before the timeout expired.
EFI_SUCCESSIn non-blocking mode, function has been dispatched to all enabled APs.
othersFailed to Startup all APs.

Definition at line 2468 of file MpLib.c.

◆ StartupThisAPWorker()

EFI_STATUS StartupThisAPWorker ( IN EFI_AP_PROCEDURE  Procedure,
IN UINTN  ProcessorNumber,
IN EFI_EVENT WaitEvent  OPTIONAL,
IN UINTN  TimeoutInMicroseconds,
IN VOID *ProcedureArgument  OPTIONAL,
OUT BOOLEAN *Finished  OPTIONAL 
)

Worker function to let the caller get one enabled AP to execute a caller-provided function.

Parameters
[in]ProcedureA pointer to the function to be run on enabled APs of the system.
[in]ProcessorNumberThe handle number of the AP.
[in]WaitEventThe event created by the caller with CreateEvent() service.
[in]TimeoutInMicrosecondsIndicates the time limit in microseconds for APs to return from Procedure, either for blocking or non-blocking mode.
[in]ProcedureArgumentThe parameter passed into Procedure for all APs.
[out]FinishedIf AP returns from Procedure before the timeout expires, its content is set to TRUE. Otherwise, the value is set to FALSE.
Return values
EFI_SUCCESSIn blocking mode, specified AP finished before the timeout expires.
othersFailed to Startup AP.

Definition at line 2626 of file MpLib.c.

◆ SwitchBSPWorker()

EFI_STATUS SwitchBSPWorker ( IN UINTN  ProcessorNumber,
IN BOOLEAN  EnableOldBSP 
)

Worker function to switch the requested AP to be the BSP from that point onward.

Parameters
[in]ProcessorNumberThe handle number of AP that is to become the new BSP.
[in]EnableOldBSPIf TRUE, then the old BSP will be listed as an enabled AP. Otherwise, it will be disabled.
Return values
EFI_SUCCESSBSP successfully switched.
othersFailed to switch BSP.

Definition at line 2152 of file MpLib.c.

◆ VOID()

typedef VOID ( EFIAPI  AP_RESET)

Assembly code to move an AP from long mode to real mode.

Move an AP from long mode to real mode in preparation to invoking the reset vector. This is used for SEV-ES guests where a hypervisor is not allowed to set the CS and RIP to point to the reset vector.

Parameters
[in]BufferStartThe reset vector target.
[in]Code1616-bit protected mode code segment value.
[in]Code3232-bit protected mode code segment value.
[in]StackStartThe start of a stack to be used for transitioning from long mode to real mode.

◆ WakeUpAP()

VOID WakeUpAP ( IN CPU_MP_DATA CpuMpData,
IN BOOLEAN  Broadcast,
IN UINTN  ProcessorNumber,
IN EFI_AP_PROCEDURE Procedure  OPTIONAL,
IN VOID *ProcedureArgument  OPTIONAL,
IN BOOLEAN  WakeUpDisabledAps 
)

This function will be called by BSP to wakeup AP.

Parameters
[in]CpuMpDataPointer to CPU MP Data
[in]BroadcastTRUE: Send broadcast IPI to all APs FALSE: Send IPI to AP by ApicId
[in]ProcessorNumberThe handle number of specified processor
[in]ProcedureThe function to be invoked by AP
[in]ProcedureArgumentThe argument to be passed into AP function
[in]WakeUpDisabledApsWhether need to wake up disabled APs in broadcast mode.

Definition at line 1120 of file MpLib.c.

Variable Documentation

◆ mCpuInitMpLibHobGuid

EFI_GUID mCpuInitMpLibHobGuid
extern

Definition at line 16 of file MpLib.c.