coreboot/src
Julius Werner 34cf073220 cbfs: Allow mcache to be found after the first lookup
This patch addresses the same problem as CB:48429, but hopefully this
time correctly. Since the mcache is not guaranteed to be available on
the first CBFS lookup for some special cases, we can no longer treat it
as a one-time fire-and-forget initialization. Instead, we test
cbd->mcache_size to check if the mcache has been initialized yet, and
keep trying on every lookup if we don't find it the first time.

Since the mcache is a hard requirement for TOCTOU safety, also make it
more clear in Kconfig that configurations known to do CBFS accesses
before CBMEM init are incompatbile with that, and make sure we die()
rather than do something unsafe if there's a case that Kconfig didn't
catch.

Signed-off-by: Julius Werner <jwerner@chromium.org>
Change-Id: I4e01e9a9905f7dcba14eaf05168495201ed5de60
Reviewed-on: https://review.coreboot.org/c/coreboot/+/48482
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
Reviewed-by: Christian Walter <christian.walter@9elements.com>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
2020-12-09 17:44:52 +00:00
..
acpi cbfs: Simplify load/map API names, remove type arguments 2020-12-02 22:13:17 +00:00
arch coreboot tables: Add SPI flash memory map windows to coreboot tables 2020-12-08 22:56:09 +00:00
commonlib coreboot tables: Add SPI flash memory map windows to coreboot tables 2020-12-08 22:56:09 +00:00
console lib/trace: Remove TRACE support 2020-12-02 23:35:58 +00:00
cpu cpu/x86/64bit: Add code to call function in protected mode 2020-12-05 08:19:17 +00:00
device device: Drop unused HyperTransport code 2020-11-25 09:11:46 +00:00
drivers coreboot tables: Add SPI flash memory map windows to coreboot tables 2020-12-08 22:56:09 +00:00
ec src: Remove redundant use of ACPI offset(0) 2020-12-03 00:05:52 +00:00
include coreboot tables: Add SPI flash memory map windows to coreboot tables 2020-12-08 22:56:09 +00:00
lib cbfs: Allow mcache to be found after the first lookup 2020-12-09 17:44:52 +00:00
mainboard mb/google/volteer: Reorganize FMAP 2020-12-09 14:23:06 +00:00
northbridge nb/intel/ironlake: Introduce memmap.h 2020-12-07 15:58:55 +00:00
security cbfs: Add verification for RO CBFS metadata hash 2020-12-03 00:11:08 +00:00
soc soc/amd/cezanne: call bootblock_main_with_basetime in bootblock_c_entry 2020-12-09 17:42:08 +00:00
southbridge sb/intel/common: Modify CONFIG_LOCK_MANAGEMENT_ENGINE behavior 2020-12-07 14:06:28 +00:00
superio src: Remove redundant use of ACPI offset(0) 2020-12-03 00:05:52 +00:00
vendorcode vc/intel/fsp/fsp2_0/cooperlake_sp: Update WW47 FSP Memory map HOB 2020-12-07 10:30:09 +00:00
Kconfig lib/trace: Remove TRACE support 2020-12-02 23:35:58 +00:00