Julius Werner has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/59767 )
Change subject: [TEST-ONLY / HACK] Mirror payload in RAM before hashing/decompression ......................................................................
[TEST-ONLY / HACK] Mirror payload in RAM before hashing/decompression
I don't know if this does anything... let's find out.
Signed-off-by: Julius Werner jwerner@chromium.org Change-Id: Ia9550ad35653f1c949fe1dd83f76142ed3dbad4c --- M src/lib/cbfs.c 1 file changed, 10 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/67/59767/1
diff --git a/src/lib/cbfs.c b/src/lib/cbfs.c index dfb7a69..5906814 100644 --- a/src/lib/cbfs.c +++ b/src/lib/cbfs.c @@ -470,6 +470,16 @@ if (!force_ro && get_preload_rdev(&rdev, name) == CB_SUCCESS) preload_successful = true;
+ if (ENV_RAMSTAGE && !strcmp(name, CONFIG_CBFS_PREFIX "/payload")) { + size_t size = region_device_sz(&rdev); + void *buffer = bootmem_allocate_buffer(size); + if (!buffer || + rdev_readat_full(&rdev, buffer) != size || + rdev_chain_mem(&rdev, buffer, size) != 0) + die("splat!"); + printk(BIOS_DEBUG, "HACK: mirrored payload rdev into RAM at %p\n", buffer); + } + void *ret = do_alloc(&mdata, &rdev, allocator, arg, size_out, false);
/* When using cbfs_preload we need to free the preload buffer after populating the