From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM02-BL2-obe.outbound.protection.outlook.com (mail-bl2nam02on060b.outbound.protection.outlook.com [IPv6:2a01:111:f400:fe46::60b]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 228091A1DF5 for ; Thu, 11 Aug 2016 08:25:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amdcloud.onmicrosoft.com; s=selector1-amd-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=IFPYo+NjQkkQ4oqHAw3GGV878iZhVuSBJIRghgmpprg=; b=wBay3L+BTAhS7o0T2oOnfuLrevl9BI9l1qjRxTdS+tDIzx3+hsGURJuKl40HYTWpt3y2Y+RAxwC5A5Rh4tvKTfgA6Fdf1/6IKKafUIm/hhlXKtV/GcoHH4Ywdo4De/hPo1bOziqDyFUXjWYv53Ak9z8yVDu+jTPvlr34a3bquOQ= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=leo.duran@amd.com; Received: from leduran-Precision-WorkStation-T5400.amd.com (165.204.77.1) by CY4PR12MB1239.namprd12.prod.outlook.com (10.168.167.14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.549.15; Thu, 11 Aug 2016 15:25:27 +0000 From: Leo Duran To: CC: , , Leo Duran Date: Thu, 11 Aug 2016 10:23:16 -0500 Message-ID: <1470928996-4545-2-git-send-email-leo.duran@amd.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1470928996-4545-1-git-send-email-leo.duran@amd.com> References: <1470928996-4545-1-git-send-email-leo.duran@amd.com> MIME-Version: 1.0 X-Originating-IP: [165.204.77.1] X-ClientProxiedBy: SN1PR12CA0028.namprd12.prod.outlook.com (10.162.96.166) To CY4PR12MB1239.namprd12.prod.outlook.com (10.168.167.14) X-MS-Office365-Filtering-Correlation-Id: 7395b5f4-ed5f-41aa-b522-08d3c1fbb974 X-Microsoft-Exchange-Diagnostics: 1; CY4PR12MB1239; 2:590TuxngGgOSUpzqtA/ttzophTiB5t+j1BXzdtOxEcuunAOW9cSU6scPSXza2tNbvYPsVX7xyvjFfxLuTZgeAhUmDODGIPxbjHJKBkKZISAJo238K15If+egnhTRXZQp6J/bsYQGPHezvCDxhZvCDN41NAu9Rkwbo6h6PLBHsqXr7oWWghz0ZXIFKuDbHYFm; 3:yQNJCgF+0K1shb3v5E5JrpegyUHgnbTESdIhhMDmIXDTn2vWxWycYbp2ivy95uDZIEpkbh+4H1ovx9YVRTy+SRMIomS7F9vM/qJIuW/VQAFew67A8ggkz6ynxidlhCrY; 25:zp6QThrovCrg6Yp0vTtrZpmkQAY9CjeTk9x7XlXjOe9OFONk5yH28r2N4GXggAqrDCYyyo/GkBcFmrEj7m12on1H+RLx8mrgjZ8/7buEhlZ684xu0rOmEohy49yM2W0Ruv9a4eQ87ieBi1nySIJTAQ+buExB2ihlAxzVGTK3x5NozCYmNXd+Ey/7dfzjgng5ArmdrlIiuURdpeMALsMd69nJ5LMxDJiCB/GbMoG8EFTxCBqafF1meGlZUbBqJezJrxhKJK0Kvr2C8nRt5aFCH6hqfXCPmOoOzy754nm9QK4Wa/fVs9hsyZBYaWRVymJa/sHHxVYWILt6FlzO3zlh+1PCsUnZGFl9LekTmpysbkIQvFfuEUZ0fpEw0zFJ2bg57/TUkWR4HhY9SnhL4tIyPOpcMXMS4waVg245tlqstKQ= X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:CY4PR12MB1239; X-Microsoft-Exchange-Diagnostics: 1; CY4PR12MB1239; 31:nJz6fHUMliE+MwtMZ25An18CR6YXNn82DLAxnMxYzmN/MwWQ01+Bqux6xIuMYbKCkfXRWJbIsLal6bYCb7NwaUO8dWgg1J9iKpoEdbNf+J8nlEAjFc14Sc7eEsfbtHBCOJOsyyinynepOgwA/rKtTevDxGmFr2GdbTiD3VDkJFM7aXIxGOTF60U7oudH40uikigC13ClTDKOyJVSXYE6md7Ou2Wp76e/gwh51WFbEHI=; 20:+7b6h5Kl+Kd7qMB5zU242FlxZ+mFOGymKuHp3w7Z81kJOFFSEwRqnH2LEZ67rDHv+7oYdiEdeZsbEujsxsOOly2NAZinJuz2EUA7li0St/K/pgjH3rmnmfk0dz+I8CUG3T6gcXq7f7cHMBHjspfWwx4DRUYjiOnwfEmLtMWPGQMtgpKI7kwVEaOVWAnblWzHtyg1XXXm5xCZ60zOOiNvv5AU+cTEHrlHzheWcNrgBwHKXx+lLGA280s6MAHfldcHAQvCcTLu903oalkLni06vjS58VUp7ks9mdgCLOwUorWbUUrCmOPUnCNW08pVWzumJhcaT74bswwDu4A9/LRo3p4TD2k52fzWigQCuTaoIRAekFOiOBXKpP5vBKOqafsqZtxnStNRk49GpIcFeDwu5c4M7OSjW7l9V6RqiqQuMRHXBVEJN0xplGw1xrmf2VnYFc+UBPJyIqC84y370XymYSn0knTkXBh2r4Z17vjaDGDxPzId+WHzr5llsz+Z/Ns+ X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(767451399110); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040171)(601004)(2401047)(8121501046)(5005006)(3002001)(10201501046)(6055026); SRVR:CY4PR12MB1239; BCL:0; PCL:0; RULEID:; SRVR:CY4PR12MB1239; X-Microsoft-Exchange-Diagnostics: 1; CY4PR12MB1239; 4:7ygEd1er0YF5DudsVudcYF+n9Wv72nieX2Z5/g37910jkwaeeqb5uvDgjUDsGxYdrLOCSToWuq9J9fO/CE7xxPu47irXQzGSSWC/qjoescFEkSRw7XODwgHnPlnb01+L0tv+/cDbfOl0ZE7aoSEwhYscJiJWenq5sBOOLF5vQjGfX2W3sfathzJbre7T62p6Hvqyb8k1oiYzRG4F04OQ+RLE4AaKWHuJpIPsEIdL7byCfyOK6K7hwLRZi69SoLSGTItC1AoI+ZPJHTjXFcZmYn1Nh0ZJL4hM1CGvMGDD5q8B9GWpSrhfikVR90wvhzGO+1dT3s8KrUJq4l8gFAVsscMrcczhcf3r/pdffvX1mAnHDqc3Xq0r/rjnA95HWW8EM8qH8f54ru+5LlIvIfrI7Lqptvvzoqj3fKVV0c7rv5ZbZWpnZ7d3HywFc/Gpbkhb X-Forefront-PRVS: 0031A0FFAF X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6029001)(6009001)(7916002)(189002)(199003)(8676002)(92566002)(66066001)(47776003)(4326007)(2906002)(105586002)(42186005)(6116002)(3846002)(86362001)(53416004)(586003)(33646002)(101416001)(2351001)(106356001)(81156014)(50226002)(76176999)(36756003)(50986999)(81166006)(50466002)(229853001)(2950100001)(19580395003)(77096005)(5003940100001)(48376002)(19580405001)(110136002)(189998001)(305945005)(97736004)(7736002)(7846002)(68736007); DIR:OUT; SFP:1101; SCL:1; SRVR:CY4PR12MB1239; H:leduran-Precision-WorkStation-T5400.amd.com; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; Received-SPF: None (protection.outlook.com: amd.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY4PR12MB1239; 23:+B1lQrRiXc75iozAWArpJL8iGkbhrTgBnKVnsxb9r?= =?us-ascii?Q?JL56dvKRtdAZLPajGxs8rmd62O7ByGwhFXLabKZADg5RzByPhkHZq9MAH15e?= =?us-ascii?Q?CBW20RQBiEUZBoN4k3LsNQqxDLKi0UrphWAng/rHgds2cwToInNiVTPmPwWP?= =?us-ascii?Q?bZ1R7gZeYMztlWVp3b/KlxeFsuTkkfZwe5SWkXi3oqkqO/boy4w7oWt//X8t?= =?us-ascii?Q?u6R7BgXP11EijW5XYXoRquzvyk2/Sb20Ialvvo46BXFd2H39ZnnLOd89+o4j?= =?us-ascii?Q?rsdbWeUwcgC/aFVB3BRbexY34YYemfSq+xjoALJKbdnQr5/gxn+3BGeTNDEL?= =?us-ascii?Q?vGf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2XGCqRvR8wyz9tRRZyQC2 X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Aug 2016 15:25:27.8965 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR12MB1239 Subject: [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: Thu, 11 Aug 2016 15:25:32 -0000 Content-Type: text/plain 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. For example, FV section defined as: [FV.FvSecPei] FvBaseAddress = $(FV_BOOT_BASE) FvForceRebase = TRUE 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(-) 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 update the - // reset vector. If the PEI Core is found, the VTF file will probably 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) == FV_IMAGES_TOP_ADDRESS) { + if ((mFvDataInfo.ForceRebase == 1) || + (mFvDataInfo.BaseAddress + mFvDataInfo.Size) == FV_IMAGES_TOP_ADDRESS) { Status = UpdateResetVector (&FvImageMemoryFile, &mFvDataInfo, VtfFileImage); if (EFI_ERROR(Status)) { Error (NULL, 0, 3000, "Invalid", "Could not update the reset vector."); -- 1.9.1