Skip to content

Commit 8910f72

Browse files
kraxelmergify[bot]
authored andcommitted
OvmfPkg/VirtMmCommunicationDxe: stop on init failure
Print an error and stop in case VirtMmCommunicationDxe initialization fails. Signed-off-by: Gerd Hoffmann <[email protected]>
1 parent 4846ac9 commit 8910f72

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

OvmfPkg/VirtMmCommunicationDxe/VirtMmCommunication.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -396,5 +396,15 @@ VirtMmCommunication2Initialize (
396396
FreePages (mCommunicateBuffer, EFI_SIZE_TO_PAGES (MAX_BUFFER_SIZE));
397397

398398
ReturnErrorStatus:
399+
if (FeaturePcdGet (PcdQemuVarsRequire)) {
400+
DEBUG ((
401+
DEBUG_ERROR,
402+
"ERROR: qemu uefi variable service is not available, use \n"
403+
" 'qemu-system-x86_64 -device uefi-vars-x64' or\n"
404+
" 'qemu-system-aarch64 -device uefi-vars-sysbus'\n"
405+
));
406+
CpuDeadLoop ();
407+
}
408+
399409
return EFI_INVALID_PARAMETER;
400410
}

OvmfPkg/VirtMmCommunicationDxe/VirtMmCommunication.inf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@
5252
[FeaturePcd]
5353
gEfiMdeModulePkgTokenSpaceGuid.PcdEnableVariableRuntimeCache ## CONSUMES
5454
gEfiMdeModulePkgTokenSpaceGuid.PcdVariableCollectStatistics ## CONSUMES
55+
gUefiOvmfPkgTokenSpaceGuid.PcdQemuVarsRequire ## CONSUMES
5556

5657
[Protocols]
5758
gEfiMmCommunication2ProtocolGuid ## PRODUCES

0 commit comments

Comments
 (0)