mirror of https://github.com/acidanthera/audk.git
UefiCpuPkg: ApWakeupFunction directly use CpuMpData.
In the original design, once the APs finished executing their assembly code and switched to executing C code, they would enter a continuous loop within a function. In this function, they would collect CpuMpData using the MP_CPU_EXCHANGE_INFO mechanism. However, in the updated approach, CpuMpData can now be passed directly to the ApWakeUpFunction, bypassing the need for MP_CPU_EXCHANGE_INFO. This modification is made in preparation for eliminating the requirement of a second INIT-SIPI-SIPI sequence in the DXE phase. Tested-by: Gerd Hoffmann <kraxel@redhat.com> Acked-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Ray Ni <ray.ni@intel.com> Cc: Eric Dong <eric.dong@intel.com> Cc: Rahul Kumar <rahul1.kumar@intel.com> Cc: Tom Lendacky <thomas.lendacky@amd.com> Signed-off-by: Yuanhao Xie <yuanhao.xie@intel.com>
This commit is contained in:
parent
8bb018afaf
commit
629c1dacc9
|
@ -197,8 +197,8 @@ CProcedureInvoke:
|
||||||
|
|
||||||
push ebx ; Push ApIndex
|
push ebx ; Push ApIndex
|
||||||
mov eax, esi
|
mov eax, esi
|
||||||
add eax, MP_CPU_EXCHANGE_INFO_OFFSET
|
add eax, MP_CPU_EXCHANGE_INFO_FIELD (CpuMpData)
|
||||||
push eax ; push address of exchange info data buffer
|
push dword [eax] ; push address of CpuMpData
|
||||||
|
|
||||||
mov edi, esi
|
mov edi, esi
|
||||||
add edi, MP_CPU_EXCHANGE_INFO_FIELD (CFunction)
|
add edi, MP_CPU_EXCHANGE_INFO_FIELD (CFunction)
|
||||||
|
|
|
@ -710,17 +710,16 @@ PlaceAPInMwaitLoopOrRunLoop (
|
||||||
/**
|
/**
|
||||||
This function will be called from AP reset code if BSP uses WakeUpAP.
|
This function will be called from AP reset code if BSP uses WakeUpAP.
|
||||||
|
|
||||||
@param[in] ExchangeInfo Pointer to the MP exchange info buffer
|
@param[in] CpuMpData Pointer to CPU MP Data
|
||||||
@param[in] ApIndex Number of current executing AP
|
@param[in] ApIndex Number of current executing AP
|
||||||
**/
|
**/
|
||||||
VOID
|
VOID
|
||||||
EFIAPI
|
EFIAPI
|
||||||
ApWakeupFunction (
|
ApWakeupFunction (
|
||||||
IN MP_CPU_EXCHANGE_INFO *ExchangeInfo,
|
IN CPU_MP_DATA *CpuMpData,
|
||||||
IN UINTN ApIndex
|
IN UINTN ApIndex
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
CPU_MP_DATA *CpuMpData;
|
|
||||||
UINTN ProcessorNumber;
|
UINTN ProcessorNumber;
|
||||||
EFI_AP_PROCEDURE Procedure;
|
EFI_AP_PROCEDURE Procedure;
|
||||||
VOID *Parameter;
|
VOID *Parameter;
|
||||||
|
@ -731,11 +730,6 @@ ApWakeupFunction (
|
||||||
UINTN CurrentApicMode;
|
UINTN CurrentApicMode;
|
||||||
AP_STACK_DATA *ApStackData;
|
AP_STACK_DATA *ApStackData;
|
||||||
|
|
||||||
//
|
|
||||||
// AP finished assembly code and begin to execute C code
|
|
||||||
//
|
|
||||||
CpuMpData = ExchangeInfo->CpuMpData;
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// AP's local APIC settings will be lost after received INIT IPI
|
// AP's local APIC settings will be lost after received INIT IPI
|
||||||
// We need to re-initialize them at here
|
// We need to re-initialize them at here
|
||||||
|
|
|
@ -259,8 +259,7 @@ CProcedureInvoke:
|
||||||
add rsp, 20h
|
add rsp, 20h
|
||||||
|
|
||||||
mov edx, ebx ; edx is ApIndex
|
mov edx, ebx ; edx is ApIndex
|
||||||
mov ecx, esi
|
mov rcx, qword [esi + MP_CPU_EXCHANGE_INFO_FIELD (CpuMpData)]
|
||||||
add ecx, MP_CPU_EXCHANGE_INFO_OFFSET ; rcx is address of exchange info data buffer
|
|
||||||
|
|
||||||
mov edi, esi
|
mov edi, esi
|
||||||
add edi, MP_CPU_EXCHANGE_INFO_FIELD (CFunction)
|
add edi, MP_CPU_EXCHANGE_INFO_FIELD (CFunction)
|
||||||
|
|
Loading…
Reference in New Issue