summaryrefslogtreecommitdiff
path: root/OvmfPkg/AcpiS3SaveDxe/AcpiS3Save.c
diff options
context:
space:
mode:
authorLaszlo Ersek <lersek@redhat.com>2014-03-31 20:35:58 +0000
committerjljusten <jljusten@6f19259b-4bc3-4df7-8a09-765794883524>2014-03-31 20:35:58 +0000
commit209c3922b7c8a4f7ddb54c9dd369500937395e58 (patch)
tree5609bef36512f4228159cb4e3dd2fde35db15cd6 /OvmfPkg/AcpiS3SaveDxe/AcpiS3Save.c
parent0e8a31f5c918edecd150c52e531bbaff0d5e0680 (diff)
downloadedk2-platforms-209c3922b7c8a4f7ddb54c9dd369500937395e58.tar.xz
OvmfPkg: AcpiS3SaveDxe: do not load if S3 is unsupported/disabled in qemu
The previous patch ensures that the LockBox is protected during DXE (but the OS can still drop it) if S3 is unsupported or disabled. However, S3 related drivers not only save data in the lockbox, they allocate objects with Reserved and AcpiNVS memory types too, which the OS can't (must not) release. This is a waste when S3 is unsupported or disabled. In OVMF a good "choke point" for these drivers is the entry point of AcpiS3SaveDxe. The messages of the following commits are relevant to the data and control flow: - SVN r15290 (git commit 8f5ca05b) - SVN r15305 (git commit 5a217a06) - SVN r15306 (git commit d4ba06df) Prevent AcpiS3SaveDxe from loading when S3 is unsupported or disabled. This should keep away (most of the) dependent drivers too. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Tested-by: Matt Fleming <matt.fleming@intel.com> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15419 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'OvmfPkg/AcpiS3SaveDxe/AcpiS3Save.c')
-rw-r--r--OvmfPkg/AcpiS3SaveDxe/AcpiS3Save.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/OvmfPkg/AcpiS3SaveDxe/AcpiS3Save.c b/OvmfPkg/AcpiS3SaveDxe/AcpiS3Save.c
index a4de911d41..f322981b53 100644
--- a/OvmfPkg/AcpiS3SaveDxe/AcpiS3Save.c
+++ b/OvmfPkg/AcpiS3SaveDxe/AcpiS3Save.c
@@ -24,6 +24,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#include <Library/LockBoxLib.h>
#include <Library/PcdLib.h>
#include <Library/DebugLib.h>
+#include <Library/QemuFwCfgLib.h>
#include <Guid/AcpiVariableCompatibility.h>
#include <Guid/AcpiS3Context.h>
#include <Guid/Acpi.h>
@@ -586,6 +587,10 @@ InstallAcpiS3Save (
{
EFI_STATUS Status;
+ if (!QemuFwCfgS3Enabled()) {
+ return EFI_LOAD_ERROR;
+ }
+
if (!FeaturePcdGet(PcdPlatformCsmSupport)) {
//
// More memory for no CSM tip, because GDT need relocation