2024-06-20 08:31:02 +00:00
|
|
|
From 8c67b1b96e42c39a3562c8790ae5985a240edfce Mon Sep 17 00:00:00 2001
|
2021-01-08 13:37:54 +00:00
|
|
|
From: Laszlo Ersek <lersek@redhat.com>
|
|
|
|
Date: Wed, 24 Jun 2020 11:31:36 +0200
|
2023-12-15 08:36:21 +00:00
|
|
|
Subject: [PATCH] OvmfPkg/QemuKernelLoaderFsDxe: suppress error on no "-kernel"
|
|
|
|
in silent aa64 build (RH)
|
2021-01-08 13:37:54 +00:00
|
|
|
|
2021-06-23 08:17:13 +00:00
|
|
|
Notes about the RHEL-8.3/20200603-ca407c7246bf [edk2-stable202005] ->
|
|
|
|
RHEL-8.5/20210520-e1999b264f1f [edk2-stable202105] rebase:
|
|
|
|
|
|
|
|
- Remove obsolete commit message tags related to downstream patch
|
|
|
|
management: Message-id, Patchwork-id, O-Subject, Acked-by, From,
|
|
|
|
RH-Acked-by, RH-Author (RHBZ#1846481).
|
|
|
|
|
2021-01-08 13:37:54 +00:00
|
|
|
Bugzilla: 1844682
|
|
|
|
|
|
|
|
If the "-kernel" QEMU option is not used, then QemuKernelLoaderFsDxe
|
|
|
|
should return EFI_NOT_FOUND, so that the DXE Core can unload it. However,
|
|
|
|
the associated error message, logged by the DXE Core to the serial
|
|
|
|
console, is not desired in the silent edk2-aarch64 build, given that the
|
|
|
|
absence of "-kernel" is nothing out of the ordinary. Therefore, return
|
|
|
|
success and stay resident. The wasted guest RAM still gets freed after
|
|
|
|
ExitBootServices().
|
|
|
|
|
|
|
|
(Inspired by RHEL-8.1.0 commit aaaedc1e2cfd.)
|
|
|
|
|
|
|
|
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
|
|
|
|
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
|
2021-06-23 08:17:13 +00:00
|
|
|
(cherry picked from commit 9adcdf493ebbd11efb74e2905ab5f6c8996e096d)
|
2021-01-08 13:37:54 +00:00
|
|
|
---
|
|
|
|
.../QemuKernelLoaderFsDxe.c | 17 +++++++++++++++++
|
|
|
|
.../QemuKernelLoaderFsDxe.inf | 1 +
|
|
|
|
2 files changed, 18 insertions(+)
|
|
|
|
|
|
|
|
diff --git a/OvmfPkg/QemuKernelLoaderFsDxe/QemuKernelLoaderFsDxe.c b/OvmfPkg/QemuKernelLoaderFsDxe/QemuKernelLoaderFsDxe.c
|
2023-06-27 09:16:50 +00:00
|
|
|
index 3c12085f6c..e192809198 100644
|
2021-01-08 13:37:54 +00:00
|
|
|
--- a/OvmfPkg/QemuKernelLoaderFsDxe/QemuKernelLoaderFsDxe.c
|
|
|
|
+++ b/OvmfPkg/QemuKernelLoaderFsDxe/QemuKernelLoaderFsDxe.c
|
2022-02-01 12:58:25 +00:00
|
|
|
@@ -19,6 +19,7 @@
|
2021-01-08 13:37:54 +00:00
|
|
|
#include <Library/BaseMemoryLib.h>
|
2022-02-01 12:58:25 +00:00
|
|
|
#include <Library/BlobVerifierLib.h>
|
2021-01-08 13:37:54 +00:00
|
|
|
#include <Library/DebugLib.h>
|
2023-06-27 09:16:50 +00:00
|
|
|
+#include <Library/DebugPrintErrorLevelLib.h>
|
2021-01-08 13:37:54 +00:00
|
|
|
#include <Library/DevicePathLib.h>
|
|
|
|
#include <Library/MemoryAllocationLib.h>
|
|
|
|
#include <Library/QemuFwCfgLib.h>
|
2022-03-31 05:48:14 +00:00
|
|
|
@@ -1081,6 +1082,22 @@ QemuKernelLoaderFsDxeEntrypoint (
|
2021-01-08 13:37:54 +00:00
|
|
|
|
|
|
|
if (KernelBlob->Data == NULL) {
|
|
|
|
Status = EFI_NOT_FOUND;
|
2023-06-27 09:16:50 +00:00
|
|
|
+#if defined (MDE_CPU_AARCH64)
|
|
|
|
+ //
|
|
|
|
+ // RHBZ#1844682
|
|
|
|
+ //
|
|
|
|
+ // If the "-kernel" QEMU option is not being used, this platform DXE driver
|
|
|
|
+ // should return EFI_NOT_FOUND, so that the DXE Core can unload it.
|
|
|
|
+ // However, the associated error message, logged by the DXE Core to the
|
|
|
|
+ // serial console, is not desired in the silent edk2-aarch64 build, given
|
|
|
|
+ // that the absence of "-kernel" is nothing out of the ordinary. Therefore,
|
|
|
|
+ // return success and stay resident. The wasted guest RAM still gets freed
|
|
|
|
+ // after ExitBootServices().
|
|
|
|
+ //
|
|
|
|
+ if (GetDebugPrintErrorLevel () == DEBUG_ERROR) {
|
|
|
|
+ Status = EFI_SUCCESS;
|
|
|
|
+ }
|
|
|
|
+#endif
|
2021-01-08 13:37:54 +00:00
|
|
|
goto FreeBlobs;
|
|
|
|
}
|
|
|
|
|
|
|
|
diff --git a/OvmfPkg/QemuKernelLoaderFsDxe/QemuKernelLoaderFsDxe.inf b/OvmfPkg/QemuKernelLoaderFsDxe/QemuKernelLoaderFsDxe.inf
|
2023-06-27 09:16:50 +00:00
|
|
|
index 7b35adb8e0..23d9f5fca1 100644
|
2021-01-08 13:37:54 +00:00
|
|
|
--- a/OvmfPkg/QemuKernelLoaderFsDxe/QemuKernelLoaderFsDxe.inf
|
|
|
|
+++ b/OvmfPkg/QemuKernelLoaderFsDxe/QemuKernelLoaderFsDxe.inf
|
|
|
|
@@ -28,6 +28,7 @@
|
|
|
|
BaseLib
|
|
|
|
BaseMemoryLib
|
|
|
|
DebugLib
|
2023-06-27 09:16:50 +00:00
|
|
|
+ DebugPrintErrorLevelLib
|
2021-01-08 13:37:54 +00:00
|
|
|
DevicePathLib
|
|
|
|
MemoryAllocationLib
|
|
|
|
QemuFwCfgLib
|