diff options
author | Laszlo Ersek <lersek@redhat.com> | 2015-11-30 18:42:05 +0000 |
---|---|---|
committer | lersek <lersek@Edk2> | 2015-11-30 18:42:05 +0000 |
commit | 542534456b48cbb3f803449669ba3cccbf828c0b (patch) | |
tree | 701c8eacae134fc0348f8d46d9b97e3edd9c0386 /OvmfPkg | |
parent | b7c14f1e43ada836e7c9c4e89829faefd7b8c879 (diff) | |
download | edk2-542534456b48cbb3f803449669ba3cccbf828c0b.tar.gz edk2-542534456b48cbb3f803449669ba3cccbf828c0b.tar.bz2 edk2-542534456b48cbb3f803449669ba3cccbf828c0b.zip |
OvmfPkg: LockBoxLib: -D SMM_REQUIRE excludes our fake lockbox
When the user builds OVMF with -D SMM_REQUIRE, our LockBox implementation
must not be used, since it doesn't actually protect data in the LockBox
from the runtime guest OS. Add an according assert to
LockBoxLibInitialize().
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@19046 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'OvmfPkg')
-rw-r--r-- | OvmfPkg/Library/LockBoxLib/LockBoxBaseLib.inf | 3 | ||||
-rw-r--r-- | OvmfPkg/Library/LockBoxLib/LockBoxDxeLib.inf | 3 | ||||
-rw-r--r-- | OvmfPkg/Library/LockBoxLib/LockBoxLib.c | 2 |
3 files changed, 8 insertions, 0 deletions
diff --git a/OvmfPkg/Library/LockBoxLib/LockBoxBaseLib.inf b/OvmfPkg/Library/LockBoxLib/LockBoxBaseLib.inf index 7203d0777d..81c893e4cb 100644 --- a/OvmfPkg/Library/LockBoxLib/LockBoxBaseLib.inf +++ b/OvmfPkg/Library/LockBoxLib/LockBoxBaseLib.inf @@ -42,3 +42,6 @@ [Pcd]
gUefiOvmfPkgTokenSpaceGuid.PcdOvmfLockBoxStorageBase
gUefiOvmfPkgTokenSpaceGuid.PcdOvmfLockBoxStorageSize
+
+[FeaturePcd]
+ gUefiOvmfPkgTokenSpaceGuid.PcdSmmSmramRequire
diff --git a/OvmfPkg/Library/LockBoxLib/LockBoxDxeLib.inf b/OvmfPkg/Library/LockBoxLib/LockBoxDxeLib.inf index a4d27a598d..08973a47be 100644 --- a/OvmfPkg/Library/LockBoxLib/LockBoxDxeLib.inf +++ b/OvmfPkg/Library/LockBoxLib/LockBoxDxeLib.inf @@ -43,3 +43,6 @@ [Pcd]
gUefiOvmfPkgTokenSpaceGuid.PcdOvmfLockBoxStorageBase
gUefiOvmfPkgTokenSpaceGuid.PcdOvmfLockBoxStorageSize
+
+[FeaturePcd]
+ gUefiOvmfPkgTokenSpaceGuid.PcdSmmSmramRequire
diff --git a/OvmfPkg/Library/LockBoxLib/LockBoxLib.c b/OvmfPkg/Library/LockBoxLib/LockBoxLib.c index 89050ac87c..45481b9230 100644 --- a/OvmfPkg/Library/LockBoxLib/LockBoxLib.c +++ b/OvmfPkg/Library/LockBoxLib/LockBoxLib.c @@ -44,6 +44,8 @@ LockBoxLibInitialize ( {
UINTN NumEntries;
+ ASSERT (!FeaturePcdGet (PcdSmmSmramRequire));
+
if (PcdGet32 (PcdOvmfLockBoxStorageSize) < sizeof (LOCK_BOX_GLOBAL)) {
return RETURN_UNSUPPORTED;
}
|