MdeModulePkg: Supporting S3 in 64bit PEI

https://bugzilla.tianocore.org/show_bug.cgi?id=4195
Transfer from DXE to OS waking vector by calling SwitchStack() when
both are in the same execution mode.

Reviewed-by: Ray Ni <ray.ni@intel.com>
Reviewed-by: Zhiguang Liu <zhiguang.liu@intel.com>
Cc: Chasel Chiu <chasel.chiu@intel.com>
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Cc: Ashraf Ali S <ashraf.ali.s@intel.com>
Cc: Chinni B Duggapu <chinni.b.duggapu@intel.com>
Signed-off-by: Ted Kuo <ted.kuo@intel.com>
This commit is contained in:
Kuo, Ted
2022-12-16 20:46:27 +08:00
committed by mergify[bot]
parent 6acf72901a
commit 8bd2028f9a
3 changed files with 22 additions and 13 deletions

View File

@@ -1,7 +1,7 @@
/** @file
This is the implementation to save ACPI S3 Context.
Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
Copyright (c) 2006 - 2022, Intel Corporation. All rights reserved.<BR>
SPDX-License-Identifier: BSD-2-Clause-Patent
@@ -97,7 +97,7 @@ IsLongModeWakingVectorSupport (
//
// BIOS supports 64bit waking vector.
//
if (FeaturePcdGet (PcdDxeIplSwitchToLongMode)) {
if (sizeof (UINTN) == sizeof (UINT64)) {
return TRUE;
}
}
@@ -110,11 +110,11 @@ IsLongModeWakingVectorSupport (
@param[in] LongModeWakingVectorSupport Support long mode waking vector or not.
If BootScriptExector driver will run in 64-bit mode, this function will establish the 1:1
If BootScriptExecutor driver will run in 64-bit mode, this function will establish the 1:1
virtual to physical mapping page table when long mode waking vector is supported, otherwise
create 4G page table when long mode waking vector is not supported and let PF handler to
handle > 4G request.
If BootScriptExector driver will not run in 64-bit mode, this function will do nothing.
If BootScriptExecutor driver will not run in 64-bit mode, this function will do nothing.
@return Page table base address.
@@ -124,7 +124,7 @@ S3AllocatePageTablesBuffer (
IN BOOLEAN LongModeWakingVectorSupport
)
{
if (FeaturePcdGet (PcdDxeIplSwitchToLongMode)) {
if ((FeaturePcdGet (PcdDxeIplSwitchToLongMode)) || (sizeof (UINTN) == sizeof (UINT64))) {
UINTN ExtraPageTablePages;
UINT32 RegEax;
UINT32 RegEdx;