lib/cbfs: Disable cbfs_preload in romstage when VBOOT_STARTS_IN_ROMSTAGE

Preloading files before vboot runs and using them after vboot has
finished will result in the wrong files getting used. Disable
cbfs_preload to avoid this behavior.

BUG=b:179699789
TEST=none

Signed-off-by: Raul E Rangel <rrangel@chromium.org>
Change-Id: I7698b481a73fb24eecf4c810ff8be8b6826528ca
Reviewed-on: https://review.coreboot.org/c/coreboot/+/59876
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Julius Werner <jwerner@chromium.org>
This commit is contained in:
Raul E Rangel 2021-12-03 15:09:35 -07:00 committed by Felix Held
parent d8f07c1f35
commit 74d2218cc7
1 changed files with 4 additions and 0 deletions

View File

@ -307,6 +307,10 @@ void cbfs_preload(const char *name)
if (!CONFIG(CBFS_PRELOAD))
dead_code();
/* We don't want to cross the vboot boundary */
if (ENV_ROMSTAGE && CONFIG(VBOOT_STARTS_IN_ROMSTAGE))
return;
DEBUG("%s(name='%s')\n", __func__, name);
if (_cbfs_boot_lookup(name, force_ro, &mdata, &rdev))