From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from atlmailgw2.ami.com (atlmailgw2.ami.com [63.147.10.42]) by mx.groups.io with SMTP id smtpd.web11.1279.1589839832817966295 for ; Mon, 18 May 2020 15:10:33 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: ami.com, ip: 63.147.10.42, mailfrom: oleksiyy@ami.com) X-AuditID: ac10606f-05fff70000001b62-e2-5ec307d59f4d 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 atlmailgw2.ami.com (Symantec Messaging Gateway) with SMTP id 7D.1C.07010.5D703CE5; Mon, 18 May 2020 18:10:29 -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; Mon, 18 May 2020 18:09:31 -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: [PATCH V7 5/6] MdeModulePkg: Add FMP Capsule Image Header extension Thread-Topic: [PATCH V7 5/6] MdeModulePkg: Add FMP Capsule Image Header extension Thread-Index: AQHWKjF/dqilD20i5USi/pEqUgh6BKio7oUAgAV9s2A= Date: Mon, 18 May 2020 22:09:30 +0000 Message-ID: <6BD875C24FFE2A4E8D6EFC142C67836F03FFFFA5E6@atlms1.us.megatrends.com> References: <20200514205145.36956-1-oleksiyy@ami.com> <20200514205145.36956-6-oleksiyy@ami.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+NgFlrBKsWRmVeSWpSXmKPExsWyRiBhhu5V9sNxBm/m2VjMf1tt0T5hNpvF 1Vu/mCzmfZvBarHuo4fFinsb2C06Ov4xWeza85DZgcNj+/cLjB6L97xkCmCKamC0SczLyy9J LElVSEktTrZVCijKLEtMrlRSyEyxVTJUUijISUxOzU3NK7FVSiwoSM1LUbLjUsAANkBlmXkK qXnJ+SmZeem2Sp7B/roWFqaWuoZKdiEZqQqZeWn5RbmJJZn5eQrJ+XklQNWpKUBRhYRuzoxP s5ewF2y2rdi9bAJbA+MUoy5GTg4JAROJrzNbWLsYuTiEBHYxSXw5+pwJwjnMKDF7xkoWkCo2 AU2JN+degNkiApESCz4fYwOxmQWmM0m8WlcJYgsLBEk0n+9lgqgJllj7cz0zhG0lcefqLbB6 FgFViRe/N7CC2LwCgRILvn9nh1i2hVHi8+PtYEWcArESF+ZuYQexGQXEJL6fWsMEsUxc4taT +UwQZwtILNlznhnCFpV4+fgfK4StKPH0wwt2iHodiQW7P0Edqi2xbOFrZojFghInZz5hmcAo OgvJ2FlIWmYhaZmFpGUBI8sqRqHEkpzcxMyc9HIjvcTcTL3k/NxNjJBkkr+D8eNH80OMTByM hxglOJiVRHgnvDgUJ8SbklhZlVqUH19UmpNafIjRCRgSE5mluEFRBIzzeGMDAylRGMfQxMzE 3Mjc0NLE3NhYSZx30to1cUIC6cC0k52aWpBaBDOEiYNTqoExs+VUyMRj9cyG++buWTqnZP5l bjeJ3HMmSxX2CyQu3mlrHb3EsZP5tMfekHNmK6Iak9e0xRipHun+qHFIbqXYN7VIrx7HsoXv /D9oeF13vht55F/mtsf5kmJ3/irZvN/8se29QQPLkU2MJS9fhk6ur5qw6VfGQgm+6PmqUrWN m8w3Tn/8cUuUEktxRqKhFnNRcSIAgXUFATsDAAA= Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hi Liming. >>From Your comment here I understand that you are waiting for somebody else h= ere. But looking through your comments - I agree with comment 1, but think other= 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 exten= sion Oleksiy: When create PR, I find some issue in this patch. The same issue is also 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, Cha= o B ; Felixp@ami.com; > oleksiyy@ami.com > Subject: [PATCH V7 5/6] MdeModulePkg: Add FMP Capsule Image Header extensi= on > > Add bitmask to structure which gives a binary-inspectable mechanism to > determine if a capsule contains an authentication section or depex section= . > (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/MdeModule= Pkg/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->UpdateIma= geIndex); > Print(L" UpdateImageSize - 0x%x\n", FmpImageHeader->UpdateIma= geSize); > Print(L" UpdateVendorCodeSize - 0x%x\n", FmpImageHeader->UpdateVen= dorCodeSize); > - if (FmpImageHeader->Version >=3D EFI_FIRMWARE_MANAGEMENT_CAPSULE_IMAG= E_HEADER_INIT_VERSION) { > - Print(L" UpdateHardwareInstance - 0x%lx\n", FmpImageHeader->Update= HardwareInstance); > + if (ImageHeader->Version >=3D 1) { > + DEBUG((DEBUG_VERBOSE, " UpdateHardwareInstance - 0x%lx\n", ImageHe= ader->UpdateHardwareInstance)); > + if (ImageHeader->Version >=3D EFI_FIRMWARE_MANAGEMENT_CAPSULE_IMAGE= _HEADER_INIT_VERSION) { > + DEBUG((DEBUG_VERBOSE, " ImageCapsuleSupport - 0x%lx\n", Image= Header->ImageCapsuleSupport)); > + } > } > } [Liming] Here should be FmpImageHeader > } > diff --git a/MdeModulePkg/Library/DxeCapsuleLibFmp/DxeCapsuleLib.c b/MdeMo= dulePkg/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", ImageHe= ader->Version)); > return EFI_INVALID_PARAMETER; > } > - if (ImageHeader->Version < EFI_FIRMWARE_MANAGEMENT_CAPSULE_IMAGE_HEAD= ER_INIT_VERSION) { > + if (ImageHeader->Version =3D=3D 1) { > FmpImageHeaderSize =3D OFFSET_OF(EFI_FIRMWARE_MANAGEMENT_CAPSULE_IM= AGE_HEADER, UpdateHardwareInstance); > + } else { > + FmpImageHeaderSize =3D OFFSET_OF(EFI_FIRMWARE_MANAGEMENT_CAPSULE_IM= AGE_HEADER, ImageCapsuleSupport); > } [Liming] Here should have one condition for ImageHeader->Version =3D=3D 2. > if (FmpImageSize < FmpImageHeaderSize) { > DEBUG((DEBUG_ERROR, "FmpImageSize(0x%lx) < FmpImageHeaderSize(0x%x)= \n", FmpImageSize, FmpImageHeaderSize)); > @@ -519,8 +521,11 @@ DumpFmpCapsule ( > DEBUG((DEBUG_VERBOSE, " UpdateImageIndex - 0x%x\n", ImageHea= der->UpdateImageIndex)); > DEBUG((DEBUG_VERBOSE, " UpdateImageSize - 0x%x\n", ImageHea= der->UpdateImageSize)); > DEBUG((DEBUG_VERBOSE, " UpdateVendorCodeSize - 0x%x\n", ImageHea= der->UpdateVendorCodeSize)); > - if (ImageHeader->Version >=3D EFI_FIRMWARE_MANAGEMENT_CAPSULE_IMAGE_H= EADER_INIT_VERSION) { > - DEBUG((DEBUG_VERBOSE, " UpdateHardwareInstance - 0x%lx\n", Image= Header->UpdateHardwareInstance)); > + if (ImageHeader->Version >=3D 1) { [Liming] Here should be ImageHeader->Version >=3D 2. Thanks Liming > + DEBUG((DEBUG_INFO, "(UpdateHardwareInstance - 0x%x)", ImageHeader->= UpdateHardwareInstance)); > + if (ImageHeader->Version >=3D EFI_FIRMWARE_MANAGEMENT_CAPSULE_IMAGE= _HEADER_INIT_VERSION) { > + DEBUG((DEBUG_INFO, "(ImageCapsuleSupport - 0x%x)", ImageHeader->= 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_MANAGEMENT_CA= PSULE_IMAGE_HEADER, > UpdateHardwareInstance); > + if (ImageHeader->Version =3D=3D 1) { > + Image =3D (UINT8 *)ImageHeader + OFFSET_OF(EFI_FIRMWARE_MANAGEMENT_= CAPSULE_IMAGE_HEADER, > UpdateHardwareInstance); > + } else { > + Image =3D (UINT8 *)ImageHeader + OFFSET_OF(EFI_FIRMWARE_MANAGEMENT_= CAPSULE_IMAGE_HEADER, ImageCapsuleSupport); > + } > } > > if (ImageHeader->UpdateVendorCodeSize =3D=3D 0) { > @@ -945,6 +955,7 @@ SetFmpImageData ( > DEBUG((DEBUG_INFO, "ImageIndex - 0x%x ", ImageHeader->UpdateImageIndex)= ); > if (ImageHeader->Version >=3D EFI_FIRMWARE_MANAGEMENT_CAPSULE_IMAGE_HEA= DER_INIT_VERSION) { > DEBUG((DEBUG_INFO, "(UpdateHardwareInstance - 0x%x)", ImageHeader->Up= dateHardwareInstance)); > + DEBUG((DEBUG_INFO, "(ImageCapsuleSupport - 0x%x)", ImageHeader->Image= CapsuleSupport)); > } > DEBUG((DEBUG_INFO, "\n")); > > @@ -1239,7 +1250,10 @@ ProcessFmpCapsuleImage ( > ImageHeader =3D (EFI_FIRMWARE_MANAGEMENT_CAPSULE_IMAGE_HEADER *)((UI= NT8 *)FmpCapsuleHeader + > ItemOffsetList[Index]); > > UpdateHardwareInstance =3D 0; > - if (ImageHeader->Version >=3D EFI_FIRMWARE_MANAGEMENT_CAPSULE_IMAGE_H= EADER_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 propriet= ary to American Megatrends (AMI). This communication > is intended to be read only by the individual or entity to whom it is addr= essed or by their designee. If the reader of this message is > not the intended recipient, you are on notice that any distribution of thi= s 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 proprietar= y to American Megatrends (AMI). This communication is intended to be read o= nly 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 no= tice that any distribution of this message, in any form, is strictly prohibi= ted. Please promptly notify the sender by reply e-mail or by telephone at 7= 70-246-8600, and then delete or destroy all copies of the transmission.