summaryrefslogtreecommitdiffstats
path: root/src/usr/secureboot/trusted
diff options
context:
space:
mode:
authorChris Engel <cjengel@us.ibm.com>2017-07-31 17:18:15 -0500
committerDaniel M. Crowell <dcrowell@us.ibm.com>2017-08-09 17:31:11 -0400
commit90d2d0fe52ca6f3b61056e7b239da696713eaec1 (patch)
tree23d355c35efcc27674ea85f9c05f29cc55f1210c /src/usr/secureboot/trusted
parentb9800ead611cce2f9ab08f893c9782f591bb4539 (diff)
downloadtalos-hostboot-90d2d0fe52ca6f3b61056e7b239da696713eaec1.tar.gz
talos-hostboot-90d2d0fe52ca6f3b61056e7b239da696713eaec1.zip
Fix HDAT support for TPM log to support events after HDAT is populated
Change-Id: I55a85f48e9238846134cdc39bcb4e5e03466bce5 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/43961 Reviewed-by: Stephen M. Cprek <smcprek@us.ibm.com> Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com> Reviewed-by: Nicholas E. Bofferding <bofferdn@us.ibm.com> Reviewed-by: Timothy R. Block <block@us.ibm.com> Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com> Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com> Tested-by: Jenkins OP HW <op-hw-jenkins+hostboot@us.ibm.com> Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
Diffstat (limited to 'src/usr/secureboot/trusted')
-rw-r--r--src/usr/secureboot/trusted/tpmLogMgr.C33
-rw-r--r--src/usr/secureboot/trusted/tpmLogMgr.H9
2 files changed, 42 insertions, 0 deletions
diff --git a/src/usr/secureboot/trusted/tpmLogMgr.C b/src/usr/secureboot/trusted/tpmLogMgr.C
index fe773d5f3..625c6261a 100644
--- a/src/usr/secureboot/trusted/tpmLogMgr.C
+++ b/src/usr/secureboot/trusted/tpmLogMgr.C
@@ -572,6 +572,39 @@ namespace TRUSTEDBOOT
i_val->devtreeI2cMasterOffset = i_i2cMasterOffset;
}
+ void TpmLogMgr_relocateTpmLog(TpmLogMgr* i_val,
+ uint8_t* i_newLog,
+ size_t i_maxSize)
+ {
+ mutex_lock( &i_val->logMutex );
+
+ TRACUCOMP( g_trac_trustedboot,
+ ">>relocateTpmLog() LogSize:%d MaxSize:%d",
+ i_val->logSize, i_maxSize);
+
+ assert(i_newLog != NULL, "Bug! Log start address is nullptr");
+ assert(i_val->eventLogInMem == NULL,
+ "relocateTpmLog can only be called once");
+ assert(i_val->logSize < i_maxSize,
+ "Logsize is greater than maxsize");
+
+ // Point logMgr to new location
+ i_val->eventLogInMem = i_newLog;
+
+ // Copy log into new location
+ memset(i_val->eventLogInMem, 0, i_maxSize);
+ memcpy(i_val->eventLogInMem, i_val->eventLog, i_val->logSize);
+ i_val->newEventPtr = i_val->eventLogInMem + i_val->logSize;
+
+ mutex_unlock( &i_val->logMutex );
+
+ TRACUCOMP( g_trac_trustedboot,
+ "<<relocateTpmLog() Addr:%p",
+ i_newLog);
+ return;
+ }
+
+
#endif
#ifdef __cplusplus
diff --git a/src/usr/secureboot/trusted/tpmLogMgr.H b/src/usr/secureboot/trusted/tpmLogMgr.H
index 09adc2f63..6828e42fe 100644
--- a/src/usr/secureboot/trusted/tpmLogMgr.H
+++ b/src/usr/secureboot/trusted/tpmLogMgr.H
@@ -164,6 +164,15 @@ namespace TRUSTEDBOOT
void TpmLogMgr_setTpmDevtreeInfo(TpmLogMgr* i_val,
uint64_t i_xscomAddr,
uint32_t i_i2cMasterOffset);
+ /**
+ * @brief Relocate the TPM log to the provided location
+ * @param[in] i_val TpmLogMgr structure
+ * @param[in] i_newLog Pointer to locate to place log
+ * @param[in] i_maxSize Size of newLog location
+ */
+ void TpmLogMgr_relocateTpmLog(TpmLogMgr* i_val,
+ uint8_t* i_newLog,
+ size_t i_maxSize);
#endif
OpenPOWER on IntegriCloud