Hi Eugene,
On 2015/12/1 21:16, Cohen, Eugene wrote:
This is a patch that enables the S3 Resume path from PEI without permanent
memory installed. There is not a strict requirement that we can see to have
permanent memory installed for S3 resume. We have platforms that hold PEI code
(not just data) in cache-as-ram and these require S3 Resume from temporary
memory.
Do you have the patch tested on your real platforms (with and without
InstallPeiMemory()?
>
This change does the following:
1. Relax the ASSERT in PEI core for permanent memory before launching IPL so
that it only enforces this in non-S3 Resume boot modes
2. Remove the gEfiPeiMemoryDiscoveredPpiGuid depex for DXE IPL so it can load
before permanent memory. Since DXE IPL is really driven by the IPL PPI this is
generally harmless. This may cause IPL to be loaded pre-memory in a normal
boot and be shadowed to permanent memory
3. Add a check in DXE IPL that permanent memory is present for boot paths that
load the DXE core (e.g. normal)
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Eugene Cohen <[email protected]>
---
MdeModulePkg/Core/DxeIplPeim/DxeIpl.inf | 3 ++-
MdeModulePkg/Core/DxeIplPeim/DxeLoad.c | 11 +++++++++++
MdeModulePkg/Core/Pei/PeiMain/PeiMain.c | 6 ++++--
3 files changed, 17 insertions(+), 3 deletions(-)
diff --git a/MdeModulePkg/Core/DxeIplPeim/DxeIpl.inf
b/MdeModulePkg/Core/DxeIplPeim/DxeIpl.inf
index 04ad928..9623f96 100644
--- a/MdeModulePkg/Core/DxeIplPeim/DxeIpl.inf
+++ b/MdeModulePkg/Core/DxeIplPeim/DxeIpl.inf
@@ -93,6 +93,7 @@
## SOMETIMES_CONSUMES
## UNDEFINED # HOB
gEfiVectorHandoffInfoPpiGuid
+ gEfiPeiMemoryDiscoveredPpiGuid ## SOMETIMES_CONSUMES # Consumed on normal
path
[Guids]
## SOMETIMES_CONSUMES ## Variable:L"MemoryTypeInformation"
@@ -115,7 +116,7 @@
gEfiMdeModulePkgTokenSpaceGuid.PcdSetNxForStack ##
SOMETIMES_CONSUMES
[Depex]
- gEfiPeiMemoryDiscoveredPpiGuid AND gEfiPeiLoadFilePpiGuid AND
gEfiPeiMasterBootModePpiGuid
+ gEfiPeiLoadFilePpiGuid AND gEfiPeiMasterBootModePpiGuid
Since the depex gEfiPeiMemoryDiscoveredPpiGuid is removed from inf. The
DxeLoad may be dispatched earlier than before.
Current code will install Decompress and Extraction PPI for both normal
and S3 path in entry point, but Decompress and Extraction PPI need to
use AllocatePages() that only works after memory discovered as PI spec
describes.
Then should the code be also updated to install Decompress and
Extraction PPI in memory discovered ppi notify with
EFI_PEI_PPI_DESCRIPTOR_NOTIFY_DISPATCH?
Thanks,
Star
#
# [BootMode]
diff --git a/MdeModulePkg/Core/DxeIplPeim/DxeLoad.c
b/MdeModulePkg/Core/DxeIplPeim/DxeLoad.c
index d7d693f..888a710 100644
--- a/MdeModulePkg/Core/DxeIplPeim/DxeLoad.c
+++ b/MdeModulePkg/Core/DxeIplPeim/DxeLoad.c
@@ -193,6 +193,7 @@ DxeLoadCore (
)
{
EFI_STATUS Status;
+ VOID *Dummy;
EFI_FV_FILE_INFO DxeCoreFileInfo;
EFI_PHYSICAL_ADDRESS DxeCoreAddress;
UINT64 DxeCoreSize;
@@ -273,6 +274,16 @@ DxeLoadCore (
//
}
+ // DXE core load requires permanent memory
+ Status = PeiServicesLocatePpi (
+ &gEfiPeiMemoryDiscoveredPpiGuid,
+ 0,
+ NULL,
+ (VOID **)&Dummy
+ );
+ ASSERT_EFI_ERROR (Status);
+ if( EFI_ERROR(Status)) return Status;
+
if (GetFirstGuidHob ((CONST EFI_GUID *)&gEfiMemoryTypeInformationGuid) ==
NULL) {
//
// Don't build GuidHob if GuidHob has been installed.
diff --git a/MdeModulePkg/Core/Pei/PeiMain/PeiMain.c
b/MdeModulePkg/Core/Pei/PeiMain/PeiMain.c
index d36f89c..8f2dfa3 100644
--- a/MdeModulePkg/Core/Pei/PeiMain/PeiMain.c
+++ b/MdeModulePkg/Core/Pei/PeiMain/PeiMain.c
@@ -421,9 +421,11 @@ PeiCore (
PeiDispatcher (SecCoreData, &PrivateData);
//
- // Check if InstallPeiMemory service was called.
+ // If we're not doing S3 resume then we require permanent memory
//
- ASSERT(PrivateData.PeiMemoryInstalled == TRUE);
+ if(PrivateData.HobList.HandoffInformationTable->BootMode !=
BOOT_ON_S3_RESUME) {
+ ASSERT(PrivateData.PeiMemoryInstalled == TRUE);
+ }
//
// Measure PEI Core execution time.
_______________________________________________
edk2-devel mailing list
[email protected]
https://lists.01.org/mailman/listinfo/edk2-devel