arch/x86: Adjust size of postcar stack
With VBOOT=y && VBOOT_MEASURED_BOOT=y message digest will be allocated from the stack and 1 KiB reserve used with the recent platforms was no longer sufficient. The comment of LZMA scratchpad consuming stack was obsolete for postcar, so these can be reduced to same 4 KiB. Change-Id: Iba1fb5bfad6946f316feac2d8c998a782142a56a Signed-off-by: Mario Scheithauer <mario.scheithauer@siemens.com> Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/33775 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Aaron Durbin <adurbin@chromium.org> Reviewed-by: Werner Zeh <werner.zeh@siemens.com>
This commit is contained in:
@@ -309,8 +309,9 @@ struct postcar_frame {
|
||||
};
|
||||
|
||||
/*
|
||||
* Initialize postcar_frame object allocating stack size in cbmem
|
||||
* with the provided size. Returns 0 on success, < 0 on error.
|
||||
* Initialize postcar_frame object allocating stack from cbmem,
|
||||
* with stack_size == 0, default 4 KiB is allocated.
|
||||
* Returns 0 on success, < 0 on error.
|
||||
*/
|
||||
int postcar_frame_init(struct postcar_frame *pcf, size_t stack_size);
|
||||
|
||||
|
@@ -48,6 +48,15 @@ int postcar_frame_init(struct postcar_frame *pcf, size_t stack_size)
|
||||
{
|
||||
void *stack;
|
||||
|
||||
/*
|
||||
* Use default postcar stack size of 4 KiB. This value should
|
||||
* not be decreased, because if mainboards use vboot, 1 KiB will
|
||||
* not be enough anymore.
|
||||
*/
|
||||
|
||||
if (stack_size == 0)
|
||||
stack_size = 4 * KiB;
|
||||
|
||||
stack = cbmem_add(CBMEM_ID_ROMSTAGE_RAM_STACK, stack_size);
|
||||
if (stack == NULL) {
|
||||
printk(BIOS_ERR, "Couldn't add %zd byte stack in cbmem.\n",
|
||||
|
Reference in New Issue
Block a user