[Skiboot] [PATCH] hdata/tpmrel: detect tpm not present by looking up the stinfo->status
Claudio Carvalho
cclaudio at linux.vnet.ibm.com
Sat Apr 21 07:03:31 AEST 2018
Skiboot detects if tpm is present by checking if a secureboot_tpm_info
entry exists. However, if a tpm is not present, hostboot also creates a
secureboot_tpm_info entry. In this case, hostboot creates an empty
entry, but setting the field tpm_status to TPM_NOT_PRESENT.
This detects if tpm is not present by looking up the stinfo->status.
This fixes the "TPMREL: TPM node not found for chip_id=0 (HB bug)"
issue, reproduced when skiboot is running on a system that has no tpm.
Signed-off-by: Claudio Carvalho <cclaudio at linux.vnet.ibm.com>
Tested-by: Pridhiviraj Paidipeddi <ppaidipe at linux.vnet.ibm.com>
---
hdata/tpmrel.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/hdata/tpmrel.c b/hdata/tpmrel.c
index 9b09765..01ef10c 100644
--- a/hdata/tpmrel.c
+++ b/hdata/tpmrel.c
@@ -59,6 +59,14 @@ static void tpmrel_add_firmware_event_log(const struct HDIF_common_hdr *hdif_hdr
TPMREL_IDATA_SECUREBOOT_TPM_INFO,
i, NULL);
+ /*
+ * If tpm is not present, hostboot creates an empty
+ * secureboot_tpm_info entry, but setting
+ * tpm_status=TPM_NOT_PRESENT
+ */
+ if (stinfo->tpm_status == TPM_NOT_PRESENT)
+ continue;
+
xscom = find_xscom_for_chip(be32_to_cpu(stinfo->chip_id));
if (xscom) {
dt_for_each_node(xscom, node) {
--
2.7.4
More information about the Skiboot
mailing list