diff options
author | Ilya Smirnov <ismirno@us.ibm.com> | 2018-03-06 16:12:45 -0600 |
---|---|---|
committer | Daniel M. Crowell <dcrowell@us.ibm.com> | 2018-07-01 21:19:29 -0400 |
commit | 41cda93cb3e7ac6a75e8454731728153247279f0 (patch) | |
tree | 4c5cefc8ffef072f627ffba600809e7e42d6bf48 /src/usr/secureboot/trusted/base | |
parent | 4085033d657dd4e8fa9ff768b7fe8b3ca9c361b1 (diff) | |
download | talos-hostboot-41cda93cb3e7ac6a75e8454731728153247279f0.tar.gz talos-hostboot-41cda93cb3e7ac6a75e8454731728153247279f0.zip |
Add Support for TPM Message Queue Flushing
Add a synchronous message handler to TPM daemon. This message
handler is used to make sure that all of the traces are flushed
before the daemon is shut down.
Change-Id: Ibb8ea2fd12d7ded9e43f284ff44c1791e61d8767
CQ:SW435287
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/55223
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com>
Tested-by: Jenkins OP HW <op-hw-jenkins+hostboot@us.ibm.com>
Reviewed-by: Michael Baiocchi <mbaiocch@us.ibm.com>
Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
Diffstat (limited to 'src/usr/secureboot/trusted/base')
-rw-r--r-- | src/usr/secureboot/trusted/base/trustedbootMsg.H | 1 | ||||
-rw-r--r-- | src/usr/secureboot/trusted/base/trustedboot_base.C | 48 |
2 files changed, 49 insertions, 0 deletions
diff --git a/src/usr/secureboot/trusted/base/trustedbootMsg.H b/src/usr/secureboot/trusted/base/trustedbootMsg.H index ededabdcf..b327d6375 100644 --- a/src/usr/secureboot/trusted/base/trustedbootMsg.H +++ b/src/usr/secureboot/trusted/base/trustedbootMsg.H @@ -53,6 +53,7 @@ namespace TRUSTEDBOOT MSG_TYPE_NOOP, MSG_TYPE_PCREXTEND, MSG_TYPE_SEPARATOR, + MSG_TYPE_FLUSH, MSG_TYPE_SHUTDOWN, MSG_TYPE_INIT_BACKUP_TPM, MSG_TYPE_GETRANDOM, diff --git a/src/usr/secureboot/trusted/base/trustedboot_base.C b/src/usr/secureboot/trusted/base/trustedboot_base.C index 5050c9a99..090cac160 100644 --- a/src/usr/secureboot/trusted/base/trustedboot_base.C +++ b/src/usr/secureboot/trusted/base/trustedboot_base.C @@ -802,4 +802,52 @@ errlHndl_t testCmpPrimaryAndBackupTpm() return l_err; } +errlHndl_t flushTpmQueue() +{ + errlHndl_t l_errl = nullptr; +#ifdef CONFIG_TPMDD + TRACFCOMP(g_trac_trustedboot, ENTER_MRK"flushTpmQueue()"); + + Message* l_msg = Message::factory(MSG_TYPE_FLUSH, + 0, + nullptr, + MSG_MODE_SYNC); + + assert(l_msg != nullptr, "TPM flush message is nullptr"); + + int l_rc = msg_sendrecv(systemData.msgQ, l_msg->iv_msg); + if(l_rc) + { + /*@ + * @errortype ERRL_SEV_UNRECOVERABLE + * @moduleid MOD_FLUSH_TPM_QUEUE + * @reasoncode RC_SENDRECV_FAIL + * @userdata1 rc from msq_sendrecv() + * @devdesc msg_sendrecv() failed trying to send flush message to + * TPM daemon + * @custdesc Trusted boot failure + */ + l_errl = new ERRORLOG::ErrlEntry(ERRORLOG::ERRL_SEV_UNRECOVERABLE, + MOD_FLUSH_TPM_QUEUE, + RC_SENDRECV_FAIL, + l_rc, + 0, + true); + l_errl->collectTrace(SECURE_COMP_NAME); + l_errl->collectTrace(TRBOOT_COMP_NAME); + } + else + { + l_errl = l_msg->iv_errl; + l_msg->iv_errl = nullptr; + } + + delete l_msg; + l_msg = nullptr; + + TRACFCOMP(g_trac_trustedboot, EXIT_MRK"flushTpmQueue()"); +#endif + return l_errl; +} + } // end TRUSTEDBOOT |