coreboot-kgpe-d16/src/commonlib/bsd
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
..
include/commonlib/bsd cbfs: Add file data hashing for CONFIG_CBFS_VERIFICATION 2021-04-06 07:48:58 +00:00
cbfs_mcache.c cbfs: mcache: Fix size calculation for perfectly full cache 2021-04-10 00:00:34 +00:00
cbfs_private.c cbfs: Add file data hashing for CONFIG_CBFS_VERIFICATION 2021-04-06 07:48:58 +00:00
lz4.c.inc
lz4_wrapper.c