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.web11.2509.1625551147212809810 for ; Mon, 05 Jul 2021 22:59:07 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@intel.onmicrosoft.com header.s=selector2-intel-onmicrosoft-com header.b=kud2g93j; spf=pass (domain: intel.com, ip: 192.55.52.43, mailfrom: chasel.chiu@intel.com) X-IronPort-AV: E=McAfee;i="6200,9189,10036"; a="294701176" X-IronPort-AV: E=Sophos;i="5.83,327,1616482800"; d="scan'208";a="294701176" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Jul 2021 22:59:05 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.83,327,1616482800"; d="scan'208";a="647166331" Received: from fmsmsx605.amr.corp.intel.com ([10.18.126.85]) by fmsmga005.fm.intel.com with ESMTP; 05 Jul 2021 22:59:05 -0700 Received: from fmsmsx607.amr.corp.intel.com (10.18.126.87) by fmsmsx605.amr.corp.intel.com (10.18.126.85) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.4; Mon, 5 Jul 2021 22:59:04 -0700 Received: from fmsmsx612.amr.corp.intel.com (10.18.126.92) by fmsmsx607.amr.corp.intel.com (10.18.126.87) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.10; Mon, 5 Jul 2021 22:59:04 -0700 Received: from FMSEDG603.ED.cps.intel.com (10.1.192.133) 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.2242.10 via Frontend Transport; Mon, 5 Jul 2021 22:59:04 -0700 Received: from NAM02-BN1-obe.outbound.protection.outlook.com (104.47.51.45) 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.2242.4; Mon, 5 Jul 2021 22:59:04 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=gNdH3E+UlheuyMaPDZ7++asFwYB6v888Ks9APaDUWaBmkwan8fd8Jn8r8+1L+i3zEt/VUkoJIGoExbSROtCtSYULxjZlCfytxaGOy8ha7kKDh4FxNpaDPqKR+hw2Y/16Px7kkMU9HNrYIfiDIuc+SdyiJTLXUBbZPWdkiZhwhegpGCWRW1MeqRAj/sBNtWDIsYgzTjKfZmg/f50a3YynSsfRlb9O1vR1LfY82GybsKoWodZ5UjtzDJDAR3i4M87R60V0zN6tJTGoytztiMEgzdfR8NNGCx+m+KSW9SiJLHjq2BZRiK2mueLFMMhmMr+YiFQt6giZyIR/f6n6eKosUQ== 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=UAYdKLbnrl9U+Rs14VyKA+QwL5GSmMNMvdL+m0Ddib0=; b=m20/CcITtXOw3Tt9qBKBnfG6pqq1VikMA4+ztlrsqyUwFVnCM8x6flEu5HkB9rEKI89DfTGT+5rKiqAwAT46uX3cpZuFeazsJEiV+8DA95zBFXXJ8HIPD+wKo6RH6CMd8f1XK5pGTlbFEF7hNgn6+t/2/KsExFuSQCfZgQOoi8RVOWHwq7xnIJVe55cIPOz+nLWAzV3WXc4yRrpZ0iTLuGT2/rXGvi2vmIiPD5JZ/4xjvA+NiamHCvMo8/srcViWicGUCfWpovVqdk7kOtqmF1fu1dB1nZqSBOKM/Zu3t2+Jod48NW7nmQxWAszwwL2Lf6DenFxOrdnm7XZdU4Nbqw== 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=UAYdKLbnrl9U+Rs14VyKA+QwL5GSmMNMvdL+m0Ddib0=; b=kud2g93jm/Ne4aChLTi1bGRtdGpTStkVJZxh+EWfdjLTQyqyNPE5KroX9uVyELMePKOsF8a1jmikA6ZPkwKQhG6frNJmzZ8z9fo2ijZPLZC0ylJmSQfDf6WvI/jaw9czUOGKRC1ihc6I8ImnaTkimyI2doDIAoYiT72Le1L4Tt4= Received: from BN9PR11MB5483.namprd11.prod.outlook.com (2603:10b6:408:104::10) by BN6PR11MB1252.namprd11.prod.outlook.com (2603:10b6:404:47::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4287.29; Tue, 6 Jul 2021 05:59:03 +0000 Received: from BN9PR11MB5483.namprd11.prod.outlook.com ([fe80::79a3:c273:504e:ace2]) by BN9PR11MB5483.namprd11.prod.outlook.com ([fe80::79a3:c273:504e:ace2%6]) with mapi id 15.20.4287.033; Tue, 6 Jul 2021 05:59:03 +0000 From: "Chiu, Chasel" To: "S, Ashraf Ali" , "devel@edk2.groups.io" CC: "Ni, Ray" , "Desimone, Nathaniel L" , "Zeng, Star" Subject: Re: [PATCH v2] IntelFsp2Pkg: PatchFv parseInfFile function modification Thread-Topic: [PATCH v2] IntelFsp2Pkg: PatchFv parseInfFile function modification Thread-Index: AQHXcXVh9OX3t5h8E06/m+5yV5FMcKs1dRIA Date: Tue, 6 Jul 2021 05:59:02 +0000 Message-ID: References: <20210705081117.3502-1-ashraf.ali.s@intel.com> In-Reply-To: <20210705081117.3502-1-ashraf.ali.s@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-reaction: no-action dlp-version: 11.5.1.3 authentication-results: intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=none action=none header.from=intel.com; x-originating-ip: [36.228.169.143] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 3acf48f5-e528-417a-c0b9-08d94043282d x-ms-traffictypediagnostic: BN6PR11MB1252: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:376; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: PFzXYwDMK7wCx2EJsL79fyL90sw/uMH8bv+kLpTAPxi2/N3tOz79jeLQ++R2oPPN20j1OKRBtTXH7yY/921IQk/3XleSFQr8BeXrJrtDnaub1i7G+bP1dR6mxzgczc7O+1aDk0a5Ytudag+u0ZewAJy+Z9zIeIIAB2YDZESRlpuIvQINSS9eJCovHkck50eRiG6Rc1dvrQogWzoOV3mVVLTtXSgpqlwiSurNoN3TYR25I4P1Ip5RLzDF0iEElFzVeYmipGuyv1pbEq97WixCyh7H+mlD9+Nk7Rk4VN76pa4maUT5gB/vbFbebUZqZROLYj5iE25otwrVuQ/MEV1rvMiEA+C3sZuHdPoFwUQLnUlRgJD/rcIWiDZ06a2V5W3uXErncVWhCsiEtnNzlxp4hrtN5sWE+pZf615cnAO5Q22B+fHX9ZE5p5ctT20ZoPhvij9K73A6+MAzadYZOKJPAFDv7G9jovpZqC061u/f0RFYnoqnHZH4JhioTvchWSyarUBvz15jXWJ3BHUjNeOOh1hxiM+2l7yIFnxzPWJumMMcEmOjdBm5TVsAhXSa8uJ25UIFy+9seaLiByE7Vv6I1MNNF9MsP722fZ4dajIt+pAtfGCi8XnSYBPoaiXqiiQOyr1H4WrMQ2EMFnP5rsTSOgj02AnFe4SsVjNxVWBaZolUXQzLOxnse+ppTPcPIV64UwTjzcfHZpcT5DBk2+tQ3rGMkXpbmNAvnqnsN8XObUc= x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BN9PR11MB5483.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(366004)(396003)(136003)(376002)(346002)(39860400002)(86362001)(107886003)(186003)(55016002)(478600001)(8936002)(8676002)(26005)(38100700002)(53546011)(6506007)(54906003)(71200400001)(66476007)(2906002)(7696005)(122000001)(19627235002)(52536014)(4326008)(66446008)(76116006)(5660300002)(110136005)(83380400001)(64756008)(33656002)(66946007)(9686003)(316002)(66556008);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?V+DENuNLgbREhXM8/7C2rLuegHHf15Dd+1XisELZxK6aJwKxqMI8+FPKfFHN?= =?us-ascii?Q?aBRJpeCwCorpJeavYMRQMtpQ/qI4KfkpEGwwvDLWsqW+1o2XCOmNz//VOEax?= =?us-ascii?Q?zWrSKnd4OBuNRqjL6787HY4lunvC6TgXQDl1tNHFFgjcmLKHmAY0utkJzi4d?= =?us-ascii?Q?SnSlKW38OKPddYlcyr3c2ydeciTqPK06513z+HQSxRs8Ruz0OLvY3kwaMFw7?= =?us-ascii?Q?54BrAC9MOK7vRpOPRMGksF/+VyHnRM0kC1+mmBSAp3hdB7q6L1WGMnv14G7x?= =?us-ascii?Q?60OAJQTmx9f9JP9G6FziOTBJEwLvOHfursMbd/7q16DL7AYTkp9vM9MuR4p4?= =?us-ascii?Q?8hdXYfzqhJjaGZhrG98wzus9lqOMkqoIZE1Y/BuqOmg3xOs2Effw/uuT2GNr?= =?us-ascii?Q?5dXLMdvnbUerHoxTQu9icKuyflwUC0Z3g5nLKhQfyTP9swSdByq0ujzX2yMa?= =?us-ascii?Q?RetprAczg64XoywnByHOIa1L9sIciNADeuK+WrtcfNld2irU/ZLEaXSXJaLt?= =?us-ascii?Q?EMl/rf4XGq83pFKkOUciC3IZExeD0IbcOgR9edReY8EFsygB8pAEEMkhHhOE?= =?us-ascii?Q?MCguKdRzo9lBA5aw8N8otu6uMJRUG0btEvHKSeXwTguaLBGyqXuSkI4IwHs+?= =?us-ascii?Q?EfZjE/MXaeBzBAfs0tkt/Swamc5W6O+Ij4lg9KSqKUtnkR2YVQJu4FN/xDSE?= =?us-ascii?Q?dVtbj1HDMhjeaU5v1hsqAf24ywbocWGqA5hB6SejwbRstegHnPV0GhdS9pyL?= =?us-ascii?Q?VSUpoD2DJUrO+6yVeRXW3BRG6gAWhI3WqkZufdsVToKSIs7E3pWuTSNlOxjI?= =?us-ascii?Q?gzzH+jYid1Ao7rM6HwwqfcGqkz/F2Th1leIX7s9QmGyVTrsoT3bE7fAfB0Vl?= =?us-ascii?Q?UtNX1d+GwlYxEwinnAyfkv0O3Tmh0x5iB2GrxkuYqFlBZjiJ9tfHCb4kYfci?= =?us-ascii?Q?YQiv2pvg6+SWiQ2OZz9qlNHZ9WlcEviunGo78f3Hen11oaeJcD4MB+7I57G/?= =?us-ascii?Q?Yv0iRaWjNJe7cuJYXBbVRi8SK6hEFq5GGlARvIYQ7wgXoLsAUYMTWU22vwnn?= =?us-ascii?Q?xOLKgLTe6TrDP1AJIfol9+sMnHLxpWaenEpdUDxQEBlHO7786wOJfWUDShDU?= =?us-ascii?Q?bTCErqVAI1ynTu/fWGPU6bfs4efJ8ayYigp4F5XT9Tnkp+ZdTCelviGXQTMR?= =?us-ascii?Q?E3a5+UlafgMVWahFTnfd9HL0aTNAET/c7oHontTP4rO565Gn80dCVe2Im8th?= =?us-ascii?Q?9MutIj0Ppeax6H1ozaO3CMm+UP7EeU3phSLFD3ODaD41Fm3CGtTR1wz+aWAH?= =?us-ascii?Q?dt408ePJBezxd0ksh4IL6LxC?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: BN9PR11MB5483.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3acf48f5-e528-417a-c0b9-08d94043282d X-MS-Exchange-CrossTenant-originalarrivaltime: 06 Jul 2021 05:59:02.8678 (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: nomcKXtEF52sCppEhcJMLNeZcEWPM3U+lfpNr95UsbBYTX5FO4eioj9yJySjEW2l2FInfkkU/GaYTXMEty0khQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR11MB1252 Return-Path: chasel.chiu@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Chasel Chiu > -----Original Message----- > From: S, Ashraf Ali > Sent: Monday, July 5, 2021 4:11 PM > To: devel@edk2.groups.io > Cc: S, Ashraf Ali ; Ni, Ray ; C= hiu, > Chasel ; Desimone, Nathaniel L > ; Zeng, Star > Subject: [PATCH v2] IntelFsp2Pkg: PatchFv parseInfFile function modificat= ion >=20 > REF:https://bugzilla.tianocore.org/show_bug.cgi?id=3D3476 >=20 > parseInfFile currently reading the EFI_BASE_ADDRESS from INF, once the > address found still it's continues to read the complete inf file which is= not > required. once the EFI_BASE_ADDRESS read from the INF no need to read the > INF further. > MSFT compiler can generate the map file address 8 or 16 based on which > architecture the INF is compiler. currently it's support for IA32, modifi= ed the > patchfv to support for all. > modification of few typo errors in parseModMapFile, getCurr function requ= ired >=20 > Signed-off-by: Ashraf Ali S > Cc: Ray Ni > Cc: Chasel Chiu > Cc: Nate DeSimone > Cc: Star Zeng > --- > IntelFsp2Pkg/Tools/PatchFv.py | 18 +++++++++++++----- > 1 file changed, 13 insertions(+), 5 deletions(-) >=20 > diff --git a/IntelFsp2Pkg/Tools/PatchFv.py b/IntelFsp2Pkg/Tools/PatchFv.p= y > index 112de4077a..64b4e927a0 100644 > --- a/IntelFsp2Pkg/Tools/PatchFv.py > +++ b/IntelFsp2Pkg/Tools/PatchFv.py > @@ -1,6 +1,6 @@ > ## @ PatchFv.py > # > -# Copyright (c) 2014 - 2019, Intel Corporation. All rights reserved.
> +# Copyright (c) 2014 - 2021, Intel Corporation. All rights > +reserved.
> # SPDX-License-Identifier: BSD-2-Clause-Patent # ## @@ -304,10 +304,11= @@ > class Symbols: > match =3D re.match("^EFI_BASE_ADDRESS\s*=3D\s*(0x[a-fA-F0-9]= +)", rptLine) > if match is not None: > self.fdBase =3D int(match.group(1), 16) - fvOffset > + break > rptLine =3D fdIn.readline() > fdIn.close() > if self.fdBase =3D=3D 0xFFFFFFFF: > - raise Exception("Could not find EFI_BASE_ADDRESS in INF file= !" % fvFile) > + raise Exception("Could not find EFI_BASE_ADDRESS in INF > + file!" % infFile) > return 0 >=20 > # > @@ -402,6 +403,7 @@ class Symbols: > # > # retval 0 Parsed MOD MAP file successfully > # retval 1 There is no moduleEntryPoint in modSymbol= s > + # retval 2 There is no offset for moduleEntryPoint i= n modSymbols > # > def parseModMapFile(self, moduleName, mapFile): > # > @@ -426,7 +428,7 @@ class Symbols: > else: > #MSFT > #0003:00000190 _gComBase 00007a50 = SerialPo > - patchMapFileMatchString =3D "^\s[0-9a-fA-F]{4}:[0-9a-fA- > F]{8}\s+(\w+)\s+([0-9a-fA-F]{8}\s+)" > + patchMapFileMatchString =3D "^\s[0-9a-fA-F]{4}:[0-9a-fA- > F]{8}\s+(\w+)\s+([0-9a-fA-F]{8,16}\s+)" > matchKeyGroupIndex =3D 1 > matchSymbolGroupIndex =3D 2 > prefix =3D '' > @@ -455,7 +457,13 @@ class Symbols: > continue >=20 > if not moduleEntryPoint in modSymbols: > - return 1 > + if matchSymbolGroupIndex =3D=3D 1: > + if not '_ModuleEntryPoint' in modSymbols: > + return 1 > + else: > + moduleEntryPoint =3D "_ModuleEntryPoint" > + else: > + return 1 >=20 > modEntry =3D '%s:%s' % (moduleName,moduleEntryPoint) > if not modEntry in self.dictSymbolAddress: > @@ -498,7 +506,7 @@ class Symbols: > # > # Get current character > # > - # retval elf.string[self.index] > + # retval self.string[self.index] > # retval '' Exception > # > def getCurr(self): > -- > 2.30.2.windows.1