diff options
author | Gerd Hoffmann <kraxel@redhat.com> | 2023-10-26 14:05:42 +0200 |
---|---|---|
committer | mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> | 2025-04-23 13:43:23 +0000 |
commit | 9af96e21d8bc47fc89d44a6480fcc962bc511c21 (patch) | |
tree | 6437e149d0b861a2c87897f00297bac1c9da60db | |
parent | cd6f84b70c3c2e05df1977255305bc7118f33699 (diff) | |
download | edk2-9af96e21d8bc47fc89d44a6480fcc962bc511c21.zip edk2-9af96e21d8bc47fc89d44a6480fcc962bc511c21.tar.gz edk2-9af96e21d8bc47fc89d44a6480fcc962bc511c21.tar.bz2 |
OvmfPkg: add PcdQemuVarsRequire
Add PcdQemuVarsRequire FeaturePcd, so firmware code can figure whenever
the given build is supposed to use the qemu uefi variable service.
Skip the emulated variable store setup in case PcdQemuVarsRequire is
true. This is needed to make secure boot work.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
-rw-r--r-- | OvmfPkg/OvmfPkg.dec | 3 | ||||
-rw-r--r-- | OvmfPkg/OvmfPkgX64.dsc | 1 | ||||
-rw-r--r-- | OvmfPkg/PlatformPei/Platform.c | 4 | ||||
-rw-r--r-- | OvmfPkg/PlatformPei/PlatformPei.inf | 1 |
4 files changed, 9 insertions, 0 deletions
diff --git a/OvmfPkg/OvmfPkg.dec b/OvmfPkg/OvmfPkg.dec index 1703f50..10de899 100644 --- a/OvmfPkg/OvmfPkg.dec +++ b/OvmfPkg/OvmfPkg.dec @@ -464,3 +464,6 @@ # framebuffer. This might be required on platforms that do not tolerate
# misaligned accesses otherwise.
gUefiOvmfPkgTokenSpaceGuid.PcdRemapFrameBufferWriteCombine|FALSE|BOOLEAN|0x75
+
+ ## This feature flag indicates the firmware build needs the qemu variable service.
+ gUefiOvmfPkgTokenSpaceGuid.PcdQemuVarsRequire|FALSE|BOOLEAN|0x77
diff --git a/OvmfPkg/OvmfPkgX64.dsc b/OvmfPkg/OvmfPkgX64.dsc index 6212d99..60fccc1 100644 --- a/OvmfPkg/OvmfPkgX64.dsc +++ b/OvmfPkg/OvmfPkgX64.dsc @@ -502,6 +502,7 @@ gEfiMdeModulePkgTokenSpaceGuid.PcdEnableVariableRuntimeCache|FALSE
!endif
!if $(QEMU_PV_VARS) == TRUE
+ gUefiOvmfPkgTokenSpaceGuid.PcdQemuVarsRequire|TRUE
gEfiMdeModulePkgTokenSpaceGuid.PcdEnableVariableRuntimeCache|FALSE
!endif
!if $(SECURE_BOOT_ENABLE) == TRUE
diff --git a/OvmfPkg/PlatformPei/Platform.c b/OvmfPkg/PlatformPei/Platform.c index d22c525..a354e06 100644 --- a/OvmfPkg/PlatformPei/Platform.c +++ b/OvmfPkg/PlatformPei/Platform.c @@ -221,6 +221,10 @@ ReserveEmuVariableNvStore ( EFI_PHYSICAL_ADDRESS VariableStore;
RETURN_STATUS PcdStatus;
+ if (FeaturePcdGet (PcdQemuVarsRequire)) {
+ return;
+ }
+
VariableStore = (EFI_PHYSICAL_ADDRESS)(UINTN)PlatformReserveEmuVariableNvStore ();
PcdStatus = PcdSet64S (PcdEmuVariableNvStoreReserved, VariableStore);
diff --git a/OvmfPkg/PlatformPei/PlatformPei.inf b/OvmfPkg/PlatformPei/PlatformPei.inf index c20ac6b..1b2af6f 100644 --- a/OvmfPkg/PlatformPei/PlatformPei.inf +++ b/OvmfPkg/PlatformPei/PlatformPei.inf @@ -143,6 +143,7 @@ [FeaturePcd]
gUefiOvmfPkgTokenSpaceGuid.PcdSmmSmramRequire
+ gUefiOvmfPkgTokenSpaceGuid.PcdQemuVarsRequire
[Ppis]
gEfiPeiMasterBootModePpiGuid
|