From nobody Sat May 4 22:16:31 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+77475+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+77475+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1625472696; cv=none; d=zohomail.com; s=zohoarc; b=P469lTMHupHQqYvmNKpRe2TQI1zqYPH/Wez+4Ic9v+9hsxp47Va6hYDwXthiGauGIVsnmJzrnJ56nuO7fgTFaOnmWx4ed+tUJv4oaS2+0qnzIuVpyZQcuHUwZ27xyHkaasBDlYB37iuWSuV3eEXbC0YCuOFDVVkexiP1eC1yu6U= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1625472696; h=Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Sender:Subject:To; bh=KBewBB10SZXCzxPZRFEmA3dC8MjzB5/lpL4XYeU5G0E=; b=ga64nRrACen90ORpz/VkCSMubyzrUdoZPaU/+EbJdp1mPOw3fFDemVX2JKEZl+lK5h823sOT4EEiUJqnSWDWJQo/bdrk3bUQ89haWuwCB7VS04EgnFT+k/zhEhpq2i07Qj6ZHWNabCMX6fBMDDXtL+twuQplI5nD4dLwtFAkAxc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+77475+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1625472696807433.3840648683823; Mon, 5 Jul 2021 01:11:36 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id Rt0sYY1788612xbLQu3UgsVS; Mon, 05 Jul 2021 01:11:36 -0700 X-Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by mx.groups.io with SMTP id smtpd.web09.7853.1625472695956271174 for ; Mon, 05 Jul 2021 01:11:36 -0700 X-IronPort-AV: E=McAfee;i="6200,9189,10035"; a="189321697" X-IronPort-AV: E=Sophos;i="5.83,325,1616482800"; d="scan'208";a="189321697" X-Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Jul 2021 01:11:30 -0700 X-IronPort-AV: E=Sophos;i="5.83,325,1616482800"; d="scan'208";a="490929294" X-Received: from basfe001.gar.corp.intel.com ([10.66.244.207]) by orsmga001-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Jul 2021 01:11:28 -0700 From: "Ashraf Ali S" To: devel@edk2.groups.io Cc: Ashraf Ali S , Ray Ni , Chasel Chiu , Nate DeSimone , Star Zeng Subject: [edk2-devel] [PATCH v2] IntelFsp2Pkg: PatchFv parseInfFile function modification Date: Mon, 5 Jul 2021 13:41:17 +0530 Message-Id: <20210705081117.3502-1-ashraf.ali.s@intel.com> MIME-Version: 1.0 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,ashraf.ali.s@intel.com X-Gm-Message-State: fuZWva5M7o2md7PvfDInlvAox1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1625472696; bh=MsecqD6uFoc8R1myccGE+dWRJVwj5UJmb92i+NwiN50=; h=Cc:Date:From:Reply-To:Subject:To; b=mQy3mzi1VYLgsS9SHy45M1sKk52aL9c/V9wh6oHGQQBd2B8WHfZyF9yfRgru0mdu2Hl cQ2yAofc/Za0pzTlyTJmACn3Y6gE//96YPDQG3PIpciwKOr6qwribNw9yeGQAMTrDWrAC 3xuOavwZZK6ytPFav+Xb1j72ydy3K0FZD0M= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1625472704805100002 Content-Type: text/plain; charset="utf-8" REF:https://bugzilla.tianocore.org/show_bug.cgi?id=3D3476 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, modified the patchfv to support for all. modification of few typo errors in parseModMapFile, getCurr function required Signed-off-by: Ashraf Ali S Cc: Ray Ni Cc: Chasel Chiu Cc: Nate DeSimone Cc: Star Zeng Reviewed-by: Chasel Chiu --- IntelFsp2Pkg/Tools/PatchFv.py | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/IntelFsp2Pkg/Tools/PatchFv.py b/IntelFsp2Pkg/Tools/PatchFv.py 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 modSymbols + # retval 2 There is no offset for moduleEntryPoint in = modSymbols # def parseModMapFile(self, moduleName, mapFile): # @@ -426,7 +428,7 @@ class Symbols: else: #MSFT #0003:00000190 _gComBase 00007a50 S= erialPo - 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): --=20 2.30.2.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 (#77475): https://edk2.groups.io/g/devel/message/77475 Mute This Topic: https://groups.io/mt/83993064/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-