diff options
author | Chen A Chen <chen.a.chen@intel.com> | 2019-02-18 15:21:14 +0800 |
---|---|---|
committer | Liming Gao <liming.gao@intel.com> | 2019-02-25 09:14:21 +0800 |
commit | 5170327b7144e19c088df0c474adbbe7b5869b08 (patch) | |
tree | 1d232f6a07bdbe8779b441a53a0ae78c03fb3e5b | |
parent | 8391ffdc15b959a562c8562e896d219693ce2c63 (diff) | |
download | edk2-5170327b7144e19c088df0c474adbbe7b5869b08.zip edk2-5170327b7144e19c088df0c474adbbe7b5869b08.tar.gz edk2-5170327b7144e19c088df0c474adbbe7b5869b08.tar.bz2 |
IntelSiliconPkg/MicrocodeUpdate: Fix incorrect checksum issue
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1020
The same issue has fixed in UefiCpuPkg/Microcode.c file.
Please reference b6f67b4d58b81f12f63f5f8c94cf8af3600297ab
to get more detail information.
Cc: Ray Ni <ray.ni@intel.com>
Cc: Rangasai V Chaganty <rangasai.v.chaganty@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Chen A Chen <chen.a.chen@intel.com>
Reviewed-by: Ray Ni <ray.ni@intel.com>
-rw-r--r-- | IntelSiliconPkg/Feature/Capsule/MicrocodeUpdateDxe/MicrocodeUpdate.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/IntelSiliconPkg/Feature/Capsule/MicrocodeUpdateDxe/MicrocodeUpdate.c b/IntelSiliconPkg/Feature/Capsule/MicrocodeUpdateDxe/MicrocodeUpdate.c index 9b5757d..e45c7a8 100644 --- a/IntelSiliconPkg/Feature/Capsule/MicrocodeUpdateDxe/MicrocodeUpdate.c +++ b/IntelSiliconPkg/Feature/Capsule/MicrocodeUpdateDxe/MicrocodeUpdate.c @@ -390,6 +390,7 @@ VerifyMicrocode ( UINTN DataSize;
UINT32 CurrentRevision;
PROCESSOR_INFO *ProcessorInfo;
+ UINT32 InCompleteCheckSum32;
UINT32 CheckSum32;
UINTN ExtendedTableLength;
UINT32 ExtendedTableCount;
@@ -488,6 +489,10 @@ VerifyMicrocode ( }
return EFI_VOLUME_CORRUPTED;
}
+ InCompleteCheckSum32 = CheckSum32;
+ InCompleteCheckSum32 -= MicrocodeEntryPoint->ProcessorSignature.Uint32;
+ InCompleteCheckSum32 -= MicrocodeEntryPoint->ProcessorFlags;
+ InCompleteCheckSum32 -= MicrocodeEntryPoint->Checksum;
//
// Check ProcessorSignature/ProcessorFlags
@@ -522,7 +527,10 @@ VerifyMicrocode ( } else {
ExtendedTable = (CPU_MICROCODE_EXTENDED_TABLE *)(ExtendedTableHeader + 1);
for (Index = 0; Index < ExtendedTableCount; Index++) {
- CheckSum32 = CalculateSum32((UINT32 *)ExtendedTable, sizeof(CPU_MICROCODE_EXTENDED_TABLE));
+ CheckSum32 = InCompleteCheckSum32;
+ CheckSum32 += ExtendedTable->ProcessorSignature.Uint32;
+ CheckSum32 += ExtendedTable->ProcessorFlag;
+ CheckSum32 += ExtendedTable->Checksum;
if (CheckSum32 != 0) {
DEBUG((DEBUG_ERROR, "VerifyMicrocode - The checksum for ExtendedTable entry with index 0x%x is incorrect\n", Index));
} else {
|