Blame SOURCES/0023-OvmfPkg-QemuRamfbDxe-Do-not-report-DXE-failure-on-Aa.patch

82dd91
From deb3451034326b75fd760aba47a5171493ff055e Mon Sep 17 00:00:00 2001
fcd20d
From: Philippe Mathieu-Daude <philmd@redhat.com>
fcd20d
Date: Thu, 1 Aug 2019 20:43:48 +0200
63d87e
Subject: OvmfPkg: QemuRamfbDxe: Do not report DXE failure on Aarch64 silent
63d87e
 builds (RH only)
63d87e
82dd91
Notes about the RHEL-8.2/20190904-37eef91017ad [edk2-stable201908] ->
82dd91
RHEL-8.3/20200603-ca407c7246bf [edk2-stable202005] rebase:
82dd91
82dd91
- no change
82dd91
63d87e
Notes about the RHEL-8.1/20190308-89910a39dcfd [edk2-stable201903] ->
63d87e
RHEL-8.2/20190904-37eef91017ad [edk2-stable201908] rebase:
63d87e
63d87e
- We have to carry this downstream-only patch -- committed originally as
63d87e
  aaaedc1e2cfd -- indefinitely.
63d87e
63d87e
- To avoid confusion, remove the tags from the commit message that had
63d87e
  been added by the downstream maintainer scripts, such as: Message-id,
63d87e
  Patchwork-id, O-Subject, Acked-by. These remain available on the
63d87e
  original downstream commit. The Bugzilla line is preserved, as it
63d87e
  doesn't relate to a specific posting, but to the problem.
fcd20d
fcd20d
Bugzilla: 1714446
fcd20d
fcd20d
To suppress an error message on the silent build when ramfb is
fcd20d
not configured, change QemuRamfbDxe to return EFI_SUCCESS even
fcd20d
when it fails.
fcd20d
Some memory is wasted (driver stays resident without
fcd20d
any good use), but it is mostly harmless, as the memory
fcd20d
is released by the OS after ExitBootServices().
fcd20d
fcd20d
Suggested-by: Laszlo Ersek <lersek@redhat.com>
fcd20d
Signed-off-by: Philippe Mathieu-Daude <philmd@redhat.com>
63d87e
(cherry picked from commit aaaedc1e2cfd55ef003fb1b5a37c73a196b26dc7)
63d87e
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
82dd91
(cherry picked from commit aa2b66b18a62d652bdbefae7b5732297294306ca)
fcd20d
---
fcd20d
 OvmfPkg/QemuRamfbDxe/QemuRamfb.c      | 14 ++++++++++++++
fcd20d
 OvmfPkg/QemuRamfbDxe/QemuRamfbDxe.inf |  1 +
fcd20d
 2 files changed, 15 insertions(+)
fcd20d
fcd20d
diff --git a/OvmfPkg/QemuRamfbDxe/QemuRamfb.c b/OvmfPkg/QemuRamfbDxe/QemuRamfb.c
63d87e
index 0d49d8bbab..dbf9bcbe16 100644
fcd20d
--- a/OvmfPkg/QemuRamfbDxe/QemuRamfb.c
fcd20d
+++ b/OvmfPkg/QemuRamfbDxe/QemuRamfb.c
63d87e
@@ -13,6 +13,7 @@
fcd20d
 #include <Library/BaseLib.h>
fcd20d
 #include <Library/BaseMemoryLib.h>
fcd20d
 #include <Library/DebugLib.h>
fcd20d
+#include <Library/DebugPrintErrorLevelLib.h>
fcd20d
 #include <Library/DevicePathLib.h>
fcd20d
 #include <Library/FrameBufferBltLib.h>
fcd20d
 #include <Library/MemoryAllocationLib.h>
63d87e
@@ -242,6 +243,19 @@ InitializeQemuRamfb (
fcd20d
 
fcd20d
   Status = QemuFwCfgFindFile ("etc/ramfb", &mRamfbFwCfgItem, &FwCfgSize);
fcd20d
   if (EFI_ERROR (Status)) {
fcd20d
+#if defined (MDE_CPU_AARCH64)
fcd20d
+    //
fcd20d
+    // RHBZ#1714446
fcd20d
+    // If no ramfb device was configured, this platform DXE driver should
fcd20d
+    // returns EFI_NOT_FOUND, so the DXE Core can unload it. However, even
fcd20d
+    // using a silent build, an error message is issued to the guest console.
fcd20d
+    // Since this confuse users, return success and stay resident. The wasted
fcd20d
+    // guest RAM still gets freed later after ExitBootServices().
fcd20d
+    //
fcd20d
+    if (GetDebugPrintErrorLevel () == DEBUG_ERROR) {
fcd20d
+      return EFI_SUCCESS;
fcd20d
+    }
fcd20d
+#endif
fcd20d
     return EFI_NOT_FOUND;
fcd20d
   }
fcd20d
   if (FwCfgSize != sizeof (RAMFB_CONFIG)) {
fcd20d
diff --git a/OvmfPkg/QemuRamfbDxe/QemuRamfbDxe.inf b/OvmfPkg/QemuRamfbDxe/QemuRamfbDxe.inf
63d87e
index e3890b8c20..6ffee5acb2 100644
fcd20d
--- a/OvmfPkg/QemuRamfbDxe/QemuRamfbDxe.inf
fcd20d
+++ b/OvmfPkg/QemuRamfbDxe/QemuRamfbDxe.inf
63d87e
@@ -29,6 +29,7 @@
fcd20d
   BaseLib
fcd20d
   BaseMemoryLib
fcd20d
   DebugLib
fcd20d
+  DebugPrintErrorLevelLib
fcd20d
   DevicePathLib
fcd20d
   FrameBufferBltLib
fcd20d
   MemoryAllocationLib
fcd20d
-- 
63d87e
2.18.1
fcd20d