From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by mx.groups.io with SMTP id smtpd.web11.8363.1589523201733521827 for ; Thu, 14 May 2020 23:13:21 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@intel.onmicrosoft.com header.s=selector2-intel-onmicrosoft-com header.b=ZLxnaNKd; spf=pass (domain: intel.com, ip: 192.55.52.151, mailfrom: liming.gao@intel.com) IronPort-SDR: 1exoIoXO5bAVtnZ0DUoo9FLkyky561r1yQYEHzTDSCXPpEupfmPaODjtAKq/LoMt1Nm3NuR1Ft M2v0X4PqHZPA== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 May 2020 23:13:20 -0700 IronPort-SDR: KZJWOt8nDliwpbdZ1vwkR97FKs6GqspRCNCBaw9ssP3JkjHhfNAn9YWFmslSMCA8L8dACmNDrN L15JymaxoRWg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,394,1583222400"; d="scan'208";a="464614963" Received: from orsmsx105.amr.corp.intel.com ([10.22.225.132]) by fmsmga005.fm.intel.com with ESMTP; 14 May 2020 23:13:20 -0700 Received: from orsmsx162.amr.corp.intel.com (10.22.240.85) by ORSMSX105.amr.corp.intel.com (10.22.225.132) with Microsoft SMTP Server (TLS) id 14.3.439.0; Thu, 14 May 2020 23:13:20 -0700 Received: from ORSEDG001.ED.cps.intel.com (10.7.248.4) by ORSMSX162.amr.corp.intel.com (10.22.240.85) with Microsoft SMTP Server (TLS) id 14.3.439.0; Thu, 14 May 2020 23:13:20 -0700 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (104.47.59.177) by edgegateway.intel.com (134.134.137.100) with Microsoft SMTP Server (TLS) id 14.3.439.0; Thu, 14 May 2020 23:13:20 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=nR/7JgQ04supwUTOYdtjm80K4WCCkCSr4GWu7je4KwMf1QP38v69Jx7glHCrGtpm8ZIixIB9ltupfjYu5iYRiDutTAX0+06iR9bnga3eLP32i38RrqfvNL3brZG+ANIRnFDwmNnl4yAyd2l97c0U6HwsXguLGolXhOvwlvKzLgW3ITNICItKeRwnMdUiOkhDV/343OBaqOMl0SjYpNrSJ7/5lJLGacT5CDW/gXINjg7Jh4P58M//32LCN4QwSrSxhqnC4pBa71qfbL1NuNiOpS+KjOl42dxGalwAXPADQOrlylvVop21sYf1eyXQ/yFKvnYpR7Kv8jCg7JtNlHx81A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=XVOTXI52brkryRQJyiJCl18Dg0Y/fdyIn5ZBoopte60=; b=Mt0YUcChKNPjHRbaRBIF3nENGgiQtqIdrRSunJ6b0ENbx+FkiNWACwJgVNdONuSInauOftzp2+IQ4QFXCpcfhCX7AnGY6NIb91GI6qVR9mau5q0kdHifpS/nuRNxe7aKBrul0PQywYtbmUh3jwG3vMT24LygCiTwz9umy0kqTMyIGuPYdRL5fxUSzNyVeh3FGCVM1rGW1f9lfjwGoVBqe7QoH3VZFMf5+LzUutDW3YTqLFNZe1PT1J02k47t1i3yi4OUbXJQm1+1z5b3HOc36uDSmfAWMTTX7lwnn/wvDqpd67oo0J9WEygGYYjxk7P4deWNk7kXeLowesm/Q303iQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.onmicrosoft.com; s=selector2-intel-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=XVOTXI52brkryRQJyiJCl18Dg0Y/fdyIn5ZBoopte60=; b=ZLxnaNKdPqVSYRDsBd2xSGZnKuGA/FY83ksSPTg9ppMzKwWM2bKge5ROihwKmQvbF2CsqGX0r1xrjRTCQDl8/BCykHPWrAT3Bn0KlVuf06BjozbWExL0/FZEkLhZLRoxxjkURJy5Jlt2gEnUJdlM1yxHlEWR2QgAmGm7L+TBn4M= Received: from BN6PR11MB3972.namprd11.prod.outlook.com (2603:10b6:405:7f::11) by BN6PR11MB1971.namprd11.prod.outlook.com (2603:10b6:404:ff::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3000.20; Fri, 15 May 2020 06:13:18 +0000 Received: from BN6PR11MB3972.namprd11.prod.outlook.com ([fe80::3c03:da06:5345:bfa0]) by BN6PR11MB3972.namprd11.prod.outlook.com ([fe80::3c03:da06:5345:bfa0%7]) with mapi id 15.20.3000.022; Fri, 15 May 2020 06:13:18 +0000 From: "Liming Gao" To: Oleksiy Yakovlev , "devel@edk2.groups.io" CC: "Kinney, Michael D" , "Wang, Jian J" , "Wu, Hao A" , "Yao, Jiewen" , "Zhang, Chao B" , "Felixp@ami.com" , "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: AQHWKjGuApjYXW0ffEakQn6+iPmvr6ioqmYQ Date: Fri, 15 May 2020 06:13:18 +0000 Message-ID: References: <20200514205145.36956-1-oleksiyy@ami.com> <20200514205145.36956-6-oleksiyy@ami.com> In-Reply-To: <20200514205145.36956-6-oleksiyy@ami.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-version: 11.2.0.6 dlp-product: dlpe-windows dlp-reaction: no-action authentication-results: ami.com; dkim=none (message not signed) header.d=none;ami.com; dmarc=none action=none header.from=intel.com; x-originating-ip: [192.55.52.207] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: f0de165d-0303-4449-b5b7-08d7f8970fcf x-ms-traffictypediagnostic: BN6PR11MB1971: x-ld-processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:6790; x-forefront-prvs: 04041A2886 x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: /Je5yNOK1wYIGSCLE6RBQhSJsJU5CHmyqHF0cv0w9Rr3ptxQvvoc/pPM09dJ3gYES2k8Q4EOCPZG0nl1FWCov2isd4tStchdUI/Y0gU9E0HpEQc4rJA48aePcwJDhfXFjy80eUW5Zbvdakr+JUsKDJPl/BRQEVCliNYvxtplPCGHaacRPXb/xLNE/SNErY9FWAe9tlcawpn7FLaVvRhzrSnClQZ65VHw3zsOMuXYDeG26ifXdUvORWvUeuxHcSW23+BeEqba31sLhYMYGro7pTbjh7jmzkhfW4o2Ex5iWGLydh+v451pjbLFTV+HQ9MTv3s/55wfjli0IZuGv5qvK7gxo52hVV3ISl5rb8lIfNN7E84wEPvy+B8/usrbF8GaqoOWcYEsA6nN6cCWWuV0I6PnPtUZykGSMl0cYZtudFNs+s/tLITbdmk9NFCuvrLt x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BN6PR11MB3972.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFTY:;SFS:(346002)(39860400002)(366004)(136003)(396003)(376002)(478600001)(5660300002)(66446008)(66476007)(66556008)(9686003)(64756008)(2906002)(71200400001)(7696005)(8676002)(4326008)(33656002)(86362001)(55016002)(76116006)(26005)(6506007)(53546011)(54906003)(66946007)(316002)(110136005)(186003)(8936002)(107886003)(52536014);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata: moxplrilK0hDtiLBX1VbLyVfJHT1pMBvEOMVgdt3MMYKHPrO646KUO8+yUDVZYK6/c64qUsGjrKNQE7qk3h5UTlqsgtxiqToACWpu1X8d9Zmm/I821Ryt9oh4akxLYNlPyCT4QE662QLwFVri3PbqgwEirVKuJ2NvmQ9OGr5brojFCOp2kyI8vihhVMJ8R/iqhIIsrLwjweXNdc9Z0aXrogKQrFH6mXgFi7H0dwDUNW4OwtuMPGG+wXYtIalY6e7iTvBFlMISCX078D4SFs0gwyhbOQ22dcFn+9w1/qyuupZwcDN3t7pZr+dOnXp6Ybi5GP7pJU7j9CHX4T4RhVVuyBJhuHMx60SiIqwdwk8Nrb+E/mrNwVfqzUBRz/FqiUwV58uUiXnL/IsBJZjBrOfR7giHr2eUMJHbOCsZo8zORGS1RCrPTcPSEkuXEESQsZftfEUG8oGz33Qz4sfiBPZQf8BbZVRocG2E5lxAq2yDA99uSnb3ehAnriziBKjNPhL MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: f0de165d-0303-4449-b5b7-08d7f8970fcf X-MS-Exchange-CrossTenant-originalarrivaltime: 15 May 2020 06:13:18.2466 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: LdTkVr62iycp2aD9lto65/pthJDEQXIFvWYKwprQp1toLJQDg0Kmbq/aSsPfnXEYIkmK3r6dg2ma1xr57q+iVg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR11MB1971 Return-Path: liming.gao@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Oleksiy: When create PR, I find some issue in this patch. The same issue is also i= n SignedCapsulePkg. Because original comments from Xu Wei6, I would like We= i 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, Ch= ao B ; Felixp@ami.com; > oleksiyy@ami.com > Subject: [PATCH V7 5/6] MdeModulePkg: Add FMP Capsule Image Header extens= ion >=20 > Add bitmask to structure which gives a binary-inspectable mechanism to > determine if a capsule contains an authentication section or depex sectio= n. > (UEFI 2.8 errata a, mantis 2026) >=20 > Signed-off-by: Oleksiy Yakovlev >=20 > Reviewed-by: Wei6 Xu > --- > MdeModulePkg/Application/CapsuleApp/CapsuleDump.c | 7 ++++-- > .../Library/DxeCapsuleLibFmp/DxeCapsuleLib.c | 26 ++++++++++++++++= +----- > 2 files changed, 25 insertions(+), 8 deletions(-) >=20 > diff --git a/MdeModulePkg/Application/CapsuleApp/CapsuleDump.c b/MdeModul= ePkg/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->UpdateIm= ageIndex); > Print(L" UpdateImageSize - 0x%x\n", FmpImageHeader->UpdateIm= ageSize); > Print(L" UpdateVendorCodeSize - 0x%x\n", FmpImageHeader->UpdateVe= ndorCodeSize); > - if (FmpImageHeader->Version >=3D EFI_FIRMWARE_MANAGEMENT_CAPSULE_IMA= GE_HEADER_INIT_VERSION) { > - Print(L" UpdateHardwareInstance - 0x%lx\n", FmpImageHeader->Updat= eHardwareInstance); > + if (ImageHeader->Version >=3D 1) { > + DEBUG((DEBUG_VERBOSE, " UpdateHardwareInstance - 0x%lx\n", ImageH= eader->UpdateHardwareInstance)); > + if (ImageHeader->Version >=3D EFI_FIRMWARE_MANAGEMENT_CAPSULE_IMAG= E_HEADER_INIT_VERSION) { > + DEBUG((DEBUG_VERBOSE, " ImageCapsuleSupport - 0x%lx\n", Imag= eHeader->ImageCapsuleSupport)); > + } > } > } [Liming] Here should be FmpImageHeader > } > diff --git a/MdeModulePkg/Library/DxeCapsuleLibFmp/DxeCapsuleLib.c b/MdeM= odulePkg/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", ImageH= eader->Version)); > return EFI_INVALID_PARAMETER; > } > - if (ImageHeader->Version < EFI_FIRMWARE_MANAGEMENT_CAPSULE_IMAGE_HEA= DER_INIT_VERSION) { > + if (ImageHeader->Version =3D=3D 1) { > FmpImageHeaderSize =3D OFFSET_OF(EFI_FIRMWARE_MANAGEMENT_CAPSULE_I= MAGE_HEADER, UpdateHardwareInstance); > + } else { > + FmpImageHeaderSize =3D OFFSET_OF(EFI_FIRMWARE_MANAGEMENT_CAPSULE_I= MAGE_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", ImageHe= ader->UpdateImageIndex)); > DEBUG((DEBUG_VERBOSE, " UpdateImageSize - 0x%x\n", ImageHe= ader->UpdateImageSize)); > DEBUG((DEBUG_VERBOSE, " UpdateVendorCodeSize - 0x%x\n", ImageHe= ader->UpdateVendorCodeSize)); > - if (ImageHeader->Version >=3D EFI_FIRMWARE_MANAGEMENT_CAPSULE_IMAGE_= HEADER_INIT_VERSION) { > - DEBUG((DEBUG_VERBOSE, " UpdateHardwareInstance - 0x%lx\n", Imag= eHeader->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_IMAG= E_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_C= APSULE_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); > + } > } >=20 > 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_HE= ADER_INIT_VERSION) { > DEBUG((DEBUG_INFO, "(UpdateHardwareInstance - 0x%x)", ImageHeader->U= pdateHardwareInstance)); > + DEBUG((DEBUG_INFO, "(ImageCapsuleSupport - 0x%x)", ImageHeader->Imag= eCapsuleSupport)); > } > DEBUG((DEBUG_INFO, "\n")); >=20 > @@ -1239,7 +1250,10 @@ ProcessFmpCapsuleImage ( > ImageHeader =3D (EFI_FIRMWARE_MANAGEMENT_CAPSULE_IMAGE_HEADER *)((U= INT8 *)FmpCapsuleHeader + > ItemOffsetList[Index]); >=20 > UpdateHardwareInstance =3D 0; > - if (ImageHeader->Version >=3D EFI_FIRMWARE_MANAGEMENT_CAPSULE_IMAGE_= HEADER_INIT_VERSION) { > + /// > + /// UpdateHardwareInstance field was added in Version 2 > + /// > + if (ImageHeader->Version >=3D 2) { > UpdateHardwareInstance =3D ImageHeader->UpdateHardwareInstance; > } >=20 > -- > 2.9.0.windows.1 >=20 >=20 > Please consider the environment before printing this email. >=20 > The information contained in this message may be confidential and proprie= tary to American Megatrends (AMI). This communication > is intended to be read only by the individual or entity to whom it is add= ressed or by their designee. If the reader of this message is > not the intended recipient, you are on notice that any distribution of th= is message, in any form, is strictly prohibited. Please > promptly notify the sender by reply e-mail or by telephone at 770-246-860= 0, and then delete or destroy all copies of the transmission.