Age | Commit message (Collapse) | Author |
|
Commit 9c200a85de2245a850546fded96a1977b84ad24d referenced
'bzImage_support_efi_boot' without matching 32-bit definition.
Signed-off-by: Tony Jones <tonyj@suse.de>
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>
|
|
strncat() does not want the total size but the maximum length
(without trailing NUL) that can still be added. Switch over
to snprintf which is both more readable and avoids this issue.
Signed-off-by: Dirk Mueller <dmueller@suse.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
|
|
When the kernel is built with CONFIG_PPC_EARLY_DEBUG_OPAL set, it is
expecting to get r8 and r9 filled respectively with OPAL base address and
OPAL entry address (arc/power/head_64.S).
On the new powernv platform, having these 2 registers set allows the kernel
to perform OPAL calls before it parse the device tree.
Signed-off-by: Laurent Dufour <ldufour@linux.vnet.ibm.com>
Tested-by: Mahesh Salgaonkar <mahesh@linux.vnet.ibm.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
|
|
When building in PPC64 little endian mode, the compiler is now using the
new ABI v2. Among other changes, this new ABI removes the function
descriptors and changes the way the TOC address is computed when entering a
C function.
The purgatory assembly part where the dot symbols are removed, and ELF
relocation code are impacted in this patch.
Signed-off-by: Laurent Dufour <ldufour@linux.vnet.ibm.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
|
|
RTAS is expecting parameters in Big Endian order so we have to byte swap
them in LE mode.
In the purgatory RTAS calls are only made for debug output.
Signed-off-by: Laurent Dufour <ldufour@linux.vnet.ibm.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
|
|
All the attributes exposed in the device tree are in Big Endian format.
This patch add the byte swap operation for some entries which were not yet
processed, including those fixed by the following kernel's patch :
https://lists.ozlabs.org/pipermail/linuxppc-dev/2014-January/114720.html
To work on PPC64 Little Endian mode, kexec now requires that the kernel's
patch mentioned above is applied on the kexecing kernel.
Tested on ppc64 LPAR (kexec/dump) and ppc64le in a Qemu/KVM guest (kexec)
Changes from v1 :
* add processing of the following entries :
- ibm,dynamic-reconfiguration-memory
- chosen/linux,kernel-end
- chosen/linux,crashkernel-base & size
- chosen/linux,memory-limit
- chosen/linux,htab-base & size
- linux,tce-base & size
- memory@/reg
Signed-off-by: Laurent Dufour <ldufour@linux.vnet.ibm.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
|
|
For supporting efi runtime, several efi physical addresses
fw_vendor, runtime, config tables, smbios and the whole runtime
mapping info need to be used in kexec kernel. Thus introduce
setup_data struct for passing these data.
collect the varialbes from /sys/firmware/efi/systab and
/sys/firmware/efi/runtime-map
Signed-off-by: Dave Young <dyoung@redhat.com>
Tested-by: Toshi Kani <toshi.kani@hp.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
|
|
For supporting efi runtime on kexec kernel we need to
fill the efi_info struct in setup_header. I just get
the info in kernel exported boot_params data in debugfs.
Signed-off-by: Dave Young <dyoung@redhat.com>
Tested-by: Toshi Kani <toshi.kani@hp.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
|
|
Not only setup_subarch will get data from debugfs file
boot_params/data, later code for adding efi_info will
also need do same thing. Thus add a common function here
for later use.
Signed-off-by: Dave Young <dyoung@redhat.com>
Tested-by: Toshi Kani <toshi.kani@hp.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
|
|
There's build warnings about using struct x86_linux_param_header *
in x86-linux-setup.h, it is declared in x86-linux.h
Fix it by include x86-linux.h in x86-linux-setup.h
Signed-off-by: Dave Young <dyoung@redhat.com>
Tested-by: Toshi Kani <toshi.kani@hp.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
|
|
In the multiboot header, there is a field, `mem_lower' that is meant to
contain the size of memory starting at zero and ending below 640k.
If your kernel is compiled with CONFIG_X86_RESERVE_LOW non zero
(the usual case), then a hole is inserted into kernel's physical
memory map at zero, so the test to find the size of this region in
kexec/arch/i386/kexec-multiboot-x86.c never succeeds, so the value is
always zero.
On a PC99 architecture, there is always memory at physycal address zero;
assume that a region that starts below 64k actually starts at zero,
and use it for the mem_lower variable.
Signed-off-by: Peter Chubb <peter.chubb@nicta.com.au>
Signed-off-by: Simon Horman <horms@verge.net.au>
|
|
Some sort of space like "\t" "\n" are used in kernel log. But we treat
them as non-printables and output "\x20%x" for each non-printable. So
let's fix it.
Signed-off-by: WANG Chao <chaowang@redhat.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
|
|
Currently little-endian ELFDATA is hard-coded in crashdump header.
This lead to a wrong header format if crashdump is generated on BE system.
Set native endianness into ELFDATA field.
Signed-off-by: Taras Kondratiuk <taras.kondratiuk@linaro.org>
Signed-off-by: Simon Horman <horms@verge.net.au>
|
|
It seems gcc doesn't check return type from inline function.
struct_val_u64() should return u64 otherwise upper 32bit is lost.
Signed-off-by: WANG Chao <chaowang@redhat.com>
Acked-by: Vivek Goyal <vgoyal@redhat.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
|
|
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Simon Horman <horms@verge.net.au>
|
|
Factor out the common part of slurp_file() and slurp_file_len() into
a new helper function slurp_fd().
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Dave Young <dyoung@redhat.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
|
|
Add an optional output parameter to slurp_file_len() so it can return the
actual number of bytes read.
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Acked-by: Dave Young <dyoung@redhat.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
|
|
A switchover from /kexec/arch/ppc64/fs2dt.c to common code under
/kexec/fs2dt.c broke the kdump on ppc64. The function add_usable_memory()
assumes that 'memory@*' node exports two 32bit values and fails
to populate mem ranges correctly. On ppc64, 'memory@*' exports two 64bit
values as below:
# hexdump /proc/device-tree/memory\@0/reg
0000000 0000 0000 0000 0000 0000 0000 0800 0000
0000010
#
This patch fixes add_usable_memory() to use buf[2] of type uint64_t.
Signed-off-by: Mahesh Salgaonkar <mahesh@linux.vnet.ibm.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
|
|
This typo was introduced in c/s c0b4a3f95dd80256cc6d7084436235e69b4933fb
It prevents a 32bit build of kexec from loading a 32bit crash image.
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
|
|
Remove redundant include of stdlib.h introduced by
commit d01680c28ba7bf1e02f74aa5841247a45738f5d4
(kexec/xen: Correct some compile errors).
Signed-off-by: Daniel Kiper <daniel.kiper@oracle.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
|
|
Do not call xc_interface_close() if xc_interface_open() failed.
xc_interface_close() crashes if it gets NULL as an argument.
Relevant fix for libxenctrl will be posted too but kexec-tools
should also behave properly.
Signed-off-by: Daniel Kiper <daniel.kiper@oracle.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
|
|
Correct various problems introduced by
08cf823704b0fa3b ("kexec/xen: directly load images images into Xen").
These all relate to the case here HAVE_LIBXENCTRL is not set.
Signed-off-by: Simon Horman <horms@verge.net.au>
|
|
Xen 4.4 has an improvided kexec hypercall ABI that allows images to be
loaded and executed without any kernel involvement. Use the API
provided by libxc to load images when running in a Xen guest.
Support for loading images via the kexec_load syscall in non-upstream
("classic") Xen kernels is no longer supported.
Signed-off-by: David Vrabel <david.vrabel@citrix.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
|
|
Signed-off-by: Don Slutz <Don@CloudSwitch.com>
Signed-off-by: David Vrabel <david.vrabel@citrix.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
|
|
Use xc_kexec_get_range(KEXEC_RANGE_MA_CPU) instead of parsing
/proc/iomem (which is only populated by non-upstream ("classic") Xen
kernels).
Signed-off-by: David Vrabel <david.vrabel@citrix.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
|
|
libxc from Xen 4.4 added xc_kexec_load() which will be required to
load images into Xen in the future.
Remove all the #ifdef'ery for older versions of libxc.
Signed-off-by: David Vrabel <david.vrabel@citrix.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
|
|
This patch provides support for the new Power PC litte endian (LE) mode. The
LE mode only differs in the way the instructions and data are stored in memory
thus there is no real need to duplicate the ppc64 code.
However some compilation's options, especially for the purgatory, differ
between little and big endian mode's support. A new "SUBARCH" build variable
is introduced which is currently only used for PPC64 to specify the
endianness.
Another set of changes in this patch is fixing minor endianess issues in the
ppc64 code and fix an alignment issue raised on Power7 little endian mode.
Among these fixes, the check on the kernel binary endianess is removed,
since we can imagine kexecing a LE kernel from a BE environment, as far as
the specified root filesystem and initrd file are containing the right
binaries.
This patch depends on the patch "kexec/ppc64: use common architecture
fs2dt.c file" I sent earlier on the kexec mailing list.
Signed-off-by: Laurent Dufour <ldufour@linux.vnet.ibm.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
|
|
Following the commit 'b3c2962 fs2dt: Add a generic copy of fs2dt' which
introduced a generic fs2dt file, this patch is removing the ppc64
architecture's one.
Tests have been done successfully on Power 7 plateform.
Signed-off-by: Laurent Dufour <ldufour@linux.vnet.ibm.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
|
|
Currently, kexec on arm assumes that it's safe to place binary images
such as atags, dtb or initrd at an estimated offset after the load
address. That estimated offset is set to 4 times the size of the
compressed image, hence assuming a minimum compression ratio of 1:4.
While that assumption matches what the in-kernel compressors are able to
achive, it doesn't take into account the .bss section the kernel image
carries, and which can grow to arbitrary sizes while not accounting to
the compressed image size.
After decompression, and before the execution of the compressed kernel,
the .bss area is initialized to zeros, trampeling over the binary images
in case they happen to live in that piece of memory.
Unfortunately, determining the full image size is not easiliy possible
at runtime, as it would include doing all possible ways of
decompression and then walk the ELF sections by hand.
For now, allow users to override the static offset with a new, arm
specific command line argument. Users are supposed to set this, and
determine a sane value by using 'arm-linux-size vmlinux'.
Signed-off-by: Daniel Mack <zonque@gmail.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
|
|
While reviewing fs2dt.c in the common kexec directory, in order to use it to
support little endian ppc64 architecture, I found some endianess
conversion's issues.
In dt_reserve, dt_base is a pointer and thus should not be converted.
In checkprop, values read from the device tree are big endian encoded and
should be converted if CPU is running in little endian mode.
In add_dyn_reconf_usable_mem_property__, fix extraneous endianess conversion
of rlen which should be natively used to increase the dt pointer.
Signed-off-by: Laurent Dufour <ldufour@linux.vnet.ibm.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
|
|
People are not always aware of PACKED macro and tend to
__attribute__((packed)) more directly. So let's remove PACKED to unify
things.
Signed-off-by: WANG Chao <chaowang@redhat.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
|
|
The putnode() routine in fs2dt.c was not checking for errors
returned from calls to read(). Add checks for these errors
and abort the setup of printing from purgatory if the checks
fail.
Signed-off-by: Geoff Levand <geoff@infradead.org>
Signed-off-by: Simon Horman <horms@verge.net.au>
|
|
Add a local variable 'result' to the putnode() routine of
ds2dt and use it to hold return values of calls to read().
Fixes build warnings like these:
kexec/fs2dt.c: warning: ignoring return value of ‘read’
Signed-off-by: Geoff Levand <geoff@infradead.org> for Huawei, Linaro
Signed-off-by: Simon Horman <horms@verge.net.au>
|
|
When calling locate_hole() with "hole_size" equal to the size of an
available memory block, it fails to use that memory block.
"end" and "hole_max" point to the last byte within the range, hence
- "size = end - start" is one less than "hole_size",
- "hole_base + hole_size" is one more than "hole_max".
Subtract one from "hole_size" when doing the comparison (adding 1 to "size"
could overflow in case of one big range covering the whole address space).
But explicitly check if "hole_size" is zero first, to handle this case
without causing underflows.
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Simon Horman <horms@verge.net.au>
|
|
Update to automake-1.11. Includes support for ARM's aarch64.
Signed-off-by: Geoff Levand <geoff@infradead.org> for Huawei, Linaro
Signed-off-by: Simon Horman <horms@verge.net.au>
|
|
Initialize a local variable to zero.
Fixes build warnings like these:
kexec/kexec-elf-rel.c: warning: ‘rel.r_offset’ may be used uninitialized in this function
Signed-off-by: Geoff Levand <geoff@infradead.org> for Huawei, Linaro
Signed-off-by: Simon Horman <horms@verge.net.au>
|
|
The source file config.h is a generated file, so its preprocessor include path must be
relative to the build directory. Add that path to the purgatory CPPFLAGS.
Fixes build errors like these:
purgatory/arch/ppc/misc.S: fatal error: config.h: No such file or directory
Signed-off-by: Geoff Levand <geoff@infradead.org> for Huawei, Linaro
Signed-off-by: Simon Horman <horms@verge.net.au>
|
|
The main kexec option code handles the -? option. Remove all the
duplicate -? handlers in the arch code which are never used.
Signed-off-by: Geoff Levand <geoff@infradead.org> for Huawei, Linaro
Signed-off-by: Simon Horman <horms@verge.net.au>
|
|
Add '?' to the short option string. Fixes runtime errors like
these:
kexec: invalid option -- '?'
Signed-off-by: Geoff Levand <geoff@infradead.org> for Huawei, Linaro
Signed-off-by: Simon Horman <horms@verge.net.au>
|
|
We should check if the initrd is in uImage format, when
the kernel might be in ELF.
Signed-off-by : Suzuki K Poulose <suzuki@in.ibm.com>
Signed-off-by : Athira Rajeev<atrajeev@in.ibm.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
|
|
If the primary kernel doesn't use an initrd,
we may not have linux,initrd-* entries in the
device-tree, and hence the initial flat tree
may not contain them.
Make sure we add the entries in the dtb if the
second kernel needs an initrd.
Signed-off-by: Suzuki K. Poulose <suzuki@in.ibm.com>
Signed-off-by: Athira Rajeev<atrajeev@in.ibm.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
|
|
It's confusing that some pointers are printed as hex numbers prefixed with
0x, while some other values are printed as hex numbers without prefixes.
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Simon Horman <horms@verge.net.au>
|
|
Cris doesn't have support for crash kernels yet.
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Simon Horman <horms@verge.net.au>
|
|
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Simon Horman <horms@verge.net.au>
|
|
E.g. all other Makefiles are handmade, but git complains when adding a
new kexec/arch/*/Makefile file.
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Simon Horman <horms@verge.net.au>
|
|
Presumably these had been copied from ppc.
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Simon Horman <horms@verge.net.au>
|
|
"kexec -p" fails to load kernels with version of the form x.y instead of
x.y.z with an error message similar to "Unsupported utsname.release:
3.10-1-amd64". Code in kernel_version() also checks the wrong variable
name for error return value from strtoul() for "minor" and "patch", and
hence possibly missing a real error.
These changes fix both of these problems.
Signed-off-by: Khalid Aziz <khalid@gonehiking.org>
Signed-off-by: Simon Horman <horms@verge.net.au>
|