summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
9fe7c61)
Current implementation only loads the latest revision if there is no microcode
loaded. Per IA32 User Manual, we should load the newer revision by comparing
the existing microcode loaded with the updating revision.
Cc: Feng Tian <feng.tian@intel.com>
Cc: Michael Kinney <michael.d.kinney@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jeff Fan <jeff.fan@intel.com>
Reviewed-by: Feng Tian <feng.tian@intel.com>
Reviewed-by: Michael Kinney <michael.d.kinney@intel.com>
/** @file\r
Implementation of loading microcode on processors.\r
\r
/** @file\r
Implementation of loading microcode on processors.\r
\r
- Copyright (c) 2015, Intel Corporation. All rights reserved.<BR>\r
+ Copyright (c) 2015 - 2016, Intel Corporation. All rights reserved.<BR>\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
UINTN TotalSize;\r
UINT32 CheckSum32;\r
BOOLEAN CorrectMicrocode;\r
UINTN TotalSize;\r
UINT32 CheckSum32;\r
BOOLEAN CorrectMicrocode;\r
- INT32 CurrentSignature;\r
MICROCODE_INFO MicrocodeInfo;\r
\r
ZeroMem (&MicrocodeInfo, sizeof (MICROCODE_INFO));\r
MICROCODE_INFO MicrocodeInfo;\r
\r
ZeroMem (&MicrocodeInfo, sizeof (MICROCODE_INFO));\r
\r
if (LatestRevision > 0) {\r
//\r
\r
if (LatestRevision > 0) {\r
//\r
- // Get microcode update signature of currently loaded microcode update\r
+ // BIOS only authenticate updates that contain a numerically larger revision\r
+ // than the currently loaded revision, where Current Signature < New Update\r
+ // Revision. A processor with no loaded update is considered to have a\r
+ // revision equal to zero.\r
- CurrentSignature = GetCurrentMicrocodeSignature ();\r
- //\r
- // If no microcode update has been loaded, then trigger microcode load.\r
- //\r
- if (CurrentSignature == 0) {\r
+ if (LatestRevision > GetCurrentMicrocodeSignature ()) {\r
AsmWriteMsr64 (\r
EFI_MSR_IA32_BIOS_UPDT_TRIG,\r
(UINT64) (UINTN) MicrocodeInfo.MicrocodeData\r
);\r
AsmWriteMsr64 (\r
EFI_MSR_IA32_BIOS_UPDT_TRIG,\r
(UINT64) (UINTN) MicrocodeInfo.MicrocodeData\r
);\r
+ //\r
+ // Get and verify new microcode signature\r
+ //\r
+ ASSERT (LatestRevision == GetCurrentMicrocodeSignature ());\r
MicrocodeInfo.Load = TRUE;\r
} else {\r
MicrocodeInfo.Load = FALSE;\r
MicrocodeInfo.Load = TRUE;\r
} else {\r
MicrocodeInfo.Load = FALSE;\r