Julius Werner has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/48429 )
Change subject: cbfs: Skip mcache in post-RAM stages before CBMEM is online ......................................................................
Patch Set 1:
(1 comment)
https://review.coreboot.org/c/coreboot/+/48429/1/src/lib/cbfs.c File src/lib/cbfs.c:
https://review.coreboot.org/c/coreboot/+/48429/1/src/lib/cbfs.c@31 PS1, Line 31: ENV_ROMSTAGE_OR_BEFORE
Wouldn't this cause romstage to always skip the lookup? Isn't cbmem_online() check sufficient here?
...no? Or did I confuse myself with the logic? (My romstage still says "Found ... in mcache", so I think it's WAI.) We're looking up files in the mcache if:
1. mcache is enabled, AND 2. we're not in SMM, AND 3. (at least one is true of) 3.1 this is a pre-RAM stage where mcache is in CAR/SRAM, OR 3.2 CBMEM is online
So romstage should be fine and use the mcache because 1, 2 and 3.1 are true.
Just checking cbmem_online() isn't sufficient because CBMEM is never online in early stages (like verstage), yet we still want to use the mcache which is still in its pre-RAM location at that point.