From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by ml01.01.org (Postfix) with ESMTP id EDC911A1DFE for ; Fri, 12 Aug 2016 01:32:27 -0700 (PDT) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga101.jf.intel.com with ESMTP; 12 Aug 2016 01:32:27 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.28,509,1464678000"; d="scan'208";a="1039899453" Received: from fmsmsx104.amr.corp.intel.com ([10.18.124.202]) by fmsmga002.fm.intel.com with ESMTP; 12 Aug 2016 01:32:28 -0700 Received: from fmsmsx113.amr.corp.intel.com (10.18.116.7) by fmsmsx104.amr.corp.intel.com (10.18.124.202) with Microsoft SMTP Server (TLS) id 14.3.248.2; Fri, 12 Aug 2016 01:32:27 -0700 Received: from shsmsx101.ccr.corp.intel.com (10.239.4.153) by FMSMSX113.amr.corp.intel.com (10.18.116.7) with Microsoft SMTP Server (TLS) id 14.3.248.2; Fri, 12 Aug 2016 01:32:27 -0700 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.147]) by SHSMSX101.ccr.corp.intel.com ([169.254.1.8]) with mapi id 14.03.0248.002; Fri, 12 Aug 2016 16:32:25 +0800 From: "Gao, Liming" To: Leo Duran , "edk2-devel@lists.01.org" Thread-Topic: [PATCH] BaseTools/Source/C/GenFv/GenFvInternalLib.c Thread-Index: AQHR8+SOIvs6WwFFUkuD5H23HdpyIqBDWqsAgAFrWgA= Date: Fri, 12 Aug 2016 08:32:25 +0000 Message-ID: <4A89E2EF3DFEDB4C8BFDE51014F606A1155EAC43@shsmsx102.ccr.corp.intel.com> References: <1470928996-4545-1-git-send-email-leo.duran@amd.com> <1470928996-4545-2-git-send-email-leo.duran@amd.com> In-Reply-To: <1470928996-4545-2-git-send-email-leo.duran@amd.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [PATCH] BaseTools/Source/C/GenFv/GenFvInternalLib.c X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Aug 2016 08:32:28 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Duran: Reusing FvForceRebase flag is a good idea to resolve this issue. I agree = your change. Reviewed-by: Liming Gao Thank Liming > -----Original Message----- > From: Leo Duran [mailto:leo.duran@amd.com] > Sent: Thursday, August 11, 2016 11:23 PM > To: edk2-devel@lists.01.org > Cc: Zhu, Yonghong ; Gao, Liming > ; Leo Duran > Subject: [PATCH] BaseTools/Source/C/GenFv/GenFvInternalLib.c >=20 > Account for rebase of FV section containing VTF file on IA32/IA64. > This supports cases where the reset vector may not be set at 0xFFFFFFF0. >=20 > For example, FV section defined as: > [FV.FvSecPei] > FvBaseAddress =3D $(FV_BOOT_BASE) > FvForceRebase =3D TRUE >=20 > Contributed-under: TianoCore Contribution Agreement 1.0 > Signed-off-by: Leo Duran > --- > BaseTools/Source/C/GenFv/GenFvInternalLib.c | 10 ++++++---- > 1 file changed, 6 insertions(+), 4 deletions(-) >=20 > diff --git a/BaseTools/Source/C/GenFv/GenFvInternalLib.c > b/BaseTools/Source/C/GenFv/GenFvInternalLib.c > index 7c839e2..8c2827b 100644 > --- a/BaseTools/Source/C/GenFv/GenFvInternalLib.c > +++ b/BaseTools/Source/C/GenFv/GenFvInternalLib.c > @@ -2770,11 +2770,13 @@ Returns: > // > // Update reset vector (SALE_ENTRY for IPF) > // Now for IA32 and IA64 platform, the fv which has bsf file must = have the > - // EndAddress of 0xFFFFFFFF. Thus, only this type fv needs to upda= te the > - // reset vector. If the PEI Core is found, the VTF file will proba= bly get > - // corrupted by updating the entry point. > + // EndAddress of 0xFFFFFFFF (unless the section was rebased). > + // Thus, only this type fv needs to update the reset vector. > + // If the PEI Core is found, the VTF file will probably get > + // corrupted by updating the entry point. > // > - if ((mFvDataInfo.BaseAddress + mFvDataInfo.Size) =3D=3D > FV_IMAGES_TOP_ADDRESS) { > + if ((mFvDataInfo.ForceRebase =3D=3D 1) || > + (mFvDataInfo.BaseAddress + mFvDataInfo.Size) =3D=3D > FV_IMAGES_TOP_ADDRESS) { > Status =3D UpdateResetVector (&FvImageMemoryFile, &mFvDataInfo, > VtfFileImage); > if (EFI_ERROR(Status)) { > Error (NULL, 0, 3000, "Invalid", "Could not update the reset v= ector."); > -- > 1.9.1