From nobody Fri May 3 05:58:16 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+77532+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+77532+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1625596957; cv=none; d=zohomail.com; s=zohoarc; b=ZXQRcCuZZM4dgq2yNAtfhvgmXthGmBv2VBmVmE7wTWYqmKMMXQ/s7MmQ8dCba5ucZRSL31OHi9GVK2zBNR/2PIL8G7L7ArH2gNU9gsPOciUhP6LtiD16uUvb30BYddqI9ivaXZ2w+r4Y3+u89F22+PiQ65n+AiusPWTGGLD55AM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1625596957; 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=dFqpXn/pIOXk6f8866cgjo4serG6beA1+lDwvWvSA0w=; b=SOY/dAV7Mi5oYDZK5VOxPfaVhlt7x3toYU+jhR6wEbbr5YA8CEwgppQylZgLWpGO85SN1fr7sKRi5X+tac6PwbIpviTO7ZQWqodoJFKlWnQzpny3aGoV6JwrelBf4U2uBuK+g7KC+Lj6bPTHsAOfP6bA9R1ixyYSZMsN1wVjNBY= 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+77532+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 16255969572211.1642711979906153; Tue, 6 Jul 2021 11:42:37 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id ddlLYY1788612xxlsdu99LAh; Tue, 06 Jul 2021 11:42:36 -0700 X-Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by mx.groups.io with SMTP id smtpd.web08.10479.1625596951457975409 for ; Tue, 06 Jul 2021 11:42:31 -0700 X-IronPort-AV: E=McAfee;i="6200,9189,10037"; a="207349271" X-IronPort-AV: E=Sophos;i="5.83,329,1616482800"; d="scan'208";a="207349271" X-Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Jul 2021 11:42:28 -0700 X-IronPort-AV: E=Sophos;i="5.83,329,1616482800"; d="scan'208";a="486418987" X-Received: from basfe001.gar.corp.intel.com ([10.66.244.207]) by fmsmga003-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Jul 2021 11:42:26 -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 v3] IntelFsp2Pkg: PatchFv parseInfFile function modification Date: Wed, 7 Jul 2021 00:12:04 +0530 Message-Id: <633780c1d8598f02052259fe8fe9115a86486225.1625596813.git.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: aGbTBWVVeaPD0JvDeg1T38kKx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1625596956; bh=zKF+GswT1m9Mq3q5Hz553fhCG0RFtsI0AwqA4oepeJs=; h=Cc:Date:From:Reply-To:Subject:To; b=wn1soCG79yZLmX/VKleTdFNUROQc/avfPWG0ocRoiyJj03CjpNSqNzu7KXnlvTOF4dG 6iMGIf5MinORz8FiQ6Rr3NIsUS3er6dgDyznKidkkbflyBYPFcEDdqACP+xYNkqkWiG9d qQxDFAHIRK4uJvsf06Y9EZUcv+AtQ2G1mAA= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1625596958370100001 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 verification : Working Fine 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..eb130049b5 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 2: + 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 (#77532): https://edk2.groups.io/g/devel/message/77532 Mute This Topic: https://groups.io/mt/84027523/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-