Julius Werner has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/46514 )
Change subject: mrc_cache: Add tpm_hash_index field to cache_region struct ......................................................................
Patch Set 1:
(2 comments)
https://review.coreboot.org/c/coreboot/+/46514/1/src/drivers/mrc_cache/mrc_c... File src/drivers/mrc_cache/mrc_cache.c:
https://review.coreboot.org/c/coreboot/+/46514/1/src/drivers/mrc_cache/mrc_c... PS1, Line 58: #if CONFIG(HAS_RECOVERY_MRC_CACHE) && CONFIG(MRC_SAVE_HASH_IN_TPM) This should be unnecessary, you're already checking MRC_SAVE_HASH_IN_TPM in the code, and if HAS_RECOVERY_MRC_CACHE isn't true it will never try using this cache_region anyway.
https://review.coreboot.org/c/coreboot/+/46514/1/src/drivers/mrc_cache/mrc_c... PS1, Line 192: uint32_t hash_idx = lookup_region(®ion, type)->tpm_hash_index; nit: All the other lookup_region() calls check the result for NULL so should probably do that here too, or at least have an assert().