]> git.proxmox.com Git - mirror_edk2.git/commitdiff
OvmfPkg/TPM PPI: Connect default consoles for user interaction
authorStefan Berger <stefanb@linux.vnet.ibm.com>
Wed, 15 Sep 2021 01:25:03 +0000 (09:25 +0800)
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Thu, 30 Sep 2021 00:00:08 +0000 (00:00 +0000)
Activate the default console when user interaction is required for
the processing of TPM 2 physical presence interface opcodes.

Background:
TPM 2 physical presence interface (PPI) opcodes need to be handled before
the TPM 2 platform hierarchy is disabled. Due to this requirement we will
move the function call to handle the PPI opcodes into
PlatformBootManagerBeforeConsole() which runs before the initialization
of the consoles. However, since for interaction with the user we need
the console to be available, activate it now before displaying any message
to the user.

Cc: Rebecca Cran <rebecca@bsdio.com>
Cc: Peter Grehan <grehan@freebsd.org>
Cc: Brijesh Singh <brijesh.singh@amd.com>
Cc: Erdem Aktas <erdemaktas@google.com>
Cc: James Bottomley <jejb@linux.ibm.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Min Xu <min.m.xu@intel.com>
Cc: Tom Lendacky <thomas.lendacky@amd.com>
Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
Reviewed-by: Jiewen Yao <Jiewen.yao@intel.com>
OvmfPkg/Library/Tcg2PhysicalPresenceLibQemu/DxeTcg2PhysicalPresenceLib.c
OvmfPkg/Library/Tcg2PhysicalPresenceLibQemu/DxeTcg2PhysicalPresenceLib.inf

index 00d76ba2c24020551a711eca60a078f33a62c442..33a470f6d8ba8ab9dd3c40690f4858fb6ebe106f 100644 (file)
@@ -32,6 +32,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
 #include <Library/UefiBootServicesTableLib.h>\r
 #include <Library/UefiLib.h>\r
 #include <Library/UefiRuntimeServicesTableLib.h>\r
+#include <Library/UefiBootManagerLib.h>\r
 \r
 #include <Library/Tcg2PhysicalPresenceLib.h>\r
 \r
@@ -591,6 +592,10 @@ Tcg2UserConfirm (
     return FALSE;\r
   }\r
 \r
+  // Console for user interaction\r
+  // We need to connect all trusted consoles for TCG PP. Here we treat all consoles in OVMF to be trusted consoles.\r
+  EfiBootManagerConnectAllDefaultConsoles ();\r
+\r
   if (TpmPpCommand < TCG2_PHYSICAL_PRESENCE_STORAGE_MANAGEMENT_BEGIN) {\r
     if (CautionKey) {\r
       TmpStr1 = Tcg2PhysicalPresenceGetStringById (STRING_TOKEN (TPM_CAUTION_KEY));\r
index 85ce0e2b294d17515b41f25cf6e01f60cc16e1c5..5b5417c32150fe79d692f662887aa1a7302ea1f9 100644 (file)
@@ -59,6 +59,7 @@
   PrintLib\r
   QemuFwCfgLib\r
   Tpm2CommandLib\r
+  UefiBootManagerLib\r
   UefiBootServicesTableLib\r
   UefiLib\r
   UefiRuntimeServicesTableLib\r