drivers/intel/fsp1.1: Read stack guards later
Read back the stack guards after most of the romstage took place. Change-Id: Ia7dc26c7ed1750d4ebbe7514ed87da57f9e34a89 Signed-off-by: Arthur Heymans <arthur@aheymans.xyz> Reviewed-on: https://review.coreboot.org/c/30875 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
This commit is contained in:
committed by
Patrick Georgi
parent
da44e34743
commit
ec3c8b552d
@@ -39,6 +39,7 @@ asmlinkage void *cache_as_ram_main(struct cache_as_ram_params *car_params)
|
|||||||
const int num_guards = 4;
|
const int num_guards = 4;
|
||||||
const u32 stack_guard = 0xdeadbeef;
|
const u32 stack_guard = 0xdeadbeef;
|
||||||
u32 *stack_base;
|
u32 *stack_base;
|
||||||
|
void *ram_stack;
|
||||||
u32 size;
|
u32 size;
|
||||||
|
|
||||||
/* Size of unallocated CAR. */
|
/* Size of unallocated CAR. */
|
||||||
@@ -78,6 +79,9 @@ asmlinkage void *cache_as_ram_main(struct cache_as_ram_params *car_params)
|
|||||||
|
|
||||||
set_fih_car(car_params->fih);
|
set_fih_car(car_params->fih);
|
||||||
|
|
||||||
|
/* Return new stack value in RAM back to assembly stub. */
|
||||||
|
ram_stack = cache_as_ram_stage_main(car_params->fih);
|
||||||
|
|
||||||
/* Check the stack. */
|
/* Check the stack. */
|
||||||
for (i = 0; i < num_guards; i++) {
|
for (i = 0; i < num_guards; i++) {
|
||||||
if (stack_base[i] == stack_guard)
|
if (stack_base[i] == stack_guard)
|
||||||
@@ -85,8 +89,7 @@ asmlinkage void *cache_as_ram_main(struct cache_as_ram_params *car_params)
|
|||||||
printk(BIOS_DEBUG, "Smashed stack detected in romstage!\n");
|
printk(BIOS_DEBUG, "Smashed stack detected in romstage!\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Return new stack value in RAM back to assembly stub. */
|
return ram_stack;
|
||||||
return cache_as_ram_stage_main(car_params->fih);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Entry point taken when romstage is called after a separate verstage. */
|
/* Entry point taken when romstage is called after a separate verstage. */
|
||||||
|
Reference in New Issue
Block a user