]> rtime.felk.cvut.cz Git - lisovros/linux_canprio.git/commit
sparc64: Fix cmdline_memory_size handling bugs.
authorDavid S. Miller <davem@davemloft.net>
Wed, 3 Sep 2008 08:21:23 +0000 (01:21 -0700)
committerGreg Kroah-Hartman <gregkh@suse.de>
Mon, 8 Sep 2008 11:44:29 +0000 (04:44 -0700)
commitc5b15cb1787f1dfb3741396779986d5653400eba
tree6a00e331fa11de9fe6c5f92f46e49fa47b546d34
parent5d77cfb999845251dd6271b0e3ccf89eba26b3e2
sparc64: Fix cmdline_memory_size handling bugs.

[ Upstream commit f2b6079464fc73cf12f08248180a618f05033a70 ]

First, lmb_enforce_memory_limit() interprets it's argument
(mostly, heh) as a size limit not an address limit.  So pass
the raw cmdline_memory_size value into it.  And we don't
need to check it against zero, lmb_enforce_memory_limit() does
that for us.

Next, free_initmem() needs special handling when the kernel
command line trims the available memory.  The problem case is
if the trimmed out memory is where the kernel image itself
resides.

When that memory is trimmed out, we don't add those physical
ram areas to the sparsemem active ranges, amongst other things.
Which means that this free_initmem() code will free up invalid
page structs, resulting in either crashes or hangs.

Just quick fix this by not freeing initmem at all if "mem="
was given on the boot command line.

Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
arch/sparc64/mm/init.c