Age | Commit message (Collapse) | Author |
|
Signed-off-by: Simon Horman <horms@verge.net.au>
|
|
Move the print statement so that the variable
value has been assigned before its value is
printed.
Signed-off-by: Geoff Levand <geoffrey.levand@am.sony.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
|
|
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>
|
|
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>
|
|
Since /proc/iomem contains physical addresses, use
add_segment_phys_virt(xxx, 0) instead of add_segment()
in add_backup_segments().
This fix is needed for kexec jump on SuperH where
add_segment() only takes virtual addresses.
Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Simon Horman <horms@verge.net.au>
|
|
Since I don't work for SUSE any more and 'bwalle@suse.de' is invalid, correct
it in the copyright so that people can still contact me.
Signed-off-by: Bernhard Walle <bernhard.walle@gmx.de>
Signed-off-by: Simon Horman <horms@verge.net.au>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
The kexec info struct defines entry to be a void *, so pass around the
user supplied value as one.
This fixes the following warning:
gcc -g -O2 -fno-strict-aliasing -Wall -Wstrict-prototypes -I./include -I./util_lib/include -Iinclude/ -I./kexec/arch/ppc64/include -c -MD -o kexec/kexec.o kexec/kexec.c
kexec/kexec.c: In function ‘my_load’:
kexec/kexec.c:773: warning: assignment makes pointer from integer without a cast
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
This patch just fixes a spell error. Found by Dave Plater.
Signed-off-by: Bernhard Walle <bwalle@suse.de>
Signed-off-by: Simon Horman <horms@verge.net.au>
|
|
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>
|
|
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>
|
|
This patch adds core dump file support to ELF file loader. This can be
used by kexec based hibernation to load hibernated image, which is
from /proc/vmcore, a core dump file.
Signed-off-by: Huang Ying <ying.huang@intel.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
The released toolchain had an old list of syscalls (kexec_load was missing)
so I had to add a fallback definition:
Signed-off-by: Simon Horman <horms@verge.net.au>
|
|
Signed-off-by: Simon Horman <horms@verge.net.au>
|
|
Currently a memory segment in memory map with attribute of EFI_MEMORY_UC
is denoted as "System RAM" in /proc/iomem, while memory of attribute
(EFI_MEMORY_WB|EFI_MEMORY_UC) is also labeled the same.
The kexec utility then includes uncached memory as part of vmcore.
The kdump kernel may MCA when it tries to save the vmcore to a disk.
A normal "cached" access can cause MCAs.
Since kexec assembled memory ranges with memory tagged as "System RAM",
the uncached memory will be excluded if it is labeled differently.
Simon, since only IA64 will create "Uncached RAM" label, i do not
make changes to other arch.
Our HP machine in the lab is dead. I am sorry that i can not test
against other IA64 systems (than SGI's). Feedback is very much
appreciated.
The corresponding kernel patch is needed to test this kexec patch:
http://marc.info/?l=linux-ia64&m=122122791230130&w=2
This patch without the kernel patch will have no effect and do no
harm.
The kernel patch has been commited as
"[IA64] kexec fails on systems with blocks of uncached memory".
Signed-off-by: Jay Lan <jlan@sgi.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
|
|
Fix these ppc64 32 bit build warnings:
kexec/arch/ppc64/kexec-zImage-ppc64.c: In function 'zImage_ppc64_load':
kexec/arch/ppc64/kexec-zImage-ppc64.c:164: warning: cast to pointer from integer of different size
kexec/arch/ppc64/kexec-elf-ppc64.c: In function 'elf_ppc64_load':
kexec/arch/ppc64/kexec-elf-ppc64.c:121: warning: integer constant is too large for 'unsigned long' type
kexec/arch/ppc64/kexec-elf-ppc64.c:237: warning: cast from pointer to integer of different size
kexec/arch/ppc64/kexec-elf-ppc64.c:276: warning: cast from pointer to integer of different size
kexec/arch/ppc64/kexec-elf-ppc64.c:283: warning: cast from pointer to integer of different size
kexec/arch/ppc64/kexec-elf-ppc64.c:287: warning: cast from pointer to integer of different size
kexec/arch/ppc64/kexec-elf-ppc64.c:341: warning: format '%lx' expects type 'long unsigned int', but argument 3 has type 'uint64_t'
kexec/arch/ppc64/kexec-elf-ppc64.c:352: warning: format '%ld' expects type 'long int', but argument 5 has type 'size_t'
kexec/arch/ppc64/crashdump-ppc64.c:45: warning: integer constant is too large for 'long' type
kexec/arch/ppc64/crashdump-ppc64.c:46: warning: integer constant is too large for 'long' type
kexec/arch/ppc64/crashdump-ppc64.c:56: warning: integer constant is too large for 'long' type
kexec/arch/ppc64/crashdump-ppc64.c:57: warning: integer constant is too large for 'long' type
Tested on PS3 (ppc64) with 32 and 64 bit builds.
Signed-off-by: Geoff Levand <geoffrey.levand@am.sony.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
|
|
Fix these 64 bit build warnings:
kexec/firmware_memmap.c:241: warning: format '%d' expects type 'int', but argument 3 has type 'size_t'
kexec/crashdump-elf.c:160: warning: format '%llx' expects type 'long long unsigned int', but argument 4 has type 'Elf64_Off'
kexec/crashdump-elf.c:160: warning: format '%llx' expects type 'long long unsigned int', but argument 5 has type 'Elf64_Addr'
kexec/crashdump-elf.c:160: warning: format '%llx' expects type 'long long unsigned int', but argument 6 has type 'Elf64_Addr'
kexec/crashdump-elf.c:160: warning: format '%llx' expects type 'long long unsigned int', but argument 7 has type 'Elf64_Xword'
kexec/crashdump-elf.c:160: warning: format '%llx' expects type 'long long unsigned int', but argument 8 has type 'Elf64_Xword'
Tested on PS3 (ppc64) with 32 and 64 bit builds.
Signed-off-by: Geoff Levand <geoffrey.levand@am.sony.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
|
|
Simple handler for the common SHcompact ELF relocations.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Signed-off-by: Simon Horman <horms@verge.net.au>
|
|
This re-enables the fairly generic put/get_unaligned() routines in
kexec.h, while tidying up the variable shadowing clash that results
when using it in places like machine_apply_elf_rel().
Needed for SH ELF relocations.
IA64 still does its own put_unaligned64(), which should likely also be
converted over to using put_unaligned() directly.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Signed-off-by: Simon Horman <horms@verge.net.au>
|
|
This patch adds SuperH crash dump support. The vmlinux loader is modified
with crash dump hooks as on other architectures. SuperH does not need any
backup region, so only the elf header is allocated from the top of the
reserved memory window. The actual size of the memory window is passed
to the secondary kernel on the command line using "mem=".
The secondary kernel must be configured to match the reserved memory
window, change kernel parameters CONFIG_MEMORY_START and CONFIG_MEMORY_SIZE.
Linux-2.6.27 should be usable as primary kernel on SuperH, later kernel
versions are needed to fully support secondary kernel /proc/vmcore.
Signed-off-by: Magnus Damm <damm@igel.co.jp>
Acked-by: Paul Mundt <lethal@linux-sh.org>
Signed-off-by: Simon Horman <horms@verge.net.au>
|
|
Fix SuperH help text spelling.
Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Simon Horman <horms@verge.net.au>
|
|
Hello,
please have a look at the following patch. This patch allows kexec to work
on IBM QS2x blades. Would it be possible to apply this patch to a next
kexec version?
Signed-off-by: Maxim Shchetynin <maxim@de.ibm.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
|
|
Add SuperH vmlinux support through a zero-page aware elf loader. Only for
kexec at this point, in the future kdump support will be added.
Signed-off-by: Magnus Damm <damm@igel.co.jp>
Acked-by: Paul Mundt <lethal@linux-sh.org>
Signed-off-by: Simon Horman <horms@verge.net.au>
|
|
Dynamically calculate SuperH zImage load address instead of hardcoding.
Signed-off-by: Magnus Damm <damm@igel.co.jp>
Acked-by: Paul Mundt <lethal@linux-sh.org>
Signed-off-by: Simon Horman <horms@verge.net.au>
|
|
Autodetect the zero page base address for zImages on SuperH.
Signed-off-by: Magnus Damm <damm@igel.co.jp>
Acked-by: Paul Mundt <lethal@linux-sh.org>
Signed-off-by: Simon Horman <horms@verge.net.au>
|
|
Implement virtual-to-physical address conversion functions for SuperH.
Signed-off-by: Magnus Damm <damm@igel.co.jp>
Acked-by: Paul Mundt <lethal@linux-sh.org>
Signed-off-by: Simon Horman <horms@verge.net.au>
|
|
Parse contents of /proc/iomem instead of hardcoding RAM ranges.
Signed-off-by: Magnus Damm <damm@igel.co.jp>
Acked-by: Paul Mundt <lethal@linux-sh.org>
Signed-off-by: Simon Horman <horms@verge.net.au>
|
|
Add support for sh4al-dsp processors such as sh7722.
Signed-off-by: Magnus Damm <damm@igel.co.jp>
Acked-by: Paul Mundt <lethal@linux-sh.org>
Signed-off-by: Simon Horman <horms@verge.net.au>
|
|
In recent kernels "asm/page.h" isn't exported to userspace anymore, thus
the include is removed.
Further this patch defines _XOPEN_SOURCE, in order to use getpagesize.
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Simon Horman <horms@verge.net.au>
|
|
To make static compilation work with
LDFLAGS=-static ./configure
make
we have to move $(LIBS) on the end of the compiler line. Static compilation has
been requested by "Yinghai Lu" <yhlu.kernel@gmail.com>. Although I don't see the
practical benefit in most cases, I don't think we should not support it. Since
kexec does not use name resolution functions of libc, it's valid to use static
linking.
Tested on x86_64-suse-linux.
Signed-off-by: Bernhard Walle <bwalle@suse.de>
Signed-off-by: Simon Horman <horms@verge.net.au>
|