coreboot-kgpe-d16/src/drivers
Julius Werner 8d8799a33a arm, arm64, mips: Add rough static stack size checks with -Wstack-usage
We've seen an increasing need to reduce stack sizes more and more for
space reasons, and it's always guesswork because no one has a good idea
how little is too litte. We now have boards with 3K and 2K stacks, and
old pieces of common code often allocate large temporary buffers that
would lead to very dangerous and hard to detect bugs when someone
eventually tries to use them on one of those.

This patch tries improve this situation at least a bit by declaring 2K
as the minimum stack size all of coreboot code should work with. It
checks all function frames with -Wstack-usage=1536 to make sure we don't
allocate more than 1.5K in a single buffer. This is of course not a
perfect test, but it should catch the most common situation of declaring
a single, large buffer in some close-to-leaf function (with the
assumption that 0.5K is hopefully enough for all the "normal" functions
above that).

Change one example where we were a bit overzealous and put a 1K buffer
into BSS back to stack allocation, since it actually conforms to this
new assumption and frees up another kilobyte of that highly sought-after
verstage space. Not touching x86 with any of this since it's lack of
__PRE_RAM__ BSS often requires it to allocate way more on the stack than
would usually be considered sane.

BRANCH=veyron
BUG=None
TEST=Compiled Cosmos, Daisy, Falco, Blaze, Pit, Storm, Urara and Pinky,
made sure they still build as well as before and don't show any stack
usage warnings.

Change-Id: Idc53d33bd8487bbef49d3ecd751914b0308006ec
Signed-off-by: Patrick Georgi <pgeorgi@chromium.org>
Original-Commit-Id: 8e5931066575e256dfc2295c3dab7f0e1b65417f
Original-Change-Id: I30bd9c2c77e0e0623df89b9e5bb43ed29506be98
Original-Signed-off-by: Julius Werner <jwerner@chromium.org>
Original-Reviewed-on: https://chromium-review.googlesource.com/236978
Original-Reviewed-by: David Hendricks <dhendrix@chromium.org>
Original-Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: http://review.coreboot.org/9729
Tested-by: build bot (Jenkins)
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2015-07-29 20:25:59 +02:00
..
ams Remove address from GPLv2 headers 2015-05-21 20:50:25 +02:00
ati x86: Change MMIO addr in readN(addr)/writeN(addr, val) to pointer 2015-02-15 08:50:22 +01:00
dec Remove address from GPLv2 headers 2015-05-21 20:50:25 +02:00
elog Verify Kconfigs symbols are not zero for hex and int type symbols 2015-07-12 19:06:44 +02:00
emulation Remove empty lines at end of file 2015-06-08 00:55:07 +02:00
generic Remove address from GPLv2 headers 2015-05-21 20:50:25 +02:00
gic Remove address from GPLv2 headers 2015-05-21 20:50:25 +02:00
i2c drivers/i2c/tpm: move tpm driver around a bit more. 2015-06-30 21:34:19 +02:00
ics Remove address from GPLv2 headers 2015-05-21 20:50:25 +02:00
intel FSP 1.1: Update the CBFS image type 2015-07-10 02:11:27 +02:00
ipmi Remove address from GPLv2 headers 2015-05-21 20:50:25 +02:00
lenovo Remove address from GPLv2 headers 2015-05-21 20:50:25 +02:00
maxim Remove address from GPLv2 headers 2015-05-21 20:50:25 +02:00
net drivers/net/ne2k.c: Fix regression 2014-11-22 15:25:09 +01:00
parade Remove address from GPLv2 headers 2015-05-21 20:50:25 +02:00
pc80 Fix Kconfig whitespace. 2015-06-07 02:54:41 +02:00
ricoh Remove address from GPLv2 headers 2015-05-21 20:50:25 +02:00
sil Fix some minor Kconfig issues 2015-04-28 20:49:12 +02:00
spi arm, arm64, mips: Add rough static stack size checks with -Wstack-usage 2015-07-29 20:25:59 +02:00
ti Remove address from GPLv2 headers 2015-05-21 20:50:25 +02:00
trident Remove empty lines at end of file 2015-06-08 00:55:07 +02:00
uart console: Add UART8250MEM 32bit support 2015-07-21 20:16:48 +02:00
usb cbmem: add indicator to hooks if cbmem is being recovered 2015-06-09 22:03:30 +02:00
xgi Remove empty lines at end of file 2015-06-08 00:55:07 +02:00
xpowers drivers/xpowers/axp209: Adapt to new I²C API 2015-02-20 23:20:56 +01:00