Age | Commit message (Collapse) | Author |
|
against klibc and dietlibc.
Based on a patch by Andrea Adami and Yuri Bushmelev
I have:
* Cleaned up indentation
* Rearranged the logic in get_command_line()
* Increased the buffer for reading the command line
from 1024 to 2048 bytes as this is now possible on x86
Only compile tested against glibc.
Cc: Andrea Adami <andrea.adami@gmail.com>
Cc: Yuri Bushmelev <jay4mail@gmail.com>
Cc: Bernhard Walle <bernhard@bwalle.de>
Signed-off-by: Simon Horman <horms@verge.net.au>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
autoconf 2.64 redefined AC_MSG_ERROR and now a ";" is required at the
end of AC_MSG_ERROR macro invocation in configure.ac. Absence of this
";" causes an "unexpected end of file" message when configure script
generated by autoconf is run. This patch adds the ";" in right places. I
have verified that configure.ac still works fine after these changes
with autoconf 2.63 and 2.61.
[horms@verge.net.au: removed trailing whitespace]
Signed-off-by: Khalid Aziz <khalid.aziz@hp.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
|
|
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>
|
|
Add -git to version so it doesn't look like a release.
This is just so when people build code from git it can
be identified as such from the version string.
Signed-off-by: Simon Horman <horms@verge.net.au>
|
|
Signed-off-by: Simon Horman <horms@verge.net.au>
|
|
[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>
|
|
[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>
|
|
This fixes up the:
config.status: WARNING: 'Makefile.in' seems to ignore the --datarootdir setting
warning when producing the output Makefile.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Signed-off-by: Simon Horman <horms@verge.net.au>
|
|
Add -git to version so it doesn't look like a release.
This is just so when people build code from git it can
be identified as such from the version string.
Signed-off-by: Simon Horman <horms@verge.net.au>
|
|
Signed-off-by: Simon Horman <horms@verge.net.au>
|
|
Signed-off-by: Simon Horman <horms@verge.net.au>
|
|
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>
|
|
gcc complains because x86_setup_jump_back_entry() has no arguments,
making the argument list void resolves this.
Also, make the function static as it isn't used in any other files.
And move the function above where it is used, to eliminate the
need for a forward-declaration.
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>
|
|
Fix a bug of kexec load on x86_64. Kexec fails to do load on x86_64, with
error message:
Symbol: cmdline_end not found cannot set
Because kexec/arch/i386/kexec-bzImage.c accesses cmdline_end symbol in
i386 purgatory, but there is no cmdline_end in x86_64 purgatory, and
kexec-bzImage.c is used by x86_64 too.
cmdline_end is added into x86_64 purgatory to solve the bug, because kexec
jump support for x86_64 is planned.
Reported-by: Bernhard Walle <bwalle@suse.de>
Signed-off-by: Huang Ying <ying.huang@intel.com>
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>
|
|
Relocatable kdump kernel support in kexec-tools
This patch adds relocatable kernel support for kdump in the kexec-tools
code. A signature (0xfeed1234) is passed in r6 from panic code to the
purgatory code through kexec_sequence function. The signature is used to
differentiate between relocatable kdump kernel and non-kdump kernels.
The purgatory code compares the signature and sets the __kdump_flag in
head_64.S by using the offset with respect to next kernel load address.
During the boot up, kernel code checks __kdump_flag and if it is set, the
kernel will behave as relocatable kdump kernel.
Signed-off-by: Mohan Kumar M <mohan@in.ibm.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
|