diff options
author | Julius Werner <jwerner@chromium.org> | 2020-12-08 14:21:43 -0800 |
---|---|---|
committer | Julius Werner <jwerner@chromium.org> | 2020-12-09 17:44:52 +0000 |
commit | 34cf0732209e7b9fefc115536719473155e430ea (patch) | |
tree | aaf0573fa701c84cb3cbb5856db45097df3188e2 /src/northbridge | |
parent | d2777b84850cb1889e5e8c36d1ddc68430d36296 (diff) |
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>
Diffstat (limited to 'src/northbridge')
0 files changed, 0 insertions, 0 deletions