linux/arch/arm/boot/compressed
Jeremy Fitzhardinge 35c7422649 [PATCH] x86: deflate stack usage in lib/inflate.c
inflate_fixed and huft_build together use around 2.7k of stack.  When
using 4k stacks, I saw stack overflows from interrupts arriving while
unpacking the root initrd:

do_IRQ: stack overflow: 384
 [<c0106b64>] show_trace_log_lvl+0x1a/0x30
 [<c01075e6>] show_trace+0x12/0x14
 [<c010763f>] dump_stack+0x16/0x18
 [<c0107ca4>] do_IRQ+0x6d/0xd9
 [<c010202b>] xen_evtchn_do_upcall+0x6e/0xa2
 [<c0106781>] xen_hypervisor_callback+0x25/0x2c
 [<c010116c>] xen_restore_fl+0x27/0x29
 [<c0330f63>] _spin_unlock_irqrestore+0x4a/0x50
 [<c0117aab>] change_page_attr+0x577/0x584
 [<c0117b45>] kernel_map_pages+0x8d/0xb4
 [<c016a314>] cache_alloc_refill+0x53f/0x632
 [<c016a6c2>] __kmalloc+0xc1/0x10d
 [<c0463d34>] malloc+0x10/0x12
 [<c04641c1>] huft_build+0x2a7/0x5fa
 [<c04645a5>] inflate_fixed+0x91/0x136
 [<c04657e2>] unpack_to_rootfs+0x5f2/0x8c1
 [<c0465acf>] populate_rootfs+0x1e/0xe4

(This was under Xen, but there's no reason it couldn't happen on bare
  hardware.)

This patch mallocs the local variables, thereby reducing the stack
usage to sane levels.

Also, up the heap size for the kernel decompressor to deal with the
extra allocation.

Signed-off-by: Jeremy Fitzhardinge <jeremy@xensource.com>
Signed-off-by: Andi Kleen <ak@suse.de>
Cc: Tim Yamin <plasmaroo@gentoo.org>
Cc: Andi Kleen <ak@suse.de>
Cc: Matt Mackall <mpm@selenic.com>
Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
Cc: Richard Henderson <rth@twiddle.net>
Cc: Russell King <rmk@arm.linux.org.uk>
Cc: Ian Molton <spyro@f2s.com>
2007-05-02 19:27:15 +02:00
..
.gitignore [ARM] 4216/1: add .gitignore entries for ARM specific files 2007-02-17 11:26:41 +00:00
big-endian.S Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
head-at91rm9200.S [ARM] 3654/1: add ajeco 1arm sbc support 2006-06-26 17:48:29 +01:00
head-clps7500.S fix file specification in comments 2006-10-03 23:01:26 +02:00
head-l7200.S Remove obsolete #include <linux/config.h> 2006-06-30 19:25:36 +02:00
head-sa1100.S Remove obsolete #include <linux/config.h> 2006-06-30 19:25:36 +02:00
head-shark.S [PATCH] ARM: 2816/1: Shark: boot kernel images bigger than 1 MB 2005-07-17 20:12:08 +01:00
head-sharpsl.S Remove obsolete #include <linux/config.h> 2006-06-30 19:25:36 +02:00
head-xscale.S Remove obsolete #include <linux/config.h> 2006-06-30 19:25:36 +02:00
head.S [ARM] 3809/3: get rid of 4 megabyte kernel image size limit 2006-09-30 11:30:44 +01:00
ll_char_wr.S [ARM] Remove LOADREGS macro 2006-06-25 11:23:45 +01:00
Makefile [ARM] nommu: manage the CP15 things 2006-09-27 17:34:30 +01:00
Makefile.debug Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
misc.c [PATCH] x86: deflate stack usage in lib/inflate.c 2007-05-02 19:27:15 +02:00
ofw-shark.c [ARM] 2922/1: compile fix for shark 2005-09-20 16:21:42 +01:00
piggy.S Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
vmlinux.lds.in [ARM] Allow decompressor to be built with -ffunction-sections 2006-04-09 19:08:42 +01:00