Attention is currently required from: Christian Walter, Filip Lewiński, Julius Werner, Yu-Ping Wu.
Michał Żygowski has posted comments on this change by Filip Lewiński. ( https://review.coreboot.org/c/coreboot/+/82695?usp=email )
Change subject: security: Allow vboot when INTEL_TXT enabled ......................................................................
Patch Set 5:
(1 comment)
File src/lib/bootblock.c:
https://review.coreboot.org/c/coreboot/+/82695/comment/1aa033a7_af83ad28?usp... : PS5, Line 62: if (CONFIG(TPM_MEASURED_BOOT_INIT_BOOTBLOCK) && !CONFIG(VBOOT_STARTS_IN_BOOTBLOCK)) {
No, sorry, this doesn't make sense. You're mixing different things together here. […]
Right, I kind of mixed the redundancy of TPM startup in bootblock when vboot runs in bootblock with the VBOOT + TXT. When I saw what vboot_setup_tpm does, I tried to minimize the loss of vboot information output from that function, and that's what I have come up with.
Regarding the TPM_MEASURED_BOOT_INIT_BOOTBLOCK dependency in INTEL_TXT, I think it has to do with how server TXT works. On servers the CPU comes out of reset with IBB modules (defined in FIT type 7 entries) already measured to PCR0 (and TPM is already started). To avoid measuring to cached log, TPM is initialized right in bootblock, to keep sending the measurements directly to the TPM. So, it would make even more sense to select INVALID_POSTINIT on servers with TXT. Summing it up, doing
``` select TPM_MEASURED_BOOT_INIT_BOOTBLOCK if TPM_MEASURED_BOOT && !VBOOT_STARTS_IN_BOOTBLOCK ```
still doesn't help much, because vboot will fail the TPM setup (INVALID_POSTINIT) and proceed to recovery with code VB2_RECOVERY_RO_TPM_S_ERROR. We don't want that either, do we?
So what could possibly work:
``` select TPM_MEASURED_BOOT_INIT_BOOTBLOCK if TPM_MEASURED_BOOT && !VBOOT_STARTS_IN_BOOTBLOCK select TPM_STARTUP_IGNORE_POSTINIT ```
We don't have any way to distinguish server TXT from client TXT, so TPM_STARTUP_IGNORE_POSTINIT will nearly always be needed, except on client platforms before TigerLake (CBnT can work like server TXT even on client) where VBOOT_STARTS_IN_BOOTBLOCK and we don't select TPM_MEASURED_BOOT_INIT_BOOTBLOCK.
I hope this sheds some light on the matter. Let's discuss further how we can solve it, as it is not yet clear to me how I may satisfy your requirements,