Attention is currently required from: Christian Walter, Felix Held, Fred Reitberger, Jason Glenesk, Krystian Hebel, Matt DeVillier, Raul Rangel, Sergii Dmytruk, Yu-Ping Wu.
Michał Żygowski has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/69160?usp=email )
Change subject: security/tpm: resolve conflicts in TSS implementations
......................................................................
Patch Set 30:
(1 comment)
File src/security/tpm/tss/tss.c:
https://review.coreboot.org/c/coreboot/+/69160/comment/be507d9f_4ad9117f :
PS30, Line 17: tpm_result_t tlcl_lib_init(void)
This function could potentially be called multiple times (by tlcl_get_family) and cause to probe all TPM drivers.
I would add a static variable to ensure the TPM will be probed once per stage, e.g.:
```
tis_sendrecv_fn tlcl_tis_sendrecv;
+static int init_done = 0;
+
/* Probe for TPM device and choose implementation based on the returned TPM family. */
tpm_result_t tlcl_lib_init(void)
{
tis_probe_fn *tis_probe;
+ if (init_done)
+ return tlcl_tpm_family == TPM_UNKNOWN ? TPM_CB_NO_DEVICE : TPM_SUCCESS;
+
if (tlcl_tpm_family != TPM_UNKNOWN)
return TPM_SUCCESS;
@@ -28,8 +33,11 @@ tpm_result_t tlcl_lib_init(void)
break;
}
+ init_done = 1;
+
if (tlcl_tis_sendrecv == NULL) {
printk(BIOS_ERR, "%s: tis_probe failed\n", __func__);
+ tlcl_tpm_family = TPM_UNKNOWN;
return TPM_CB_NO_DEVICE;
}
```
--
To view, visit
https://review.coreboot.org/c/coreboot/+/69160?usp=email
To unsubscribe, or for help writing mail filters, visit
https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: main
Gerrit-Change-Id: Ia0ea5a917c46ada9fc3274f17240e12bca98db6a
Gerrit-Change-Number: 69160
Gerrit-PatchSet: 30
Gerrit-Owner: Sergii Dmytruk
sergii.dmytruk@3mdeb.com
Gerrit-Reviewer: Christian Walter
christian.walter@9elements.com
Gerrit-Reviewer: Erik van den Bogaert
ebogaert@eltan.com
Gerrit-Reviewer: Felix Held
felix-coreboot@felixheld.de
Gerrit-Reviewer: Frans Hendriks
fhendriks@eltan.com
Gerrit-Reviewer: Fred Reitberger
reitbergerfred@gmail.com
Gerrit-Reviewer: Jason Glenesk
jason.glenesk@gmail.com
Gerrit-Reviewer: Julius Werner
jwerner@chromium.org
Gerrit-Reviewer: Krystian Hebel
krystian.hebel@3mdeb.com
Gerrit-Reviewer: Matt DeVillier
matt.devillier@amd.corp-partner.google.com
Gerrit-Reviewer: Michał Żygowski
michal.zygowski@3mdeb.com
Gerrit-Reviewer: Raul Rangel
rrangel@chromium.org
Gerrit-Reviewer: Yu-Ping Wu
yupingso@google.com
Gerrit-Reviewer: build bot (Jenkins)
no-reply@coreboot.org
Gerrit-CC: Stefan Reinauer
stefan.reinauer@coreboot.org
Gerrit-Attention: Jason Glenesk
jason.glenesk@gmail.com
Gerrit-Attention: Raul Rangel
rrangel@chromium.org
Gerrit-Attention: Matt DeVillier
matt.devillier@amd.corp-partner.google.com
Gerrit-Attention: Christian Walter
christian.walter@9elements.com
Gerrit-Attention: Krystian Hebel
krystian.hebel@3mdeb.com
Gerrit-Attention: Fred Reitberger
reitbergerfred@gmail.com
Gerrit-Attention: Yu-Ping Wu
yupingso@google.com
Gerrit-Attention: Sergii Dmytruk
sergii.dmytruk@3mdeb.com
Gerrit-Attention: Felix Held
felix-coreboot@felixheld.de
Gerrit-Comment-Date: Tue, 13 Feb 2024 14:51:51 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment