]> git.proxmox.com Git - mirror_edk2.git/commitdiff
UefiCpuPkg/CpuMpPei: Skip microcode check/load if it has been loaded
authorJeff Fan <jeff.fan@intel.com>
Fri, 1 Jul 2016 06:51:10 +0000 (14:51 +0800)
committerJeff Fan <jeff.fan@intel.com>
Wed, 13 Jul 2016 07:41:14 +0000 (15:41 +0800)
Actually, there is only one microcode region in platform. If microcode has been
loaded, its signature will not be zero and should be loaded successfully.
We needn't to check microcode region and load microcode again. This update is to
skip checking/loading microcode if current microcode signature is not zero.

Cc: Michael Kinney <michael.d.kinney@intel.com>
Cc: Feng Tian <feng.tian@intel.com>
Cc: Giri P Mudusuru <giri.p.mudusuru@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jeff Fan <jeff.fan@intel.com>
Reviewed-by: Giri P Mudusuru <giri.p.mudusuru@intel.com>
UefiCpuPkg/CpuMpPei/Microcode.c

index 3fd3a8bb8185167a37f896a8cd89a448abc95a44..67280d334d33fd8774ee93b2d09574283d8a6bec 100644 (file)
@@ -53,6 +53,7 @@ MicrocodeDetect (
   UINTN                                   Index;\r
   UINT8                                   PlatformId;\r
   UINT32                                  RegEax;\r
+  UINT32                                  CurrentRevision;\r
   UINT32                                  LatestRevision;\r
   UINTN                                   TotalSize;\r
   UINT32                                  CheckSum32;\r
@@ -69,6 +70,14 @@ MicrocodeDetect (
     return;\r
   }\r
 \r
+  CurrentRevision = GetCurrentMicrocodeSignature ();\r
+  if (CurrentRevision != 0) {\r
+    //\r
+    // Skip loading microcode if it has been loaded successfully\r
+    //\r
+    return;\r
+  }\r
+\r
   ExtendedTableLength = 0;\r
   //\r
   // Here data of CPUID leafs have not been collected into context buffer, so\r