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.65; helo=mga03.intel.com; envelope-from=ray.ni@intel.com; receiver=edk2-devel@lists.01.org Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) (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 68A6D211BD619 for ; Fri, 22 Feb 2019 01:47:30 -0800 (PST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 22 Feb 2019 01:47:29 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.58,399,1544515200"; d="scan'208";a="140735087" Received: from fmsmsx104.amr.corp.intel.com ([10.18.124.202]) by orsmga001.jf.intel.com with ESMTP; 22 Feb 2019 01:47:29 -0800 Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by fmsmsx104.amr.corp.intel.com (10.18.124.202) with Microsoft SMTP Server (TLS) id 14.3.408.0; Fri, 22 Feb 2019 01:47:28 -0800 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.102]) by SHSMSX151.ccr.corp.intel.com ([169.254.3.172]) with mapi id 14.03.0415.000; Fri, 22 Feb 2019 17:47:12 +0800 From: "Ni, Ray" To: "Chen, Chen A" , "edk2-devel@lists.01.org" Thread-Topic: [edk2] [PATCH] IntelSiliconPkg/MicrocodeUpdate: Fix incorrect checksum issue Thread-Index: AQHUykheC54mYraInkyd2bTa3vCXG6XrkoSg Date: Fri, 22 Feb 2019 09:47:10 +0000 Deferred-Delivery: Fri, 22 Feb 2019 09:47:00 +0000 Message-ID: <734D49CCEBEEF84792F5B80ED585239D5C02CB3A@SHSMSX104.ccr.corp.intel.com> References: <20190222004835.13780-1-chen.a.chen@intel.com> In-Reply-To: <20190222004835.13780-1-chen.a.chen@intel.com> Accept-Language: en-US, zh-CN X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiYmQyMmQ2YmItNTM2Ni00YjViLTkwYmYtYmE1MmQxNjRlYWQzIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiXC84REk5MjV1M1dJcVNmK1p2cHlreGR2YWZUQmpYKzJuWDBRaFVqRm02WWNQRlFtUUFKSUpveXBDK21sNnFlbjQifQ== x-ctpclassification: CTP_NT dlp-product: dlpe-windows dlp-version: 11.0.400.15 dlp-reaction: no-action x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [PATCH] IntelSiliconPkg/MicrocodeUpdate: Fix incorrect checksum issue 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: Fri, 22 Feb 2019 09:47:30 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Ray Ni > -----Original Message----- > From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of Ch= en > A Chen > Sent: Friday, February 22, 2019 8:49 AM > To: edk2-devel@lists.01.org > Subject: [edk2] [PATCH] IntelSiliconPkg/MicrocodeUpdate: Fix incorrect > checksum issue >=20 > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D1020 >=20 > The same issue has fixed in UefiCpuPkg/Microcode.c file. > Please reference b6f67b4d58b81f12f63f5f8c94cf8af3600297ab > to get more detail information. >=20 > Contributed-under: TianoCore Contribution Agreement 1.1 > Signed-off-by: Chen A Chen > Cc: Ray Ni > Cc: Rangasai V Chaganty > --- > .../Feature/Capsule/MicrocodeUpdateDxe/MicrocodeUpdate.c | 10 > +++++++++- > 1 file changed, 9 insertions(+), 1 deletion(-) >=20 > diff --git > a/IntelSiliconPkg/Feature/Capsule/MicrocodeUpdateDxe/MicrocodeUpdate.c > b/IntelSiliconPkg/Feature/Capsule/MicrocodeUpdateDxe/MicrocodeUpdate.c > index 9b5757da71..e45c7a8def 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 =3D CheckSum32; > + InCompleteCheckSum32 -=3D MicrocodeEntryPoint->ProcessorSignature.Uint= 32; > + InCompleteCheckSum32 -=3D MicrocodeEntryPoint->ProcessorFlags; > + InCompleteCheckSum32 -=3D MicrocodeEntryPoint->Checksum; >=20 > // > // Check ProcessorSignature/ProcessorFlags > @@ -522,7 +527,10 @@ VerifyMicrocode ( > } 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)); > + CheckSum32 =3D InCompleteCheckSum32; > + CheckSum32 +=3D ExtendedTable->ProcessorSignature.Uint32; > + CheckSum32 +=3D ExtendedTable->ProcessorFlag; > + CheckSum32 +=3D ExtendedTable->Checksum; > if (CheckSum32 !=3D 0) { > DEBUG((DEBUG_ERROR, "VerifyMicrocode - The checksum for > ExtendedTable entry with index 0x%x is incorrect\n", Index)); > } else { > -- > 2.16.2.windows.1 >=20 > _______________________________________________ > edk2-devel mailing list > edk2-devel@lists.01.org > https://lists.01.org/mailman/listinfo/edk2-devel