Arthur Heymans has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/34976 )
Change subject: cpu/intel/car: Make stack guards more useful on C_ENV_BOOTBLOCK ......................................................................
cpu/intel/car: Make stack guards more useful on C_ENV_BOOTBLOCK
With C_ENVIRONMENT_BOOTBLOCK, CONFIG_DCACHE_BSP_STACK_SIZE needs to be set to define a stack region that can be shared over all stages using CAR. It makes sense to use that Kconfig option's value instead of a hardcoded value.
This will result in less false positives when the stack size is big, for instance with FSP using the coreboot stack.
Change-Id: I2ce1dda4d1f254e6c36de4d3fea26e12c34195ff Signed-off-by: Arthur Heymans arthur@aheymans.xyz --- M src/cpu/intel/car/romstage.c 1 file changed, 3 insertions(+), 3 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/76/34976/1
diff --git a/src/cpu/intel/car/romstage.c b/src/cpu/intel/car/romstage.c index 89052d6..1816e80 100644 --- a/src/cpu/intel/car/romstage.c +++ b/src/cpu/intel/car/romstage.c @@ -20,8 +20,6 @@ #include <program_loading.h> #include <timestamp.h>
-#define DCACHE_RAM_ROMSTAGE_STACK_SIZE 0x2000 - static void romstage_main(unsigned long bist) { int i; @@ -29,11 +27,13 @@ const u32 stack_guard = 0xdeadbeef; u32 *stack_base; u32 size; + const u32 max_dcache_stack_size = CONFIG_DCACHE_BSP_STACK_SIZE ? + CONFIG_DCACHE_BSP_STACK_SIZE : 0x2000;
/* Size of unallocated CAR. */ size = ALIGN_DOWN(_car_stack_size, 16);
- size = MIN(size, DCACHE_RAM_ROMSTAGE_STACK_SIZE); + size = MIN(size, max_dcache_stack_size); if (size < DCACHE_RAM_ROMSTAGE_STACK_SIZE) printk(BIOS_DEBUG, "Romstage stack size limited to 0x%x!\n", size);