summaryrefslogtreecommitdiffstats
path: root/IntelSiliconPkg
diff options
context:
space:
mode:
authorHao Wu <hao.a.wu@intel.com>2018-01-25 10:10:46 +0800
committerHao Wu <hao.a.wu@intel.com>2018-02-02 11:38:12 +0800
commitec37c40e5f8716e182a5c66c15695c1401c60aa8 (patch)
tree5ead744171d981b3764c2083c672cf890c88e60d /IntelSiliconPkg
parent4fa13b6957d61f9463734c5d61256a06f721d887 (diff)
downloadedk2-ec37c40e5f8716e182a5c66c15695c1401c60aa8.tar.gz
edk2-ec37c40e5f8716e182a5c66c15695c1401c60aa8.tar.bz2
edk2-ec37c40e5f8716e182a5c66c15695c1401c60aa8.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> (cherry picked from commit 2ad34f65af46b825b4fbf0d492e22df89207516c)
Diffstat (limited to 'IntelSiliconPkg')
-rw-r--r--IntelSiliconPkg/Feature/Capsule/MicrocodeUpdateDxe/MicrocodeUpdate.c19
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) {