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.web09.13616.1605397984805996673 for ; Sat, 14 Nov 2020 15:53:05 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@intel.onmicrosoft.com header.s=selector2-intel-onmicrosoft-com header.b=ZFOTgVPd; spf=pass (domain: intel.com, ip: 192.55.52.43, mailfrom: nathaniel.l.desimone@intel.com) IronPort-SDR: tkDSsbTHjb4CeUFFVwhRV3SLoAW5G/8cTjUmAVT8C8cvlm6ExJiWWhdK05YqepVVGemZAEVGVu o7PZr50Abo6g== X-IronPort-AV: E=McAfee;i="6000,8403,9805"; a="255315823" X-IronPort-AV: E=Sophos;i="5.77,479,1596524400"; d="scan'208";a="255315823" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Nov 2020 15:53:01 -0800 IronPort-SDR: JsuBW6VKkAGK+nKPz644ZOg+MzMg6gr22qywFmlBjdWTS3Nf8kbZHdMDM/FNTRRw+7gX46AxtY NW9o1NJPm8TA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.77,479,1596524400"; d="scan'208";a="309983488" Received: from orsmsx601.amr.corp.intel.com ([10.22.229.14]) by fmsmga007.fm.intel.com with ESMTP; 14 Nov 2020 15:53:01 -0800 Received: from orsmsx607.amr.corp.intel.com (10.22.229.20) by ORSMSX601.amr.corp.intel.com (10.22.229.14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Sat, 14 Nov 2020 15:53:00 -0800 Received: from orsmsx610.amr.corp.intel.com (10.22.229.23) by ORSMSX607.amr.corp.intel.com (10.22.229.20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Sat, 14 Nov 2020 15:53:00 -0800 Received: from ORSEDG601.ED.cps.intel.com (10.7.248.6) by orsmsx610.amr.corp.intel.com (10.22.229.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5 via Frontend Transport; Sat, 14 Nov 2020 15:53:00 -0800 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (104.47.56.177) by edgegateway.intel.com (134.134.137.102) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.1713.5; Sat, 14 Nov 2020 15:52:58 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=aApzD7s+ZhCJ2HhOQjxINSwm2ZStYky05FRtThH16qAfdBnsDsCuJA1F3Y7zwW8uxFxoJYidq0rKt19uBc+6QSLwvWBWMtPl1u/LgeBqEWfVuhSBSp6MdKdLbVS+nwJ7Fcb6bXHsI8gSP8XNlb+qybmt6uRafoFRCDCM3u/clpuA1L9ZMitxLuKItsNSPEtPgF9vxYn+C59aBGthK4AQzlmKEJTPboFxqeX8e86o04gVj6LRtcj08vPK/IoE6qFsMiYYHnc2dh72eTNg5cF1D5zubEYuFH6zHTU3aSnhYLjygi0Iqw/Zc50F3oojbaCHOScX5XAyM8PZxlRZFUWggA== 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=aMPWrKvcDtrpCeDU9qP9Q7Qg0K7Iz8tWMCWO427yUfc=; b=M5fLiDdwf1vCHbcCuK62uuV2NzES6tcB3qWNnYnlnmQlyCbqIPJufjS08bgsYStrEBjKlOhQcp0H3k4hMFL2u+PfCPuAWnLn4Ekr8icWzQ6l6W+gTDivneTscln5aghBqPh0ddR5fFqu+FR5rI/kM+/lUoBcarjr86sK6qP4NSaUX/H4szB41yerHJ8HeXVq6zVY+r4YbtNeYmMAA3XlN14epW4PMa7Fj5szMxazmg8DxHemOUYe9X6VjHt+jSTxmf7JFSI1esbSlt1wOeCQmnBBweT2QDIJK4vhH6bZVT0/9ScgRUBYh+Rut9I46VmOxaDJu6uLgiA4QAZccUtbJw== 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=aMPWrKvcDtrpCeDU9qP9Q7Qg0K7Iz8tWMCWO427yUfc=; b=ZFOTgVPdT3sks7Su5+8cbEtZ5QBpG/Uph7GrrctJzUtTcw7GHvXvq6e2nDbcLlRcVk89qhVJEX7bWZzKZoXjTEQHgP42yTy7+p6w/VeKbwqEdwpk6MxwzlWx9jQNuJpmFVpXlL+VvQOI0IjXAkc4G2sdKjc7Z45TKFjCN/M0Bsc= Received: from MWHPR1101MB2160.namprd11.prod.outlook.com (2603:10b6:301:5b::12) by MWHPR11MB1568.namprd11.prod.outlook.com (2603:10b6:301:f::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3541.24; Sat, 14 Nov 2020 23:52:58 +0000 Received: from MWHPR1101MB2160.namprd11.prod.outlook.com ([fe80::3161:c00f:c5c5:f710]) by MWHPR1101MB2160.namprd11.prod.outlook.com ([fe80::3161:c00f:c5c5:f710%8]) with mapi id 15.20.3564.028; Sat, 14 Nov 2020 23:52:58 +0000 From: "Nate DeSimone" To: "Ma, Maurice" , "devel@edk2.groups.io" CC: "Ma, Maurice" , "Chiu, Chasel" , "Zeng, Star" Subject: Re: [PATCH] IntelFsp2Pkg: Fix FSP binary rebasing issue for PE32+ image Thread-Topic: [PATCH] IntelFsp2Pkg: Fix FSP binary rebasing issue for PE32+ image Thread-Index: AQHWuIhvMQgvEd1yk0CBCT7MJ4fJCKnIUWUw Date: Sat, 14 Nov 2020 23:52:57 +0000 Message-ID: References: <6799c7ce4aff0db1d5d0c6afe2901fb10bc939a9.1605139779.git.maurice.ma@intel.com> In-Reply-To: <6799c7ce4aff0db1d5d0c6afe2901fb10bc939a9.1605139779.git.maurice.ma@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-reaction: no-action dlp-version: 11.5.1.3 dlp-product: dlpe-windows 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: [50.53.190.176] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: d04830eb-c62a-4b64-7080-08d888f869c5 x-ms-traffictypediagnostic: MWHPR11MB1568: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:6790; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: GxVZIxhL3sN5cRzbuCx/k21FCJdsZ6ajPaNR83e0jQ5tG+20/8b4pkK20GZ/wX9AllFBrk+qqlLOEQlYWCzkc4QV549CDCrSRzSaHnpubs8WShFeTlWmeaxYHzCXJGeLDKkvbj2g+jO4mhXSGm8hI0nF8RHeVrmFny+F489OfyB2HPd9VlMQeC2GbnMZ9cUmxBby5NqBCTfUsW9PHJMN+496dHlWGQaATU5rDTsFUZhjrZqiGuX4/xP0U07R8Kh+UeIWcJ2hpKtSd11pikm5NE7+ybEUX5qQvQBJfu8vSmrEOEfmKYFpBW9jk7IIE4piSd4kGOb7WDhFijOQfMAcuQ== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:MWHPR1101MB2160.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(396003)(136003)(346002)(376002)(366004)(39860400002)(66446008)(66556008)(83380400001)(64756008)(86362001)(6506007)(4326008)(52536014)(8936002)(7696005)(66946007)(33656002)(71200400001)(19627235002)(54906003)(53546011)(316002)(2906002)(186003)(9686003)(5660300002)(55016002)(478600001)(26005)(110136005)(66476007)(76116006)(8676002)(107886003);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata: sKNH3tDqERNbCH4J6uacxFcTh5xQOkCEuPWilW3ZBXj6pshEGHjCD89TnhqnIzo3Se1QIu0wIZvBFCtUuNGp+Oofe4y/dJWG8aeFxAQIDK1HQc8tSFjCIcE+YL3gSqaECQNLBMdQXWHqiEVOVg6pKk+iyNH1v4k6OP4e4UylbspTQ241sPzN5pGsvlNUcU2yDsAD3UU+K8mwSRbjOqPv780KYzLFaFvBJY2zxflLI3bZ8UoBiC3+ddX5SKxF7/wn23Y7wbLT8x+tJIonbF2pA7EefGO+lkcIN0TBpxKTs90Z11foVthNclJ5vE0JZvMnmoXCYMhEV7OBfx0709yDWjFCNRRkhFdgjh6rkNkimgonLpLewNAsz5dp2zC//GWyIlUdcMRW5KZbWTIfMeU19+nmAmKCzLFBrVPO6NMwevsuaBWcRTRZaeQ/qsNxsV7QYWiXjDFqV2eaRWxMIi5X9YdI/Tl+yM3CewAbGO2iOXX+l6EsuBxS67308+9E6nLC+qAXE5mCUjH0D0MBJzx5qbMqD+8PSM2GHohtCrnjZlSHJjRksYcIrJv+gbI9BKSkBE/ZC86RM8RsZqmoNd+ZPTiWdal5NPb84vzrz2ShWTuQN+lWakzk+PnNIVzkr25x9Cj+B4Dzws+W1iNgxHErV6w0CKsMgMp1IyKtzgwLX7nZMppPRDRKVMCbvlNG2z4ySkjqrT/m+KCJOF32jULqf9IUNZgqTuXvsNYdffRgAzKVaSbR5o8iX+LvpdILa4zhkHoyw7MGQj4gmYhZRkjUW5Hqjomq3Kto2VaCWBD2wWYGjsokxfbEKOxjV/fgZG0uGNYyddGFa+hCheiSqEO8lF3f0eT7qWyHqJTp5J5FENj4QmraWxvzEF1SaczkQ3vIN9pP9Qf0wpM3Qp1oxUR11A== MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: MWHPR1101MB2160.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: d04830eb-c62a-4b64-7080-08d888f869c5 X-MS-Exchange-CrossTenant-originalarrivaltime: 14 Nov 2020 23:52:57.8010 (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: tjnlD8jnZazmB5pXsmgG7ssbfU6qr2/7nlURFOKmPCpd92bZApAUajXWqVyMdq1u9Vc/jfHomjpHlBWFHwMJlCKymAHJJojI/fng2uRzNkM= X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR11MB1568 Return-Path: nathaniel.l.desimone@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Nate DeSimone > -----Original Message----- > From: Maurice Ma > Sent: Wednesday, November 11, 2020 4:11 PM > To: devel@edk2.groups.io > Cc: Ma, Maurice ; Chiu, Chasel > ; Desimone, Nathaniel L > ; Zeng, Star > Subject: [PATCH] IntelFsp2Pkg: Fix FSP binary rebasing issue for PE32+ im= age >=20 > Current FSP rebasing script SplitFspBin.py has support for both > PE32 and PE32+ image formats. However, while updating the ImageBase field > in the image header, it always assumed the ImageBase field is 32bit long. > Since PE32+ image format defined ImageBase as 64bit, the current script w= ill > only update the lower 32bit value and leave the upper 32bit untouched. It > does not work well for PE32+ image that requires update in the upper 32bi= t > ImageBase field. The expected behavior is to update the full 64bit field.= This > patch implemented this fix. >=20 > Signed-off-by: Maurice Ma >=20 > Cc: Chasel Chiu > Cc: Nate DeSimone > Cc: Star Zeng > --- > IntelFsp2Pkg/Tools/SplitFspBin.py | 8 ++++++-- > 1 file changed, 6 insertions(+), 2 deletions(-) >=20 > diff --git a/IntelFsp2Pkg/Tools/SplitFspBin.py > b/IntelFsp2Pkg/Tools/SplitFspBin.py > index 3c0d5af1b6..24272e82af 100644 > --- a/IntelFsp2Pkg/Tools/SplitFspBin.py > +++ b/IntelFsp2Pkg/Tools/SplitFspBin.py > @@ -677,8 +677,12 @@ class PeTeImage: > else: offset =3D self.Offset + self.DosHdr.e_lfanew= offset +=3D > EFI_IMAGE_NT_HEADERS32.OptionalHeader.offset- offset +=3D > EFI_IMAGE_OPTIONAL_HEADER32.ImageBase.offset- size =3D > EFI_IMAGE_OPTIONAL_HEADER32.ImageBase.size+ if > self.PeHdr.OptionalHeader.PePlusOptHdr.Magic =3D=3D 0x20b: # PE32+ image+ > offset +=3D EFI_IMAGE_OPTIONAL_HEADER32_PLUS.ImageBase.offset+ > size =3D EFI_IMAGE_OPTIONAL_HEADER32_PLUS.ImageBase.size+ > else:+ offset +=3D > EFI_IMAGE_OPTIONAL_HEADER32.ImageBase.offset+ size =3D > EFI_IMAGE_OPTIONAL_HEADER32.ImageBase.size value =3D > Bytes2Val(fdbin[offset:offset+size]) + delta fdbin[offset:offset+= size] =3D > Val2Bytes(value, size)-- > 2.29.2.windows.1