diff options
author | Patrick Georgi <patrick@coreboot.org> | 2023-12-13 17:57:34 +0100 |
---|---|---|
committer | Patrick Georgi <patrick@coreboot.org> | 2023-12-18 08:13:12 +0000 |
commit | ed0647a850c973435b382250322d07749c5c4437 (patch) | |
tree | a91e8458c719a7b580bbcef5fc091502f714d66c /src/soc/intel/cannonlake/finalize.c | |
parent | 520ca9a51876177b3b99c01a4b2206cc3edbd3a4 (diff) |
src/lib: Add memory/time saving special case for ramstage caching
When caching the ramstage for suspend/resume, we copy the entire image
as it resides in RAM. The last part of that, CONFIG_HEAP_SIZE bytes, is
the heap that will be reinitialized when the ramstage is started again.
As such, copying doesn't make sense and complicates HEAP_SIZE
configuration (because it needs to fit the space-constrained cache
location) and costs time and space. Therefore, skip the heap.
Side notes:
- When building with ASAN, program.ld indicates that it will allocate
some more space after the heap. This is not a problem, we just copy
an ASAN-sized copy of the heap.
- Heap use is managed in src/lib/malloc with statically allocated
variables. Because ramstage is cached before it's executed, these
values will be reset to their compile-time default values, too.
Change-Id: I6553dc8b758196f2476af2e692c0421d0fa2b98e
Signed-off-by: Patrick Georgi <patrick@coreboot.org>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/79525
Reviewed-by: Martin L Roth <gaumless@gmail.com>
Reviewed-by: Paul Menzel <paulepanter@mailbox.org>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
Diffstat (limited to 'src/soc/intel/cannonlake/finalize.c')
0 files changed, 0 insertions, 0 deletions