coreboot/src/lib
Ronald G. Minnich 9764d4c690 Implement stack overflow checking for the BSP
Previous patches implemented stack overflow checking for the APs.
This patch builds on the BSP stack poisoning patch to implement
stack overflow checking for the BSP, and also prints out maximum
stack usage. It reveals that our 32K stack is ridiculously oversized,
especially now that the lzma decoder doesn't use a giant 16K on-stack
array.

Break the stack checking out into a separate function, which
we will later use for the APs.

CPU0: stack from 00180000 to 00188000:Lowest stack address 00187ad8

To test failure, change the DEADBEEF stack poison value in c_start.S
to something else. Then we should get an error like this:
Stack overrun on BSP.Increase stack from current 32768 bytes
CPU0: stack from 00180000 to 00188000:Lowest stack address 00180000

Separate the act of loading from the act of starting the payload. This
allows us better error management and reporting of stack use. Now we
see:
CPU0: stack from 00180000 to 00188000:Lowest stack address 00187ad8

Tested for both success and failure on Link. At the same time, feel free
to carefully check my manipulation of _estack.

Change-Id: Ibb09738b15ec6a5510ac81e45dd82756bfa5aac2
Signed-off-by: Ronald G. Minnich <rminnich@chromium.org>
Reviewed-on: http://review.coreboot.org/1286
Tested-by: build bot (Jenkins)
Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
2012-07-24 23:29:12 +02:00
..
cbfs.c Make CBFS output more consistent 2012-05-04 08:11:28 +02:00
cbfs_core.c Make CBFS output more consistent 2012-05-04 08:11:28 +02:00
cbmem.c Tell CBMEM pretty printer about MRC cache 2012-05-03 20:33:13 +02:00
cbmem_console.c Add infrastructure for global data in the CAR phase of boot 2012-03-29 23:19:13 +02:00
clog2.c
compute_ip_checksum.c
debug.c
delay.c
fallback_boot.c refactor vesa mode setting code and bootsplash code 2011-10-13 20:00:50 +02:00
gcc.c
generic_dump_spd.c
generic_sdram.c
jpeg.c
jpeg.h
lzma.c Shrink the stack sizes we need in coreboot 2012-07-24 19:52:53 +02:00
lzmadecode.c
lzmadecode.h
Makefile.inc Implement stack overflow checking for the BSP 2012-07-24 23:29:12 +02:00
malloc.c Remove unused free() function 2012-07-24 08:38:21 +02:00
memchr.c Add an implementation for the memchr library function 2012-03-09 20:00:53 +01:00
memcmp.c
memcpy.c
memmove.c
memset.c
ne2k.c
nrv2b.c
ns8390.h
ramtest.c Replace ramtest pattern to assist in DIMM configuration 2012-03-25 20:17:51 +02:00
stack.c Implement stack overflow checking for the BSP 2012-07-24 23:29:12 +02:00
timestamp.c Add timestamp collecting to coreboot. 2012-03-28 20:43:59 +02:00
trace.c
uart8250.c Remove whitespace. 2012-02-17 19:04:31 +01:00
uart8250mem.c Don't loop infinitely long on serial comm failures 2012-05-08 04:34:26 +02:00
usbdebug.c remove trailing whitespace 2011-11-01 19:07:45 +01:00
version.c
xmodem.c Move C labels to start-of-line 2012-03-07 17:48:03 +01:00