From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=134.134.136.24; helo=mga09.intel.com; envelope-from=hao.a.wu@intel.com; receiver=edk2-devel@lists.01.org Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id A9226223648B8 for ; Thu, 1 Feb 2018 18:31:28 -0800 (PST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 01 Feb 2018 18:37:06 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.46,445,1511856000"; d="scan'208";a="14746057" Received: from fmsmsx108.amr.corp.intel.com ([10.18.124.206]) by fmsmga007.fm.intel.com with ESMTP; 01 Feb 2018 18:37:05 -0800 Received: from shsmsx102.ccr.corp.intel.com (10.239.4.154) by FMSMSX108.amr.corp.intel.com (10.18.124.206) with Microsoft SMTP Server (TLS) id 14.3.319.2; Thu, 1 Feb 2018 18:37:05 -0800 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.127]) by shsmsx102.ccr.corp.intel.com ([169.254.2.124]) with mapi id 14.03.0319.002; Fri, 2 Feb 2018 10:37:03 +0800 From: "Wu, Hao A" To: "Zeng, Star" , "edk2-devel@lists.01.org" CC: "Yao, Jiewen" Thread-Topic: [PATCH] IntelSiliconPkg/MicrocodeUpdateDxe: Refine debug messages Thread-Index: AQHTlYLdqEsGKVUODE+aUZs9QPBbK6OP5gAAgACMPVA= Date: Fri, 2 Feb 2018 02:37:02 +0000 Message-ID: References: <20180125021849.4572-1-hao.a.wu@intel.com> <0C09AFA07DD0434D9E2A0C6AEB0483103BA1ED8B@shsmsx102.ccr.corp.intel.com> In-Reply-To: <0C09AFA07DD0434D9E2A0C6AEB0483103BA1ED8B@shsmsx102.ccr.corp.intel.com> Accept-Language: zh-CN, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [PATCH] IntelSiliconPkg/MicrocodeUpdateDxe: Refine debug messages X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Feb 2018 02:31:29 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Sure, I will modify the messages before pushing the change. Best Regards, Hao Wu > -----Original Message----- > From: Zeng, Star > Sent: Friday, February 02, 2018 10:15 AM > To: Wu, Hao A; edk2-devel@lists.01.org > Cc: Yao, Jiewen; Zeng, Star > Subject: RE: [PATCH] IntelSiliconPkg/MicrocodeUpdateDxe: Refine debug > messages >=20 > Minor comments. >=20 > How about to update the error message like below? > + DEBUG((DEBUG_ERROR, "VerifyMicrocode - The extended checksum i= s > incorrect\n")); > -> > + DEBUG((DEBUG_ERROR, "VerifyMicrocode - The checksum for > extended table is incorrect\n")); >=20 > + DEBUG((DEBUG_ERROR, "VerifyMicrocode - Checksum is incor= rect > for ExtendedTable with index 0x%x\n", Index)); > -> > + DEBUG((DEBUG_ERROR, "VerifyMicrocode - The checksum for > ExtendedTable entry with index 0x%x is incorrect \n", Index)); >=20 > With the comments handled, Reviewed-by: Star Zeng >=20 >=20 > Thanks, > Star > -----Original Message----- > From: Wu, Hao A > Sent: Thursday, January 25, 2018 10:19 AM > To: edk2-devel@lists.01.org > Cc: Wu, Hao A ; Yao, Jiewen ; > Zeng, Star > Subject: [PATCH] IntelSiliconPkg/MicrocodeUpdateDxe: Refine debug message= s >=20 > Refine the debug messages during the verification of microcode to make > them more clear. >=20 > Cc: Jiewen Yao > Cc: Star Zeng > Contributed-under: TianoCore Contribution Agreement 1.1 > Signed-off-by: Hao Wu > --- > .../Capsule/MicrocodeUpdateDxe/MicrocodeUpdate.c | 21 > +++++++++++++++------ > 1 file changed, 15 insertions(+), 6 deletions(-) >=20 > diff --git > a/IntelSiliconPkg/Feature/Capsule/MicrocodeUpdateDxe/MicrocodeUpdate.c > b/IntelSiliconPkg/Feature/Capsule/MicrocodeUpdateDxe/MicrocodeUpdate.c > index b99221c969..6167e0b584 100644 > --- > a/IntelSiliconPkg/Feature/Capsule/MicrocodeUpdateDxe/MicrocodeUpdate.c > +++ > b/IntelSiliconPkg/Feature/Capsule/MicrocodeUpdateDxe/MicrocodeUpdate.c > @@ -8,7 +8,7 @@ >=20 > MicrocodeWrite() and VerifyMicrocode() will receive untrusted input an= d do > basic validation. >=20 > - Copyright (c) 2016 - 2017, Intel Corporation. All rights reserved.
> + Copyright (c) 2016 - 2018, Intel Corporation. All rights reserved.
> This program and the accompanying materials > are licensed and made available under the terms and conditions of the = BSD > License > which accompanies this distribution. The full text of the license may= be found > at > @@ -437,7 +437,7 @@ VerifyMicrocode ( > return EFI_VOLUME_CORRUPTED; > } > if (TotalSize !=3D ImageSize) { > - DEBUG((DEBUG_ERROR, "VerifyMicrocode - fail on TotalSize\n")); > + DEBUG((DEBUG_ERROR, "VerifyMicrocode - TotalSize not equal to > ImageSize\n")); > *LastAttemptStatus =3D LAST_ATTEMPT_STATUS_ERROR_INVALID_FORMAT; > if (AbortReason !=3D NULL) { > *AbortReason =3D AllocateCopyPool(sizeof(L"InvalidTotalSize"), > L"InvalidTotalSize"); > @@ -496,16 +496,25 @@ VerifyMicrocode ( > // > if ((ExtendedTableLength > > sizeof(CPU_MICROCODE_EXTENDED_TABLE_HEADER)) && > ((ExtendedTableLength & 0x3) =3D=3D 0)) { > CheckSum32 =3D CalculateSum32((UINT32 *)ExtendedTableHeader, > ExtendedTableLength); > - if (CheckSum32 =3D=3D 0) { > + if (CheckSum32 !=3D 0) { > + // > + // Checksum incorrect > + // > + DEBUG((DEBUG_ERROR, "VerifyMicrocode - The extended checksum i= s > incorrect\n")); > + } else { > // > // Checksum correct > // > ExtendedTableCount =3D ExtendedTableHeader->ExtendedSignatureC= ount; > - if (ExtendedTableCount <=3D (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 to= o > big\n")); > + } else { > ExtendedTable =3D (CPU_MICROCODE_EXTENDED_TABLE > *)(ExtendedTableHeader + 1); > for (Index =3D 0; Index < ExtendedTableCount; Index++) { > CheckSum32 =3D CalculateSum32((UINT32 *)ExtendedTable, > sizeof(CPU_MICROCODE_EXTENDED_TABLE)); > - if (CheckSum32 =3D=3D 0) { > + if (CheckSum32 !=3D 0) { > + DEBUG((DEBUG_ERROR, "VerifyMicrocode - Checksum is incor= rect > for ExtendedTable with index 0x%x\n", Index)); > + } else { > // > // Verify Header > // > @@ -526,7 +535,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 =3D > LAST_ATTEMPT_STATUS_ERROR_INCORRECT_VERSION; > if (AbortReason !=3D NULL) { > -- > 2.12.0.windows.1