]> git.proxmox.com Git - mirror_edk2.git/blobdiff - UefiCpuPkg/Library/MpInitLib/Microcode.c
UefiCpuPkg/MpInitLib: Load uCode once for each core.
[mirror_edk2.git] / UefiCpuPkg / Library / MpInitLib / Microcode.c
index 30ceaa46adcd6526ceceec7311b8ccec6de4f895..efda143e67198c19b14ad0d28591da3e392e9371 100644 (file)
@@ -61,6 +61,7 @@ MicrocodeDetect (
   VOID                                    *MicrocodeData;\r
   MSR_IA32_PLATFORM_ID_REGISTER           PlatformIdMsr;\r
   UINT32                                  ProcessorFlags;\r
+  UINT32                                  ThreadId;\r
 \r
   if (CpuMpData->MicrocodePatchRegionSize == 0) {\r
     //\r
@@ -77,6 +78,14 @@ MicrocodeDetect (
     return;\r
   }\r
 \r
+  GetProcessorLocationByApicId (GetInitialApicId (), NULL, NULL, &ThreadId);\r
+  if (ThreadId != 0) {\r
+    //\r
+    // Skip loading microcode if it is not the first thread in one core.\r
+    //\r
+    return;\r
+  }\r
+\r
   ExtendedTableLength = 0;\r
   //\r
   // Here data of CPUID leafs have not been collected into context buffer, so\r