summaryrefslogtreecommitdiffstats
path: root/OvmfPkg/AcpiS3SaveDxe
diff options
context:
space:
mode:
authorLaszlo Ersek <lersek@redhat.com>2015-11-30 18:42:01 +0000
committerlersek <lersek@Edk2>2015-11-30 18:42:01 +0000
commitb7c14f1e43ada836e7c9c4e89829faefd7b8c879 (patch)
tree39e3cd710af309505464f605da81d2e66dd927d5 /OvmfPkg/AcpiS3SaveDxe
parent8dbe742d17071f81392923e67fda45696438a831 (diff)
downloadedk2-b7c14f1e43ada836e7c9c4e89829faefd7b8c879.tar.gz
edk2-b7c14f1e43ada836e7c9c4e89829faefd7b8c879.tar.bz2
edk2-b7c14f1e43ada836e7c9c4e89829faefd7b8c879.zip
OvmfPkg: AcpiS3SaveDxe: don't fake LockBox protocol if SMM_REQUIRE
In SVN r15306 (git commit d4ba06df), "OvmfPkg: S3 Resume: fake LockBox protocol for BootScriptExecutorDxe", we installed a fake LockBox protocol in OVMF's AcpiS3SaveDxe clone. While our other AcpiS3SaveDxe customizations remain valid (or harmless), said change is invalid when OVMF is built with -D SMM_REQUIRE and includes the real protocol provider, "MdeModulePkg/Universal/LockBox/SmmLockBox/SmmLockBox.inf". Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19045 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'OvmfPkg/AcpiS3SaveDxe')
-rw-r--r--OvmfPkg/AcpiS3SaveDxe/AcpiS3Save.c14
-rw-r--r--OvmfPkg/AcpiS3SaveDxe/AcpiS3SaveDxe.inf3
2 files changed, 10 insertions, 7 deletions
diff --git a/OvmfPkg/AcpiS3SaveDxe/AcpiS3Save.c b/OvmfPkg/AcpiS3SaveDxe/AcpiS3Save.c
index f20560f8fe..e3ff234101 100644
--- a/OvmfPkg/AcpiS3SaveDxe/AcpiS3Save.c
+++ b/OvmfPkg/AcpiS3SaveDxe/AcpiS3Save.c
@@ -538,12 +538,14 @@ InstallEndOfDxeCallback (
return EFI_LOAD_ERROR;
}
- Status = gBS->InstallMultipleProtocolInterfaces (
- &ImageHandle,
- &gEfiLockBoxProtocolGuid, NULL,
- NULL
- );
- ASSERT_EFI_ERROR (Status);
+ if (!FeaturePcdGet (PcdSmmSmramRequire)) {
+ Status = gBS->InstallMultipleProtocolInterfaces (
+ &ImageHandle,
+ &gEfiLockBoxProtocolGuid, NULL,
+ NULL
+ );
+ ASSERT_EFI_ERROR (Status);
+ }
Status = gBS->CreateEventEx (
EVT_NOTIFY_SIGNAL,
diff --git a/OvmfPkg/AcpiS3SaveDxe/AcpiS3SaveDxe.inf b/OvmfPkg/AcpiS3SaveDxe/AcpiS3SaveDxe.inf
index 4cc0713d1a..a288b954b7 100644
--- a/OvmfPkg/AcpiS3SaveDxe/AcpiS3SaveDxe.inf
+++ b/OvmfPkg/AcpiS3SaveDxe/AcpiS3SaveDxe.inf
@@ -59,7 +59,7 @@
gEfiEndOfDxeEventGroupGuid ## CONSUMES ## Event
[Protocols]
- gEfiLockBoxProtocolGuid # PROTOCOL ALWAYS_PRODUCED
+ gEfiLockBoxProtocolGuid # PROTOCOL SOMETIMES_PRODUCED
gEfiLegacyBiosProtocolGuid # PROTOCOL ALWAYS_CONSUMED
gEfiLegacyRegion2ProtocolGuid # PROTOCOL SOMETIMES_CONSUMED
gFrameworkEfiMpServiceProtocolGuid # PROTOCOL SOMETIMES_CONSUMED
@@ -71,6 +71,7 @@
gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdS3AcpiReservedMemorySize ## CONSUMES
gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdS3BootScriptStackSize ## CONSUMES
gEfiMdeModulePkgTokenSpaceGuid.PcdUse1GPageTable
+ gUefiOvmfPkgTokenSpaceGuid.PcdSmmSmramRequire ## CONSUMES
[Depex]
gEfiVariableArchProtocolGuid AND gEfiVariableWriteArchProtocolGuid