Print an error and stop in case VirtMmCommunicationDxe
initialization fails.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
OvmfPkg/VirtMmCommunicationDxe/VirtMmCommunication.inf | 1 +
OvmfPkg/VirtMmCommunicationDxe/VirtMmCommunication.c | 10 ++++++++++
2 files changed, 11 insertions(+)
diff --git a/OvmfPkg/VirtMmCommunicationDxe/VirtMmCommunication.inf b/OvmfPkg/VirtMmCommunicationDxe/VirtMmCommunication.inf
index 1403e92e1d6d..08fadefa5275 100644
--- a/OvmfPkg/VirtMmCommunicationDxe/VirtMmCommunication.inf
+++ b/OvmfPkg/VirtMmCommunicationDxe/VirtMmCommunication.inf
@@ -36,6 +36,7 @@ [LibraryClasses]
[FeaturePcd]
gEfiMdeModulePkgTokenSpaceGuid.PcdEnableVariableRuntimeCache ## CONSUMES
gEfiMdeModulePkgTokenSpaceGuid.PcdVariableCollectStatistics ## CONSUMES
+ gUefiOvmfPkgTokenSpaceGuid.PcdQemuVarsRequire ## CONSUMES
[Protocols]
gEfiMmCommunication2ProtocolGuid ## PRODUCES
diff --git a/OvmfPkg/VirtMmCommunicationDxe/VirtMmCommunication.c b/OvmfPkg/VirtMmCommunicationDxe/VirtMmCommunication.c
index 7b4ebe1257c6..c33561b39f9b 100644
--- a/OvmfPkg/VirtMmCommunicationDxe/VirtMmCommunication.c
+++ b/OvmfPkg/VirtMmCommunicationDxe/VirtMmCommunication.c
@@ -376,5 +376,15 @@ VirtMmCommunication2Initialize (
FreePages (mCommunicateBuffer, EFI_SIZE_TO_PAGES (MAX_BUFFER_SIZE));
ReturnErrorStatus:
+ if (FeaturePcdGet (PcdQemuVarsRequire)) {
+ DEBUG ((
+ DEBUG_ERROR,
+ "ERROR: qemu uefi variable service is not available, use \n"
+ " 'qemu-system-x86_64 -device uefi-vars-isa' or\n"
+ " 'qemu-system-aarch64 -machine virt,x-uefi-vars=on'\n"
+ ));
+ CpuDeadLoop ();
+ }
+
return EFI_INVALID_PARAMETER;
}
--
2.42.0
-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#111680): https://edk2.groups.io/g/devel/message/111680
Mute This Topic: https://groups.io/mt/102767937/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-