coreboot/payloads/libpayload/libc
Julius Werner 8e5e178463 libpayload: dma_malloc: Prevent warm reboot problems and add debugging
Since the DMA memory is allocated by Coreboot (outside of the payload's
linker script), it won't get zeroed upon loading like the heap.
Therefore, a warm reboot that doesn't reset memory may leave stale
malloc cookies lying around and misinterpret them as memory that is
still in use on the next boot. After several boots this may fill up the
whole DMA memory and lead to OOM conditions.

Therefore, this patch explicitly wipes the first cookie in
init_dma_memory() to prevent that from happening. It also expands the
existing memory allocator debugging code to cover the DMA parts, which
was very helpful in identifying this particular problem.

BUG=chrome-os-partner:21969
TEST=None

Change-Id: I6e2083c286ff8ec865b22dd922c39c456944b451
Signed-off-by: Julius Werner <jwerner@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/169455
Reviewed-by: Stefan Reinauer <reinauer@google.com>
2013-09-17 03:22:09 +00:00
..
args.c Since some people disapprove of white space cleanups mixed in regular commits 2010-04-27 06:56:47 +00:00
console.c libpayload: Change CONFIG_* to CONFIG_LP_* in the kconfig. 2013-08-14 17:05:33 -07:00
ctype.c fix typo in ctype.c 2008-08-19 16:53:47 +00:00
exec.c libpayload: Change CONFIG_* to CONFIG_LP_* in the kconfig. 2013-08-14 17:05:33 -07:00
getopt_long.c Reduce warnings/errors in libpayload when using picky compiler options 2011-06-30 20:41:23 +02:00
hexdump.c libpayload: Add simple hexdump function 2013-07-30 17:08:46 -07:00
ipchecksum.c trivial fix: ipchksum takes an unspecified input blob, not explicitly a number of shorts. 2008-08-16 15:16:36 +00:00
lar.c Refactor the endianness conversion functions and header files. 2012-11-08 19:49:51 +01:00
lib.c libpayload: Provide dummy getenv() 2011-07-20 10:02:19 +02:00
Makefile.inc libpayload: Change CONFIG_* to CONFIG_LP_* in the kconfig. 2013-08-14 17:05:33 -07:00
malloc.c libpayload: dma_malloc: Prevent warm reboot problems and add debugging 2013-09-17 03:22:09 +00:00
memory.c libpayload: make functions static that are unused outside memory.c 2013-02-15 06:51:17 +01:00
printf.c libpayload: fix size_t handling 2013-03-26 19:35:28 +01:00
qsort.c libpayload: remove trailing whitespace and run dos2unix 2011-11-01 19:08:23 +01:00
rand.c Add rand/rand_r/srand functions for generating pseudo-random bytes. 2008-04-07 23:33:50 +00:00
readline.c Catch various cases in libpayload where malloc() or memalign() return NULL 2009-07-31 11:39:55 +00:00
string.c libpayload: Some more compatibility (for flashrom) 2011-08-17 16:26:20 +02:00
strings.c Reduce warnings/errors in libpayload when using picky compiler options 2011-06-30 20:41:23 +02:00
strlcpy.c libpayload: Implement strlcpy 2011-07-07 22:29:35 +02:00
sysinfo.c Reduce warnings/errors in libpayload when using picky compiler options 2011-06-30 20:41:23 +02:00
time.c libpayload: Change CONFIG_* to CONFIG_LP_* in the kconfig. 2013-08-14 17:05:33 -07:00