• Bernhard Walle's avatar
    Extended crashkernel command line · cba63c30
    Bernhard Walle authored
    This patch adds a extended crashkernel syntax that makes the value of reserved
    system RAM dependent on the system RAM itself:
    
        crashkernel=<range1>:<size1>[,<range2>:<size2>,...][@offset]
        range=start-[end]
    
    For example:
    
        crashkernel=512M-2G:64M,2G-:128M
    
    The motivation comes from distributors that configure their crashkernel
    command line automatically with some configuration tool (YaST, you know ;)).
    Of course that tool knows the value of System RAM, but if the user removes
    RAM, then the system becomes unbootable or at least unusable and error
    handling is very difficult.
    
    This series implements this change for i386, x86_64, ia64, ppc64 and sh.  That
    should be all platforms that support kdump in current mainline.  I tested all
    platforms except sh due to the lack of a sh processor.
    
    This patch:
    
    This is the generic part of the patch.  It adds a parse_crashkernel() function
    in kernel/kexec.c that is called by the architecture specific code that
    actually reserves the memory.  That function takes the whole command line and
    looks itself for "crashkernel=" in it.
    
    If there are multiple occurrences, then the last one is taken.  The advantage
    is that if you have a bootloader like lilo or elilo which allows you to append
    a command line parameter but not to remove one (like in GRUB), then you can
    add another crashkernel value for testing at the boot command line and this
    one overwrites the command line in the configuration then.
    Signed-off-by: default avatarBernhard Walle <bwalle@suse.de>
    Cc: Andi Kleen <ak@suse.de>
    Cc: "Luck, Tony" <tony.luck@intel.com>
    Cc: Paul Mackerras <paulus@samba.org>
    Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
    Cc: Paul Mundt <lethal@linux-sh.org>
    Cc: Vivek Goyal <vgoyal@in.ibm.com>
    Cc: "Eric W. Biederman" <ebiederm@xmission.com>
    Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
    Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
    cba63c30
kexec.c 35.3 KB