|
|
3e2dc0 |
From cbce29f7749477e271f9764fed82de94724af5df Mon Sep 17 00:00:00 2001
|
|
|
3e2dc0 |
From: Laszlo Ersek <lersek@redhat.com>
|
|
|
3e2dc0 |
Date: Wed, 24 Jun 2020 11:40:09 +0200
|
|
|
3e2dc0 |
Subject: [PATCH 3/3] SecurityPkg/Tcg2Dxe: suppress error on no swtpm in silent
|
|
|
3e2dc0 |
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-4-lersek@redhat.com>
|
|
|
3e2dc0 |
Patchwork-id: 97534
|
|
|
3e2dc0 |
O-Subject: [RHEL-8.3.0 edk2 PATCH 3/3] SecurityPkg/Tcg2Dxe: suppress error on no swtpm 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 swtpm / vTPM2 is not being used, Tcg2Dxe should return EFI_UNSUPPORTED,
|
|
|
3e2dc0 |
so that the DXE Core can unload it. However, the associated error message,
|
|
|
3e2dc0 |
logged by the DXE Core to the serial console, is not desired in the silent
|
|
|
3e2dc0 |
edk2-aarch64 build, given that the absence of swtpm / vTPM2 is nothing out
|
|
|
3e2dc0 |
of the ordinary. Therefore, return success and stay resident. The wasted
|
|
|
3e2dc0 |
guest RAM still gets freed after 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 |
SecurityPkg/Tcg/Tcg2Dxe/Tcg2Dxe.c | 17 +++++++++++++++++
|
|
|
3e2dc0 |
SecurityPkg/Tcg/Tcg2Dxe/Tcg2Dxe.inf | 1 +
|
|
|
3e2dc0 |
2 files changed, 18 insertions(+)
|
|
|
3e2dc0 |
|
|
|
3e2dc0 |
diff --git a/SecurityPkg/Tcg/Tcg2Dxe/Tcg2Dxe.c b/SecurityPkg/Tcg/Tcg2Dxe/Tcg2Dxe.c
|
|
|
3e2dc0 |
index 9a5f987e68..da2153cb25 100644
|
|
|
3e2dc0 |
--- a/SecurityPkg/Tcg/Tcg2Dxe/Tcg2Dxe.c
|
|
|
3e2dc0 |
+++ b/SecurityPkg/Tcg/Tcg2Dxe/Tcg2Dxe.c
|
|
|
3e2dc0 |
@@ -28,6 +28,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
|
|
|
3e2dc0 |
#include <Protocol/ResetNotification.h>
|
|
|
3e2dc0 |
|
|
|
3e2dc0 |
#include <Library/DebugLib.h>
|
|
|
3e2dc0 |
+#include <Library/DebugPrintErrorLevelLib.h>
|
|
|
3e2dc0 |
#include <Library/BaseMemoryLib.h>
|
|
|
3e2dc0 |
#include <Library/UefiRuntimeServicesTableLib.h>
|
|
|
3e2dc0 |
#include <Library/UefiDriverEntryPoint.h>
|
|
|
3e2dc0 |
@@ -2642,6 +2643,22 @@ DriverEntry (
|
|
|
3e2dc0 |
if (CompareGuid (PcdGetPtr(PcdTpmInstanceGuid), &gEfiTpmDeviceInstanceNoneGuid) ||
|
|
|
3e2dc0 |
CompareGuid (PcdGetPtr(PcdTpmInstanceGuid), &gEfiTpmDeviceInstanceTpm12Guid)){
|
|
|
3e2dc0 |
DEBUG ((DEBUG_INFO, "No TPM2 instance required!\n"));
|
|
|
3e2dc0 |
+#if defined (MDE_CPU_AARCH64)
|
|
|
3e2dc0 |
+ //
|
|
|
3e2dc0 |
+ // RHBZ#1844682
|
|
|
3e2dc0 |
+ //
|
|
|
3e2dc0 |
+ // If swtpm / vTPM2 is not being used, this driver should return
|
|
|
3e2dc0 |
+ // EFI_UNSUPPORTED, so that the DXE Core can unload it. However, the
|
|
|
3e2dc0 |
+ // associated error message, logged by the DXE Core to the serial console,
|
|
|
3e2dc0 |
+ // is not desired in the silent edk2-aarch64 build, given that the absence
|
|
|
3e2dc0 |
+ // of swtpm / vTPM2 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 |
+ if (GetDebugPrintErrorLevel () == DEBUG_ERROR) {
|
|
|
3e2dc0 |
+ return EFI_SUCCESS;
|
|
|
3e2dc0 |
+ }
|
|
|
3e2dc0 |
+#endif
|
|
|
3e2dc0 |
return EFI_UNSUPPORTED;
|
|
|
3e2dc0 |
}
|
|
|
3e2dc0 |
|
|
|
3e2dc0 |
diff --git a/SecurityPkg/Tcg/Tcg2Dxe/Tcg2Dxe.inf b/SecurityPkg/Tcg/Tcg2Dxe/Tcg2Dxe.inf
|
|
|
3e2dc0 |
index 576cf80d06..851471afb7 100644
|
|
|
3e2dc0 |
--- a/SecurityPkg/Tcg/Tcg2Dxe/Tcg2Dxe.inf
|
|
|
3e2dc0 |
+++ b/SecurityPkg/Tcg/Tcg2Dxe/Tcg2Dxe.inf
|
|
|
3e2dc0 |
@@ -55,6 +55,7 @@
|
|
|
3e2dc0 |
UefiRuntimeServicesTableLib
|
|
|
3e2dc0 |
BaseMemoryLib
|
|
|
3e2dc0 |
DebugLib
|
|
|
3e2dc0 |
+ DebugPrintErrorLevelLib
|
|
|
3e2dc0 |
Tpm2CommandLib
|
|
|
3e2dc0 |
PrintLib
|
|
|
3e2dc0 |
UefiLib
|
|
|
3e2dc0 |
--
|
|
|
3e2dc0 |
2.27.0
|
|
|
3e2dc0 |
|