From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from atlmailgw1.ami.com (atlmailgw1.ami.com [63.147.10.40]) by mx.groups.io with SMTP id smtpd.web11.14262.1589902992612578628 for ; Tue, 19 May 2020 08:43:13 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: ami.com, ip: 63.147.10.40, mailfrom: oleksiyy@ami.com) X-AuditID: ac1060b2-0f7ff700000018d4-c4-5ec3fe8ec46c Received: from atlms2.us.megatrends.com (atlms2.us.megatrends.com [172.16.96.152]) (using TLS with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (Client did not present a certificate) by atlmailgw1.ami.com (Symantec Messaging Gateway) with SMTP id 85.7E.06356.F8EF3CE5; Tue, 19 May 2020 11:43:11 -0400 (EDT) Received: from ATLMS1.us.megatrends.com ([fe80::8c55:daf0:ef05:5605]) by atlms2.us.megatrends.com ([fe80::29dc:a91e:ea0c:cdeb%12]) with mapi id 14.03.0468.000; Tue, 19 May 2020 11:42:09 -0400 From: "Oleksiy Yakovlev" To: "Gao, Liming" , "devel@edk2.groups.io" CC: "Kinney, Michael D" , "Wang, Jian J" , "Wu, Hao A" , "Yao, Jiewen" , "Zhang, Chao B" , "Felix Polyudov" , "Xu, Wei6" Subject: Re: [edk2-devel] [PATCH V7 5/6] MdeModulePkg: Add FMP Capsule Image Header extension Thread-Topic: [edk2-devel] [PATCH V7 5/6] MdeModulePkg: Add FMP Capsule Image Header extension Thread-Index: AQHWKjF/dqilD20i5USi/pEqUgh6BKio7oUAgAV9s2CAAG5xgIAAuJLw Date: Tue, 19 May 2020 15:42:09 +0000 Message-ID: <6BD875C24FFE2A4E8D6EFC142C67836F03FFFFA653@atlms1.us.megatrends.com> References: <20200514205145.36956-1-oleksiyy@ami.com> <20200514205145.36956-6-oleksiyy@ami.com> <6BD875C24FFE2A4E8D6EFC142C67836F03FFFFA5E6@atlms1.us.megatrends.com> In-Reply-To: Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [172.16.97.158] MIME-Version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrOKsWRmVeSWpSXmKPExsWyRiBhhm7/v8NxBv1P5Szmv622aJ8wm83i 6q1fTBbzvs1gtVj30cNixb0N7BYdHf+YLHbtecjswOGx/fsFRo/Fe14yBTBFNTDaJObl5Zck lqQqpKQWJ9sqBRRlliUmVyopZKbYKhkqKRTkJCan5qbmldgqJRYUpOalKNlxKWAAG6CyzDyF 1Lzk/JTMvHRbJc9gf10LC1NLXUMlu5CMVIXMvLT8otzEksz8PIXk/LwSoOrUFKCoQkI3Z0bb tM0sBceDKjZt3czewNjq3MXIySEhYCKxaGkHexcjF4eQwC4mic/L30M5hxklPvz8wQJSxSag KfHm3AswW0QgUmLB52NsIDazwHQmiVfrKrsYOTiEBeIlOu5ZQJQkSGyd3coKYbtJrN64EMxm EVCV+L7vGBOIzSsQKDFh+XlWiF3nmSTa7sxjBklwCsRKTN9/gR3EZhQQk/h+ag0TxC5xiVtP 5jNBXC0gsWTPeWYIW1Ti5eN/rBC2osTTDy/YIep1JBbs/gR1p7bEsoWvmSEWC0qcnPmEZQKj 6CwkY2chaZmFpGUWkpYFjCyrGIUSS3JyEzNz0ssN9RJzM/WS83M3MUJSyaYdjC0XzQ8xMnEw HmKU4GBWEuGd8OJQnBBvSmJlVWpRfnxRaU5q8SFGJ2BITGSW4gbFEDDK440NDKREYRxDEzMT cyNzQ0sTc2NjJXHeyWvXxAkJpAOTTnZqakFqEcwQJg5OqQbG+C1rmbf0c91eeal9q9uDSONb U9ZOlku/1/Py49RbtydxsTLFpN8RmPf8+I27AhF7eTWemF8N/q2qclvbOtaG19Zl4S650oui v6uef66/47I4hEPq/60el0nf3n5tEJTd3Z9U8maD1St3j0cy58u8jtqeKM19NONSfpjuhiPz K/dUvfE7x76kQ4mlOCPRUIu5qDgRAH/faCw6AwAA Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hi Liming. 2 patches reviewed. Regards, Oleksiy. -----Original Message----- From: Gao, Liming [mailto:liming.gao@intel.com] Sent: Monday, May 18, 2020 8:40 PM To: devel@edk2.groups.io; Oleksiy Yakovlev Cc: Kinney, Michael D; Wang, Jian J; Wu, Hao A; Yao, Jiewen; Zhang, Chao B= ; Felix Polyudov; Xu, Wei6 Subject: RE: [edk2-devel] [PATCH V7 5/6] MdeModulePkg: Add FMP Capsule Ima= ge Header extension Oleksiy: Wei has sent the updated patches for the changes in MdeModulePkg and Sig= nedCapsulePkg. https://edk2.groups.io/g/devel/message/59652 He bases on your patch and does some updated. Please help review whether= it is ok to you. You don't need to submit this patch set again. Thanks Liming > -----Original Message----- > From: devel@edk2.groups.io On Behalf Of Oleksiy Y= akovlev > Sent: Tuesday, May 19, 2020 6:10 AM > To: Gao, Liming ; devel@edk2.groups.io > Cc: Kinney, Michael D ; Wang, Jian J ; Wu, Hao A ; Yao, > Jiewen ; Zhang, Chao B ; F= elix Polyudov ; Xu, Wei6 > > Subject: Re: [edk2-devel] [PATCH V7 5/6] MdeModulePkg: Add FMP Capsule I= mage Header extension > > Hi Liming. > > From Your comment here I understand that you are waiting for somebody el= se here. > But looking through your comments - I agree with comment 1, but think ot= her two are incorrect. > So do I need to resubmit 2.8a series? > > Regards, Oleksiy. > > > > -----Original Message----- > From: Gao, Liming [mailto:liming.gao@intel.com] > Sent: Friday, May 15, 2020 2:13 AM > To: Oleksiy Yakovlev; devel@edk2.groups.io > Cc: Kinney, Michael D; Wang, Jian J; Wu, Hao A; Yao, Jiewen; Zhang, Chao= B; Felix Polyudov; Xu, Wei6 > Subject: RE: [PATCH V7 5/6] MdeModulePkg: Add FMP Capsule Image Header e= xtension > > Oleksiy: > When create PR, I find some issue in this patch. The same issue is als= o in SignedCapsulePkg. Because original comments from Xu > Wei6, I would like Wei to provide the updated patch for MdeModulePkg and= SignedCapsulePkg. > > Thanks > Liming > > -----Original Message----- > > From: Oleksiy Yakovlev > > Sent: Friday, May 15, 2020 4:52 AM > > To: devel@edk2.groups.io > > Cc: Gao, Liming ; Kinney, Michael D ; Wang, Jian J ; > Wu, > > Hao A ; Yao, Jiewen ; Zhang,= Chao B ; Felixp@ami.com; > > oleksiyy@ami.com > > Subject: [PATCH V7 5/6] MdeModulePkg: Add FMP Capsule Image Header ext= ension > > > > Add bitmask to structure which gives a binary-inspectable mechanism to > > determine if a capsule contains an authentication section or depex sec= tion. > > (UEFI 2.8 errata a, mantis 2026) > > > > Signed-off-by: Oleksiy Yakovlev > > > > Reviewed-by: Wei6 Xu > > --- > > MdeModulePkg/Application/CapsuleApp/CapsuleDump.c | 7 ++++-- > > .../Library/DxeCapsuleLibFmp/DxeCapsuleLib.c | 26 +++++++++++++= ++++----- > > 2 files changed, 25 insertions(+), 8 deletions(-) > > > > diff --git a/MdeModulePkg/Application/CapsuleApp/CapsuleDump.c b/MdeMo= dulePkg/Application/CapsuleApp/CapsuleDump.c > > index 7e3e072..057bfa8 100644 > > --- a/MdeModulePkg/Application/CapsuleApp/CapsuleDump.c > > +++ b/MdeModulePkg/Application/CapsuleApp/CapsuleDump.c > > @@ -96,8 +96,11 @@ DumpFmpCapsule ( > > Print(L" UpdateImageIndex - 0x%x\n", FmpImageHeader->Updat= eImageIndex); > > Print(L" UpdateImageSize - 0x%x\n", FmpImageHeader->Updat= eImageSize); > > Print(L" UpdateVendorCodeSize - 0x%x\n", FmpImageHeader->Updat= eVendorCodeSize); > > - if (FmpImageHeader->Version >=3D EFI_FIRMWARE_MANAGEMENT_CAPSULE_= IMAGE_HEADER_INIT_VERSION) { > > - Print(L" UpdateHardwareInstance - 0x%lx\n", FmpImageHeader->Up= dateHardwareInstance); > > + if (ImageHeader->Version >=3D 1) { > > + DEBUG((DEBUG_VERBOSE, " UpdateHardwareInstance - 0x%lx\n", Ima= geHeader->UpdateHardwareInstance)); > > + if (ImageHeader->Version >=3D EFI_FIRMWARE_MANAGEMENT_CAPSULE_I= MAGE_HEADER_INIT_VERSION) { > > + DEBUG((DEBUG_VERBOSE, " ImageCapsuleSupport - 0x%lx\n", I= mageHeader->ImageCapsuleSupport)); > > + } > > } > > } > [Liming] Here should be FmpImageHeader > > > } > > diff --git a/MdeModulePkg/Library/DxeCapsuleLibFmp/DxeCapsuleLib.c > b/MdeModulePkg/Library/DxeCapsuleLibFmp/DxeCapsuleLib.c > > index 5dda561..68cece6 100644 > > --- a/MdeModulePkg/Library/DxeCapsuleLibFmp/DxeCapsuleLib.c > > +++ b/MdeModulePkg/Library/DxeCapsuleLibFmp/DxeCapsuleLib.c > > @@ -285,8 +285,10 @@ ValidateFmpCapsule ( > > DEBUG((DEBUG_ERROR, "ImageHeader->Version(0x%x) Unknown\n", Ima= geHeader->Version)); > > return EFI_INVALID_PARAMETER; > > } > > - if (ImageHeader->Version < EFI_FIRMWARE_MANAGEMENT_CAPSULE_IMAGE_= HEADER_INIT_VERSION) { > > + if (ImageHeader->Version =3D=3D 1) { > > FmpImageHeaderSize =3D OFFSET_OF(EFI_FIRMWARE_MANAGEMENT_CAPSUL= E_IMAGE_HEADER, UpdateHardwareInstance); > > + } else { > > + FmpImageHeaderSize =3D OFFSET_OF(EFI_FIRMWARE_MANAGEMENT_CAPSUL= E_IMAGE_HEADER, ImageCapsuleSupport); > > } > > [Liming] Here should have one condition for ImageHeader->Version =3D=3D = 2. > > > if (FmpImageSize < FmpImageHeaderSize) { > > DEBUG((DEBUG_ERROR, "FmpImageSize(0x%lx) < FmpImageHeaderSize(0= x%x)\n", FmpImageSize, FmpImageHeaderSize)); > > @@ -519,8 +521,11 @@ DumpFmpCapsule ( > > DEBUG((DEBUG_VERBOSE, " UpdateImageIndex - 0x%x\n", Imag= eHeader->UpdateImageIndex)); > > DEBUG((DEBUG_VERBOSE, " UpdateImageSize - 0x%x\n", Imag= eHeader->UpdateImageSize)); > > DEBUG((DEBUG_VERBOSE, " UpdateVendorCodeSize - 0x%x\n", Imag= eHeader->UpdateVendorCodeSize)); > > - if (ImageHeader->Version >=3D EFI_FIRMWARE_MANAGEMENT_CAPSULE_IMA= GE_HEADER_INIT_VERSION) { > > - DEBUG((DEBUG_VERBOSE, " UpdateHardwareInstance - 0x%lx\n", I= mageHeader->UpdateHardwareInstance)); > > + if (ImageHeader->Version >=3D 1) { > [Liming] Here should be ImageHeader->Version >=3D 2. > > Thanks > Liming > > + DEBUG((DEBUG_INFO, "(UpdateHardwareInstance - 0x%x)", ImageHead= er->UpdateHardwareInstance)); > > + if (ImageHeader->Version >=3D EFI_FIRMWARE_MANAGEMENT_CAPSULE_I= MAGE_HEADER_INIT_VERSION) { > > + DEBUG((DEBUG_INFO, "(ImageCapsuleSupport - 0x%x)", ImageHead= er->ImageCapsuleSupport)); > > + } > > } > > } > > } > > @@ -928,9 +933,14 @@ SetFmpImageData ( > > } else { > > // > > // If the EFI_FIRMWARE_MANAGEMENT_CAPSULE_IMAGE_HEADER is version= 1, > > - // Header should exclude UpdateHardwareInstance field > > + // Header should exclude UpdateHardwareInstance field, and > > + // ImageCapsuleSupport field if version is 2. > > // > > - Image =3D (UINT8 *)ImageHeader + OFFSET_OF(EFI_FIRMWARE_MANAGEMEN= T_CAPSULE_IMAGE_HEADER, > > UpdateHardwareInstance); > > + if (ImageHeader->Version =3D=3D 1) { > > + Image =3D (UINT8 *)ImageHeader + OFFSET_OF(EFI_FIRMWARE_MANAGEM= ENT_CAPSULE_IMAGE_HEADER, > > UpdateHardwareInstance); > > + } else { > > + Image =3D (UINT8 *)ImageHeader + OFFSET_OF(EFI_FIRMWARE_MANAGEM= ENT_CAPSULE_IMAGE_HEADER, > ImageCapsuleSupport); > > + } > > } > > > > if (ImageHeader->UpdateVendorCodeSize =3D=3D 0) { > > @@ -945,6 +955,7 @@ SetFmpImageData ( > > DEBUG((DEBUG_INFO, "ImageIndex - 0x%x ", ImageHeader->UpdateImageIn= dex)); > > if (ImageHeader->Version >=3D EFI_FIRMWARE_MANAGEMENT_CAPSULE_IMAGE= _HEADER_INIT_VERSION) { > > DEBUG((DEBUG_INFO, "(UpdateHardwareInstance - 0x%x)", ImageHeader= ->UpdateHardwareInstance)); > > + DEBUG((DEBUG_INFO, "(ImageCapsuleSupport - 0x%x)", ImageHeader->I= mageCapsuleSupport)); > > } > > DEBUG((DEBUG_INFO, "\n")); > > > > @@ -1239,7 +1250,10 @@ ProcessFmpCapsuleImage ( > > ImageHeader =3D (EFI_FIRMWARE_MANAGEMENT_CAPSULE_IMAGE_HEADER *)= ((UINT8 *)FmpCapsuleHeader + > > ItemOffsetList[Index]); > > > > UpdateHardwareInstance =3D 0; > > - if (ImageHeader->Version >=3D EFI_FIRMWARE_MANAGEMENT_CAPSULE_IMA= GE_HEADER_INIT_VERSION) { > > + /// > > + /// UpdateHardwareInstance field was added in Version 2 > > + /// > > + if (ImageHeader->Version >=3D 2) { > > UpdateHardwareInstance =3D ImageHeader->UpdateHardwareInstance; > > } > > > > -- > > 2.9.0.windows.1 > > > > > > Please consider the environment before printing this email. > > > > The information contained in this message may be confidential and prop= rietary to American Megatrends (AMI). This > communication > > is intended to be read only by the individual or entity to whom it is = addressed or by their designee. If the reader of this message is > > not the intended recipient, you are on notice that any distribution of= this message, in any form, is strictly prohibited. Please > > promptly notify the sender by reply e-mail or by telephone at 770-246-= 8600, and then delete or destroy all copies of the > transmission. > > Please consider the environment before printing this email. > > The information contained in this message may be confidential and propri= etary to American Megatrends (AMI). This communication > is intended to be read only by the individual or entity to whom it is ad= dressed or by their designee. If the reader of this message is > not the intended recipient, you are on notice that any distribution of t= his message, in any form, is strictly prohibited. Please > promptly notify the sender by reply e-mail or by telephone at 770-246-86= 00, and then delete or destroy all copies of the transmission. > >=20 Please consider the environment before printing this email. The information contained in this message may be confidential and propriet= ary to American Megatrends (AMI). This communication is intended to be rea= d only by the individual or entity to whom it is addressed or by their desi= gnee. If the reader of this message is not the intended recipient, you are = on notice that any distribution of this message, in any form, is strictly p= rohibited. Please promptly notify the sender by reply e-mail or by telepho= ne at 770-246-8600, and then delete or destroy all copies of the transmissi= on.