render / rpms / edk2

Forked from rpms/edk2 3 months ago
Clone

Blame SOURCES/edk2-OvmfPkg-QemuKernelLoaderFsDxe-suppress-error-on-no-k.patch

3e2dc0
From 9adcdf493ebbd11efb74e2905ab5f6c8996e096d Mon Sep 17 00:00:00 2001
3e2dc0
From: Laszlo Ersek <lersek@redhat.com>
3e2dc0
Date: Wed, 24 Jun 2020 11:31:36 +0200
3e2dc0
Subject: [PATCH 1/3] OvmfPkg/QemuKernelLoaderFsDxe: suppress error on no
3e2dc0
 "-kernel" in silent aa64 build (RH)
3e2dc0
MIME-Version: 1.0
3e2dc0
Content-Type: text/plain; charset=UTF-8
3e2dc0
Content-Transfer-Encoding: 8bit
3e2dc0
3e2dc0
RH-Author: Laszlo Ersek <lersek@redhat.com>
3e2dc0
Message-id: <20200615080105.11859-2-lersek@redhat.com>
3e2dc0
Patchwork-id: 97532
3e2dc0
O-Subject: [RHEL-8.3.0 edk2 PATCH 1/3] OvmfPkg/QemuKernelLoaderFsDxe: suppress error on no "-kernel" in silent aa64 build (RH)
3e2dc0
Bugzilla: 1844682
3e2dc0
RH-Acked-by: Vitaly Kuznetsov <vkuznets@redhat.com>
3e2dc0
RH-Acked-by: Miroslav Rezanina <mrezanin@redhat.com>
3e2dc0
RH-Acked-by: Philippe Mathieu-Daudé <philmd@redhat.com>
3e2dc0
3e2dc0
If the "-kernel" QEMU option is not used, then QemuKernelLoaderFsDxe
3e2dc0
should return EFI_NOT_FOUND, so that the DXE Core can unload it. However,
3e2dc0
the associated error message, logged by the DXE Core to the serial
3e2dc0
console, is not desired in the silent edk2-aarch64 build, given that the
3e2dc0
absence of "-kernel" is nothing out of the ordinary. Therefore, return
3e2dc0
success and stay resident. The wasted guest RAM still gets freed after
3e2dc0
ExitBootServices().
3e2dc0
3e2dc0
(Inspired by RHEL-8.1.0 commit aaaedc1e2cfd.)
3e2dc0
3e2dc0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
3e2dc0
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
3e2dc0
---
3e2dc0
 .../QemuKernelLoaderFsDxe.c                     | 17 +++++++++++++++++
3e2dc0
 .../QemuKernelLoaderFsDxe.inf                   |  1 +
3e2dc0
 2 files changed, 18 insertions(+)
3e2dc0
3e2dc0
diff --git a/OvmfPkg/QemuKernelLoaderFsDxe/QemuKernelLoaderFsDxe.c b/OvmfPkg/QemuKernelLoaderFsDxe/QemuKernelLoaderFsDxe.c
3e2dc0
index b09ff6a359..ec0244d61b 100644
3e2dc0
--- a/OvmfPkg/QemuKernelLoaderFsDxe/QemuKernelLoaderFsDxe.c
3e2dc0
+++ b/OvmfPkg/QemuKernelLoaderFsDxe/QemuKernelLoaderFsDxe.c
3e2dc0
@@ -18,6 +18,7 @@
3e2dc0
 #include <Library/BaseLib.h>
3e2dc0
 #include <Library/BaseMemoryLib.h>
3e2dc0
 #include <Library/DebugLib.h>
3e2dc0
+#include <Library/DebugPrintErrorLevelLib.h>
3e2dc0
 #include <Library/DevicePathLib.h>
3e2dc0
 #include <Library/MemoryAllocationLib.h>
3e2dc0
 #include <Library/QemuFwCfgLib.h>
3e2dc0
@@ -1039,6 +1040,22 @@ QemuKernelLoaderFsDxeEntrypoint (
3e2dc0
 
3e2dc0
   if (KernelBlob->Data == NULL) {
3e2dc0
     Status = EFI_NOT_FOUND;
3e2dc0
+#if defined (MDE_CPU_AARCH64)
3e2dc0
+    //
3e2dc0
+    // RHBZ#1844682
3e2dc0
+    //
3e2dc0
+    // If the "-kernel" QEMU option is not being used, this platform DXE driver
3e2dc0
+    // should return EFI_NOT_FOUND, so that the DXE Core can unload it.
3e2dc0
+    // However, the associated error message, logged by the DXE Core to the
3e2dc0
+    // serial console, is not desired in the silent edk2-aarch64 build, given
3e2dc0
+    // that the absence of "-kernel" is nothing out of the ordinary. Therefore,
3e2dc0
+    // return success and stay resident. The wasted guest RAM still gets freed
3e2dc0
+    // after ExitBootServices().
3e2dc0
+    //
3e2dc0
+    if (GetDebugPrintErrorLevel () == DEBUG_ERROR) {
3e2dc0
+      Status = EFI_SUCCESS;
3e2dc0
+    }
3e2dc0
+#endif
3e2dc0
     goto FreeBlobs;
3e2dc0
   }
3e2dc0
 
3e2dc0
diff --git a/OvmfPkg/QemuKernelLoaderFsDxe/QemuKernelLoaderFsDxe.inf b/OvmfPkg/QemuKernelLoaderFsDxe/QemuKernelLoaderFsDxe.inf
3e2dc0
index 7b35adb8e0..e0331c6e2c 100644
3e2dc0
--- a/OvmfPkg/QemuKernelLoaderFsDxe/QemuKernelLoaderFsDxe.inf
3e2dc0
+++ b/OvmfPkg/QemuKernelLoaderFsDxe/QemuKernelLoaderFsDxe.inf
3e2dc0
@@ -28,6 +28,7 @@
3e2dc0
   BaseLib
3e2dc0
   BaseMemoryLib
3e2dc0
   DebugLib
3e2dc0
+  DebugPrintErrorLevelLib
3e2dc0
   DevicePathLib
3e2dc0
   MemoryAllocationLib
3e2dc0
   QemuFwCfgLib
3e2dc0
-- 
3e2dc0
2.27.0
3e2dc0