diff options
author | Hao Wu <hao.a.wu@intel.com> | 2018-01-25 10:10:46 +0800 |
---|---|---|
committer | Hao Wu <hao.a.wu@intel.com> | 2018-02-02 11:36:10 +0800 |
commit | 2ad34f65af46b825b4fbf0d492e22df89207516c (patch) | |
tree | 606bb0b3373740ed53728a9e37f22119c4d8d4bc | |
parent | 693877f8e593e51f38e67108c4db98e56f68e8d8 (diff) | |
download | edk2-2ad34f65af46b825b4fbf0d492e22df89207516c.tar.gz edk2-2ad34f65af46b825b4fbf0d492e22df89207516c.tar.bz2 edk2-2ad34f65af46b825b4fbf0d492e22df89207516c.zip |
IntelSiliconPkg/MicrocodeUpdateDxe: Refine debug messages
Refine the debug messages during the verification of microcode to make
them more clear.
Cc: Jiewen Yao <jiewen.yao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Hao Wu <hao.a.wu@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
-rw-r--r-- | IntelSiliconPkg/Feature/Capsule/MicrocodeUpdateDxe/MicrocodeUpdate.c | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/IntelSiliconPkg/Feature/Capsule/MicrocodeUpdateDxe/MicrocodeUpdate.c b/IntelSiliconPkg/Feature/Capsule/MicrocodeUpdateDxe/MicrocodeUpdate.c index 65729e30a0..2cb0adbc44 100644 --- a/IntelSiliconPkg/Feature/Capsule/MicrocodeUpdateDxe/MicrocodeUpdate.c +++ b/IntelSiliconPkg/Feature/Capsule/MicrocodeUpdateDxe/MicrocodeUpdate.c @@ -445,7 +445,7 @@ VerifyMicrocode ( return EFI_VOLUME_CORRUPTED;
}
if (TotalSize != ImageSize) {
- DEBUG((DEBUG_ERROR, "VerifyMicrocode - fail on TotalSize\n"));
+ DEBUG((DEBUG_ERROR, "VerifyMicrocode - TotalSize not equal to ImageSize\n"));
*LastAttemptStatus = LAST_ATTEMPT_STATUS_ERROR_INVALID_FORMAT;
if (AbortReason != NULL) {
*AbortReason = AllocateCopyPool(sizeof(L"InvalidTotalSize"), L"InvalidTotalSize");
@@ -507,16 +507,25 @@ VerifyMicrocode ( //
if ((ExtendedTableLength > sizeof(CPU_MICROCODE_EXTENDED_TABLE_HEADER)) && ((ExtendedTableLength & 0x3) == 0)) {
CheckSum32 = CalculateSum32((UINT32 *)ExtendedTableHeader, ExtendedTableLength);
- if (CheckSum32 == 0) {
+ if (CheckSum32 != 0) {
+ //
+ // Checksum incorrect
+ //
+ DEBUG((DEBUG_ERROR, "VerifyMicrocode - The checksum for extended table is incorrect\n"));
+ } else {
//
// Checksum correct
//
ExtendedTableCount = ExtendedTableHeader->ExtendedSignatureCount;
- if (ExtendedTableCount <= (ExtendedTableLength - sizeof(CPU_MICROCODE_EXTENDED_TABLE_HEADER)) / sizeof(CPU_MICROCODE_EXTENDED_TABLE)) {
+ if (ExtendedTableCount > (ExtendedTableLength - sizeof(CPU_MICROCODE_EXTENDED_TABLE_HEADER)) / sizeof(CPU_MICROCODE_EXTENDED_TABLE)) {
+ DEBUG((DEBUG_ERROR, "VerifyMicrocode - ExtendedTableCount too big\n"));
+ } else {
ExtendedTable = (CPU_MICROCODE_EXTENDED_TABLE *)(ExtendedTableHeader + 1);
for (Index = 0; Index < ExtendedTableCount; Index++) {
CheckSum32 = CalculateSum32((UINT32 *)ExtendedTable, sizeof(CPU_MICROCODE_EXTENDED_TABLE));
- if (CheckSum32 == 0) {
+ if (CheckSum32 != 0) {
+ DEBUG((DEBUG_ERROR, "VerifyMicrocode - The checksum for ExtendedTable entry with index 0x%x is incorrect\n", Index));
+ } else {
//
// Verify Header
//
@@ -537,7 +546,7 @@ VerifyMicrocode ( }
if (!CorrectMicrocode) {
if (TryLoad) {
- DEBUG((DEBUG_ERROR, "VerifyMicrocode - fail on CurrentProcessorSignature/ProcessorFlags\n"));
+ DEBUG((DEBUG_ERROR, "VerifyMicrocode - fail on Current ProcessorSignature/ProcessorFlags\n"));
}
*LastAttemptStatus = LAST_ATTEMPT_STATUS_ERROR_INCORRECT_VERSION;
if (AbortReason != NULL) {
|