UefiCpuPkg/MpInitLib: Load uCode once for each core.

The SDM requires only one thread per core to load the
microcode.

This change enables this solution.

Cc: Laszlo Ersek <lersek@redhat.com>
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Eric Dong <eric.dong@intel.com>
Acked-by: Laszlo Ersek <lersek@redhat.com>
Regression-tested-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
This commit is contained in:
Eric Dong 2018-07-12 18:21:01 +08:00
parent 2a08913443
commit f63a3e2867

View File

@ -61,6 +61,7 @@ MicrocodeDetect (
VOID *MicrocodeData; VOID *MicrocodeData;
MSR_IA32_PLATFORM_ID_REGISTER PlatformIdMsr; MSR_IA32_PLATFORM_ID_REGISTER PlatformIdMsr;
UINT32 ProcessorFlags; UINT32 ProcessorFlags;
UINT32 ThreadId;
if (CpuMpData->MicrocodePatchRegionSize == 0) { if (CpuMpData->MicrocodePatchRegionSize == 0) {
// //
@ -77,6 +78,14 @@ MicrocodeDetect (
return; return;
} }
GetProcessorLocationByApicId (GetInitialApicId (), NULL, NULL, &ThreadId);
if (ThreadId != 0) {
//
// Skip loading microcode if it is not the first thread in one core.
//
return;
}
ExtendedTableLength = 0; ExtendedTableLength = 0;
// //
// Here data of CPUID leafs have not been collected into context buffer, so // Here data of CPUID leafs have not been collected into context buffer, so