UefiCpuPkg/MpInitLib: add struct MP_HAND_OFF_CONFIG

Move the WaitLoopExecutionMode and StartupSignalValue fields to a
separate HOB with the new struct.

WaitLoopExecutionMode and StartupSignalValue are independent of
processor index ranges; they are global to MpInitLib (i.e., the entire
system). Therefore they shouldn't be repeated in every MpHandOff GUID
HOB.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Message-Id: <20240228114855.1615788-1-kraxel@redhat.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Cc: Rahul Kumar <rahul1.kumar@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Cc: Oliver Steffen <osteffen@redhat.com>
Cc: Gerd Hoffmann <kraxel@redhat.com>
[lersek@redhat.com: turn the "Cc:" message headers from Gerd's on-list
 posting into "Cc:" tags in the commit message, in order to pacify
 "PatchCheck.py"]
This commit is contained in:
Gerd Hoffmann
2024-02-28 12:48:55 +01:00
committed by mergify[bot]
parent bac9c74080
commit dc7cfa9bab
4 changed files with 75 additions and 22 deletions

View File

@@ -126,14 +126,15 @@ SaveCpuMpData (
IN CPU_MP_DATA *CpuMpData
)
{
UINT32 MaxCpusPerHob;
UINT32 CpusInHob;
UINT64 Data64;
UINT32 Index;
UINT32 HobBase;
CPU_INFO_IN_HOB *CpuInfoInHob;
MP_HAND_OFF *MpHandOff;
UINTN MpHandOffSize;
UINT32 MaxCpusPerHob;
UINT32 CpusInHob;
UINT64 Data64;
UINT32 Index;
UINT32 HobBase;
CPU_INFO_IN_HOB *CpuInfoInHob;
MP_HAND_OFF *MpHandOff;
MP_HAND_OFF_CONFIG MpHandOffConfig;
UINTN MpHandOffSize;
MaxCpusPerHob = (0xFFF8 - sizeof (EFI_HOB_GUID_TYPE) - sizeof (MP_HAND_OFF)) / sizeof (PROCESSOR_HAND_OFF);
@@ -155,11 +156,6 @@ SaveCpuMpData (
MpHandOff->ProcessorIndex = HobBase;
MpHandOff->CpuCount = CpusInHob;
if (CpuMpData->ApLoopMode != ApInHltLoop) {
MpHandOff->StartupSignalValue = MP_HAND_OFF_SIGNAL;
MpHandOff->WaitLoopExecutionMode = sizeof (VOID *);
}
}
MpHandOff->Info[Index-HobBase].ApicId = CpuInfoInHob[Index].ApicId;
@@ -170,6 +166,18 @@ SaveCpuMpData (
}
}
ZeroMem (&MpHandOffConfig, sizeof (MpHandOffConfig));
if (CpuMpData->ApLoopMode != ApInHltLoop) {
MpHandOffConfig.StartupSignalValue = MP_HAND_OFF_SIGNAL;
MpHandOffConfig.WaitLoopExecutionMode = sizeof (VOID *);
}
BuildGuidDataHob (
&mMpHandOffConfigGuid,
(VOID *)&MpHandOffConfig,
sizeof (MpHandOffConfig)
);
//
// Build location of CPU MP DATA buffer in HOB
//