From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by mx.groups.io with SMTP id smtpd.web12.8488.1618913459611436895 for ; Tue, 20 Apr 2021 03:10:59 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@intel.onmicrosoft.com header.s=selector2-intel-onmicrosoft-com header.b=QrdUEA2X; spf=pass (domain: intel.com, ip: 192.55.52.88, mailfrom: bob.c.feng@intel.com) IronPort-SDR: f+WTLGXK/0OQIMMZfk5vAJyJQ3doum5OxV2LyXsMvZUvkGegvEOeyAW9X/sFzdotbzsCC4aKYo maPImfddtPGA== X-IronPort-AV: E=McAfee;i="6200,9189,9959"; a="216067798" X-IronPort-AV: E=Sophos;i="5.82,236,1613462400"; d="scan'208";a="216067798" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Apr 2021 03:10:58 -0700 IronPort-SDR: qztLuBTf7fXknQhwFNQzfegosOD6XCfYgxIOk7w53ad+h6lcptos3U2DUQjMl2vn/BJSS54a62 rmaJiaDlPw9g== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.82,236,1613462400"; d="scan'208";a="385266025" Received: from fmsmsx604.amr.corp.intel.com ([10.18.126.84]) by orsmga006.jf.intel.com with ESMTP; 20 Apr 2021 03:10:58 -0700 Received: from fmsmsx612.amr.corp.intel.com (10.18.126.92) by fmsmsx604.amr.corp.intel.com (10.18.126.84) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2106.2; Tue, 20 Apr 2021 03:10:57 -0700 Received: from fmsmsx606.amr.corp.intel.com (10.18.126.86) by fmsmsx612.amr.corp.intel.com (10.18.126.92) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2106.2; Tue, 20 Apr 2021 03:10:57 -0700 Received: from FMSEDG603.ED.cps.intel.com (10.1.192.133) by fmsmsx606.amr.corp.intel.com (10.18.126.86) 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, 20 Apr 2021 03:10:57 -0700 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (104.47.55.175) by edgegateway.intel.com (192.55.55.68) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2106.2; Tue, 20 Apr 2021 03:10:57 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Mu2Rv5j7Bsgd7OPQ+u4F+SKJ8aRN3g0KBcTtTRLtOwqxQDQABJu8czjSYiAOdl5VD/spYn7gBU9snFVITjOGHVcIXsOUW3aEwNSKu+Ex0qtDkwjMPx24QFXy2sTDY8AUG7EW5Zin5DMpmH2Talt+TO84/YcuzCOU1gTUYU6ftGDZltWP4ZUH93Dip2XD5uaoC54ANPHa9Ik51hxc559B0v/M3mTI19Ynxu6pHy8KlH7wlTzAGVbDNb1vCJuRxrtXq9z+lkJQJajvFRInFdzHDGpwqWqqp0o4BAf1O/aZs1vFFa72p7rnf6O1+NAvui70p04a14mEOt1VlSRPN36DUQ== 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=tOwIwCOeFavuanEp26MqQ/3NeLDySoLLEJA0DkFkuo0=; b=LcD+pCE6B3ZwtrsBzRWM6YfykY37ccdlnIMYbHUPcwhUrpIIckInP0+jVcnHqPOX9XU5jntx7y9qfLIZaceARwnH8vxSm736Ngj2SwPcZAFs0fpYkh4OudlRf4gnOQ5qY2CsZRsFXaAIuuUj6+cIPPl4Y+wSN5zpp/uBJkK8BXgP1EVdoaZNk8FwhsgcWrOBZ8kbf+gZa9Jw0csw2Lmk+cVBH+EGmjLYmOItmMWQPg+4ZreZKRHMceB6whUbr0uHKi2hSB35QE/6AL/juhvC3fmWENltvVJrIdUVObL4OSRzr6F+FomG/64N4asoyGZPaFBL/OLHBYIOVJ/37nS12A== 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=tOwIwCOeFavuanEp26MqQ/3NeLDySoLLEJA0DkFkuo0=; b=QrdUEA2XzV3KutoxI6syxY+nhRP4jDVbDAOKq4159pRdNS8C21UVgKj5pl0S8d/vhct2aCT4hEeatj440mXt6axoCdQkHBVQoj13f9afjXILIjLI8cBu9SgYvzMnF4I6/98UgoWfe108FVZfDY4AtMLubuWgr/RX7hgoMTZ0egI= Received: from DM6PR11MB4073.namprd11.prod.outlook.com (2603:10b6:5:19f::22) by DM4PR11MB5295.namprd11.prod.outlook.com (2603:10b6:5:392::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4042.18; Tue, 20 Apr 2021 10:10:56 +0000 Received: from DM6PR11MB4073.namprd11.prod.outlook.com ([fe80::cc64:a87c:5cf:5f18]) by DM6PR11MB4073.namprd11.prod.outlook.com ([fe80::cc64:a87c:5cf:5f18%3]) with mapi id 15.20.4042.024; Tue, 20 Apr 2021 10:10:56 +0000 From: "Bob Feng" To: Sughosh Ganu , "devel@edk2.groups.io" CC: Liming Gao , "Chen, Christine" Subject: Re: [PATCH] BaseTools: GenerateCapsule.py: Add support for version 3 of FMP Image Header structure Thread-Topic: [PATCH] BaseTools: GenerateCapsule.py: Add support for version 3 of FMP Image Header structure Thread-Index: AQHXNRDMoVgJyJCvMEupmKpSvXxAPKq9MKUw Date: Tue, 20 Apr 2021 10:10:55 +0000 Message-ID: References: <20210419114004.16505-1-sughosh.ganu@linaro.org> In-Reply-To: <20210419114004.16505-1-sughosh.ganu@linaro.org> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: linaro.org; dkim=none (message not signed) header.d=none;linaro.org; dmarc=none action=none header.from=intel.com; x-originating-ip: [192.55.46.54] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: c39335f2-36eb-438d-8623-08d903e49662 x-ms-traffictypediagnostic: DM4PR11MB5295: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:7219; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 6ODr9jw7Kwe76gBqR6N0r//Agq0hHcjg4sbdXf9aeNOuS3c+/PNniXFxyIi5PT1InjFHX8X42zs3QVzLe3Kift6g12yj9c2DIPh5blxKWaakzEQh6Jl2mSUNgKh0Ok0ptp6wz9a479KKoKyd6ehextpB9dh+EsePBdunxhVwr3GkkpDM5SBNSDEIK84Z/phd/fem/l1lHT9C1zEvtRWnTogKTsdr8AbXCw2RBSbUck7KStmCfh8ijfOXm3tL2IGarBhh/uALMpxACHh9fXL+PIIiJFLyp7Hnsse5Vqmtanxz8txbwUQQX3fZjIi0jxcfWaz8lCZ8D69E8PxXC6aszCZx27d8ciNgRfqAO0Gx/NWb5jbFSHOfbcT8evACKWmukt4KE01A6OLHHKVVfg5KGGUlQWTchNj56NMZPbq3VspP40o0Q+kEto+z7yVny40mJTovNk/y52EoQ5vq7a43hKte3DNKsB3JvFriKy98XzxdVIVNOxNfe3Y2mMVP5XLEwpRPEkf0riKnnluKwqilo+3VTIpHHZvWltQKX3ZWMbGe2BfejGwcRDhLqN/WEdFdbxDMSKeZp6HZzbNO6KTR5q7UOZn4ldSEZyvaFvKu0WM= x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DM6PR11MB4073.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(346002)(366004)(396003)(136003)(376002)(39850400004)(64756008)(83380400001)(53546011)(5660300002)(6506007)(7696005)(54906003)(66476007)(110136005)(2906002)(8676002)(4326008)(186003)(76116006)(66556008)(107886003)(8936002)(316002)(33656002)(26005)(66446008)(55016002)(9686003)(122000001)(478600001)(38100700002)(71200400001)(52536014)(66946007)(86362001);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata: =?us-ascii?Q?Md/hFt8yErscl73w5dAzFn8uf6Vxk2OXaieY1c2SuuuQRxDDL1wkzfcK9Gx9?= =?us-ascii?Q?0cJnPb6Dk/wmBsxMKSIlFhWNVFuCbnWfsnpI68fZZJGWalpIANzCzWQy/wIV?= =?us-ascii?Q?rB2IEo9W/oZ9eUKHts4UdwUCDxhf5xKu2pFUMdHtpA8aOohtMK5xEBBfPxkI?= =?us-ascii?Q?1FjZHSjC432TblzidLve5dRuJryY+q8EpeIi+i0fu5aIwdpGJOABO7xb3sX7?= =?us-ascii?Q?/33JtNJZ7B1uRob1KXm+XRYD0Om/LaePVNKx4ItcbduAVU/PzYHX3oZAaJhl?= =?us-ascii?Q?D2jdcjaCZC7SV+z5zw8IGnaBZ3J/wWPWVgiRmi52+/Mkhy9T48gJvPFWGMoL?= =?us-ascii?Q?48dwA2wrCz27XCKIM3W0TdatiPr/3nHeDNYieqW3fAhbpYJGFw7B7hcYxXsJ?= =?us-ascii?Q?LYYEWJMnPSJ3sGMdThwQMqTwO3Be7NDorP7pyJnH/SLLfhHKtvnVir9YH6SL?= =?us-ascii?Q?gjFjbhO3nhcNGLHePodIz1gD23Bvsvbcz6yCUuPkl5ZtHBoQlArbiharP48q?= =?us-ascii?Q?ecLazbi/bLJsT5Ob+X4bIPbvwHk5voshaQG9nk3RASynz9XEJwHQ8BbwCrlu?= =?us-ascii?Q?R2v4pG/926l0LD54N2LLtMqjw5KawHbEdZcye/UpB2USWgREAWKYqK1yEhQK?= =?us-ascii?Q?nLPKb6+3ZShXbFApK+HrD9JltJwPPFRIxxc6qfwhiFFsEzayy68SxoaT2qvT?= =?us-ascii?Q?4F6Jng2YMKWXhRjRDc57X/bUwWzBct/miYKJhKJvzeVcqhcNpdblFm9Hz/OH?= =?us-ascii?Q?S9u46N0X02rGVh83mS0jeABs/wbnQ6sSt9qFhrjISlGR2y667fBOSsBikUcG?= =?us-ascii?Q?k25hRi6jp9x/AO3Ky3x0C3ZI7IFcuS9g8FB12SIPhg71r1o8On1NUkpjqqEn?= =?us-ascii?Q?Ahx8uQifYefY7AXcljG5TMchWGHbkYCsWduGPrhhH1IypikEGjrK3cB9EOCS?= =?us-ascii?Q?WneS142m57/I1LFRpmZtbqkwMIgfZTQKjWcZtTc4kVyRX+04JCVaOtiD+Lxy?= =?us-ascii?Q?dluB++4TeUIlbiaHlI7vXdEqE/lZWb6WfGV1IK/2NIlOh7Ewh9R37GpMbUiE?= =?us-ascii?Q?oV73rtSSMIdu149dvR8BOgHg6aThMTR86+/vvh8RVwhtVTVimxzzy51xcC8S?= =?us-ascii?Q?p37x78zqV2C5rvMDJDldDqknWO/cjbuZ3StAI5CAwuEYHQROS8VC+16deaS4?= =?us-ascii?Q?aMNR9/AhRkgwTn4RypI3OBKGEuFeH3eQW5G0lccfpVp0Ydqrk/OOqTvTcg42?= =?us-ascii?Q?/4L7hQPQQFNlgA2fIkID0Hsmajdl0JRGIgQCdpGaPDq1MIVWl5atP4QgzDGp?= =?us-ascii?Q?nyw29QgILxaX6Gljd0rqHp2O?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: DM6PR11MB4073.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: c39335f2-36eb-438d-8623-08d903e49662 X-MS-Exchange-CrossTenant-originalarrivaltime: 20 Apr 2021 10:10:55.9382 (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: RyhHr6Farmkrly44be5TH/7v+lwwrzJbIwdglPCpFlDIqCnbfophiCe8USdyu5ytpXCJIOh3/tuZNsvD5TkBcQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR11MB5295 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 Reviewed-by: Bob Feng -----Original Message----- From: Sughosh Ganu =20 Sent: Monday, April 19, 2021 7:40 PM To: devel@edk2.groups.io Cc: Feng, Bob C ; Liming Gao ; Chen, Christine ; Sughosh Ganu Subject: [PATCH] BaseTools: GenerateCapsule.py: Add support for version 3 o= f FMP Image Header structure Add support for the ImageCapsuleSupport field, introduced in version 3 of t= he EFI_FIRMWARE_MANAGEMENT_CAPSULE_IMAGE_HEADER structure. This structure m= ember is used to indicate if the corresponding payload has support for auth= entication and dependency. Signed-off-by: Sughosh Ganu --- .../Source/Python/Capsule/GenerateCapsule.py | 5 +++- .../Common/Uefi/Capsule/FmpCapsuleHeader.py | 26 +++++++++++++------ 2 files changed, 22 insertions(+), 9 deletions(-) diff --git a/BaseTools/Source/Python/Capsule/GenerateCapsule.py b/BaseTools= /Source/Python/Capsule/GenerateCapsule.py index a8de988253..6419a2ac6f 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 SinglePayloadD= escriptor.FwVersion @@ -575,6 +576,7 @@ if __name__ =3D=3D '__main__': if SinglePayloadDescriptor.UseDependency: CapsuleDependency.Payload =3D Result CapsuleDependency.DepexExp =3D SinglePayloadDescriptor.Dep= exExp + ImageCapsuleSupport |=3D 0x0000000000000002 Result =3D CapsuleDependency.Encode () if args.Verbose: CapsuleDependency.DumpInfo () @@ -607,13 +609,14 @@ if= __name__ =3D=3D '__main__': FmpAuthHeader.MonotonicCount =3D SinglePayloadDescript= or.MonotonicCount FmpAuthHeader.CertData =3D CertData FmpAuthHeader.Payload =3D Result + ImageCapsuleSupport |=3D 0x0000000000000001 Result =3D FmpAuthHeader.Encode () if args.Verbose: FmpAuthHeader.DumpInfo () except: print ('GenerateCapsule: error: can not encode FMP Aut= h Header') sys.exit (1) - FmpCapsuleHeader.AddPayload (SinglePayloadDescriptor.Guid, Res= ult, HardwareInstance =3D SinglePayloadDescriptor.HardwareInstance, UpdateI= mageIndex =3D SinglePayloadDescriptor.UpdateImageIndex) + FmpCapsuleHeader.AddPayload (SinglePayloadDescriptor.Guid,=20 + Result, ImageCapsuleSupport, HardwareInstance =3D=20 + SinglePayloadDescriptor.HardwareInstance, UpdateImageIndex =3D=20 + SinglePayloadDescriptor.UpdateImageIndex) try: for EmbeddedDriver in EmbeddedDriverDescriptorList: FmpCapsuleHeader.AddEmbeddedDriver(EmbeddedDriver) diff --git a/BaseTools/Source/Python/Common/Uefi/Capsule/FmpCapsuleHeader.p= y b/BaseTools/Source/Python/Common/Uefi/Capsule/FmpCapsuleHeader.py index 91d24919c4..a2a5cf0db8 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 t= he image that follows this structure + # /// + # UINT64 ImageCapsuleSupport # } EFI_FIRMWARE_MANAGEMENT_CAPSULE_IMAGE_HEADER; # - # #define EFI_FIRMWARE_MANAGEMENT_CAPSULE_IMAGE_HEADER_INIT_VERSION 0= x00000002 + # #define=20 + EFI_FIRMWARE_MANAGEMENT_CAPSULE_IMAGE_HEADER_INIT_VERSION 0x00000003 =20 - _StructFormat =3D '=3D len (self._FmpCapsuleImageHeaderList): @@ -198,13 +207,14 @@ class FmpCapsuleHeaderClass (object): self._ItemOffsetList.append (Offset) Offset =3D Offset + len (EmbeddedDriver) Index =3D 1 - for (UpdateImageTypeId, Payload, VendorCodeBytes, HardwareInstance= , UpdateImageIndex) in self._PayloadList: + for (UpdateImageTypeId, Payload, ImageCapsuleSupport, VendorCodeBy= tes, HardwareInstance, UpdateImageIndex) in self._PayloadList: FmpCapsuleImageHeader =3D FmpCapsuleImageHeaderClass () FmpCapsuleImageHeader.UpdateImageTypeId =3D UpdateImageTy= peId FmpCapsuleImageHeader.UpdateImageIndex =3D UpdateImageIn= dex FmpCapsuleImageHeader.Payload =3D Payload FmpCapsuleImageHeader.VendorCodeBytes =3D VendorCodeByt= es FmpCapsuleImageHeader.UpdateHardwareInstance =3D HardwareInsta= nce + FmpCapsuleImageHeader.ImageCapsuleSupport =3D ImageCapsuleS= upport FmpCapsuleImage =3D FmpCapsuleImageHeader.Encode () FmpCapsuleData =3D FmpCapsuleData + FmpCapsuleImage =20 -- 2.17.1