coreboot-kgpe-d16/src/commonlib
Julius Werner b571846ea4 cbfs: mcache: Fix size calculation for perfectly full cache
cbfs_mcache_real_size() has a subtle flaw: when the cache is perfectly
full to the end (so that the termination token sits exactly at the end
of the available space), the loop counting the size ends prematurely.
This means that when migrating the cache to CBMEM the terminating token
is not copied, which isn't actually noticeable unless you're looking for
a file that's not in the cache (because it doesn't exist or because not
all files fit when building).

This patch fixes the problem and slightly changes the error message for
when a cache isn't terminated (to make it more clear that this is a
different condition from a "normal" cache overflow that can happen when
building if there's not enough room to fit all files).

Signed-off-by: Julius Werner <jwerner@chromium.org>
Change-Id: I8d89e7dadc958f97b173b3a2352f2010c8a3d1d5
Reviewed-on: https://review.coreboot.org/c/coreboot/+/52200
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2021-04-10 00:00:34 +00:00
..
bsd cbfs: mcache: Fix size calculation for perfectly full cache 2021-04-10 00:00:34 +00:00
include/commonlib soc/mediatek: add new driver 'msdc' for eMMC 2021-04-09 06:05:12 +00:00
storage src/commonlib: Drop unneeded empty lines 2020-09-21 15:53:25 +00:00
Makefile.inc cbfs: Pull handling of the CBFS_CACHE mem_pool into CBFS core 2021-03-08 22:31:29 +00:00
cbfs.c commonlib/cbfs.c: Remove unuse <console/console.h> 2021-02-15 10:51:24 +00:00
fsp_relocate.c
iobuf.c
mem_pool.c mem_pool: Track the last two allocations (not just one) 2021-04-06 07:50:05 +00:00
region.c cbfs: Pull handling of the CBFS_CACHE mem_pool into CBFS core 2021-03-08 22:31:29 +00:00
sort.c