From 74d2218cc7c5b9d07528a2ffb3b727e52e688bd3 Mon Sep 17 00:00:00 2001 From: Raul E Rangel Date: Fri, 3 Dec 2021 15:09:35 -0700 Subject: 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 Change-Id: I7698b481a73fb24eecf4c810ff8be8b6826528ca Reviewed-on: https://review.coreboot.org/c/coreboot/+/59876 Tested-by: build bot (Jenkins) Reviewed-by: Julius Werner --- src/lib/cbfs.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src') diff --git a/src/lib/cbfs.c b/src/lib/cbfs.c index d2a4b84656..5bbbe6a2ad 100644 --- a/src/lib/cbfs.c +++ b/src/lib/cbfs.c @@ -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)) -- cgit v1.2.3