public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Gerd Hoffmann" <kraxel@redhat.com>
To: devel@edk2.groups.io
Cc: "Oliver Steffen" <osteffen@redhat.com>,
	"László Érsek" <lersek@redhat.com>,
	"Gerd Hoffmann" <kraxel@redhat.com>
Subject: [edk2-devel] [PATCH 5/7] OvmfPkg/VirtMmCommunicationDxe: stop on init failure
Date: Thu, 23 Nov 2023 16:02:32 +0100	[thread overview]
Message-ID: <20231123150234.117835-6-kraxel@redhat.com> (raw)
In-Reply-To: <20231123150234.117835-1-kraxel@redhat.com>

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/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



  parent reply	other threads:[~2023-11-23 15:02 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-23 15:02 [edk2-devel] [PATCH 0/7] Add VirtMmCommunication driver, enable for OVMF and ArmVirt Gerd Hoffmann
2023-11-23 15:02 ` [edk2-devel] [PATCH 1/7] OvmfPkg: add IndustryStandard/QemuUefiVars.h Gerd Hoffmann
2023-11-23 15:02 ` [edk2-devel] [PATCH 2/7] OvmfPkg: add new VirtMmCommunicationDxe driver Gerd Hoffmann
2023-11-23 15:02 ` [edk2-devel] [PATCH 3/7] OvmfPkg/OvmfPkgX64: add QEMU_VARS option Gerd Hoffmann
2023-11-23 15:02 ` [edk2-devel] [PATCH 4/7] OvmfPkg: add PcdQemuVarsRequire Gerd Hoffmann
2023-11-23 15:02 ` Gerd Hoffmann [this message]
2023-11-23 15:02 ` [edk2-devel] [PATCH 6/7] OvmfPkg/VirtMmCommunicationDxe: add arm support Gerd Hoffmann
2023-11-23 15:02 ` [edk2-devel] [PATCH 7/7] ArmVirtPkg/ArmVirtQemu: add QEMU_VARS option Gerd Hoffmann
2023-11-28  8:33 ` [edk2-devel] [PATCH 0/7] Add VirtMmCommunication driver, enable for OVMF and ArmVirt Ard Biesheuvel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20231123150234.117835-6-kraxel@redhat.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox