summaryrefslogtreecommitdiffstats
path: root/UefiCpuPkg
diff options
context:
space:
mode:
authorEric Dong <eric.dong@intel.com>2018-07-12 18:21:01 +0800
committerEric Dong <eric.dong@intel.com>2018-07-18 12:43:30 +0800
commitf63a3e286765f47b79a73d56f8d687c4f3733979 (patch)
treef4e3104d58a33b3e8249dbb58ef6d1f360c377d3 /UefiCpuPkg
parent2a08913443bb3fff0056cc555e260b2c3fdd2120 (diff)
downloadedk2-f63a3e286765f47b79a73d56f8d687c4f3733979.tar.gz
edk2-f63a3e286765f47b79a73d56f8d687c4f3733979.tar.bz2
edk2-f63a3e286765f47b79a73d56f8d687c4f3733979.zip
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>
Diffstat (limited to 'UefiCpuPkg')
-rw-r--r--UefiCpuPkg/Library/MpInitLib/Microcode.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/UefiCpuPkg/Library/MpInitLib/Microcode.c b/UefiCpuPkg/Library/MpInitLib/Microcode.c
index 30ceaa46ad..efda143e67 100644
--- a/UefiCpuPkg/Library/MpInitLib/Microcode.c
+++ b/UefiCpuPkg/Library/MpInitLib/Microcode.c
@@ -61,6 +61,7 @@ MicrocodeDetect (
VOID *MicrocodeData;
MSR_IA32_PLATFORM_ID_REGISTER PlatformIdMsr;
UINT32 ProcessorFlags;
+ UINT32 ThreadId;
if (CpuMpData->MicrocodePatchRegionSize == 0) {
//
@@ -77,6 +78,14 @@ MicrocodeDetect (
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;
//
// Here data of CPUID leafs have not been collected into context buffer, so