summaryrefslogtreecommitdiffstats
path: root/OvmfPkg/PlatformPei
diff options
context:
space:
mode:
authorGerd Hoffmann <kraxel@redhat.com>2023-04-21 08:55:44 +0200
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2023-05-04 14:26:58 +0000
commit92da8a154fc0a1b0f42ab0ec4aee7dd2933f1a0a (patch)
tree797e6302d85642bb3c75330eff1b4c74c5405a59 /OvmfPkg/PlatformPei
parenta818a873e5381726c16470fa452d76fbbd5b200e (diff)
downloadedk2-92da8a154fc0a1b0f42ab0ec4aee7dd2933f1a0a.tar.gz
edk2-92da8a154fc0a1b0f42ab0ec4aee7dd2933f1a0a.tar.bz2
edk2-92da8a154fc0a1b0f42ab0ec4aee7dd2933f1a0a.zip
OvmfPkg: replace SECURE_BOOT_FEATURE_ENABLED with PcdSecureBootSupported
Drop the '-D SECURE_BOOT_FEATURE_ENABLED' compile time option, use a new FeaturePcd instead. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Diffstat (limited to 'OvmfPkg/PlatformPei')
-rw-r--r--OvmfPkg/PlatformPei/Platform.c7
-rw-r--r--OvmfPkg/PlatformPei/PlatformPei.inf1
2 files changed, 5 insertions, 3 deletions
diff --git a/OvmfPkg/PlatformPei/Platform.c b/OvmfPkg/PlatformPei/Platform.c
index cc9384ba5c..c56247e294 100644
--- a/OvmfPkg/PlatformPei/Platform.c
+++ b/OvmfPkg/PlatformPei/Platform.c
@@ -222,9 +222,10 @@ ReserveEmuVariableNvStore (
VariableStore = (EFI_PHYSICAL_ADDRESS)(UINTN)PlatformReserveEmuVariableNvStore ();
PcdStatus = PcdSet64S (PcdEmuVariableNvStoreReserved, VariableStore);
- #ifdef SECURE_BOOT_FEATURE_ENABLED
- PlatformInitEmuVariableNvStore ((VOID *)(UINTN)VariableStore);
- #endif
+ if (FeaturePcdGet (PcdSecureBootSupported)) {
+ // restore emulated VarStore from pristine ROM copy
+ PlatformInitEmuVariableNvStore ((VOID *)(UINTN)VariableStore);
+ }
ASSERT_RETURN_ERROR (PcdStatus);
}
diff --git a/OvmfPkg/PlatformPei/PlatformPei.inf b/OvmfPkg/PlatformPei/PlatformPei.inf
index 1fadadeb55..3934aeed95 100644
--- a/OvmfPkg/PlatformPei/PlatformPei.inf
+++ b/OvmfPkg/PlatformPei/PlatformPei.inf
@@ -94,6 +94,7 @@
gUefiOvmfPkgTokenSpaceGuid.PcdQ35SmramAtDefaultSmbase
gUefiOvmfPkgTokenSpaceGuid.PcdXenPvhStartOfDayStructPtr
gUefiOvmfPkgTokenSpaceGuid.PcdXenPvhStartOfDayStructPtrSize
+ gUefiOvmfPkgTokenSpaceGuid.PcdSecureBootSupported
gEfiMdePkgTokenSpaceGuid.PcdGuidedExtractHandlerTableAddress
gEfiMdePkgTokenSpaceGuid.PcdPciExpressBaseAddress
gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareSize