From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga04.intel.com (mga04.intel.com []) by mx.groups.io with SMTP id smtpd.web11.3253.1574404399285073315 for ; Thu, 21 Nov 2019 22:33:21 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@intel.onmicrosoft.com header.s=selector2-intel-onmicrosoft-com header.b=hZQO8vmY; spf=fail (domain: intel.com, ip: , mailfrom: michael.a.kubacki@intel.com) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 21 Nov 2019 22:33:20 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.69,228,1571727600"; d="scan'208";a="210343363" Received: from fmsmsx103.amr.corp.intel.com ([10.18.124.201]) by orsmga006.jf.intel.com with ESMTP; 21 Nov 2019 22:33:20 -0800 Received: from fmsmsx156.amr.corp.intel.com (10.18.116.74) by FMSMSX103.amr.corp.intel.com (10.18.124.201) with Microsoft SMTP Server (TLS) id 14.3.439.0; Thu, 21 Nov 2019 22:33:19 -0800 Received: from FMSEDG002.ED.cps.intel.com (10.1.192.134) by fmsmsx156.amr.corp.intel.com (10.18.116.74) with Microsoft SMTP Server (TLS) id 14.3.439.0; Thu, 21 Nov 2019 22:33:18 -0800 Received: from NAM05-DM3-obe.outbound.protection.outlook.com (104.47.49.54) by edgegateway.intel.com (192.55.55.69) with Microsoft SMTP Server (TLS) id 14.3.439.0; Thu, 21 Nov 2019 22:33:18 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Y6b5LV1g4KYyYdG0BZlvI4IdbhPzyxZI+TXrqS/7FV+PnITdEQvQt4VHhD+6hcl+mI7OZh8NtS4D7XQYaaMABJoSUMGGI2Kqw4D7cu/BKwZOm7BjadmENmCIzF7Nw47EwBHEYubjBOdTIvcXeKGn6d7tlDg7l1YJhSe2XueFRVyRsrKz6L18Pnez18MX30mWCzPnICGyFptyQJEd+XLvLpU7KtfNEz0XBlRugUfboK4HLtsgzKajFc3e0FJwvxFbSchZZ/PGJY3FhciNZAxmzqKQXqnYfdjZCqWTNhmCAAN7Eb3bqcpVrPsF1+7m7QKF8e/9dUkJINan57rX5RrdqQ== 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=nNvxECyXcne+kZBpJhN8FBEE48XJnSZwlCHR0mQ7IqM=; b=gopx93RlbrvGUMDNXDyJCxqUSrUmSxGleyoNalkfNGVA/ArBPkwAtMnJ3e7bGgOCmGvoUgY2AmcJaAzpESuq84+/7UHBGZ6TZKzsmULBSaTUmKSxnF037VPn7jygQncuXPSWUFg96TdPYRQb2uFgxNH3FMxC9LsMjzRFvSBSwV4CSO1iT74/knWl0Q1ndytlodlOXIYPAGVWVJ5FeeZ4LHrB4YF+T0TI3u1rrsAcbI4RRjwXupOZ8uabbyI9c/R66RQqQpO8fhmx7A1iBkC5S270oXfQK6jFovvczctKSv9Vh9f0qUb4xrwG/J8xF9YLrudrpa5+GwLSd+TnM9TLxg== 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=nNvxECyXcne+kZBpJhN8FBEE48XJnSZwlCHR0mQ7IqM=; b=hZQO8vmYdVtu7V0Op99QDyDwOKwbOj5R8/0xqYBsc0C3q9GHNO28x74RtFLrh4Pf0wfIkIaDj0m9lnS5mklN/EBHXwRKxvrxXiL7dybtxyzi1AhQTgYT70kxfYMo1w3kDBqtbQsrgLJAMq2UgPLXYrtCH8rKmaxKcCTymE9Iitw= Received: from BY5PR11MB4484.namprd11.prod.outlook.com (52.132.254.155) by BY5PR11MB4053.namprd11.prod.outlook.com (10.255.72.84) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2474.19; Fri, 22 Nov 2019 06:33:04 +0000 Received: from BY5PR11MB4484.namprd11.prod.outlook.com ([fe80::a114:604b:7ca3:5420]) by BY5PR11MB4484.namprd11.prod.outlook.com ([fe80::a114:604b:7ca3:5420%7]) with mapi id 15.20.2474.019; Fri, 22 Nov 2019 06:33:04 +0000 From: "Kubacki, Michael A" To: "Desimone, Nathaniel L" , "devel@edk2.groups.io" CC: "Chiu, Chasel" , "Gao, Liming" Subject: Re: [edk2-platforms] [PATCH V2 14/14] MinPlatformPkg: Remove BoardInitLib dependency from PlatformSecLib Thread-Topic: [edk2-platforms] [PATCH V2 14/14] MinPlatformPkg: Remove BoardInitLib dependency from PlatformSecLib Thread-Index: AQHVoEoL3NSBAZsh6EidLyFUR4jPb6eWuA/Q Date: Fri, 22 Nov 2019 06:33:04 +0000 Message-ID: References: <20191121085853.2626-1-nathaniel.l.desimone@intel.com> <20191121085853.2626-15-nathaniel.l.desimone@intel.com> In-Reply-To: <20191121085853.2626-15-nathaniel.l.desimone@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows x-ctpclassification: CTP_NT x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiZTc3Zjc5YWQtNDExZi00NWNmLWFkNjktZWYxNzZjY2E2MTgwIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiOFZSaSs4dFhUY0tkaWtneFNMdkluSmlRTmdMZ0NaZmJ1MlZhZ3VZeEk4Rk5hSmVXOVpGVjJyTXNMYThVK3pEUiJ9 dlp-reaction: no-action dlp-version: 11.2.0.6 authentication-results: spf=none (sender IP is ) smtp.mailfrom=michael.a.kubacki@intel.com; x-originating-ip: [134.134.136.217] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: c3f94351-c42a-48ff-5df8-08d76f15d471 x-ms-traffictypediagnostic: BY5PR11MB4053: x-ld-processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:9508; x-forefront-prvs: 02296943FF x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(1496009)(396003)(136003)(366004)(346002)(376002)(39860400002)(13464003)(189003)(199004)(3846002)(26005)(7736002)(76176011)(76116006)(229853002)(66066001)(102836004)(9686003)(6116002)(86362001)(6506007)(305945005)(66946007)(11346002)(14444005)(256004)(64756008)(66446008)(2906002)(66556008)(53546011)(74316002)(8676002)(8936002)(19627235002)(66476007)(81166006)(446003)(81156014)(107886003)(6436002)(25786009)(52536014)(2501003)(14454004)(71200400001)(71190400001)(30864003)(7696005)(186003)(55016002)(4326008)(54906003)(316002)(110136005)(99286004)(6246003)(33656002)(5660300002)(508600001);DIR:OUT;SFP:1102;SCL:1;SRVR:BY5PR11MB4053;H:BY5PR11MB4484.namprd11.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: DmI8LTyGcRCgDj+W0qU7OuxDkRBe7uac/yqHriJNQDNCxFbAQVQL7AVzEKNd7z5cs/5vyixE042+90gSV3OSFHyKGpUFrzDxzo5ROFbu6lXaHjSfoNlezeSjdosZxM0C3c/46DoJe+NRzbM5TfpFWunlTSzJYjuTVlT8paUGAa8cWayVSAOML3S6jyU94EtJHgHnmsYUoiKQIrgXUH5HshJ2aiOGFPtW9JW6Yu9kYtyidDr5eXskbWWSyjiaTZCv1z79O5Fj9Vr5LE5nESznysLL8r8V3UTKBRrTaIMdwW/MKPa+pp3CTDc/ukz/UnPpLpAMIYExSzHzDVIZk/8CvV0Fkkc+Lm+tQM+6zJIA6qVC0hNyRE1rW/cY2pSij7GYHscwDAC5WsZphXOrCzFvR1EKSGLvhsAw4gHAvEa0Are2AvLsqjt91hjR6ED7i5P4 MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: c3f94351-c42a-48ff-5df8-08d76f15d471 X-MS-Exchange-CrossTenant-originalarrivaltime: 22 Nov 2019 06:33:04.4380 (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: ffWKzCKTbI8bqD2D3OCAJblIRaDkbtzAIA3HfB5Vd3Jg4ltyzJvfw7AuRIHuvZFBLltvD3Qe625sk3cWjrH9/lyQxQ2Ycwlp1lhSKTM33I0= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR11MB4053 Return-Path: michael.a.kubacki@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Michael Kubacki > -----Original Message----- > From: Desimone, Nathaniel L > Sent: Thursday, November 21, 2019 12:59 AM > To: devel@edk2.groups.io > Cc: Kubacki, Michael A ; Chiu, Chasel > ; Gao, Liming > Subject: [edk2-platforms] [PATCH V2 14/14] MinPlatformPkg: Remove > BoardInitLib dependency from PlatformSecLib >=20 > SecFspWrapperPlatformSecLib contains the implementation of > SecPlatformDisableTemporaryMemory(), which SecMain in UefiCpuPkg will > call as part of its implementation of EFI_PEI_TEMPORARY_RAM_DONE_PPI. > For platforms that use FSP, the implementation of > SecPlatformDisableTemporaryMemory() can be made generic since the > chipset specifics will be contained in FspTempRamExit(). >=20 > The Minimum Platform Specification provides the BoardPkg two interface > hook points, BoardInitBeforeTempRamExit() and > BoardInitAfterTempRamExit() which must be called during > SecPlatformDisableTemporaryMemory(). Due to > EFI_PEI_TEMPORARY_RAM_DONE_PPI being a special case of a PPI that is > implemented in SEC, these two functions are the only ones in BoardInitLib > that need to be called by SEC. >=20 > Linking BoardInitLib with SEC places many restrictions on the implementat= ion > of that library. The features available to SEC phase code are very minima= l. > Since this code runs during PEI phase, these restrictions are not actuall= y > required. >=20 > Instead of directly linking with BoardInitLib, > SecPlatformDisableTemporaryMemory() shall call BoardInitLib indirectly > through a PPI (PLATFORM_INIT_TEMP_RAM_EXIT_PPI.) This PPI is produced > by PlatformInitPreMem, which implements the other BoardInitLib calls > already, so this change should also slightly reduce the size of the final= binary > image since less PE/COFF images will need to link with BoardInitLib. >=20 > Cc: Michael Kubacki > Cc: Chasel Chiu > Cc: Liming Gao > Signed-off-by: Nate DeSimone > --- > .../SecFspWrapperPlatformSecLib.inf | 2 +- > .../SecTempRamDone.c | 36 +++++++-- > .../Include/Ppi/PlatformInitTempRamExitPpi.h | 55 ++++++++++++++ > .../Intel/MinPlatformPkg/MinPlatformPkg.dec | 2 + > .../PlatformInitPei/PlatformInitPreMem.c | 76 ++++++++++++++++++- > .../PlatformInitPei/PlatformInitPreMem.inf | 1 + > 6 files changed, 159 insertions(+), 13 deletions(-) create mode 100644 > Platform/Intel/MinPlatformPkg/Include/Ppi/PlatformInitTempRamExitPpi.h >=20 > diff --git > a/Platform/Intel/MinPlatformPkg/FspWrapper/Library/SecFspWrapperPlatf > ormSecLib/SecFspWrapperPlatformSecLib.inf > b/Platform/Intel/MinPlatformPkg/FspWrapper/Library/SecFspWrapperPlatf > ormSecLib/SecFspWrapperPlatformSecLib.inf > index 02c720c73d..4f3fa9fa34 100644 > --- > a/Platform/Intel/MinPlatformPkg/FspWrapper/Library/SecFspWrapperPlatf > ormSecLib/SecFspWrapperPlatformSecLib.inf > +++ > b/Platform/Intel/MinPlatformPkg/FspWrapper/Library/SecFspWrapperPlat > +++ formSecLib/SecFspWrapperPlatformSecLib.inf > @@ -69,7 +69,6 @@ > SerialPortLib FspWrapperPlatformLib FspWrapperApiLib- BoardInitLi= b > SecBoardInitLib TestPointCheckLib PeiServicesTablePointerLib@@ -80,6 > +79,7 @@ > gTopOfTemporaryRamPpiGuid ## PRODUCES > gEfiPeiFirmwareVolumeInfoPpiGuid ## PRODUCES > gFspTempRamExitPpiGuid ## CONSUMES+ > gPlatformInitTempRamExitPpiGuid ## CONSUMES [Pcd] > gUefiCpuPkgTokenSpaceGuid.PcdPeiTemporaryRamStackSize ## > CONSUMESdiff --git > a/Platform/Intel/MinPlatformPkg/FspWrapper/Library/SecFspWrapperPlatf > ormSecLib/SecTempRamDone.c > b/Platform/Intel/MinPlatformPkg/FspWrapper/Library/SecFspWrapperPlatf > ormSecLib/SecTempRamDone.c > index 922e4ec204..b22cf57d6c 100644 > --- > a/Platform/Intel/MinPlatformPkg/FspWrapper/Library/SecFspWrapperPlatf > ormSecLib/SecTempRamDone.c > +++ > b/Platform/Intel/MinPlatformPkg/FspWrapper/Library/SecFspWrapperPlat > +++ formSecLib/SecTempRamDone.c > @@ -10,6 +10,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent > #include #include > +#include > #include #include @@ - > 17,7 +18,6 @@ SPDX-License-Identifier: BSD-2-Clause-Patent #include > #include > #include -#include > #include /**@@ -29,14 +29,35 @@ > SecPlatformDisableTemporaryMemory ( > VOID ) {- EFI_STATUS Status;- VOID > *TempRamExitParam;- CONST EFI_PEI_SERVICES **PeiServices;- > FSP_TEMP_RAM_EXIT_PPI *TempRamExitPpi;+ EFI_STATUS > Status;+ VOID *TempRamExitParam;+ CONST > EFI_PEI_SERVICES **PeiServices;+ FSP_TEMP_RAM_EXIT_PPI > *TempRamExitPpi;+ PLATFORM_INIT_TEMP_RAM_EXIT_PPI > *PlatformInitTempRamExitPpi; DEBUG ((DEBUG_INFO, > "SecPlatformDisableTemporaryMemory enter\n"));+ PeiServices =3D > GetPeiServicesTablePointer ();+ ASSERT (PeiServices !=3D NULL);+ if > (PeiServices =3D=3D NULL) {+ return;+ }+ ASSERT ((*PeiServices) !=3D= NULL);+ if > ((*PeiServices) =3D=3D NULL) {+ return;+ }+ Status =3D (*PeiServices= )->LocatePpi > (+ PeiServices,+ > &gPlatformInitTempRamExitPpiGuid,+ 0,+ = NULL,+ > (VOID **) &PlatformInitTempRamExitPpi+ );+ > ASSERT_EFI_ERROR (Status);+ if (EFI_ERROR (Status)) {+ return;+ } - = Status > =3D BoardInitBeforeTempRamExit ();+ Status =3D PlatformInitTempRamExitPp= i- > >PlatformInitBeforeTempRamExit (); ASSERT_EFI_ERROR (Status); if > (PcdGet8 (PcdFspModeSelection) =3D=3D 1) {@@ -51,7 +72,6 @@ > SecPlatformDisableTemporaryMemory ( > // // FSP Dispatch mode //- PeiServices =3D GetPeiService= sTablePointer > (); Status =3D (*PeiServices)->LocatePpi ( = PeiServices, > &gFspTempRamExitPpiGuid,@@ -66,7 +86,7 @@ > SecPlatformDisableTemporaryMemory ( > TempRamExitPpi->TempRamExit (NULL); } - Status =3D > BoardInitAfterTempRamExit ();+ Status =3D PlatformInitTempRamExitPpi- > >PlatformInitAfterTempRamExit (); ASSERT_EFI_ERROR (Status); return > ;diff --git > a/Platform/Intel/MinPlatformPkg/Include/Ppi/PlatformInitTempRamExitPpi. > h > b/Platform/Intel/MinPlatformPkg/Include/Ppi/PlatformInitTempRamExitPpi. > h > new file mode 100644 > index 0000000000..590647738c > --- /dev/null > +++ > b/Platform/Intel/MinPlatformPkg/Include/Ppi/PlatformInitTempRamExitP > +++ pi.h > @@ -0,0 +1,55 @@ > +/** @file+ This file defines the PPI for notifying PlatformInitPreMem+ = of > temporary memory being disabled.++Copyright (c) 2019, Intel Corporation. > All rights reserved.
+SPDX-License-Identifier: BSD-2-Clause- > Patent++**/++#ifndef > _PLATFORM_INIT_TEMP_RAM_EXIT_PPI_H_+#define > _PLATFORM_INIT_TEMP_RAM_EXIT_PPI_H_++#include ++//+// > Forward declaration for the > PLATFORM_INIT_TEMP_RAM_EXIT_PPI.+//+typedef struct > _PLATFORM_INIT_TEMP_RAM_EXIT_PPI > PLATFORM_INIT_TEMP_RAM_EXIT_PPI;++/**+ A hook for platform-specific > initialization prior to disabling temporary RAM.++ @retval EFI_SUCCESS = The > platform initialization was successful.+ @retval EFI_NOT_READY The > platform has not been detected yet.+**/+typedef+EFI_STATUS+(EFIAPI > *PLATFORM_INIT_BEFORE_TEMP_RAM_EXIT) (+ VOID+ );++/**+ A hook > for platform-specific initialization after disabling temporary RAM.++ @r= etval > EFI_SUCCESS The platform initialization was successful.+ @retval > EFI_NOT_READY The platform has not been detected > yet.+**/+typedef+EFI_STATUS+(EFIAPI > *PLATFORM_INIT_AFTER_TEMP_RAM_EXIT) (+ VOID+ );++///+/// This PPI > provides functions for notifying PlatformInitPreMem+/// of temporary > memory being disabled.+///+struct > _PLATFORM_INIT_TEMP_RAM_EXIT_PPI {+ > PLATFORM_INIT_BEFORE_TEMP_RAM_EXIT > PlatformInitBeforeTempRamExit;+ > PLATFORM_INIT_AFTER_TEMP_RAM_EXIT > PlatformInitAfterTempRamExit;+};++extern EFI_GUID > gPlatformInitTempRamExitPpiGuid;++#endif // > _PLATFORM_INIT_TEMP_RAM_EXIT_PPI_H_diff --git > a/Platform/Intel/MinPlatformPkg/MinPlatformPkg.dec > b/Platform/Intel/MinPlatformPkg/MinPlatformPkg.dec > index 6ef0219129..6a765d689d 100644 > --- a/Platform/Intel/MinPlatformPkg/MinPlatformPkg.dec > +++ b/Platform/Intel/MinPlatformPkg/MinPlatformPkg.dec > @@ -28,6 +28,8 @@ > gPeiBaseMemoryTestPpiGuid =3D {0xb6ec423c, 0x21d2, 0x490d, {0x= 85, > 0xc6, 0xdd, 0x58, 0x64, 0xea, 0xa6, 0x74}} gPeiPlatformMemorySizePpiGui= d > =3D {0x9a7ef41e, 0xc140, 0x4bd1, {0xb8, 0x84, 0x1e, 0x11, 0x24, 0x0b, 0x4= c, > 0xe6}} + gPlatformInitTempRamExitPpiGuid =3D {0xbae23646, 0xbd60, 0x4f= 8b, > {0xb3, 0xf9, 0xf3, 0x91, 0xee, 0x7e, 0xe6, 0xc8}}+ [Guids] > gMinPlatformPkgTokenSpaceGuid =3D {0x69d13bf0, 0xaf91, 0x4d96, {0xaa, > 0x9f, 0x21, 0x84, 0xc5, 0xce, 0x3b, 0xc0}} diff --git > a/Platform/Intel/MinPlatformPkg/PlatformInit/PlatformInitPei/PlatformInit= P > reMem.c > b/Platform/Intel/MinPlatformPkg/PlatformInit/PlatformInitPei/PlatformInit= P > reMem.c > index c579ff008e..efdeb6a91c 100644 > --- > a/Platform/Intel/MinPlatformPkg/PlatformInit/PlatformInitPei/PlatformInit= P > reMem.c > +++ b/Platform/Intel/MinPlatformPkg/PlatformInit/PlatformInitPei/Platfor > +++ mInitPreMem.c > @@ -29,6 +29,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent #include > #include > #include +#include > EFI_STATUS EFIAPI@@ -72,7 +73,31 > @@ BaseMemoryTest ( > OUT EFI_PHYSICAL_ADDRESS *ErrorAddress ); -static > EFI_PEI_NOTIFY_DESCRIPTOR mMemDiscoveredNotifyList =3D {+/**+ A hook > for platform-specific initialization prior to disabling temporary RAM.++ > @retval EFI_SUCCESS The platform initialization was successful.+ @retv= al > EFI_NOT_READY The platform has not been detected > yet.+**/+EFI_STATUS+EFIAPI+PlatformInitBeforeTempRamExit (+ VOID+ > );++/**+ A hook for platform-specific initialization after disabling tem= porary > RAM.++ @retval EFI_SUCCESS The platform initialization was successful.= + > @retval EFI_NOT_READY The platform has not been detected > yet.+**/+EFI_STATUS+EFIAPI+PlatformInitAfterTempRamExit (+ VOID+ > );++GLOBAL_REMOVE_IF_UNREFERENCED EFI_PEI_NOTIFY_DESCRIPTOR > mMemDiscoveredNotifyList =3D { > (EFI_PEI_PPI_DESCRIPTOR_NOTIFY_CALLBACK | > EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST), > &gEfiPeiMemoryDiscoveredPpiGuid, (EFI_PEIM_NOTIFY_ENTRY_POINT) > MemoryDiscoveredPpiNotifyCallback@@ -90,11 +115,11 @@ > GLOBAL_REMOVE_IF_UNREFERENCED EFI_PEI_PPI_DESCRIPTOR > mPpiBootMode =3D { > NULL }; -static PEI_BASE_MEMORY_TEST_PPI mPeiBaseMemoryTestPpi =3D > { BaseMemoryTest };+GLOBAL_REMOVE_IF_UNREFERENCED > PEI_BASE_MEMORY_TEST_PPI mPeiBaseMemoryTestPpi =3D { > BaseMemoryTest }; -static PEI_PLATFORM_MEMORY_SIZE_PPI > mMemoryMemorySizePpi =3D { GetPlatformMemorySize > };+GLOBAL_REMOVE_IF_UNREFERENCED > PEI_PLATFORM_MEMORY_SIZE_PPI mMemoryMemorySizePpi =3D { > GetPlatformMemorySize }; -static EFI_PEI_PPI_DESCRIPTOR > mMemPpiList[] =3D {+GLOBAL_REMOVE_IF_UNREFERENCED > EFI_PEI_PPI_DESCRIPTOR mMemPpiList[] =3D { { > EFI_PEI_PPI_DESCRIPTOR_PPI, &gPeiBaseMemoryTestPpiGuid,@@ -107,6 > +132,17 @@ static EFI_PEI_PPI_DESCRIPTOR mMemPpiList[] =3D { > }, }; +GLOBAL_REMOVE_IF_UNREFERENCED > PLATFORM_INIT_TEMP_RAM_EXIT_PPI mPlatformInitTempRamExitPpi =3D {+ > PlatformInitBeforeTempRamExit,+ > PlatformInitAfterTempRamExit+};++GLOBAL_REMOVE_IF_UNREFERENCED > EFI_PEI_PPI_DESCRIPTOR mPlatformInitTempRamExitPpiDesc =3D {+ > (EFI_PEI_PPI_DESCRIPTOR_PPI | > EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST),+ > &gPlatformInitTempRamExitPpiGuid,+ &mPlatformInitTempRamExitPpi+};+ > /// /// Memory Reserved should be between 125% to 150% of the Current > required memory /// otherwise BdsMisc.c would do a reset to make it 125% > to avoid s4 resume issues.@@ -391,6 +427,35 @@ > MemoryDiscoveredPpiNotifyCallback ( > return Status; } +/**+ A hook for platform-specific initialization pr= ior to > disabling temporary RAM.++ @retval EFI_SUCCESS The platform > initialization was successful.+ @retval EFI_NOT_READY The platform has n= ot > been detected > yet.+**/+EFI_STATUS+EFIAPI+PlatformInitBeforeTempRamExit (+ VOID+ > )+{+ return BoardInitBeforeTempRamExit ();+}++/**+ A hook for platform- > specific initialization after disabling temporary RAM.++ @retval EFI_SUC= CESS > The platform initialization was successful.+ @retval EFI_NOT_READY The > platform has not been detected > yet.+**/+EFI_STATUS+EFIAPI+PlatformInitAfterTempRamExit (+ VOID+ > )+{+ return BoardInitAfterTempRamExit ();+} /** This function handles > PlatformInit task after PeiReadOnlyVariable2 PPI produced@@ -446,6 +511,9 > @@ PlatformInitPreMem ( > Status =3D BoardInitBeforeMemoryInit (); ASSERT_EFI_ERROR (Status); = + > Status =3D PeiServicesInstallPpi (&mPlatformInitTempRamExitPpiDesc);+ > ASSERT_EFI_ERROR (Status);+ return Status; } diff --git > a/Platform/Intel/MinPlatformPkg/PlatformInit/PlatformInitPei/PlatformInit= P > reMem.inf > b/Platform/Intel/MinPlatformPkg/PlatformInit/PlatformInitPei/PlatformInit= P > reMem.inf > index af5dbe8772..7ee18eb6d5 100644 > --- > a/Platform/Intel/MinPlatformPkg/PlatformInit/PlatformInitPei/PlatformInit= P > reMem.inf > +++ b/Platform/Intel/MinPlatformPkg/PlatformInit/PlatformInitPei/Platfor > +++ mInitPreMem.inf > @@ -53,6 +53,7 @@ > gEfiPeiMemoryDiscoveredPpiGuid gEfiPeiMasterBootModePpiGuid > ## PRODUCES gEfiPeiBootInRecoveryModePpiGuid ## PRODUCES+ > gPlatformInitTempRamExitPpiGuid ## PRODUCES > gEfiPeiReadOnlyVariable2PpiGuid gPeiBaseMemoryTestPpiGuid > gPeiPlatformMemorySizePpiGuid-- > 2.24.0.windows.2