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; }