From 4c518e18e358d927b1f9080c016c988a67dc4500 Mon Sep 17 00:00:00 2001 From: Raul E Rangel Date: Fri, 11 May 2018 11:08:07 -0600 Subject: timestamp: Add timestamps for TPM communication On grunt these operations combined take a little over 37ms. BUG=b:64549506 TEST=built on grunt 511:starting TPM PCR extend 301,268 (598) 512:finished TPM PCR extend 326,710 (25,442) 513:starting locking TPM 326,716 (6) 514:finished locking TPM 339,517 (12,801) Change-Id: I05cfb3d0f8463f073e329a035484a340546649e1 Signed-off-by: Raul E Rangel Reviewed-on: https://review.coreboot.org/26218 Reviewed-by: Paul Menzel Reviewed-by: Philipp Deppenwiese Reviewed-by: Aaron Durbin Tested-by: build bot (Jenkins) --- src/security/vboot/vboot_logic.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/security/vboot') diff --git a/src/security/vboot/vboot_logic.c b/src/security/vboot/vboot_logic.c index 9221a12ca2..2600f84945 100644 --- a/src/security/vboot/vboot_logic.c +++ b/src/security/vboot/vboot_logic.c @@ -403,6 +403,7 @@ void verstage_main(void) vboot_reboot(); } + timestamp_add_now(TS_START_TPMPCR); rv = extend_pcrs(&ctx); if (rv) { printk(BIOS_WARNING, "Failed to extend TPM PCRs (%#x)\n", rv); @@ -410,8 +411,11 @@ void verstage_main(void) save_if_needed(&ctx); vboot_reboot(); } + timestamp_add_now(TS_END_TPMPCR); /* Lock TPM */ + + timestamp_add_now(TS_START_TPMLOCK); rv = antirollback_lock_space_firmware(); if (rv) { printk(BIOS_INFO, "Failed to lock TPM (%x)\n", rv); @@ -419,6 +423,7 @@ void verstage_main(void) save_if_needed(&ctx); vboot_reboot(); } + timestamp_add_now(TS_END_TPMLOCK); /* Lock rec hash space if available. */ if (IS_ENABLED(CONFIG_VBOOT_HAS_REC_HASH_SPACE)) { -- cgit v1.2.3