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.31; helo=mga06.intel.com; envelope-from=ray.ni@intel.com; receiver=edk2-devel@lists.01.org Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) (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 5263E201B045D for ; Tue, 19 Feb 2019 01:38:35 -0800 (PST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 19 Feb 2019 01:38:34 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.58,387,1544515200"; d="scan'208";a="117304696" Received: from fmsmsx105.amr.corp.intel.com ([10.18.124.203]) by orsmga006.jf.intel.com with ESMTP; 19 Feb 2019 01:38:34 -0800 Received: from fmsmsx101.amr.corp.intel.com (10.18.124.199) by FMSMSX105.amr.corp.intel.com (10.18.124.203) with Microsoft SMTP Server (TLS) id 14.3.408.0; Tue, 19 Feb 2019 01:38:34 -0800 Received: from shsmsx107.ccr.corp.intel.com (10.239.4.96) by fmsmsx101.amr.corp.intel.com (10.18.124.199) with Microsoft SMTP Server (TLS) id 14.3.408.0; Tue, 19 Feb 2019 01:38:33 -0800 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.102]) by SHSMSX107.ccr.corp.intel.com ([169.254.9.162]) with mapi id 14.03.0415.000; Tue, 19 Feb 2019 17:38:32 +0800 From: "Ni, Ray" To: "Zhang, Shenglei" , "edk2-devel@lists.01.org" Thread-Topic: [PATCH v2] IntelSiliconPkg/MicrocodeUpdateDxe: Error message enhancement Thread-Index: AQHUyCizx2VsYtkD+kC+zsphc/A5DqXm3VCw Date: Tue, 19 Feb 2019 09:38:31 +0000 Message-ID: <734D49CCEBEEF84792F5B80ED585239D5C025364@SHSMSX104.ccr.corp.intel.com> References: <20190219075644.20320-1-shenglei.zhang@intel.com> In-Reply-To: <20190219075644.20320-1-shenglei.zhang@intel.com> Accept-Language: en-US, zh-CN X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [PATCH v2] IntelSiliconPkg/MicrocodeUpdateDxe: Error message enhancement X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Feb 2019 09:38:35 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable > -----Original Message----- > From: Zhang, Shenglei > Sent: Tuesday, February 19, 2019 3:57 PM > To: edk2-devel@lists.01.org > Cc: Ni, Ray ; Chaganty, Rangasai V > > Subject: [PATCH v2] IntelSiliconPkg/MicrocodeUpdateDxe: Error message > enhancement >=20 > The error message of ExtendedTableCount is not clear. Add the count > number into the debug message. > https://bugzilla.tianocore.org/show_bug.cgi?id=3D1500 >=20 > v2: Change the judgment condition to return error message when > ExtendedTableCount is not equal to target value. >=20 > Cc: Ray Ni > Cc: Rangasai V Chaganty > Contributed-under: TianoCore Contribution Agreement 1.1 > Signed-off-by: Shenglei Zhang > --- > .../Feature/Capsule/MicrocodeUpdateDxe/MicrocodeUpdate.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) >=20 > diff --git > a/IntelSiliconPkg/Feature/Capsule/MicrocodeUpdateDxe/MicrocodeUpdate > .c > b/IntelSiliconPkg/Feature/Capsule/MicrocodeUpdateDxe/MicrocodeUpdate > .c > index 9098712c2f..037b2433a6 100644 > --- > a/IntelSiliconPkg/Feature/Capsule/MicrocodeUpdateDxe/MicrocodeUpdate > .c > +++ > b/IntelSiliconPkg/Feature/Capsule/MicrocodeUpdateDxe/MicrocodeUpdate > +++ .c > @@ -517,8 +517,8 @@ VerifyMicrocode ( > // Checksum correct > // > ExtendedTableCount =3D ExtendedTableHeader- > >ExtendedSignatureCount; > - if (ExtendedTableCount > (ExtendedTableLength - > sizeof(CPU_MICROCODE_EXTENDED_TABLE_HEADER)) / > sizeof(CPU_MICROCODE_EXTENDED_TABLE)) { > - DEBUG((DEBUG_ERROR, "VerifyMicrocode - ExtendedTableCount to= o > big\n")); > + if (ExtendedTableCount !=3D (ExtendedTableLength - > sizeof(CPU_MICROCODE_EXTENDED_TABLE_HEADER)) / > sizeof(CPU_MICROCODE_EXTENDED_TABLE)) { > + DEBUG((DEBUG_ERROR, "VerifyMicrocode - ExtendedTableCount > + %d is incorrect\n", ExtendedTableCount)); I am not sure if changing ">" to "!=3D" is ok here. Because the total size is multiple of 1024, ExtendedTableLength calculated = from the total length may contain padding bytes. The original ">" is ok because it makes sure the extended table header does= n't declare more entries than the ExtendedTableLength can cover. But ExtendedTableLength may be bigger. So I am wondering this change may cause some originally good uCode be denie= d. > } else { > ExtendedTable =3D (CPU_MICROCODE_EXTENDED_TABLE > *)(ExtendedTableHeader + 1); > for (Index =3D 0; Index < ExtendedTableCount; Index++) { > -- > 2.18.0.windows.1