public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Liming Gao" <liming.gao@intel.com>
To: Pankaj Bansal <pankaj.bansal@nxp.com>,
	"devel@edk2.groups.io" <devel@edk2.groups.io>
Cc: "Bi, Dandan" <dandan.bi@intel.com>
Subject: Re: [PATCH] MdeModulePkg PeiCore: Install SEC PPIs before library constructor call
Date: Fri, 3 Jan 2020 05:30:58 +0000	[thread overview]
Message-ID: <4A89E2EF3DFEDB4C8BFDE51014F606A14E589722@SHSMSX104.ccr.corp.intel.com> (raw)
In-Reply-To: <20191229101353.20820-1-pankaj.bansal@nxp.com>

This change looks good. What functionality test have been done? 

-----Original Message-----
From: Pankaj Bansal <pankaj.bansal@nxp.com> 
Sent: 2019年12月29日 12:54
To: devel@edk2.groups.io
Cc: Pankaj Bansal <pankaj.bansal@nxp.com>; Bi, Dandan <dandan.bi@intel.com>; Gao, Liming <liming.gao@intel.com>
Subject: [PATCH] MdeModulePkg PeiCore: Install SEC PPIs before library constructor call

Install PPIs received from SEC phase before library constructor call, so that any platform specific library can make use of the PPIs exposed by SEC phase.

Since SEC phase can expose HOBs also in PPI list, we need to Initialize memory service before installing SEC PPIs.

Therefore, the sequence becomes:
Initialize memory -> install SEC PPIs -> Call libraries' constructors

Signed-off-by: Pankaj Bansal <pankaj.bansal@nxp.com>

Cc: Dandan Bi <dandan.bi@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
---
 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/Pei/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);
 
   //
-  // Initialize libraries that the PEI Core is linked against
+  // Initialize PEI Core Services
   //
-  ProcessLibraryConstructorList (NULL, (CONST EFI_PEI_SERVICES **)&PrivateData.Ps);
+  InitializeMemoryServices   (&PrivateData, SecCoreData, OldCoreData);
+
+  if (OldCoreData == NULL) {
+    //
+    // If SEC provided the PpiList, process it.
+    //
+    if (PpiList != NULL) {
+      ProcessPpiListFromSec ((CONST EFI_PEI_SERVICES **) &PrivateData.Ps, PpiList);
+    }
+  }
 
   //
-  // Initialize PEI Core Services
+  // Initialize libraries that the PEI Core is linked against
   //
-  InitializeMemoryServices   (&PrivateData, SecCoreData, OldCoreData);
+  ProcessLibraryConstructorList (NULL, (CONST EFI_PEI_SERVICES 
+ **)&PrivateData.Ps);
 
   //
   // 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 != NULL) {
-      ProcessPpiListFromSec ((CONST EFI_PEI_SERVICES **) &PrivateData.Ps, PpiList);
-    }
   } else {
     //
     // Try to locate Temporary RAM Done Ppi.
--
2.17.1


      reply	other threads:[~2020-01-03  5:31 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-29  4:53 [PATCH] MdeModulePkg PeiCore: Install SEC PPIs before library constructor call pankaj.bansal
2020-01-03  5:30 ` Liming Gao [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4A89E2EF3DFEDB4C8BFDE51014F606A14E589722@SHSMSX104.ccr.corp.intel.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox