From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by spool.mail.gandi.net (Postfix) with ESMTPS id A76BBD802AD for ; Fri, 22 Sep 2023 05:33:02 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=UN1UNh9LJ4iILsKBZzbluLgIZR/uzoCEG9DsIbSN3hc=; c=relaxed/simple; d=groups.io; h=ARC-Seal:ARC-Message-Signature:ARC-Authentication-Results:From:To:CC:Subject:Thread-Topic:Thread-Index:Date:Message-ID:References:In-Reply-To:Accept-Language:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Language:Content-Type:Content-Transfer-Encoding; s=20140610; t=1695360781; v=1; b=BnnIE2+FOCrqgvC7VCJs63IINv5G5q2jW+JpuyDqgchPePwgTHZpQNY6OwpbAuhYsK6xjfvB Z8iU2KaceCAeGkScsOr+mfN23Ph/zf9nBv3Whl9T6mClug+ccW0LNPxMDo0flc5V1/8CEqT81kR m5K91wsBbZx/qWqEkR7Obd4o= X-Received: by 127.0.0.2 with SMTP id yVG4YY7687511x4oPplcLEr1; Thu, 21 Sep 2023 22:33:01 -0700 X-Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.151]) by mx.groups.io with SMTP id smtpd.web10.15050.1695360780544340412 for ; Thu, 21 Sep 2023 22:33:00 -0700 X-IronPort-AV: E=McAfee;i="6600,9927,10840"; a="360999485" X-IronPort-AV: E=Sophos;i="6.03,167,1694761200"; d="scan'208";a="360999485" X-Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Sep 2023 22:32:55 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10840"; a="776720257" X-IronPort-AV: E=Sophos;i="6.03,167,1694761200"; d="scan'208";a="776720257" X-Received: from fmsmsx601.amr.corp.intel.com ([10.18.126.81]) by orsmga008.jf.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 21 Sep 2023 22:32:52 -0700 X-Received: from fmsmsx602.amr.corp.intel.com (10.18.126.82) by fmsmsx601.amr.corp.intel.com (10.18.126.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.32; Thu, 21 Sep 2023 22:32:52 -0700 X-Received: from FMSEDG603.ED.cps.intel.com (10.1.192.133) by fmsmsx602.amr.corp.intel.com (10.18.126.82) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.32 via Frontend Transport; Thu, 21 Sep 2023 22:32:52 -0700 X-Received: from NAM10-MW2-obe.outbound.protection.outlook.com (104.47.55.103) by edgegateway.intel.com (192.55.55.68) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.32; Thu, 21 Sep 2023 22:32:51 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Q/vrrG3jMtr64Uhs77hDy72jKIahnQKAHIKL45J5Zl8rRBH28qLGnEV4qrKhhpQJQWA6RD0m9futr5/X181G2qPUnnyzF/ZgDlug1kq9VXxaPj2Vg904opuuOfHwDdDo8PCzoVU9rIUre7uZpxcBBugYsXE2JbKawcu2/2VWA8/kxLEMfqIwFVhu2RvfbqfiPbC/cX1FMZeL9y0PMZKSz74bJB3G4CoE99+mC4yaiIXVKwbm8iYxCL25hte7NaLNzIlBtPL0DPTTruAYMtW1XCAcxjRat1n3KU3UKc5AzXv4Dk5qCI0p9etORUCXo9psDJ546tIbu6KSbEv+Gsugqg== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=jD2Bj+9kJ+cYNryh1hilvHKsq9YUysBc/54KtLMb2o4=; b=ccyC2sqCf1e8++7ihzlEDNfg2ggXJGn3KebsEM3Wu1u6Ghp3rfKhO+Yzgdq9L+Au6egaKtOZPAtgsjVPdwtbWoiXoH9iRax/DaRviMZCvXQZ6QkQEVKFlK9eSHSM48D761cn7CgTpTjSumUkPLsWlEH9+atxjLPkPvcYUyZ9QWmSeDTuufxRtlXsK/XdLO8NafQNTuIQ8JIRZpAeMgTPW68FZyPjucEoub5KWNmEr64YH3Va4Y1TyWnEnGx8O69znZkVEMJ1HRuqSmeSGcD1GQBFiZWRrOw2qN/nowRK4C794akH+0Ep5e7shwP/rlgNS6Hm3dddJ43Y0XLMHnXCrg== 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 X-Received: from DM8PR11MB5752.namprd11.prod.outlook.com (2603:10b6:8:13::15) by SJ0PR11MB5868.namprd11.prod.outlook.com (2603:10b6:a03:42b::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6813.21; Fri, 22 Sep 2023 05:32:49 +0000 X-Received: from DM8PR11MB5752.namprd11.prod.outlook.com ([fe80::93de:c6c0:4381:202b]) by DM8PR11MB5752.namprd11.prod.outlook.com ([fe80::93de:c6c0:4381:202b%7]) with mapi id 15.20.6813.017; Fri, 22 Sep 2023 05:32:49 +0000 From: "Wang Fan" To: "devel@edk2.groups.io" , "Kinney, Michael D" , "Gao, Liming" , "Jiang, Guomin" , "Bi, Dandan" CC: "Wang, Fan" Subject: Re: [edk2-devel] [PATCH V2 1/1] MdeModulePkg: Support customized FV Migration Information Thread-Topic: [edk2-devel] [PATCH V2 1/1] MdeModulePkg: Support customized FV Migration Information Thread-Index: AQHZ5JYZm864bHZ3tUSU8vgumd4z1LAmYusw Date: Fri, 22 Sep 2023 05:32:49 +0000 Message-ID: References: <1783CF665DB6E42F.23877@groups.io> In-Reply-To: <1783CF665DB6E42F.23877@groups.io> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-publictraffictype: Email x-ms-traffictypediagnostic: DM8PR11MB5752:EE_|SJ0PR11MB5868:EE_ x-ms-office365-filtering-correlation-id: 5ae57659-7f68-4a6a-8bf0-08dbbb2d5c25 x-ld-processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam-message-info: SMALvQLPNLe07yWqky5/D5CHBHOHhgz59gyG33MaVOQUqCJpm8Ng+cydIBDIbN9W+Jl1SshC8cEd0FSX19Q3y3L+wCyrAJ+0ER4RGVs+y4/vNqVImtdzBOve08IyMZGcRInZYFv1hbB6t6IOPnvLMkUSSr51d6WilMt3pRTYEZ5Oo0iuaRJ0Y7GDXjIb7TxH7ireKanQki4GqoPQEAO0hTqNQQ9wPNlipEWUTPWnDhurFkltDe1TMXvbUWIgBJMOQvKoHWF2NvH30b4a4UFGMPGosSQMmNXnRAJIZtzg7cLcac4XFRzyyWrBXXAhAXehmJ75DvvdJn3bwmuvRSbsJnkA8XpZHtPIlrbraCMRhxuajIIU0TCP5MPnRSJAias+1KdlMgPKqqy5RVL8+lpbmYnvp5OjiUDRou1+PnI1bwZcwRXiNVUtJPw8A3Gbi+kg0vT/m2elzVus7YEEyjLrhz0pGuFuBz6UWBuNRoQNAX9ssN3A9LDoFpRzzXZDTNJI6bSAJ763cm8mixOXhOqi/lXHZbsYH/CW2IrEFigM48bUTx6L2wKhzJYZsfo7bjJK5MzFHwCnNukN/goe2cjxObg5dpR0OXbv+rCQ/Cotr7ikmozzvgBVPwfkrPlKTm2jZU5LhQVTvGXGj6I+SkOvtQ== x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?NYJ66QZa+Z43cbUb0aO4yAUz9JeI33WqZMVkk9KjyUciZ9y0U7BOFI7/fXMe?= =?us-ascii?Q?gKet8ZbBYMLNnMGlU72EyIQXQutB+EfZ+xTy2D+8vKrHVA/3y92b/85UHP5V?= =?us-ascii?Q?/Nw+OdBwNPWOvfJKwPzxIaCEXLzSR3wvjNT9xsEoLDlsLp3keXglBeoc4xYi?= =?us-ascii?Q?whPNWOyDvRoJtIlOFNINGT7wVMpgFM5+Bf9GAClVmiJ8dJgoayrg3DYYs8tC?= =?us-ascii?Q?dj/u8LMbBNY6rbgNSaFaHqn2AJoSRLrnx23gfDXFkHT7Rg8A2IahHxeijZqi?= =?us-ascii?Q?nxIBPzdIqUHK9g6dlBIRLDaO6xD8GSSjCUvgtuQDBEJOAAWIYcSd3h7qQfI1?= =?us-ascii?Q?zoKHiH0TBvCnz1wlWoR97E8/0TVWozcm9cOJoWMI8u5FozO9dcCXQDE2JKJJ?= =?us-ascii?Q?bms85BHeZpyLtGK+Iatr//Fxib2RZ93qyHNW2wW5wQruTBmo72YNmsESSCSr?= =?us-ascii?Q?HqAylyWjTovF/Bg8oSPSX6OAJ01c+txU/l3btcMhnALI37xObHrsorHcjyIR?= =?us-ascii?Q?KvbdUd6nIMczlACvd0ZoaSSHfnAsvqelHbPfVxmvSK5uqafUW0BQ+b7mSKXw?= =?us-ascii?Q?O7cRlYrm9bvkpp4mZ1xNliD8j1s7nD0vPXBtOvivdDkmROJE4httEP5JD50a?= =?us-ascii?Q?vTwpvWQe8cQZZjzGfV5y8YuXmesCmHng/ug5F/TT8nJvHlNkkaasInViS6Ts?= =?us-ascii?Q?o9QPaFwmzb4mFDxQZ6irNOfM5CVGoIpsupqUU+86HeXoyCFqMbMjMkZo4Mux?= =?us-ascii?Q?XG1yLjqbjX/wg77mYX9z+BEWDVGET8WRBDWvVUgW30bejisC7gQ36x1xJ2Yk?= =?us-ascii?Q?qhJuIKVJsxrbSWP0LvJxZwHaWHBMaAEHEAoEFg1yYJoIfegN8zQMc6Fms72n?= =?us-ascii?Q?6U7eYQ38XIAjKKjp5EXDnSqIB5ogRC1kNgX8Eoqzo/KQa6s69k9T7Q5x3OBd?= =?us-ascii?Q?i3j5WkPKM4P3lHhs0bC3ewhMtApXYjAHRIbaQX4Y91J4gP7BQ0BbN99EyMXo?= =?us-ascii?Q?MYd+KFOIgyaIgCh6q0dJXJMl+TIL43XqlOsGt9suuIh2h3I0s/AkMq5Cz7Iq?= =?us-ascii?Q?dUXpFC3cqx+B3Q5nMiBscLp1Wd2flFsVZ0CsoPPWnWSrdDvIrjaKTbHJVgEA?= =?us-ascii?Q?xlYTTMd3Rsv81qLXOXdDipD8yVUIIypvGVxXMR7PYcid/L72vRwN4SKj7jKk?= =?us-ascii?Q?1gDvvx2QMjgKNB2dP68PprEyt5Y6FruACZQxayyqL+pxLlt7BOUKxa5XlCU7?= =?us-ascii?Q?JvkqHQm9xzwZdnN7S+99YLiyzKT9wxZM5vqMWLQF9Zxwddf0N8O8tonkv+2t?= =?us-ascii?Q?QyGyYoJe8zDTRxeGq5zSVSS/nLnOHrK8t40Qt/+gjjcSokpGLDZ232bkxp1i?= =?us-ascii?Q?UFtGjqVVARYL9CCIEUT4g1QqvrNW1ZmvdufBkwuYdBmKMxZ3EXZ5VsQeAMDN?= =?us-ascii?Q?paDazty3bvZsxSAuqbequv3GfBAVbt5Ghtnwm1fPklRALnHvEP3dE37hvDwf?= =?us-ascii?Q?sC3kTLkKTMQ4K3HxpboQMS/h+J2uMEQzGuseOPPP7hCGshb6VN4mNFhZEqeM?= =?us-ascii?Q?NyjSvfwvYcpezb9jS/3uS+lQwu3qe5E731ryEZUa?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: DM8PR11MB5752.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5ae57659-7f68-4a6a-8bf0-08dbbb2d5c25 X-MS-Exchange-CrossTenant-originalarrivaltime: 22 Sep 2023 05:32:49.6784 (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: 3j/Wq71Dfj4hp6c4OimDVMR/N/fpAr3+cUov3XyPywnduSpxdC2OTyFJZSJaVoxT1XWS+0e85BfHG0/WKNvN2g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR11MB5868 X-OriginatorOrg: intel.com Precedence: Bulk 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,fan.wang@intel.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: ZxpKWczFUG4l0N56q95Cb3R4x7686176AA= Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20140610 header.b=BnnIE2+F; spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce@groups.io; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=intel.com (policy=none); arc=reject ("signature check failed: fail, {[1] = sig:microsoft.com:reject}") Hi Mike, Liming, Guomin and Dandan Could you help review this change? Best Regards Fan -----Original Message----- From: devel@edk2.groups.io On Behalf Of Wang Fan Sent: Monday, September 11, 2023 5:52 PM To: devel@edk2.groups.io Cc: Wang, Fan ; Kinney, Michael D ; Gao, Liming ; Jiang, Guomin ; Bi, Dandan Subject: [edk2-devel] [PATCH V2 1/1] MdeModulePkg: Support customized FV Mi= gration Information REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D4533 There are use cases which not all FVs need be migrated from TempRam to perm= anent memory before TempRam tears down. This new guid is introduced to avoi= d unnecessary FV migration to improve boot performance. Platform can publis= h ToMigrateFvInfo hob with this guid to customize FV migration info, and Pe= iCore will only migrate FVs indicated by this Hob info. This is a backwards compatible change, PeiCore will check ToMigrateFvInfo h= ob before migration. If ToMigrateFvInfo hobs exists, only migrate FVs recor= ded by hobs. If ToMigrateFvInfo hobs not exists, migrate all FVs to permane= nt memory. Cc: Michael D Kinney Cc: Liming Gao Cc: Guomin Jiang Cc: Dandan Bi Signed-off-by: Wang Fan --- MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c | 82 +++++++++++++------ MdeModulePkg/Core/Pei/PeiMain.inf | 1 + MdeModulePkg/Include/Guid/MigratedFvInfo.h | 19 +++++ MdeModulePkg/MdeModulePkg.dec | 3 +- 4 files changed, 79 insertions(+), 26 deletions(-) diff --git a/MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c b/MdeModulePkg/C= ore/Pei/Dispatcher/Dispatcher.c index 5f32ebb560ae..e84849ec6db1 100644 --- a/MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c +++ b/MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c @@ -1184,7 +1184,11 @@ EvacuateTempRam ( =20 PEI_CORE_FV_HANDLE PeiCoreFvHandle; EFI_PEI_CORE_FV_LOCATION_PPI *PeiCoreFvLocationPpi; + EDKII_TO_MIGRATE_FV_INFO *ToMigrateFvInfo; EDKII_MIGRATED_FV_INFO MigratedFvInfo; + EFI_PEI_HOB_POINTERS Hob; + BOOLEAN MigrateAllFvs; + UINT32 MigrationFlags; =20 ASSERT (Private->PeiMemoryInstalled); =20 @@ -1211,6 +1215,17 @@ EvacuateTempRam ( =20 ConvertPeiCorePpiPointers (Private, &PeiCoreFvHandle); =20 + // + // Check if platform defined hobs to indicate which FVs are expected to = migrate or keep raw data. + // If ToMigrateFvInfo hobs exists, only migrate FVs recorded by hobs. + // If ToMigrateFvInfo hobs not exists, migrate all FVs to permanent memo= ry. + // + MigrateAllFvs =3D TRUE; + Hob.Raw =3D GetFirstGuidHob (&gEdkiiToMigrateFvInfoGuid); + if (Hob.Raw !=3D NULL) { + MigrateAllFvs =3D FALSE; + } + for (FvIndex =3D 0; FvIndex < Private->FvCount; FvIndex++) { FvHeader =3D Private->Fv[FvIndex].FvHeader; ASSERT (FvHeader !=3D NULL); @@ -1224,6 +1239,25 @@ EvacuateTempRam ( ) ) { + if (MigrateAllFvs) { + MigrationFlags =3D 0; + } else { + MigrationFlags =3D FLAGS_SKIP_FV_MIGRATION | FLAGS_SKIP_FV_RAW_DAT= A_COPY; + Hob.Raw =3D GetFirstGuidHob (&gEdkiiToMigrateFvInfoGuid); + while (Hob.Raw !=3D NULL) { + ToMigrateFvInfo =3D GET_GUID_HOB_DATA (Hob); + if (ToMigrateFvInfo->FvOrgBase =3D=3D (UINT32)(UINTN)FvHeader) { + MigrationFlags =3D ToMigrateFvInfo->MigrationFlags; + break; + } + Hob.Raw =3D GET_NEXT_HOB (Hob); + Hob.Raw =3D GetNextGuidHob (&gEdkiiToMigrateFvInfoGuid, Hob.Raw)= ; + } + } + if (MigrationFlags & FLAGS_SKIP_FV_MIGRATION) { + continue; + } + // // Allocate page to save the rebased PEIMs, the PEIMs will get dispa= tched later. // @@ -1234,18 +1268,7 @@ EvacuateTempRam ( ); ASSERT_EFI_ERROR (Status); MigratedFvHeader =3D (EFI_FIRMWARE_VOLUME_HEADER *)(UINTN)FvHeaderAd= dress; - - // - // Allocate pool to save the raw PEIMs, which is used to keep consis= tent context across - // multiple boot and PCR0 will keep the same no matter if the addres= s of allocated page is changed. - // - Status =3D PeiServicesAllocatePages ( - EfiBootServicesCode, - EFI_SIZE_TO_PAGES ((UINTN)FvHeader->FvLength), - &FvHeaderAddress - ); - ASSERT_EFI_ERROR (Status); - RawDataFvHeader =3D (EFI_FIRMWARE_VOLUME_HEADER *)(UINTN)FvHeaderAdd= ress; + CopyMem (MigratedFvHeader, FvHeader, (UINTN)FvHeader->FvLength); =20 DEBUG (( DEBUG_VERBOSE, @@ -1256,18 +1279,29 @@ EvacuateTempRam ( )); =20 // - // Copy the context to the rebased pages and raw pages, and create h= ob to save the - // information. The MigratedFvInfo HOB will never be produced when - // PcdMigrateTemporaryRamFirmwareVolumes is FALSE, because the PCD c= ontrol the - // feature. + // Copy the context to the raw pages, and create hob to save the inf= ormation. The MigratedFvInfo + // HOB will never be produced when PcdMigrateTemporaryRamFirmwareVol= umes is FALSE, because the PCD + // controls the feature. // - CopyMem (MigratedFvHeader, FvHeader, (UINTN)FvHeader->FvLength); - CopyMem (RawDataFvHeader, MigratedFvHeader, (UINTN)FvHeader->FvLengt= h); - MigratedFvInfo.FvOrgBase =3D (UINT32)(UINTN)FvHeader; - MigratedFvInfo.FvNewBase =3D (UINT32)(UINTN)MigratedFvHeader; - MigratedFvInfo.FvDataBase =3D (UINT32)(UINTN)RawDataFvHeader; - MigratedFvInfo.FvLength =3D (UINT32)(UINTN)FvHeader->FvLength; - BuildGuidDataHob (&gEdkiiMigratedFvInfoGuid, &MigratedFvInfo, sizeof= (MigratedFvInfo)); + if ((MigrationFlags & FLAGS_SKIP_FV_RAW_DATA_COPY) !=3D FLAGS_SKIP_F= V_RAW_DATA_COPY) { + // + // Allocate pool to save the raw PEIMs, which is used to keep cons= istent context across + // multiple boot and PCR0 will keep the same no matter if the addr= ess of allocated page is changed. + // + Status =3D PeiServicesAllocatePages ( + EfiBootServicesCode, + EFI_SIZE_TO_PAGES ((UINTN)FvHeader->FvLength), + &FvHeaderAddress + ); + ASSERT_EFI_ERROR (Status); + RawDataFvHeader =3D (EFI_FIRMWARE_VOLUME_HEADER *)(UINTN)FvHeaderA= ddress; + CopyMem (RawDataFvHeader, MigratedFvHeader, (UINTN)FvHeader->FvLen= gth); + MigratedFvInfo.FvOrgBase =3D (UINT32)(UINTN)FvHeader; + MigratedFvInfo.FvNewBase =3D (UINT32)(UINTN)MigratedFvHeader; + MigratedFvInfo.FvDataBase =3D (UINT32)(UINTN)RawDataFvHeader; + MigratedFvInfo.FvLength =3D (UINT32)(UINTN)FvHeader->FvLength; + BuildGuidDataHob (&gEdkiiMigratedFvInfoGuid, &MigratedFvInfo, size= of (MigratedFvInfo)); + } =20 // // Migrate any children for this FV now @@ -1330,8 +1364,6 @@ Evacua= teTempRam ( } } =20 - RemoveFvHobsInTemporaryMemory (Private); - return Status; } =20 diff --git a/MdeModulePkg/Core/Pei/PeiMain.inf b/MdeModulePkg/Core/Pei/PeiM= ain.inf index 0cf357371a16..944b230b0e19 100644 --- a/MdeModulePkg/Core/Pei/PeiMain.inf +++ b/MdeModulePkg/Core/Pei/PeiMain.inf @@ -78,6 +78,7 @@ gEfiFirmwareFileSystem3Guid gStatusCodeCallbackGuid gEdkiiMigratedFvInfoGuid ## SOMETIMES_PRODUCES = ## HOB + gEdkiiToMigrateFvInfoGuid ## SOMETIMES_CONSUMES = ## HOB =20 [Ppis] gEfiPeiStatusCodePpiGuid ## SOMETIMES_CONSUMES # Pe= iReportStatusService is not ready if this PPI doesn't exist diff --git a/MdeModulePkg/Include/Guid/MigratedFvInfo.h b/MdeModulePkg/Incl= ude/Guid/MigratedFvInfo.h index aca2332a0ec6..543cd9ba7ddd 100644 --- a/MdeModulePkg/Include/Guid/MigratedFvInfo.h +++ b/MdeModulePkg/Include/Guid/MigratedFvInfo.h @@ -9,6 +9,24 @@ SPDX-License-Identifier: BSD-2-Clause-Patent #ifndef __ED= KII_MIGRATED_FV_INFO_GUID_H__ #define __EDKII_MIGRATED_FV_INFO_GUID_H__ =20 +#define FLAGS_SKIP_FV_MIGRATION BIT0 +#define FLAGS_SKIP_FV_RAW_DATA_COPY BIT1 + +/// +/// EDKII_TO_MIGRATE_FV_INFO Hob information should be published by=20 +platform to indicate /// one FV is expected to migrate to permarnant memor= y or not before TempRam tears down. +/// +typedef struct { + UINT32 FvOrgBase; // original FV address + // + // Migration Flags: + // Bit0: Indicate to skip FV migration or not + // Bit1: Indicate to skip FV raw data copy or not + // Others: Reserved bits + // + UINT32 MigrationFlags; +} EDKII_TO_MIGRATE_FV_INFO; + typedef struct { UINT32 FvOrgBase; // original FV address UINT32 FvNewBase; // new FV address @@ -16,6 +34,7 @@ typedef struct { UINT32 FvLength; // Fv Length } EDKII_MIGRATED_FV_INFO; =20 +extern EFI_GUID gEdkiiToMigrateFvInfoGuid; extern EFI_GUID gEdkiiMigratedFvInfoGuid; =20 #endif // #ifndef __EDKII_MIGRATED_FV_INFO_GUID_H__ diff --git a/MdeModule= Pkg/MdeModulePkg.dec b/MdeModulePkg/MdeModulePkg.dec index dd182c02fdf6..d6= cbcc721a5e 100644 --- a/MdeModulePkg/MdeModulePkg.dec +++ b/MdeModulePkg/MdeModulePkg.dec @@ -416,7 +416,8 @@ gEdkiiCapsuleOnDiskNameGuid =3D { 0x98c80a4f, 0xe16b, 0x4d11, { 0x93, 0x= 9a, 0xab, 0xe5, 0x61, 0x26, 0x3, 0x30 } } =20 ## Include/Guid/MigratedFvInfo.h - gEdkiiMigratedFvInfoGuid =3D { 0xc1ab12f7, 0x74aa, 0x408d, { 0xa2, 0xf4,= 0xc6, 0xce, 0xfd, 0x17, 0x98, 0x71 } } + gEdkiiToMigrateFvInfoGuid =3D { 0xb4b140a5, 0x72f6, 0x4c21, { 0x93,=20 + 0xe4, 0xac, 0xc4, 0xec, 0xcb, 0x23, 0x23 } } gEdkiiMigratedFvInfoGuid = =20 + =3D { 0xc1ab12f7, 0x74aa, 0x408d, { 0xa2, 0xf4, 0xc6, 0xce, 0xfd, 0x17,= =20 + 0x98, 0x71 } } =20 ## Include/Guid/RngAlgorithm.h gEdkiiRngAlgorithmUnSafe =3D { 0x869f728c, 0x409d, 0x4ab4, {0xac, 0x03, = 0x71, 0xd3, 0x09, 0xc1, 0xb3, 0xf4 }} -- 2.29.2.windows.2 -=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 (#108978): https://edk2.groups.io/g/devel/message/108978 Mute This Topic: https://groups.io/mt/101289546/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-