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.web10.286.1620779320777174745 for ; Tue, 11 May 2021 17:28:43 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@intel.onmicrosoft.com header.s=selector2-intel-onmicrosoft-com header.b=ZLeL1IRJ; spf=pass (domain: intel.com, ip: 192.55.52.151, mailfrom: bob.c.feng@intel.com) IronPort-SDR: LdsUzv0UiYyL+TgLgZqRNWMuErcJZOE+c4LF0WqWQ0/SyhV6lNr4lzKjKHwyJGPbP+liym2eM/ Fbo5FZCdEsEg== X-IronPort-AV: E=McAfee;i="6200,9189,9981"; a="179849997" X-IronPort-AV: E=Sophos;i="5.82,292,1613462400"; d="scan'208";a="179849997" Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 May 2021 17:28:38 -0700 IronPort-SDR: Drb3BsBb0Iz3JVtvSI7UepXJfYAQFUhVaeoTBdPs8SpdZMe7eTjwjlbBbtuzO2tJam4wLu1+Am fV5rn/GkAxxQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.82,292,1613462400"; d="scan'208";a="609694367" Received: from orsmsx604.amr.corp.intel.com ([10.22.229.17]) by orsmga005.jf.intel.com with ESMTP; 11 May 2021 17:28:37 -0700 Received: from orsmsx612.amr.corp.intel.com (10.22.229.25) by ORSMSX604.amr.corp.intel.com (10.22.229.17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2106.2; Tue, 11 May 2021 17:28:37 -0700 Received: from orsmsx606.amr.corp.intel.com (10.22.229.19) by ORSMSX612.amr.corp.intel.com (10.22.229.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2106.2; Tue, 11 May 2021 17:28:36 -0700 Received: from ORSEDG601.ED.cps.intel.com (10.7.248.6) by orsmsx606.amr.corp.intel.com (10.22.229.19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2106.2 via Frontend Transport; Tue, 11 May 2021 17:28:36 -0700 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (104.47.57.177) by edgegateway.intel.com (134.134.137.102) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2106.2; Tue, 11 May 2021 17:27:57 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=LtlB6gZMn7AzEjL1WjWrIs8aDqFv/1idgIxNt2jbzQqntbbMpM6Zo09Ueiw2RZYlRmJ2XIkSLM2cC46HrVk92CUc+EUTxd9n4JmGQ1JpB0S/o6xvK56QHw43pRURHBSfTQV1J27XaxSM/RTWidoXAkHFpJlUY6gQwAuPviOCisBeizUY3gztYAMpfFqdX1KtrtPOzhK+xSdrEEDhpuZlHJ3y7vk9ABDEEyqx8c/zb+oGdpMcUJ/r88SpVztOWrbDkVUECT47dRMF8YI5/1J7cTSe2cfDnioCw347sNbGK5MFM4ktJ57r+spy/3+cO48zW2nyxmIsDWHqlSifMuUQ3A== 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=oVKpEHbafDue7MLtwvOYJMVMfF1jKxmy/E2UqZKkx38=; b=kuYJrbzqbWnZi59BNrpAGgvwW8gRORmJfk4HDbEnYbliLYq6nqdxVwTI4WKxVuNEXS31angviqd2X7j7M5fJcfBq69EDb+vTpv4FnTMIAR5ZtTiYUHUU4wAIqch7BokMW2bjdp4+8gkPu5iN+J1yGXpY3YNx31uHbcP5cIY8jl4d9lESkzm7xfjkoOR919gzKJWSeZO96vZv78NveVM7hIY64e/MuEa1StI3gRgItRLMIrlx9OtP9R2Kp6ze+fgitaCF3HlucTmtG8v03dfdUn2hQNDj4VC3U3lASFbQSboG46eq22Lm74gLe/y/rPHTAwI8fAtsdVVHfSw6zY6Kyg== 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=oVKpEHbafDue7MLtwvOYJMVMfF1jKxmy/E2UqZKkx38=; b=ZLeL1IRJAtIA90wdBmxF40cGiyhA0hQ8lFItsZhZ/iUkqfdfmTm1fBA8l0p568CP5NiTnj1P+V+szRciEekqVTU/v/R73wZXHZ3Rru5xPdbTplrnunnbDCjM4uJ/uqMypg84b4jTsXhtnWgyEkcw346dvkxdSrWGCAW13+NCBvI= Received: from BY5PR11MB4070.namprd11.prod.outlook.com (2603:10b6:a03:181::16) by SJ0PR11MB4973.namprd11.prod.outlook.com (2603:10b6:a03:2de::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4108.25; Wed, 12 May 2021 00:27:56 +0000 Received: from BY5PR11MB4070.namprd11.prod.outlook.com ([fe80::348a:4f22:4ccf:ecf]) by BY5PR11MB4070.namprd11.prod.outlook.com ([fe80::348a:4f22:4ccf:ecf%5]) with mapi id 15.20.4108.031; Wed, 12 May 2021 00:27:56 +0000 From: "Bob Feng" To: "devel@edk2.groups.io" , "sughosh.ganu@linaro.org" CC: "Kinney, Michael D" , Liming Gao , "Chen, Christine" Subject: Re: [edk2-devel] [PATCH v2] BaseTools: Add support for version 3 of FMP Image Header structure Thread-Topic: [edk2-devel] [PATCH v2] BaseTools: Add support for version 3 of FMP Image Header structure Thread-Index: AQHXN0xPFnNYYVCFX0Wm4ku7kOkHf6rfHIsA Date: Wed, 12 May 2021 00:27:56 +0000 Message-ID: References: <20210422075059.26799-1-sughosh.ganu@linaro.org> In-Reply-To: <20210422075059.26799-1-sughosh.ganu@linaro.org> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: edk2.groups.io; dkim=none (message not signed) header.d=none;edk2.groups.io; dmarc=none action=none header.from=intel.com; x-originating-ip: [192.55.46.56] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 544729ae-c4d9-4524-2549-08d914dcca33 x-ms-traffictypediagnostic: SJ0PR11MB4973: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:8882; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: jN3U8h9Vm/fmTadp9tUz7jXmHPF6Zz3PbTPtXG+Qjp9S6mom11KcwWmTTPTUr+7guYMTuF5QystYsK35vtLiAwlGmlRwmI1IM+YPeAVR7ZAkM++H5PAsaLwqDFJTWPD2Po/1F1u7lEsyu/0meNvEJXN4zqKZ7/Bt7rD0yAVeBtsbEgiwyDoxCCrzmTG4xNW91306wpIkBV2F1CeqGqji15KPG6L5I+pwRQQV44xaFtOEpcTLN2ij7BeC2hDolm/uUOoFeIiBRNCq6wneTMMrt/jaB8KFqb2xFGvGoWfFpCczVKE384rr1/+iV+iGbbsF/qI0LXXAZRjVR+6zF5W98USTEFte6tnJyIoAstcVjD1BJelJEfln+6HocAU7E1MoXtTrhOeu1qYtKy5AtqexiCPBLRXA3OyYkRDa/+0jIhNyVICWOjF61q3tJ2JkppdO0mX0QkTd+/wEltKajE38rToRoHgfnlGPpJEsbOY2EOfrMhxN1oBLz7wwPfwqsqThwtOSJ2Mcn8TxR8FJTsy8oWdX8MlNm4PsurIwgeiF7gzN1qhp7SYbg1FSeEoE9AV341hPMVQ4Y1hfQKx7HEhQUWj4tjZusgsMwaBfgMtTUnV/sEcP5AUAI7LEr7rmEzzcxYK+3UtDFCrj7W/J74Kinow4KlDQ1YxvSW034Goth4y6nXkxeVEvRSPpMyXOKz3+t2pnk6ayIPepkvWR7P30+bm/IBPs/7s45OEajSUlokg= x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BY5PR11MB4070.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(396003)(346002)(366004)(39860400002)(376002)(136003)(2906002)(52536014)(83380400001)(66946007)(76116006)(66556008)(66476007)(64756008)(66446008)(53546011)(478600001)(55016002)(8676002)(9686003)(26005)(4326008)(33656002)(110136005)(8936002)(7696005)(5660300002)(316002)(54906003)(122000001)(86362001)(6506007)(186003)(107886003)(966005)(71200400001)(38100700002);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata: =?us-ascii?Q?KGHExa4zhsasbXNUQwXMbkKNPk+zz/sUxCQEzKIlGmxUpv2WGCeYpjLXuQkE?= =?us-ascii?Q?fmEPqyauc8c6oSWu4JhqFsoV1y/HOUIqqjYaw/gF2nSKH2/J7CfaTLFpKoVs?= =?us-ascii?Q?juRvdjipz41alpT1pbRpwgDPmD3JIRSNUwETsZ4OTc/1zNXuaUANYKuTxpBh?= =?us-ascii?Q?dRHWGQFZ/HGsv93e+WzjadIiy9MLbrPzD/WhyeKzTM65HY4YQAqpzXGONrwm?= =?us-ascii?Q?fN/hTj5lmhgIU9Zk/R878OFn1tRvYicRsjrIRuDETb8R3AJ6s0a3gDHOOpUy?= =?us-ascii?Q?962JTtnDxFSe+Il60qmKFwYp7ehfLk5bZLEuKfajfPUJ9q3jRStuMV/LuBD7?= =?us-ascii?Q?kslOwMqweIO63HU2wl9qn9NvM/myyC1pb24sp5o3wwc8BMa5bClrZt9ALlDD?= =?us-ascii?Q?vXcW7rXzod94E8b9KKIJkfqerVVXtBs+O8PdPO0nrOSnP2N3ziZdrFJCUtYe?= =?us-ascii?Q?yWkgDTPgq0rTL6pVdNS/4m9Na00lwoXTHnapzbCq359V9E6FRaDzrHrP8QVa?= =?us-ascii?Q?p4+qEP3NRez8PuKeuDUST6XlFE+st7dvnqd3KvXmEhXM6cjCkuWZ+nsVvDVa?= =?us-ascii?Q?V/89y1DOgHRXLczSljjZKF4LM3DThpK3NJhHvohplMggHhydW3RkB8wZN+Yr?= =?us-ascii?Q?+5RfYzSHY4K8ffASDYFezONDIdZzOjX6IIRN85Ji+RHAJYvXuIGlmxRu9S4C?= =?us-ascii?Q?NmA0X/g3aJEK7WpGFbLIWP/IKPv6tyEPpG9XMVMFYK0RIegXLip7VppGUF+d?= =?us-ascii?Q?WFwjtkUlv4CvXiehBVEPqKg11rUDvrslf4ZPaJIlbthLdKIP6fNyGJNda18N?= =?us-ascii?Q?QHQPz0L3lI0/82FiYS56vDXW5X5ErNz8YAMYsimTT3qh9BjKAgQrjs79yoxb?= =?us-ascii?Q?8tDe6BwM4DLUs66RYbA/g/Kw/vZu9da+NLSzJnUA9zdZJYlnC8+79DVEQ5pM?= =?us-ascii?Q?W2lF+vYuhPhuInCirKq+hS/5sQDFB8NtUPRdTiE025KBh5GB/asCvPnrcGid?= =?us-ascii?Q?/MAoMoZPboUR9KKRLai+kylPrMsfj9YGMSuy53eSWt3g6BDEYmBjDA8V0rIh?= =?us-ascii?Q?SLz/uGATMtom61wMijL/SUWxhh+1UDtR+7zmNkFn88zS5mFd+jlhvHCfiUPW?= =?us-ascii?Q?K2FO8BxRotsEbwcuxusTPT9irq6VUifyQEw1QrhiWwYVpMmJlYulkYxaaP/E?= =?us-ascii?Q?aeD96r5Jy3GWefSOTaAsexqI4LsNYV95L7PWmsUcKunBINMUVDeuTRMyKHST?= =?us-ascii?Q?cE6vvIFTwaR9nMhBuu4AOGAgmXbeCL6v0uAFeVG6N7IsTwHUmJZ+KXVH2o18?= =?us-ascii?Q?yqM=3D?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: BY5PR11MB4070.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 544729ae-c4d9-4524-2549-08d914dcca33 X-MS-Exchange-CrossTenant-originalarrivaltime: 12 May 2021 00:27:56.5906 (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: 6/ImBZALAz3OmaHCemGgGWoHAEElSQpcvDlif43rc8367mIIaWsFhwyValu8F4wDys8g4hQbtWwi6fy5utNZeA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR11MB4973 Return-Path: bob.c.feng@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable This patch is good to me. Reviewed-by: Bob Feng Thanks, Bob -----Original Message----- From: devel@edk2.groups.io On Behalf Of Sughosh Gan= u Sent: Thursday, April 22, 2021 3:51 PM To: devel@edk2.groups.io Cc: Kinney, Michael D ; Feng, Bob C ; Liming Gao ; Chen, Christine ; Sughosh Ganu Subject: [edk2-devel] [PATCH v2] BaseTools: Add support for version 3 of F= MP Image Header structure Add support for the ImageCapsuleSupport field, introduced in version 3 of = the EFI_FIRMWARE_MANAGEMENT_CAPSULE_IMAGE_HEADER structure. This structure = member is used to indicate if the corresponding payload has support for aut= hentication and dependency. Signed-off-by: Sughosh Ganu --- Changes since v1: - Reword the patch header to get rid of the PatchCheck warning - Make passing of ImageCapsuleSupport parameter to the AddPayload function as an optional parameter to maintain backward compatibility - Declare the values of CAPSULE_SUPPORT_DEPENDENCY and CAPSULE_SUPPORT_AUTHENTICATION in the FmpCapsuleHeaderClass and use those in the GenerateCapsule script .../Source/Python/Capsule/GenerateCapsule.py | 5 +++- .../Common/Uefi/Capsule/FmpCapsuleHeader.py | 28 +++++++++++++------ 2 files changed, 24 insertions(+), 9 deletions(-) diff --git a/BaseTools/Source/Python/Capsule/GenerateCapsule.py b/BaseTool= s/Source/Python/Capsule/GenerateCapsule.py index a8de988253..b8039db878 100644 --- a/BaseTools/Source/Python/Capsule/GenerateCapsule.py +++ b/BaseTools/Source/Python/Capsule/GenerateCapsule.py @@ -561,6 +561,7 @@ if __name__ =3D=3D '__main__': print ('GenerateCapsule: error:' + str(Msg)) sys.exit (1) for SinglePayloadDescriptor in PayloadDescriptorList: + ImageCapsuleSupport =3D 0x0000000000000000 Result =3D SinglePayloadDescriptor.Payload try: FmpPayloadHeader.FwVersion =3D SinglePayload= Descriptor.FwVersion @@ -575,6 +576,7 @@ if __name__ =3D=3D '__main__': if SinglePayloadDescriptor.UseDependency: CapsuleDependency.Payload =3D Result CapsuleDependency.DepexExp =3D SinglePayloadDescriptor.De= pexExp + ImageCapsuleSupport |=3D FmpCapsuleHeader.CAPSULE_= SUPPORT_DEPENDENCY Result =3D CapsuleDependency.Encode () if args.Verbose: CapsuleDependency.DumpInfo () @@ -607,13 +609,14 @@ i= f __name__ =3D=3D '__main__': FmpAuthHeader.MonotonicCount =3D SinglePayloadDescrip= tor.MonotonicCount FmpAuthHeader.CertData =3D CertData FmpAuthHeader.Payload =3D Result + ImageCapsuleSupport |=3D FmpCapsuleHeader.CA= PSULE_SUPPORT_AUTHENTICATION Result =3D FmpAuthHeader.Encode () if args.Verbose: FmpAuthHeader.DumpInfo () except: print ('GenerateCapsule: error: can not encode FMP Au= th Header') sys.exit (1) - FmpCapsuleHeader.AddPayload (SinglePayloadDescriptor.Guid, Re= sult, HardwareInstance =3D SinglePayloadDescriptor.HardwareInstance, Update= ImageIndex =3D SinglePayloadDescriptor.UpdateImageIndex) + FmpCapsuleHeader.AddPayload (SinglePayloadDescriptor.Guid,=20 + Result, HardwareInstance =3D SinglePayloadDescriptor.HardwareInstance,= =20 + UpdateImageIndex =3D SinglePayloadDescriptor.UpdateImageIndex,=20 + CapsuleSupport =3D ImageCapsuleSupport) try: for EmbeddedDriver in EmbeddedDriverDescriptorList: FmpCapsuleHeader.AddEmbeddedDriver(EmbeddedDriver) diff --git a/BaseTools/Source/Python/Common/Uefi/Capsule/FmpCapsuleHeader.= py b/BaseTools/Source/Python/Common/Uefi/Capsule/FmpCapsuleHeader.py index 91d24919c4..8abb449c6f 100644 --- a/BaseTools/Source/Python/Common/Uefi/Capsule/FmpCapsuleHeader.py +++ b/BaseTools/Source/Python/Common/Uefi/Capsule/FmpCapsuleHeader.py @@ -47,14 +47,19 @@ class FmpCapsuleImageHeaderClass (object): # /// therefore can be modified without changing the Auth data. # /// # UINT64 UpdateHardwareInstance; + # + # /// + # /// Bits which indicate authentication and depex information for = the image that follows this structure + # /// + # UINT64 ImageCapsuleSupport # } EFI_FIRMWARE_MANAGEMENT_CAPSULE_IMAGE_HEADER; # - # #define EFI_FIRMWARE_MANAGEMENT_CAPSULE_IMAGE_HEADER_INIT_VERSION = 0x00000002 + # #define=20 + EFI_FIRMWARE_MANAGEMENT_CAPSULE_IMAGE_HEADER_INIT_VERSION 0x00000003 =20 - _StructFormat =3D '=3D len (self._FmpCapsuleImageHeaderList): @@ -198,13 +209,14 @@ class FmpCapsuleHeaderClass (object): self._ItemOffsetList.append (Offset) Offset =3D Offset + len (EmbeddedDriver) Index =3D 1 - for (UpdateImageTypeId, Payload, VendorCodeBytes, HardwareInstanc= e, UpdateImageIndex) in self._PayloadList: + for (UpdateImageTypeId, Payload, VendorCodeBytes, HardwareInstanc= e, UpdateImageIndex, CapsuleSupport) in self._PayloadList: FmpCapsuleImageHeader =3D FmpCapsuleImageHeaderClass () FmpCapsuleImageHeader.UpdateImageTypeId =3D UpdateImageT= ypeId FmpCapsuleImageHeader.UpdateImageIndex =3D UpdateImageI= ndex FmpCapsuleImageHeader.Payload =3D Payload FmpCapsuleImageHeader.VendorCodeBytes =3D VendorCodeBy= tes FmpCapsuleImageHeader.UpdateHardwareInstance =3D HardwareInst= ance + FmpCapsuleImageHeader.ImageCapsuleSupport =3D CapsuleSuppo= rt FmpCapsuleImage =3D FmpCapsuleImageHeader.Encode () FmpCapsuleData =3D FmpCapsuleData + FmpCapsuleImage =20 -- 2.17.1