summaryrefslogtreecommitdiff
path: root/kexec/arch
AgeCommit message (Collapse)Author
2010-02-02Use %llx to format mem_max as it is an unsigned long longSimon Horman
Signed-off-by: Simon Horman <horms@verge.net.au>
2010-02-02Remove some unused variablesSimon Horman
Signed-off-by: Simon Horman <horms@verge.net.au>
2010-02-02ia64: Remove unused range parameter from get_crash_memory_ranges()Simon Horman
Signed-off-by: Simon Horman <horms@verge.net.au>
2010-02-02ia64: Remove unused info parameter from add_loaded_segments_info()Simon Horman
Signed-off-by: Simon Horman <horms@verge.net.au>
2010-02-02ia64: Remove unused info parameter from {move,update}_loaded_segments()Simon Horman
Signed-off-by: Simon Horman <horms@verge.net.au>
2010-02-02i386: Remove unused kexec_flags parameter from setup_edd_info()Simon Horman
Signed-off-by: Simon Horman <horms@verge.net.au>
2010-02-02sh: Remove unused len parameter from zImage_head32()Simon Horman
Signed-off-by: Simon Horman <horms@verge.net.au>
2010-02-02sh: make zImage_head32() staticSimon Horman
Signed-off-by: Simon Horman <horms@verge.net.au>
2010-02-02Mark unused parametersSimon Horman
Signed-off-by: Simon Horman <horms@verge.net.au>
2010-02-02don't leak in concat_cmdlineSimon Horman
Cc: Eric W. Biederman <ebiederm@xmission.com> Signed-off-by: Simon Horman <horms@verge.net.au>
2010-02-02Fix --reuse-cmdline so it is usable.Eric W. Biederman
A colleague of mine implemented kdump and it used --reuse-cmdline with some rather interesting and unexpected results. Update the getopt specification so that --reuse-cmdline does not attempt to take an argument that it will not use. Update the processing of --append so that --reuse-cmdline followed by --append actually appends the parameters specified by --reuse-cmdline. Signed-off-by: Eric W. Biederman <ebiederm@aristanetworks.com>
2009-12-16kexec-sh: uImage support.Paul Mundt
This follows the ARM change, and wires up uImage support on SH, with all of the same caveats. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-12-16kexec: Move the uImage header to a better place.Paul Mundt
This is a completely generic header for uImage support and has no place being hidden away in an architecture directory. Move it up to the top-level include so that other architectures can trivially tie in uImage support, too. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-12-10kexec jump support for x86_64Huang Ying
x86_64 specific support, including crash memory range and purgatory setup. Corresponding kernel support has been merged already. Together with the kexec jump features in Linux kernel, kexec jump can be used for following: - A simple hibernation implementation without ACPI support. You can kexec a hibernating kernel, save the memory image of original system and shutdown the system. When resuming, you restore the memory image of original system via ordinary kexec load then jump back. - Kernel/system debug through making system snapshot. You can make system snapshot with kexec/kdump, jump back, do some thing and make another system snapshot. - Cooperative multi-kernel/system. With kexec jump, you can switch between several kernels/systems quickly without boot process except the first time. This appears like swap a whole kernel/system out/in. - A general method to call program in physical mode (paging turning off). This can be used to invoke BIOS code under Linux. Signed-off-by: Huang Ying <ying.huang@intel.com> Signed-off-by: Simon Horman <horms@verge.net.au>
2009-11-26arm: fix architecture detectionSimon Horman
There are many variants of arm and it seems to be impractical to add them all to the arches array. Instead just match on the leading "arm" portion of the utsname. I have made this specific to arm for now, as I'm not sure what fallout might occur if it was made more generic. e.g. arch ppc matching utsname ppc64 is a concern. Based on variants of this patch submitted by Andrea Adami and Marc Andre Tanner, and feedback from Magnus Damm. Cc: Andrea Adami <andrea.adami@gmail.com> Cc: Marc Andre Tanner <mat@brain-dump.org> Cc: Magnus Damm <magnus.damm@gmail.com> Signed-off-by: Simon Horman <horms@verge.net.au>
2009-11-26Write to HVC terminal from purgatory codeM. Mohan Kumar
Current x86/x86-64 kexec-tools print the message "I'm in purgatory" to serial console/VGA while executing the purgatory code. Implement this feature for POWERPC pseries platform by using the H_PUT_TERM_CHAR hypervisor call by printng to hvc console. Includes the changes suggested by Michael Ellerman Signed-off-by: M. Mohan Kumar <mohan@in.ibm.com> Signed-off-by: Simon Horman <horms@verge.net.au>
2009-11-21kexec-arm: add uImage supportMarc Andre Tanner
uImages are basically just zImages with a special header, we therefore just skip the header and let the normal zImage infrastructure do the actual work. Signed-off-by: Marc Andre Tanner <mat@brain-dump.org> Signed-off-by: Simon Horman <horms@verge.net.au>
2009-11-19add kexec-tools support for armv7l processorsMagnus Damm
Add kexec-tools support for arm processors identifying themselves as armv7l. This includes sh7377 and the omap3 on my beagle board. Signed-off-by: Magnus Damm <damm@opensource.se> Signed-off-by: Simon Horman <horms@verge.net.au>
2009-11-19add kexec-tools support for armv6l processorsMagnus Damm
Add kexec-tools support for arm processors identifying themselves as armv6l. Tested on a sh7367. Signed-off-by: Magnus Damm <damm@opensource.se> Signed-off-by: Simon Horman <horms@verge.net.au>
2009-08-13Increase kernel text size for x86_64Hannes Reinecke
Hi all, I cannot load a x86_64 kernel with kexec on 2.6.31; the error message is: Can't find kernel text map area from kcore Cannot load /boot/vmlinuz Digging through the source I found a mismatch between the assumed kernel text size; kexec has: #define KERNEL_TEXT_SIZE (40UL*1024*1024) but on the kernel side we have: include/asm/page_64_types.h: #define KERNEL_IMAGE_SIZE (512 * 1024 * 1024) And, indeed, changing the definition in kexec-tools to the kernel one fixed the problem. Not sure if this has been reported before, if so please ignore the noise. Cheers, Hannes -- Dr. Hannes Reinecke zSeries & Storage hare@suse.de +49 911 74053 688 SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg GF: Markus Rex, HRB 16746 (AG Nürnberg) Signed-off-by: Simon Horman <horms@verge.net.au>
2009-08-13Support R_PPC64_REL32 relocation typeM. Mohan Kumar
[PATCH 2/2] Support R_PPC64_REL32 relocation type gcc-4.4 compiler creates R_PPC64_REL32 relocation type in the ppc64 purgatory code. Add support to handle R_PPC64_REL32 relocation type. Signed-off-by: M. Mohan Kumar <mohan@in.ibm.com> Signed-off-by: Simon Horman <horms@verge.net.au>
2009-08-13Make dtstruct variable to be 8 byte alignedM. Mohan Kumar
[PATCH 1/2] Make dtstruct variable to be 8 byte aligned kexec is creating a version 3 device tree to be backwards compatible. This version of the struct has 8-byte alignment for properties whose value is 8 or more bytes. As the code directly checks the pointer when deciding to add the alignment word, the struct memory must start on an 8 byte boundary. Force the dtstruct variable to be always 8 bytes aligned. Signed-off-by: M. Mohan Kumar <mohan@in.ibm.com> Signed-off-by: Simon Horman <horms@verge.net.au>
2009-07-22Include kexec/arch/cris/kexec-cris.h in distribution tarballSimon Horman
Signed-off-by: Simon Horman <horms@verge.net.au>
2009-07-22Include kexec/arch/sh/crashdump-sh.h in distribution tarballSimon Horman
Signed-off-by: Simon Horman <horms@verge.net.au>
2009-03-19sh: use physical address for zImage entryMagnus Damm
Use a physical address for the SuperH zImage entry point. This makes the zImage loader behave as the elf loader. Signed-off-by: Magnus Damm <damm@igel.co.jp> Signed-off-by: Simon Horman <horms@verge.net.au>
2009-03-18kexec jump: SuperH vmlinux supportMagnus Damm
Create elf header and modify the kernel command line when loading a crash kernel or a kexec jump kernel. Signed-off-by: Magnus Damm <damm@igel.co.jp> Signed-off-by: Simon Horman <horms@verge.net.au>
2009-02-08x86_64 : exclude gart memory region in kexec toolsChandru
The following patch was discussed sometime back on kexec-tools mailing list. http://lists.infradead.org/pipermail/kexec/2008-December/003096.html Sending it here again for inclusion into kexec-tools. thanks ==================================== Exclude GART memory region and make kexec-tools to not create elf headers to it. Currently it seems like the dump analysis tools do not need a copy of the GART memory region, hence ignoring it in kexec-tools. Symtoms of accessing this region in kdump kernel included hangs, spurious restarts, and MCE (Machine Check Exception) panics in some AMD Opteron systems Signed-off-by: Chandru S <chandru@in.ibm.com> Signed-off-by: Simon Horman <horms@verge.net.au>
2009-02-08powerpc: initialize drconf variablesChandru
The initialization of lmb_size and num_of_lmbs got removed as part of the 'kexec memory ranges dynamic allocation' patch to kexec-tools (which added realloc_memory_ranges() code to kexec-tools). These variables are pertinent to ppc64 systems with ibm,dynamic-reconfiguration-memory node in device-tree, i.e systems with /proc/device-tree/ibm,dynamic-reconfiguration-memory. The following patch adds code to initialize the variables back again in kexec-tools. Without this patch kexec-tools will think that it needs to save only the memory represented in memory@ nodes and will skip the memory in /proc/device-tree/ibm,dynamic-reconfiguration-memory node of the device-tree. Signed-off-by: Chandru S <chandru@linux.vnet.ibm.com> Reviewed-by: Bernhard Walle <bwalle@suse.de> Signed-off-by: Simon Horman <horms@verge.net.au>
2009-01-19printf() consolidationBernhard Walle
Remove the fprintf(stderr,...) in get_memory_ranges() that adds unnecessary output in the normal kexec case that the user don't want to see. Use dbgprintf() in get_base_ranges() instead of #ifdef DEBUG fprintf(stderr,...) #endif to to make the code more readable. Signed-off-by: Bernhard Walle <bwalle@suse.de>diff --git a/kexec/arch/ppc64/kexec-ppc64.c b/kexec/arch/ppc64/kexec-ppc64.c index ad8a31c..8d4e42b 100644 Signed-off-by: Bernhard Walle <bwalle@suse.de> Signed-off-by: Simon Horman <horms@verge.net.au>
2009-01-19Fix memory corruption when using realloc_memory_ranges()Bernhard Walle
Because realloc_memory_ranges() makes the old memory invalid, and we return a pointer to memory_range in get_memory_ranges(), we need to copy the contents in get_memory_ranges(). Some code that calls realloc_memory_ranges() may be triggered by get_base_ranges() which is called after get_memory_ranges(). Yes, the memory needs to be deleted somewhere, but I don't know currently where it's the best, and since it's not in a loop and memory is deleted anyway after program termination I don't want to introduce unneccessary complexity. The problem is that get_base_ranges() gets called from architecture independent code and that allocation is PPC64-specific here. Signed-off-by: Bernhard Walle <bwalle@suse.de>diff --git a/kexec/arch/ppc64/kexec-ppc64.c b/kexec/arch/ppc64/kexec-ppc64.c index b0d8acd..ad8a31c 100644 Signed-off-by: Bernhard Walle <bwalle@suse.de> Signed-off-by: Simon Horman <horms@verge.net.au>
2009-01-19Fix typo in realloc_memory_ranges()Bernhard Walle
The base_memory_range should not become memory_range. We need to realloc base_memory_range to not change the contents of memory. That was a copy & paste error. Signed-off-by: Bernhard Walle <bwalle@suse.de> Signed-off-by: Simon Horman <horms@verge.net.au>
2009-01-19Fix missing FILE argument in fprintf()Bernhard Walle
This fixes the following compiler warning kexec/arch/i386/crashdump-x86.c: In function 'get_crash_memory_ranges': kexec/arch/i386/crashdump-x86.c:144: warning: passing argument 1 of \ 'fprintf' from incompatible pointer type kexec/arch/i386/crashdump-x86.c:144: warning: passing argument 2 of \ 'fprintf' makes pointer from integer without a cast Signed-off-by: Bernhard Walle <bwalle@suse.de> Signed-off-by: Simon Horman <horms@verge.net.au>
2009-01-16ppc64: cleanupsMilton Miller
don't copy purgatory, as elf-load-rel does that for us (like x86_64). move function declarations from c to h files remove casts between void * and various pointers change some pointers between char and unsigned char * change args to be vars of the right type instead of casting or copying between types Signed-off-by: Milton Miller <miltonm@bga.com> Tested-by: M. Mohan Kumar <mohan@in.ibm.com> Signed-off-by: Simon Horman <horms@verge.net.au>
2009-01-16ppc64: segments may be reorderedMilton Miller
Instead of fetching data from the segment array, remember the address when added and find the kernel text from the parsed elf header. While add_segment (and hence add_buffer) always adds to the end of the list of segments, it sorts the previous segments before each allocation. In some layouts, the device tree or initrd will fit in a hole below the the kernel. When that happens, the previus code mis-patches purgatory and the kexec fails. Signed-off-by: Milton Miller <miltonm@bga.com> Tested-by: M. Mohan Kumar <mohan@in.ibm.com> Signed-off-by: Simon Horman <horms@verge.net.au>
2009-01-16ppc64: update kdump for 2.6.28 relocatable kernelMilton Miller
The kernel updated its ABI to tell the relocatable kernel to run where it was loaded. We now need to set a flag in the kernel image. Since we only have the kernel image avialable as const data to kexec-tools c code, set the flag in the copy we put in purgatory, and have it set the flag in the kernel (after purgatory has run its checksum). To simplfy the purgatory code we can always copy the flag word back to the kernel as the c code made a copy of the original flag value. Signed-off-by: Milton Miller <miltonm@bga.com> Tested-by: M. Mohan Kumar <mohan@in.ibm.com> Signed-off-by: Simon Horman <horms@verge.net.au>
2009-01-16ppc64: always check number of ranges when adding themMilton Miller
make the idom "always call realloc_memory_ranges when filling a range entry" kexec was core dumping after using 5 exclude_range pairs when only 3 were allocated. also delcare realloc_memory_ranges to take void. Signed-off-by: Milton Miller <miltonm@bga.com> Tested-by: M. Mohan Kumar <mohan@in.ibm.com> Signed-off-by: Simon Horman <horms@verge.net.au>
2008-11-28Fix compile warnings in get_memory_ranges()Bernhard Walle
This patch fixes: kexec/arch/i386/kexec-x86-common.c: In function ‘get_memory_ranges’: kexec/arch/i386/kexec-x86-common.c:189: \ warning: passing argument 2 of ‘parse_iomem_single’ from incompatible pointer type kexec/arch/i386/kexec-x86-common.c:189: \ warning: passing argument 3 of ‘parse_iomem_single’ from incompatible pointer type Yes, that was my own code. :-( Signed-off-by: Bernhard Walle <bwalle@suse.de> Signed-off-by: Simon Horman <horms@verge.net.au>
2008-11-28Don't use /sys/firmware/memmap for XenBernhard Walle
On Xen, we have to use /proc/iomem to retrieve the memory area for the kexec'd kernel, not /sys/firmware/memmap. Dom0 kernel gets a E820 map that contains only one region: 0000000000000000-0000000018e5e000 (System RAM) Compared to the /proc/iomem: 00000000-0009cbff : System RAM 0009cc00-0009ffff : reserved 000ce000-000d3fff : reserved 000e0000-000fffff : reserved 00100000-1fd6ffff : System RAM 01000000-04ffffff : Crash kernel 1ec00000-1fbfffff : Hypervisor code and data 1f0b4680-1f0b4873 : Crash note 1f0b4900-1f0b4a93 : Crash note 1f0b4b80-1f0b4d13 : Crash note 1f0b4e00-1f0b4f93 : Crash note ... Without that patch, /proc/vmcore is empty in the kexec'd kernel and I'm unable to copy the crashdump. Signed-off-by: Bernhard Walle <bwalle@suse.de> Signed-off-by: Simon Horman <horms@verge.net.au>
2008-11-10Add include for offsetof macroStefan Assmann
kexec/arch/i386/kexec-elf-x86.c and kexec/arch/x86_64/kexec-elf-x86_64.c both use the macro offsetof() which according to the man page requires #include <stddef.h>. The include is not present at the moment and this patch adds it. This is necessary for compatibility with i.e. uClibc. Signed-off-by: Stefan Assmann <sassmann@suse.de> Signed-off-by: Simon Horman <horms@verge.net.au>
2008-11-03ppc64: kexec memory ranges dynamic allocationMaxim Uvarov
Do not count max_memory_range for allocation. Increase allocation buffers when it is needed. This actually allows us to avoid a lot of troubles with various device-tree files. Signed-off-by: Maxim Uvarov <muvarov@gmail.com> Signed-off-by: Simon Horman <horms@verge.net.au>
2008-10-31kexec jump support for kexec-toolsHuang Ying
To support memory backup/restore an option named --load-preserve-context is added to kexec. When it is specified toggether with --mem-max, most segments for crash dump support are loaded, and the memory range between mem_min to mem_max which has no segments loaded are loaded as backup segments. To support jump back from kexeced, options named --load-jump-back-helper and --entry are added to load a helper image with specified entry to jump back. Signed-off-by: Huang Ying <ying.huang@intel.com> Signed-off-by: Simon Horman <horms@verge.net.au>
2008-10-23kdump: check flags field from drconf memoryChandru
On a powerpc machine when memory is dynamically removed/added from an lpar, the corresponding flags field in the drconf memory reflects the same with the bits unset/set accordingly. The kernel does a check on these flags while booting. Following are the similar changes brought in to kexec-tools. This makes kexec-tools to skip those memory regions that do not belong or are not assigned to the current partition ( but are available to dynamically add them back ). Without this patch (and with memory remove operation) copying vmcore fails with error as Copying data : [ 84 %] readmem: Can't read the dump memory(/proc/vmcore). Bad address read_pfn: Can't get the page data. Signed-off-by : Chandru S <chandru@in.ibm.com> Signed-off-by: Simon Horman <horms@verge.net.au>
2008-10-23IA64: better calculate PT_LOAD segment sizeJay Lan
This patch combines consecutive PL_LOAD segments into one. The end address of the last PL_LOAD segment, calculated by adding p_memsz to p_paddr & rounded up to ELF_PAGE_SIZE, will be the end address of this loaded_segments[] entry. This patch fixes the kdump kernel MCA problem caused by under- allocation of memory and a "kdump broken on ALtix 350" problem reported by Bernhard Walle. Simon, this patch replaces my previous patch I submitted on the underallocation issue. Signed-off-by: Jay Lan <jlan@sgi.com> Signed-off-by: Simon Horman <horms@verge.net.au>
2008-10-10Fix declaration of get_dyn_reconf_crash_memory_ranges()Simon Horman
powerpc64-unknown-linux-gnu-gcc (GCC) 4.1.1 Copyright (C) 2006 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. kexec/arch/ppc64/crashdump-ppc64.c:125: warning: function declaration isn't a prototype Signed-off-by: Simon Horman <horms@verge.net.au>
2008-10-10Use return value of count_dyn_reconf_memory_ranges()Bernhard Walle
This patch fixes the build error kexec/arch/ppc64/kexec-ppc64.c:140: \ warning: control reaches end of non-void function The patch returns 0 on success, and checks when the function is called for a non-zero value. Signed-off-by: Bernhard Walle <bwalle@suse.de> Signed-off-by: Simon Horman <horms@verge.net.au>
2008-10-09kexec/kdump : get details of ibm, dynamic-reconfiguration-memory node of ↵Chandru
device tree Get number of lmb's (logical memory blocks) , size of each lmb from ibm,dynamic-memory property , get base memory ranges from ibm,dynamic-reconfiguration-memory node. Signed-off-by: Chandru Siddalingappa <chandru@in.ibm.com> Signed-off-by: Simon Horman <horms@verge.net.au>
2008-10-09kexec/kdump : add a new linux, usable-drconf-memory node to the device treeChandru
Add a new linux,usable-drconf-memory property to the device tree passed to the 2nd kernel. Each entry in the property is of the form: a count followed by so many (base, size) pairs of usable memory regions. The total number of such entries is equal to number of lmb's in ibm,dynamic-memory property. Signed-off-by: Chandru Siddalingappa <chandru@in.ibm.com> Signed-off-by: Simon Horman <horms@verge.net.au>
2008-10-09kexec/kdump: read crash memory ranges from drconf memoryChandru
Get the memory ranges of the 1st kernel excluding the memory reserved for kexec/kdump kernel in case of ibm,dynamic-reconfiguration-memory node of device tree Signed-off-by: Chandru Siddalingappa <chandru@in.ibm.com> Signed-off-by: Simon Horman <horms@verge.net.au>
2008-10-08cris: Add CRISv32 supportEdgar E. Iglesias
Hello, I hope this is the correct list to which to send these patches. Comments are very welcome. Thanks, Edgar From: Edgar E. Iglesias <edgar.iglesias@axis.com> Add a CRISv32 port. Initially only the elf filetype is supported. Signed-off-by: Edgar E. Iglesias <edgar.iglesias@axis.com> Signed-off-by: Simon Horman <horms@verge.net.au>
2008-10-08ia64: use generic put_unaligned()Simon Horman
Signed-off-by: Simon Horman <horms@verge.net.au>