[SeaBIOS] [PATCH v2 4/6] tpm: Move tpm_log_init to a later point

Stefan Berger stefanb at linux.vnet.ibm.com
Tue Jul 26 17:19:51 CEST 2016


Move tpm_log_init to a point after tpm_startup since in the subsequent
steps we will need to be able to call TPM2_GetCapabilties from this
function to learn about the TPM's PCR bank configuration. We can move
it there, since tpm_startup does not write anything into the log.

Signed-off-by: Stefan Berger <stefanb at linux.vnet.ibm.com>
---
 src/tcgbios.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/src/tcgbios.c b/src/tcgbios.c
index 206c296..1eaf45e 100644
--- a/src/tcgbios.c
+++ b/src/tcgbios.c
@@ -909,17 +909,19 @@ tpm_setup(void)
     if (ret)
         return;
 
-    tpm_log_init();
-
     TPM_working = 1;
 
-    if (runningOnXen())
+    if (runningOnXen()) {
+        tpm_log_init();
         return;
+    }
 
     ret = tpm_startup();
     if (ret)
         return;
 
+    tpm_log_init();
+
     tpm_smbios_measure();
     tpm_add_action(2, "Start Option ROM Scan");
 }
-- 
2.5.5




More information about the SeaBIOS mailing list