Age | Commit message (Collapse) | Author |
|
A few device nodes are dynamically determined by the bootloader (MAC address,
memory size, ..) and are not part of the device tree. The kernel command line
is also read from dtb and usually not part of the device tree.
With the libfdt it is now easy to add/replace nodes in the device tree.
The user may specify "--reuse-node=/memory/reg" to update the memory/reg
node to what ever is now. This requires the kernel to export the device
tree via the procfs in /proc/device-tree.
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
|
This is v1.2.0 of libfdt from the dtc project which is available at
git://www.jdl.com/software/dtc.git
The other files
- include/page.h
- include/types.h
- libfdt-wrapper.c
- ops.h
are part of the glue code which is used the powerpc boot wrapper code
is comming from the Linux kernel v2.6.27-rc6 and has been modified a
little to fit.
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
|
Some code dtb scanning & filling has been borrowed from ppc64.
The old behavior is still available if compiled with GameCube,
other PowerPC platform use the can purgatory and specify a new
dtb.
Booting a self contained elf image (incl. dtb / without the need
for a bd sturct or the like) can be booted. The dtb support is currently
optional. That means if the elf image does not contain a dtb file then
the user has to supply a complete dtb (including mem size, command line,
bus freq., mac addr, ...)
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
|
fstat() is used to determine the filesize before read() and
it requires a filesystem. That means that it can not be used
on character nodes. This makes it impossible to obtains the
kernel from a char node like mtd or more likely ubi.
We can't use this in every case because files in /proc don't
support lseek(). This is required by the powerpc part to read
some device-tree entries.
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
|
The RMO region can only exist in '/memory@0' node in the device tree.
While adding support for '/ibm,dynamic-reconfiguration-memory' in
kexec-tools, I incorrectly extended the code of '/memory@' nodes to
drconf memory with the assumption that what applies to '/memory@'
nodes would also apply to drconf memory. This is incorrect and
hence removing the code from kexec-tools now.
With this code in place, kexec on kexec fails. The first kexec
works because '/memory@0' node is read after drconf memory and
that correctly sets rmo_base and rmo_top from '/memory@0' node.
While in the kexec'ed kernel, '/ibm,dynamic-reconfiguration-memory'
is read after '/memory@xxx' nodes and this incorrectly sets both
rmo_base and rmo_top from drconf memory.
Sorry for introducing this bug.
Signed-off-by: Chandru Siddalingappa <chandru@linux.vnet.ibm.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
|
|
This fixes a bug when using gdb with vmcore
as explained by Dave Anderson:
The kexec/arch/x86_64/crashdump-x86_64.h file contains a
stale PAGE_OFFSET value. In 2.6.27 it was changed from
0xffff810000000000UL to 0xffff880000000000UL. This is
only a problem when using gdb with the vmlinux/vmcore
pair, because gdb relies upon the PT_LOAD segment's p_vaddr
values in the ELF header to be correct.
Cc: Dave Anderson <anderson@redhat.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
|
|
# crisv32-axis-linux-gnu-gcc --version
crisv32-axis-linux-gnu-gcc (GCC) 3.2.1 Axis release R64/1.64
Copyright (C) 2002 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.
# make
kexec/arch/cris/kexec-elf-cris.c: In function `elf_cris_load':
kexec/arch/cris/kexec-elf-cris.c:134: warning: assignment makes pointer from integer without a cast
Signed-off-by: Simon Horman <horms@verge.net.au>
|
|
Although the following compiler warning is bogus
it seems harmless to initialise initrd_start to NULL.
# arm-unknown-linux-gnu-gcc --version
arm-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.
# make
kexec/arch/arm/kexec-zImage-arm.c: In function 'zImage_arm_load':
kexec/arch/arm/kexec-zImage-arm.c:135: warning: 'initrd_start' may be used
uninitialized in this function
Signed-off-by: Simon Horman <horms@verge.net.au>
|
|
Signed-off-by: Simon Horman <horms@verge.net.au>
|
|
# sh4-unknown-linux-gnu-gcc --version
sh4-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.
# make
kexec/arch/sh/kexec-netbsd-sh.c:29: warning: 'extern' is not at beginning of declaration
Signed-off-by: Simon Horman <horms@verge.net.au>
|
|
This avoids comparisons between signed and unsigned integers.
Signed-off-by: Simon Horman <horms@verge.net.au>
|
|
Signed-off-by: Simon Horman <horms@verge.net.au>
|
|
Apparently this never happens, but the current code seems excessively loose.
1) die if it does happen
2) initialise offset to make gcc happy.
# ia64-unknown-linux-gnu-gcc --version
ia64-unknown-linux-gnu-gcc (GCC) 3.4.5
Copyright (C) 2004 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.
# make
kexec/arch/ia64/kexec-elf-ia64.c: In function `move_loaded_segments':
kexec/arch/ia64/kexec-elf-ia64.c:102: warning: 'offset' might be used
uninitialized in this function
Signed-off-by: Simon Horman <horms@verge.net.au>
|
|
The two-stage cast is because we really do want a 32bit integer value
from a 64bit pointer, and gcc assumes that we're making a mistake
if there is just one cast.
# powerpc64-unknown-linux-gnu-gcc --version
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.
# make
kexec/arch/ppc64/kexec-elf-rel-ppc64.c: In function 'machine_apply_elf_rel':
kexec/arch/ppc64/kexec-elf-rel-ppc64.c:66: warning: cast from pointer to integer of different size
Signed-off-by: Simon Horman <horms@verge.net.au>
|
|
Signed-off-by: Simon Horman <horms@verge.net.au>
|
|
The consumer of the purgatory buffer, elf_rel_build_load()
expects a signed char buffer.
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>
|
|
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>
|
|
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>
|
|
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>
|
|
Signed-off-by: Simon Horman <horms@verge.net.au>
|
|
Signed-off-by: Simon Horman <horms@verge.net.au>
|
|
Cc: Eric W. Biederman <ebiederm@xmission.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
There isn't any need for anything in kexec-lzma.h other
than a declaration of zlib_decompress_file().
Other being cleaner it also fixes a build problem when
lzma support isn't being compiled in.
$ make all
i686-unknown-linux-gnu-gcc -Wall -Wextra -O2 -fomit-frame-pointer -pipe -fno-strict-aliasing -Wall -Wstrict-prototypes -I/home/horms/local/opt/crosstool/i686/gcc-3.4.5-glibc-2.3.6/i686-unknown-linux-gnu/include -I./include -I./util_lib/include -Iinclude/ -I./kexec/arch/i386/include -c
-MD -o kexec/kexec.o kexec/kexec.c
In file included from kexec/kexec.c:47:
kexec/kexec-lzma.h:8:18: lzma.h: No such file or directory
kexec/kexec.c: In function `locate_hole':
kexec/kexec.c:203: warning: comparison between signed and unsigned
It ought to be possible to just provide a stub for zlib_decompress_file()
in kexec-lzma.h and not compile lzma.c at all in the case where
lzma support isn't being compiled in. However I see no obvious way
to do this with the existing build system. So I'd like to deal
with that as a separate possible change.
Changes as suggested by Eric W. Biederman.
Cc: Florian Fainelli <florian@openwrt.org>
Cc: Eric W. Biederman <ebiederm@xmission.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
|
|
This patch allows one to load a lzma compressed kernel using kexec -l.
As I wanted the lzma code to be very similar to the existing
zlib slurp_decompress I took lzread and associated routines
from the cpio lzma support. Tested on my x86 laptop using the
following commands:
lzma e bzImage bzImage.lzma
kexec -l bzImage.lzma
Having lzma support is particularly useful on some embedded
systems on which we have the kernel already lzma compressed
and available on a mtd partition.
Signed-off-by: Florian Fainelli <florian@openwrt.org>
Signed-off-by: Simon Horman <horms@verge.net.au>
|
|
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>
|
|
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>
|
|
[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>
|
|
Signed-off-by: Simon Horman <horms@verge.net.au>
|