Aaron Durbin has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/33775 )
Change subject: soc/{amd, intel}: Increase size of postcar stack ......................................................................
Patch Set 2:
(1 comment)
https://review.coreboot.org/#/c/33775/2/src/include/memlayout.h File src/include/memlayout.h:
https://review.coreboot.org/#/c/33775/2/src/include/memlayout.h@45 PS2, Line 45: #ifndef POSTCAR_COMMON_RAM_STACK_SIZE
Remove the guard, if you need customizeable preprocessor variable, use Kconfigs. […]
Seems like a good place. But we could also flip this around. Pass in 0 for stack size (still allowing someone to override the default). Then in postcar_frame_init() do this:
diff --git a/src/arch/x86/postcar_loader.c b/src/arch/x86/postcar_loader.c index 732b767bf6..3deb99bcb0 100644 --- a/src/arch/x86/postcar_loader.c +++ b/src/arch/x86/postcar_loader.c @@ -48,6 +48,9 @@ int postcar_frame_init(struct postcar_frame *pcf, size_t stack_size) { void *stack;
+ 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",