diff options
author | Jeff Fan <jeff.fan@intel.com> | 2016-07-01 14:51:10 +0800 |
---|---|---|
committer | Hao Wu <hao.a.wu@intel.com> | 2016-07-14 13:20:36 +0800 |
commit | 573607b0750febbee4be86f73360fe27f4c1c8a6 (patch) | |
tree | 6cfcbae8559856729817597d40d2abfd0a1bab12 | |
parent | 49dcbf6b2cb5a4283f83300c02f418c419c47387 (diff) | |
download | edk2-platforms-573607b0750febbee4be86f73360fe27f4c1c8a6.tar.xz |
UefiCpuPkg/CpuMpPei: Skip microcode check/load if it has been loaded
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>
(cherry picked from commit 46fd118219fcce638f1eb9c861f4a037530b64b9)
-rw-r--r-- | UefiCpuPkg/CpuMpPei/Microcode.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/UefiCpuPkg/CpuMpPei/Microcode.c b/UefiCpuPkg/CpuMpPei/Microcode.c index 9dcbf99db3..8e7f3b0200 100644 --- a/UefiCpuPkg/CpuMpPei/Microcode.c +++ b/UefiCpuPkg/CpuMpPei/Microcode.c @@ -53,6 +53,7 @@ MicrocodeDetect ( UINTN Index;
UINT8 PlatformId;
UINT32 RegEax;
+ UINT32 CurrentRevision;
UINT32 LatestRevision;
UINTN TotalSize;
UINT32 CheckSum32;
@@ -69,6 +70,14 @@ MicrocodeDetect ( return;
}
+ CurrentRevision = GetCurrentMicrocodeSignature ();
+ if (CurrentRevision != 0) {
+ //
+ // Skip loading microcode if it has been loaded successfully
+ //
+ return;
+ }
+
ExtendedTableLength = 0;
//
// Here data of CPUID leafs have not been collected into context buffer, so
|