From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by mx.groups.io with SMTP id smtpd.web10.9459.1589531637688236624 for ; Fri, 15 May 2020 01:33:57 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@intel.onmicrosoft.com header.s=selector2-intel-onmicrosoft-com header.b=ar8PRFcp; spf=pass (domain: intel.com, ip: 192.55.52.43, mailfrom: liming.gao@intel.com) IronPort-SDR: CJC+iJp0Wd28nvDgQFj6t2OfHfHwI+hHEWPPyCbYubS8ixoP4fBqHVO/Wq/ZIIjSTOpcv3y0e4 DCL8evEdLQJA== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 May 2020 01:33:56 -0700 IronPort-SDR: UHW63EpT9iAlixrIAWZXr3TquNbtVYSSQjQCJ6F8XV53/tG18EfaNvdVDMdGdrUxfeGlkG2UDo QtfNEbjLTfjA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,394,1583222400"; d="scan'208";a="253739953" Received: from fmsmsx103.amr.corp.intel.com ([10.18.124.201]) by fmsmga008.fm.intel.com with ESMTP; 15 May 2020 01:33:56 -0700 Received: from fmsmsx603.amr.corp.intel.com (10.18.126.83) by FMSMSX103.amr.corp.intel.com (10.18.124.201) with Microsoft SMTP Server (TLS) id 14.3.439.0; Fri, 15 May 2020 01:33:56 -0700 Received: from fmsmsx603.amr.corp.intel.com (10.18.126.83) by fmsmsx603.amr.corp.intel.com (10.18.126.83) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Fri, 15 May 2020 01:33:55 -0700 Received: from FMSEDG002.ED.cps.intel.com (10.1.192.134) by fmsmsx603.amr.corp.intel.com (10.18.126.83) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.1.1713.5 via Frontend Transport; Fri, 15 May 2020 01:33:55 -0700 Received: from NAM02-CY1-obe.outbound.protection.outlook.com (104.47.37.59) by edgegateway.intel.com (192.55.55.69) with Microsoft SMTP Server (TLS) id 14.3.439.0; Fri, 15 May 2020 01:33:53 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Kufj5r0nU3Q6Kh049+uiEXC4pL43oADu/VJreaJ9pJ5g2ZMb9OZpooGYpuscyjRnZ4b1rgrKBN5cfInWnsMwJa75QE2EYQrp7plErqO9aC9m0xgnnxsDnDJSlVknA8Kg7YvQMmtYUcTbefw2kGSuN9qM+MRQTK56rw3OVX87JAqJhjq7OeGdcyLtohBTpm+9RZzp/4fQnxkSD3SQDhJ5jmg5ZcM5TdonQ/yYC9fB+Dh3A2Aa9jKWjkz0AwGpY7wMMMdxumYYJE0UMw/TwWXWjtKxaQvI9CGsP0ObrTxJSiWSYpYuahqVu/57X+RnsNQnPq10lwC9MUPGrKpCQRaNDA== 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=Lbx5SjCAVhjKlXsN9SwcQogNR9t1hKwzUhN1X8Qhrv4=; b=MsSEaAeUQkbyHd28Pq6yF6zWmRcXB9l+rcV3M5onAXFFsvalESlfvDKZh9NKr/R/LdqcjLZdhd88L/WyMbjsV96PZ5RuwbP4HKgvt2GFJQRxAxjpmYV6lu8J61OWkI3TivGIReXLiF7WKTLa50ozLxZGuONx8NmSMNdDYrs8UDvXXDg/pBYrCADb9Bcfi4uX2QiDsGV31JTSbj9YwyU/k0YVuwgh0+zXM5LbZOYzzeh9vrTHdX79265fgtXdJqKqsDFA/qBTW8U0y6kWmT0P8w5uWpormT4dGv3IjH+Iw3YJWizfXFYcRnDFoaNvfDxndXTtdi6X2p0E6lMQPGLKnA== 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=Lbx5SjCAVhjKlXsN9SwcQogNR9t1hKwzUhN1X8Qhrv4=; b=ar8PRFcpLrfT26zw/y0ArRp20C0bfNeb5VUwLg91lJ1LDXg7FKTUTz0Ig59zSbeKo2gOnXWNXg3iWO0gnyMPyqJsSTQsjVU+YhJDM1tD5IVPScN/ZEcispxWh/B4sDdeoq9yGQuRoq+hDIgWd8UojNpA6YBkICE67+52B3SwaFw= Received: from BN6PR11MB3972.namprd11.prod.outlook.com (2603:10b6:405:7f::11) by BN6PR11MB1794.namprd11.prod.outlook.com (2603:10b6:404:104::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3000.26; Fri, 15 May 2020 08:33:50 +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 08:33:50 +0000 From: "Liming Gao" To: "devel@edk2.groups.io" , "Gao, Liming" , Oleksiy Yakovlev CC: "Kinney, Michael D" , "Wang, Jian J" , "Wu, Hao A" , "Yao, Jiewen" , "Zhang, Chao B" , "Felixp@ami.com" , "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: AQHWKjGuApjYXW0ffEakQn6+iPmvr6ioqmYQgAAoI9A= Date: Fri, 15 May 2020 08:33:50 +0000 Message-ID: References: <20200514205145.36956-1-oleksiyy@ami.com> <20200514205145.36956-6-oleksiyy@ami.com> <160F1EEE36EFCBA2.23170@groups.io> In-Reply-To: <160F1EEE36EFCBA2.23170@groups.io> 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: 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.52.207] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: d73624db-d18a-4157-f67a-08d7f8aab18d x-ms-traffictypediagnostic: BN6PR11MB1794: 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: 38bSgKkn0tU+XiuWmui/HeKx0mr59dQZZLr4D0IIFbC0pPUbEKx/YZOYjj7Zd7QTg2ZlpxTK89IaL+tg9cX/ZaAJI50lUkHflLmQo40Ho7rjCrNDYIYOaOEKevK2Zg4gE2EO5e8sP7uwlNcEZOouYL3OpuKt+qN7BJg2E9Cg1nX/Uk6HIFCwO8QWN8s5Fg7Rjv9QFgiSAcg5z+eZb/eGGByfEv6IimZ/U7t7xDDDdoHtBEdnfNG732PO6ZWghL4zn3rmkFp82bmUzf9ozfB9WGsHTAtCzY+EAPnWyrKLL0bA1XucaMr9IsZiCEIHcyMmzdVVWhIRp9ooRVdHDPiX9HUUX+I/9Yvzv77K4KUmQKbYkU7bnDkljJFen7jtCs4Ai1GBEZ3zf10U0+DyUwskj6L7iFxkuL1/LhwOZX4zSoASRRFsFjo3Z5w2vs83umhbv+4NIXM7Xdi7+b/Qpkydf6COgsAa74qfbDG/ZtjXYr0EqCkF3N2ZsRh6MqshOWXFKkVqCjvZBpQWPqqe7RwpNw== 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)(396003)(376002)(39860400002)(136003)(366004)(8676002)(66446008)(26005)(66946007)(52536014)(64756008)(66476007)(66556008)(76116006)(2906002)(55016002)(110136005)(4326008)(107886003)(9686003)(316002)(54906003)(966005)(8936002)(5660300002)(478600001)(33656002)(71200400001)(6506007)(53546011)(86362001)(186003)(7696005);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata: tfGFCpzbRndn85tvaER0Txbqsj/ySCEu8UhvpaVweg4xXzYUF6xh+ywshkhKLE6skh3HO00WFi+01YFreffDZbq2jFfSWCAOE51jZSupzhsE+2XVV2JOtfHhgO5DWsE5kQOCPkTMtppFLO6UnkWxXINowo5ClBt1nO4Iu0EAVda20jfwNJLZaxfoZvJM6FHxC8nBpoukzr6gZRbr3Y+KGWZQwyScHlBhNk4/OyMFXsrUVjb4G8Ay9kTmbuV1aUa5cOrAjSPfWUKccbrM6K00iPj1bFW0c4i3VDmyGSK7kOBbzDOT/NiboxHqHrL7fCNSnAdrFv6AmPNEoCebOyY0OGf/hWJCR2aISJCT7awtrtGRWRM4G1cgZ80waSWgVQ744CkqmZyHY5ge1D2QWBDJc8BNCGX053MMPbme4F8mKjbWrL9/QMeBOZ65rpYkmiRENiY8qIkdMEob0XWqmt3e5uaJzUG1wM31hXvYvo+XBbynEIQgJSRAj/zS5SPK1b+M MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: d73624db-d18a-4157-f67a-08d7f8aab18d X-MS-Exchange-CrossTenant-originalarrivaltime: 15 May 2020 08:33:50.1944 (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: B6yQT9BW5dKpBkMecg69h2sDnOFgBedtn3RRRtqt/3ScbuAs7/3OzNDp7UYzkxWRhpiCOAsCLBHsEH9X8+7U0A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR11MB1794 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: Wei has sent the updated patch for MdeModulePkg and SignedCapsulePkg. ht= tps://edk2.groups.io/g/devel/message/59652 Thanks Liming > -----Original Message----- > From: devel@edk2.groups.io On Behalf Of Liming Ga= o > Sent: Friday, May 15, 2020 2:13 PM > To: Oleksiy Yakovlev ; devel@edk2.groups.io > Cc: Kinney, Michael D ; Wang, Jian J ; Wu, Hao A ; Yao, > Jiewen ; Zhang, Chao B ; F= elixp@ami.com; Xu, Wei6 > Subject: Re: [edk2-devel] [PATCH V7 5/6] MdeModulePkg: Add FMP Capsule I= mage Header extension >=20 > 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. >=20 > 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 >=20 > > } > > 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); > > } >=20 > [Liming] Here should have one condition for ImageHeader->Version =3D=3D = 2. >=20 > > 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. >=20 > 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. >=20 >=20