From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by mx.groups.io with SMTP id smtpd.web09.653.1578029461410978166 for ; Thu, 02 Jan 2020 21:31:01 -0800 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 134.134.136.126, mailfrom: liming.gao@intel.com) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 02 Jan 2020 21:31:01 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.69,389,1571727600"; d="scan'208";a="222069903" Received: from fmsmsx104.amr.corp.intel.com ([10.18.124.202]) by orsmga003.jf.intel.com with ESMTP; 02 Jan 2020 21:31:00 -0800 Received: from fmsmsx124.amr.corp.intel.com (10.18.125.39) by fmsmsx104.amr.corp.intel.com (10.18.124.202) with Microsoft SMTP Server (TLS) id 14.3.439.0; Thu, 2 Jan 2020 21:31:00 -0800 Received: from shsmsx101.ccr.corp.intel.com (10.239.4.153) by fmsmsx124.amr.corp.intel.com (10.18.125.39) with Microsoft SMTP Server (TLS) id 14.3.439.0; Thu, 2 Jan 2020 21:31:00 -0800 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.197]) by SHSMSX101.ccr.corp.intel.com ([169.254.1.30]) with mapi id 14.03.0439.000; Fri, 3 Jan 2020 13:30:58 +0800 From: "Liming Gao" To: Pankaj Bansal , "devel@edk2.groups.io" CC: "Bi, Dandan" Subject: Re: [PATCH] MdeModulePkg PeiCore: Install SEC PPIs before library constructor call Thread-Topic: [PATCH] MdeModulePkg PeiCore: Install SEC PPIs before library constructor call Thread-Index: AQHVvgPymyICpiI6tkWQbYHqZL3dCKfYccYg Date: Fri, 3 Jan 2020 05:30:58 +0000 Message-ID: <4A89E2EF3DFEDB4C8BFDE51014F606A14E589722@SHSMSX104.ccr.corp.intel.com> References: <20191229101353.20820-1-pankaj.bansal@nxp.com> In-Reply-To: <20191229101353.20820-1-pankaj.bansal@nxp.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Return-Path: liming.gao@intel.com Content-Language: en-US Content-Type: text/plain; charset="iso-2022-jp" Content-Transfer-Encoding: quoted-printable This change looks good. What functionality test have been done?=20 -----Original Message----- From: Pankaj Bansal =20 Sent: 2019=1B$BG/=1B(B12=1B$B7n=1B(B29=1B$BF|=1B(B 12:54 To: devel@edk2.groups.io Cc: Pankaj Bansal ; Bi, Dandan = ; Gao, Liming Subject: [PATCH] MdeModulePkg PeiCore: Install SEC PPIs before library cons= tructor call Install PPIs received from SEC phase before library constructor call, so th= at any platform specific library can make use of the PPIs exposed by SEC ph= ase. Since SEC phase can expose HOBs also in PPI list, we need to Initialize mem= ory service before installing SEC PPIs. Therefore, the sequence becomes: Initialize memory -> install SEC PPIs -> Call libraries' constructors Signed-off-by: Pankaj Bansal Cc: Dandan Bi Cc: Liming Gao --- MdeModulePkg/Core/Pei/PeiMain/PeiMain.c | 24 ++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/MdeModulePkg/Core/Pei/PeiMain/PeiMain.c b/MdeModulePkg/Core/Pe= i/PeiMain/PeiMain.c index 025d7f98ec..3dd69ddde0 100644 --- a/MdeModulePkg/Core/Pei/PeiMain/PeiMain.c +++ b/MdeModulePkg/Core/Pei/PeiMain/PeiMain.c @@ -366,14 +366,23 @@ PeiCore ( SetPeiServicesTablePointer ((CONST EFI_PEI_SERVICES **)&PrivateData.Ps); =20 // - // Initialize libraries that the PEI Core is linked against + // Initialize PEI Core Services // - ProcessLibraryConstructorList (NULL, (CONST EFI_PEI_SERVICES **)&Private= Data.Ps); + InitializeMemoryServices (&PrivateData, SecCoreData, OldCoreData); + + if (OldCoreData =3D=3D NULL) { + // + // If SEC provided the PpiList, process it. + // + if (PpiList !=3D NULL) { + ProcessPpiListFromSec ((CONST EFI_PEI_SERVICES **) &PrivateData.Ps, = PpiList); + } + } =20 // - // Initialize PEI Core Services + // Initialize libraries that the PEI Core is linked against // - InitializeMemoryServices (&PrivateData, SecCoreData, OldCoreData); + ProcessLibraryConstructorList (NULL, (CONST EFI_PEI_SERVICES=20 + **)&PrivateData.Ps); =20 // // Update performance measurements @@ -410,13 +419,6 @@ PeiCore ( EFI_PROGRESS_CODE, (EFI_SOFTWARE_PEI_CORE | EFI_SW_PC_INIT) ); - - // - // If SEC provided the PpiList, process it. - // - if (PpiList !=3D NULL) { - ProcessPpiListFromSec ((CONST EFI_PEI_SERVICES **) &PrivateData.Ps, = PpiList); - } } else { // // Try to locate Temporary RAM Done Ppi. -- 2.17.1