From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by spool.mail.gandi.net (Postfix) with ESMTPS id A085B740037 for ; Thu, 20 Jul 2023 10:21:49 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=YOOFmGlXp+OWtKpqLLKdB4zG15yM3qmeVNeRVC65Ur4=; c=relaxed/simple; d=groups.io; h=X-Received:X-Received:X-IronPort-AV:X-IronPort-AV:X-Received:X-ExtLoop1:X-IronPort-AV:X-IronPort-AV:X-Received:X-Received:X-Received:X-Received:ARC-Seal:ARC-Message-Signature:ARC-Authentication-Results:X-Received:X-Received:From:To:CC:Subject:Thread-Topic:Thread-Index:Date:Message-ID:References:In-Reply-To:Accept-Language:X-MS-Has-Attach:X-MS-TNEF-Correlator:x-ms-publictraffictype:x-ms-traffictypediagnostic:x-ms-office365-filtering-correlation-id:x-ms-exchange-senderadcheck:x-ms-exchange-antispam-relay:x-microsoft-antispam-message-info:x-ms-exchange-antispam-messagedata-chunkcount:x-ms-exchange-antispam-messagedata-0:MIME-Version:X-MS-Exchange-CrossTenant-AuthAs:X-MS-Exchange-CrossTenant-AuthSource:X-MS-Exchange-CrossTenant-Network-Message-Id:X-MS-Exchange-CrossTenant-originalarrivaltime:X-MS-Exchange-CrossTenant-fromentityheader:X-MS-Exchange-CrossTenant-id:X-MS-Exchange-CrossTenant-mailboxtype:X-MS-Exchange-CrossTenant-userprincipalname:X-MS-Exchange-Transport-CrossTenantHeaders Stamped:X-OriginatorOrg:Precedence:List-Unsubscribe:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:X-Gm-Message-State:Content-Language:Content-Type:Content-Transfer-Encoding; s=20140610; t=1689848508; v=1; b=M5a71Fiz9D4xJvU2R6lIyc79a7ZYm6eX3pkozCan8+vAaEaSOJx5NLEX/EFFi1edm7YWhhWf T1TAllIk0SJRrsfZWkQ4eSBU0SewiPAx1fmFfJfmEFUmNPjU/BTqZCUHyCZvyubVfkzNjoHvORg vwCmTfOj9xmMGm9eNOe4NKCE= X-Received: by 127.0.0.2 with SMTP id keVpYY7687511xfUq0BeDaAe; Thu, 20 Jul 2023 03:21:48 -0700 X-Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by mx.groups.io with SMTP id smtpd.web10.9735.1689848507469660617 for ; Thu, 20 Jul 2023 03:21:47 -0700 X-IronPort-AV: E=McAfee;i="6600,9927,10776"; a="365579125" X-IronPort-AV: E=Sophos;i="6.01,218,1684825200"; d="scan'208";a="365579125" X-Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Jul 2023 03:21:46 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10776"; a="970995818" X-IronPort-AV: E=Sophos;i="6.01,218,1684825200"; d="scan'208";a="970995818" X-Received: from fmsmsx602.amr.corp.intel.com ([10.18.126.82]) by fmsmga006.fm.intel.com with ESMTP; 20 Jul 2023 03:21:46 -0700 X-Received: from fmsmsx612.amr.corp.intel.com (10.18.126.92) by fmsmsx602.amr.corp.intel.com (10.18.126.82) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27; Thu, 20 Jul 2023 03:21:46 -0700 X-Received: from fmsedg601.ED.cps.intel.com (10.1.192.135) 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.2507.27 via Frontend Transport; Thu, 20 Jul 2023 03:21:46 -0700 X-Received: from NAM02-BN1-obe.outbound.protection.outlook.com (104.47.51.49) by edgegateway.intel.com (192.55.55.70) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.27; Thu, 20 Jul 2023 03:21:45 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=RbfKqoU6Eu7Ow2ceawqWjwzO3JEQ/aSpBcHTwZF/P7pbHLhGKxFSWJM+MsJUz4RnkdNshizmY92s8cl/AVBqf5IweVHrahD5SqgZeC2iU87yLEfsihnJC6/1swab9a/Ot/kfESUI5KZHSu5gRgqOAaszSgdhwe9yCiz+w+OHnqyzt1vOqJeEHbyLTN9zg6uB1uiIJ1HHvEx5t8xpvqxIPgzabExrg0oWkiTwM4cTt8Z9LlXOAOE9n/gBn1KuWKOEsVfgTT+eQBNdYIZHkEREy14mDmv6EpqX728GZIKUxHpUAU+9mWfPpT9MAOwk9RwxW1OZxJY32/mD/4P2GZj0cQ== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=nZbyNQ3F/YVvjiJq3B3Hy+mAvs5UBSBzXUG4ZqvWzpI=; b=S8p0Sk8AbYWQKpAOT1ArdF+Z03vlE5SrmpIp/VUt5yvDLR7hb8TGtbeXG4XVfKGEz2iIBxHsNaMajRSeoAq/t+mz1VbnnxiEMiceHXPzqogI/FPUaVCZ+OsPZtKS1zb7i2Oub+cHVQ64hUt0xgOZpbWZfp9wPnDAyTgmY32rFGKTUFt4E55BqNrRxb3KplTtQdVcFasXXmg5hrdCkM6SaXDGOb1yQV6czmCyxcXQT+RfqyrZ207fcWJQvshZ7fgYbndM/ne/Wp4QibUAV2+XcgIwWRmCSGcfjx3scagFKd3BoXvzQBPF4+YnT0vR3od2mg8SlZYYWfFx2pIyqtx2eQ== 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 X-Received: from IA0PR11MB8355.namprd11.prod.outlook.com (2603:10b6:208:480::14) by PH7PR11MB6652.namprd11.prod.outlook.com (2603:10b6:510:1aa::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.25; Thu, 20 Jul 2023 10:21:43 +0000 X-Received: from IA0PR11MB8355.namprd11.prod.outlook.com ([fe80::d67:6431:a151:5df7]) by IA0PR11MB8355.namprd11.prod.outlook.com ([fe80::d67:6431:a151:5df7%7]) with mapi id 15.20.6588.031; Thu, 20 Jul 2023 10:21:43 +0000 From: "Kuo, Ted" To: "Chiu, Chasel" , "devel@edk2.groups.io" CC: "Desimone, Nathaniel L" , "Zeng, Star" , "S, Ashraf Ali" , "Duggapu, Chinni B" , "Ng, Ray Han Lim" , "Mohapatra, Susovan" Subject: Re: [edk2-devel][PATCH v1] SplitFspBin.py cannot support FSP binary with child FV included Thread-Topic: [edk2-devel][PATCH v1] SplitFspBin.py cannot support FSP binary with child FV included Thread-Index: AQHZuYKPJ1EPafWewEeA5XCR1XQO5K/BZMJggAEPx0A= Date: Thu, 20 Jul 2023 10:21:42 +0000 Message-ID: References: In-Reply-To: Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-publictraffictype: Email x-ms-traffictypediagnostic: IA0PR11MB8355:EE_|PH7PR11MB6652:EE_ x-ms-office365-filtering-correlation-id: 9dad6aa3-2ae6-4fe2-03de-08db890b1d16 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam-message-info: i1Vj3bDTEOAwQTcEniuJb7//d6FoeMSwf71Jzwo0D20Ofkt9vSZ6m9N1Evdouc5hnjEWs6GdFZ+17cQvqIRWKV1MtjfehYNbg99Ppk83wRPAqKBVD2CjXPNVktkav7W1IKOQKDD2cskxGuTxEQXd/xJMmHsKFBI+bQI4UXk7Baqk2NeKeRuZKCnV9bakVyeLALLq9Hq7/oRRTUEXpoRGNwUn0h/6KY/iXShTxBdL5IZ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?us-ascii?Q?wXHH/rZnsTIDR2vxCR0fo6c74wIltVm7lOYXGUGq4ZRO8dtyRTzvLpCqHJUN?= =?us-ascii?Q?tPrstN4DhLmldGTHmeXvOrMGMVk9hT30lF0SPdfTXpU5HT3xLD6N/rOhDN0N?= =?us-ascii?Q?MXk2fBNurEZXRXEIvV48eZvX+znph9wZjENRKz/wDqQrcp/M1hqut3Zvt/wp?= =?us-ascii?Q?Exptr03PeXRBc7bglSI=3D?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: IA0PR11MB8355.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9dad6aa3-2ae6-4fe2-03de-08db890b1d16 X-MS-Exchange-CrossTenant-originalarrivaltime: 20 Jul 2023 10:21:42.8443 (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: SNp1KVyNsuYMlC743P/lOzvXJCumaKedXr5OPeAvoSWMYoycldvPL5szfKXx7WUEFDTLIb5wGp/tcDzgsnSziA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR11MB6652 X-OriginatorOrg: intel.com Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,ted.kuo@intel.com X-Gm-Message-State: zpz1d8118KrCy4nFfwX7htFYx7686176AA= Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20140610 header.b=M5a71Fiz; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=intel.com (policy=none); spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce@groups.io; arc=reject ("signature check failed: fail, {[1] = sig:microsoft.com:reject}") Thanks Chasel for the feedback. I've sent patch v2 with changes according t= o your comment. Can you please review it again? Thanks, Ted -----Original Message----- From: Chiu, Chasel =20 Sent: Thursday, July 20, 2023 2:14 AM To: Kuo, Ted ; devel@edk2.groups.io Cc: Desimone, Nathaniel L ; Zeng, Star ; S, Ashraf Ali ; Duggapu, Chinni = B ; Ng, Ray Han Lim ;= Mohapatra, Susovan Subject: RE: [edk2-devel][PATCH v1] SplitFspBin.py cannot support FSP binar= y with child FV included Hi Ted, One question below inline. Another minor feedback is the commit/patch subject format should be "Packag= e: title" Thanks, Chasel > -----Original Message----- > From: Kuo, Ted > Sent: Tuesday, July 18, 2023 7:16 AM > To: devel@edk2.groups.io > Cc: Chiu, Chasel ; Desimone, Nathaniel L=20 > ; Zeng, Star ; S,=20 > Ashraf Ali ; Duggapu, Chinni B=20 > ; Ng, Ray Han Lim=20 > ; Mohapatra, Susovan=20 > > Subject: [edk2-devel][PATCH v1] SplitFspBin.py cannot support FSP=20 > binary with child FV included >=20 > https://bugzilla.tianocore.org/show_bug.cgi?id=3D4502 > Update SplitFspBin.py to support child FV in FSP binary. Without the=20 > patch, the tool won't be able to rebase the images in child FV in FSP bin= ary. >=20 > Cc: Chasel Chiu > Cc: Nate DeSimone > Cc: Star Zeng > Cc: Ashraf Ali S > Cc: Chinni B Duggapu > Cc: Ray Han Lim Ng > Cc: Susovan Mohapatra > Signed-off-by: Ted Kuo > --- > IntelFsp2Pkg/Tools/SplitFspBin.py | 32=20 > ++++++++++++++++++++++++------- > 1 file changed, 25 insertions(+), 7 deletions(-) >=20 > diff --git a/IntelFsp2Pkg/Tools/SplitFspBin.py=20 > b/IntelFsp2Pkg/Tools/SplitFspBin.py > index 419e5ba985..2e7550dbb2 100644 > --- a/IntelFsp2Pkg/Tools/SplitFspBin.py > +++ b/IntelFsp2Pkg/Tools/SplitFspBin.py > @@ -469,6 +469,7 @@ class FirmwareVolume: > else: self.FvExtHdr =3D None self.FfsList = =3D []+ self.ChildFvList =3D > [] def ParseFv(self): fvsize =3D len(self.FvData)@@ -483,8 += 484,18 @@ class > FirmwareVolume: > offset =3D fvsize else: ffs = =3D FirmwareFile (offset, > self.FvData[offset:offset + int(ffshdr.Size)])- ffs.ParseF= fs()- > self.FfsList.append(ffs)+ csoffset =3D offset + sizeof > (EFI_FFS_FILE_HEADER)+ cshdr =3D > EFI_COMMON_SECTION_HEADER.from_buffer (self.FvData, csoffset)+ = # > check if there is child fv+ if (ffs.FfsHdr.Type =3D=3D > EFI_FV_FILETYPE.FIRMWARE_VOLUME_IMAGE and cshdr.Type =3D=3D > EFI_SECTION_TYPE.RAW):+ childfvoffset =3D csoffset + s= izeof Is child FV always with EFI_SECTION_TYPE.RAW? Or it could be other types li= ke EFI_SECTION_TYPE.FIRMWARE_VOLUME_IMAGE? > (EFI_COMMON_SECTION_HEADER) + int(cshdr.Size)+ childfv= hdr =3D > EFI_FIRMWARE_VOLUME_HEADER.from_buffer (self.FvData, childfvoffset)+=20 > childfv =3D FirmwareVolume (childfvoffset, self.FvData[childfvoffset:chil= dfvoffset + > int(childfvhdr.FvLength)])+ childfv.ParseFv ()+ > self.ChildFvList.append(childfv)+ else:+ = ffs.ParseFfs()+ > self.FfsList.append(ffs) offset +=3D int(ffshdr.Size) = offset =3D > AlignPtr(offset) @@ -789,6 +800,13 @@ def SplitFspBin (fspfile,=20 > outdir, > nametemplate): > hfsp.write(fv.FvData) hfsp.close() +def GetImageFrom= Fv (fd, > parentfvoffset, fv, imglist):+ for ffs in fv.FfsList:+ for sec = in ffs.SecList:+ > if sec.SecHdr.Type in [EFI_SECTION_TYPE.TE, EFI_SECTION_TYPE.PE32]: # T= E or > PE32+ offset =3D fd.Offset + parentfvoffset + fv.Offset += =20 > PE32+ ffs.Offset + > sec.Offset + sizeof(sec.SecHdr)+ imglist.append ((offset, = len(sec.SecData) > - sizeof(sec.SecHdr)))+ def RebaseFspBin (FspBinary, FspComponent, FspBas= e, > OutputDir, OutputFile): fd =3D FirmwareDevice(0, FspBinary) fd.Pa= rseFd ()@@ - > 832,11 +850,11 @@ def RebaseFspBin (FspBinary, FspComponent, FspBase,=20 > OutputDir, OutputFile): > imglist =3D [] for fvidx in fsp.FvIdxList: f= v =3D fd.FvList[fvidx]- for > ffs in fv.FfsList:- for sec in ffs.SecList:- = if sec.SecHdr.Type in > [EFI_SECTION_TYPE.TE, EFI_SECTION_TYPE.PE32]: # TE or PE32- > offset =3D fd.Offset + fv.Offset + ffs.Offset + sec.Offset +=20 > sizeof(sec.SecHdr)- imglist.append ((offset, len(sec.SecData) - sizeof(se= c.SecHdr)))+ > GetImageFromFv (fd, 0, fv, imglist)+ # get image from child fv= + for > childfv in fv.ChildFvList:+ print ("Get image from child f= v of fv%d, parent > fv offset: 0x%x" % (fvidx, fv.Offset))+ GetImageFromFv (fd= , fv.Offset, > childfv, imglist) fcount =3D 0 pcount =3D 0-- > 2.40.1.windows.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#107094): https://edk2.groups.io/g/devel/message/107094 Mute This Topic: https://groups.io/mt/100216127/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-