U-Boot might be the first component to start the event log, eg when used in qemu. So allocate and attach the TPM event log to the TPM device if not initialized yet. The address is copied into the device tree for the kernel so the event log is accessible from Linux userspace too.
Changes in v3: - fix test failure - sync description with cover letter Changes in v2: - fix return value handling - imply DEVRES in config TPM - use fdt_getprop for reading property - don't wrap #include in #if - fix memory leak in error case of tcg2_log_prepare_buffer - handle NULL elog parameter in tcg2_measurement_term - use CONFIG_TPM2_EVENT_LOG_SIZE - pass log_size instead of position in dt Ludwig Nussel (3): test: include mapmem.h explicitly tpm: print all PCRs from pcr_read tpm: allocate tpm event log if missing boot/bootm.c | 18 ++--- boot/image-fdt.c | 69 ++++++++++++++++++++ cmd/tpm-v2.c | 69 ++++++++++++++------ include/tpm-common.h | 2 + include/tpm_tcg2.h | 9 +-- lib/Kconfig | 1 + lib/tpm_tcg2.c | 130 +++++++++++++++++++++++++++++-------- test/boot/measurement.c | 1 + test/py/tests/test_tpm2.py | 9 +-- 9 files changed, 242 insertions(+), 66 deletions(-) -- 2.43.0 base-commit: 3cdce049f90d77c3f9221f1eb73922384c8972c3 branch: us-tpm3

