Commit Graph

1025 Commits

Author SHA1 Message Date
faust93
116d9ac04e specify initrd base for m86 2016-12-18 14:07:20 +03:00
jollaman999
b7341b7f07 Revert "arm64: add support for appended dtb (Squashed)"
This reverts commit bb982d67c1.
2016-10-01 02:19:12 +09:00
oshmoun
bb982d67c1 arm64: add support for appended dtb (Squashed) 2016-09-30 21:39:54 +09:00
Zhuowei Zhang
12c48969ba arm64: hardcode dtb and initrd addresses for Snapdragon 810; disable purgatory 2016-08-18 23:03:16 +09:00
jollaman999
7cfcd44a0a Add version.h 2016-08-18 21:47:32 +09:00
jollaman999
a6b0bae37a Android.mk: Remove unneeded line 2016-08-18 21:36:25 +09:00
jollaman999
13237ad912 config.h: kexec-tools 2.0.13 2016-08-18 21:16:46 +09:00
Zhuowei Zhang
756829fcd8 arm64: Update command line size to match value in kernel 2016-08-18 20:52:29 +09:00
Zhuowei Zhang
ad8b6e1ff6 Remove hardboot minimum address warning: it's handled in the kernel on arm64 2016-08-18 20:52:12 +09:00
Zhuowei Zhang
271d351ad3 sscanf on Android uses "ll" instead of "L" for long long 2016-08-18 20:51:47 +09:00
Mike Kasick
3cb6c2c361 Add kexec-hardboot options 2016-08-18 20:48:10 +09:00
Zhuowei Zhang
90efb1bc02 Modified to build in AOSP 2016-08-18 20:47:01 +09:00
Geoff Levand
4eb231e1f8 mail-blurb.txt 2016-08-10 10:01:41 -07:00
Geoff Levand
ac0ab87b99 debugging: Add model_brk 2016-08-10 10:01:41 -07:00
Geoff Levand
adc0898c18 debugging: Add endian-boot-test 2016-08-10 10:01:41 -07:00
Geoff Levand
0347ff0532 debugging: Add debug print 2016-08-10 10:01:41 -07:00
Geoff Levand
dab4fbb5f8 debugging: Add version 2016-08-10 10:01:41 -07:00
Geoff Levand
9ba2a923f4 util_lib: Silence ar informational message
Add the -c option to ar to silence the informational message 'ar creating
libutil.a'.  ar outputs this message to stderr, and some tools interpret this as
a build warning.

Signed-off-by: Geoff Levand <geoff@infradead.org>
2016-08-10 10:01:41 -07:00
Geoff Levand
817ef96962 purgatory: Change default sha256 optimization to -O2
Change the default purgatory sha256 code optimization from -O0 to -O2, and add a
new arch specific makefile variable $(ARCH)_PURGATORY_SHA256_CFLAGS which can
over ride this default.  Set ia64_PURGATORY_SHA256_CFLAGS to -O0 to retain the
previous optimization level for ia64.

The purgatory sha256 code needs the be built with -O0 for the  ia64
architecture.  Currently this code is built with -O0 for all architectures,
which slows down the calculations for architectures which could otherwise
use -O2.

Signed-off-by: Geoff Levand <geoff@infradead.org>
2016-08-10 10:01:41 -07:00
Geoff Levand
fd80c9db14 arm64: Add purgatory printing
Signed-off-by: Geoff Levand <geoff@infradead.org>
2016-08-10 10:01:41 -07:00
Pratyush Anand
80e81483bd arm64: Add support for binary image files
Signed-off-by: Pratyush Anand <panand@redhat.com>
[Reworked and cleaned up]
Signed-off-by: Geoff Levand <geoff@infradead.org>
2016-08-10 10:01:41 -07:00
Geoff Levand
2b069ace9b arm64: Add arm64 kexec support
Add kexec reboot support for ARM64 platforms.

Signed-off-by: Geoff Levand <geoff@infradead.org>
2016-08-10 10:01:41 -07:00
Geoff Levand
e58fa31dd8 kexec: Add common device tree routines
Common device tree routines that can be shared between all arches
that have device tree support.

Signed-off-by: Geoff Levand <geoff@infradead.org>
2016-08-08 14:52:54 -07:00
Simon Horman
67488beb0a kexec-tools 2.0.13
Signed-off-by: Simon Horman <horms@verge.net.au>
2016-08-08 12:26:44 +02:00
Simon Horman
d41c3bb5dc kexec-tools 2.0.13-rc1
Signed-off-by: Simon Horman <horms@verge.net.au>
2016-07-29 09:33:07 +09:00
Russell King
8d61400860 arm: use zImage size from header
We do not support zImage with an appended DTB as we need to supply our
own DTB to the kernel, and an appended DTB will override any that we
try to supply.  To ensure that we do not load an appended DTB, clamp
the kernel size to the size specified in the zImage header.

Signed-off-by: Russell King <rmk@armlinux.org.uk>
Signed-off-by: Simon Horman <horms@verge.net.au>
2016-07-15 13:12:28 +09:00
Russell King
f11d833efc arm: plug a zImage corner case
If a zImage is built with ARM_APPENDED_DTB enabled, the zImage will
look at the word following the zImage and check whether it contains
the DTB magic number.

Generally, kexec will clear the destination pages before copying the
zImage, but there is a corner case where the zImage is a multiple of
the page size, where the following page will not be touched.  Should
the first word in this page contain the DTB magic number, the data
following will be interpreted as a DTB image.

In order to make this bullet-proof, we must always initialise the word
following the zImage.  Arrange this by specifying the zImage memory
size one word bigger than the buffer size.

Signed-off-by: Russell King <rmk@armlinux.org.uk>
Signed-off-by: Simon Horman <horms@verge.net.au>
2016-07-15 13:12:12 +09:00
Russell King
4db7f295d5 arm: fix kernel image size
If we want to assume that the compressed image will expand by a maximum
of 4x, we actually need to reserve 5x the space, since we need to keep
a copy of the compessed image around while decompressing.

Signed-off-by: Russell King <rmk@armlinux.org.uk>
Reviewed-by: Pratyush Anand <panand@redhat.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
2016-06-23 09:40:58 +09:00
Russell King
fe9b19d49b arm: take account of TEXT_OFFSET for subsequent images
The ARM kexec code was not taking account of the 32k text offset when
applying the size(s) of the kernel image.  We need to take account of
this so when we decide to place the initrd at 4x the compressed image
length, it is appropriately placed.

Signed-off-by: Russell King <rmk@armlinux.org.uk>
Reviewed-by: Pratyush Anand <panand@redhat.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
2016-06-23 09:40:22 +09:00
Russell King
bf759f2aa6 Remove "max" parameter comment
Remove the "max" parameter in the documentation for mem_regions_add()

Signed-off-by: Russell King <rmk@armlinux.org.uk>
Signed-off-by: Simon Horman <horms@verge.net.au>
2016-06-23 09:39:46 +09:00
Russell King
dfd1de0460 arm: report which ELF core format we will use
Report which ELF core format will be used to create the template ELF
core dump in the debug information.

Reviewed-by: Pratyush Anand <panand@redhat.com>
Signed-off-by: Russell King <rmk@arm.linux.org.uk>
Signed-off-by: Simon Horman <horms@verge.net.au>
2016-06-08 09:24:10 +09:00
Russell King
9eb4a681fd arm: clean up phys/page offset debug
Clean up the physical and page offset debug prints.

Reviewed-by: Pratyush Anand <panand@redhat.com>
Signed-off-by: Russell King <rmk@arm.linux.org.uk>
Signed-off-by: Simon Horman <horms@verge.net.au>
2016-06-08 09:24:10 +09:00
Russell King
2f10ffb193 arm: fix type of phys_offset
Some LPAE systems may have phys_offset above the 4GB mark.  Hence, we
need phys_offset to be a 64-bit integer.

Reviewed-by: Pratyush Anand <panand@redhat.com>
Signed-off-by: Russell King <rmk@arm.linux.org.uk>
Signed-off-by: Simon Horman <horms@verge.net.au>
2016-06-08 09:24:10 +09:00
Russell King
fbee2f01cd arm: add debug of reserved and coredump memory ranges
Add debug of the reserved and coredump memory ranges for validation.

Reviewed-by: Pratyush Anand <panand@redhat.com>
Signed-off-by: Russell King <rmk@arm.linux.org.uk>
Signed-off-by: Simon Horman <horms@verge.net.au>
2016-06-08 09:24:10 +09:00
Russell King
921a8d1d5b arm: add support for boot-time crash kernel resource
Add support for detecting and using the boot-time crash kernel
resource, which is needed for systems which have special boot-time
memory views, such as Keystone 2.

Reviewed-by: Pratyush Anand <panand@redhat.com>
Signed-off-by: Russell King <rmk@arm.linux.org.uk>
Signed-off-by: Simon Horman <horms@verge.net.au>
2016-06-08 09:24:10 +09:00
Russell King
db82098601 arm: add support for multiple reserved regions
Add support for reserving multiple memory regions rather than just a
single region.

Reviewed-by: Pratyush Anand <panand@redhat.com>
Signed-off-by: Russell King <rmk@arm.linux.org.uk>
Signed-off-by: Simon Horman <horms@verge.net.au>
2016-06-08 09:24:10 +09:00
Russell King
3e6bd29e7b arm: rename crash_reserved_mem to crash_kernel_mem
Rename crash_reserved_mem to crash_kernel_mem as we want to support
multiple reserved memory ranges.

Reviewed-by: Pratyush Anand <panand@redhat.com>
Signed-off-by: Russell King <rmk@arm.linux.org.uk>
Signed-off-by: Simon Horman <horms@verge.net.au>
2016-06-08 09:24:10 +09:00
Russell King
e401f47321 arm: crashdump needs boot alias of crash kernel region
When crashdumping, we need the boot memory alias of the crash kernel
region rather than the system view.  Arrange to check for the boot
alias of the crash kernel region first, and if found, use it instead
of the main alias.

Reviewed-by: Pratyush Anand <panand@redhat.com>
Signed-off-by: Russell King <rmk@arm.linux.org.uk>
Signed-off-by: Simon Horman <horms@verge.net.au>
2016-06-08 09:24:09 +09:00
Russell King
92e120d8ca arm: add support for platforms with boot memory aliases
The kexec API deals with boot-view addresses, rather than normal system
view addresses.  This causes problems for platforms such as Keystone 2,
where the boot view is substantially different from the normal system
view.

This is because Keystone 2 boots from a memory alias in the lower 4GiB,
before switching to a high alias at 32GiB.

We handle this in a generic way by introducing boot alias resources in
/proc/iomem:

80000000-dfffffff : System RAM (boot alias)
  9f800000-9fffffff : Crash kernel (boot alias)
800000000-85fffffff : System RAM
  800008000-800790e37 : Kernel code
  8007ec000-8008b856f : Kernel data
  81f800000-81fffffff : Crash kernel

To allow kexec to load a kernel, we need to add the boot alias of RAM
to the memory ranges returned by get_memory_ranges().  Parse the
system RAM boot alias into the memory ranges.

Reviewed-by: Pratyush Anand <panand@redhat.com>
Signed-off-by: Russell King <rmk@arm.linux.org.uk>
Signed-off-by: Simon Horman <horms@verge.net.au>
2016-06-08 09:24:09 +09:00
Russell King
103656d859 arm: move crash system RAM parsing earlier
Reviewed-by: Pratyush Anand <panand@redhat.com>
Signed-off-by: Russell King <rmk@arm.linux.org.uk>
Signed-off-by: Simon Horman <horms@verge.net.au>
2016-06-08 09:24:09 +09:00
Russell King
11c52266a2 arm: use generic mem_region sorting implementation
Use the generic mem_region sorting implementation.

Reviewed-by: Pratyush Anand <panand@redhat.com>
Signed-off-by: Russell King <rmk@arm.linux.org.uk>
Signed-off-by: Simon Horman <horms@verge.net.au>
2016-06-08 09:24:09 +09:00
Russell King
a40977d6d7 arm: parse crash_reserved_mem early
We parse the crash kernel memory region in several locations in the
kexec tools - once to check that there's a region, another time for
real when we're locating the memory regions to dump, and another
while loading the image.

Move the real parsing step to is_crashkernel_mem_reserved(), which
matches what x86 is doing.

Reviewed-by: Pratyush Anand <panand@redhat.com>
Signed-off-by: Russell King <rmk@arm.linux.org.uk>
Signed-off-by: Simon Horman <horms@verge.net.au>
2016-06-08 09:24:09 +09:00
Russell King
d4b51af171 arm: add maximum number of memory ranges
Add the maximum number of memory ranges to the list of usable memory
ranges, so that we don't have to carry this around.

Reviewed-by: Pratyush Anand <panand@redhat.com>
Signed-off-by: Russell King <rmk@arm.linux.org.uk>
Signed-off-by: Simon Horman <horms@verge.net.au>
2016-06-08 09:24:09 +09:00
Russell King
66d941fccb arm: add memory ranges debug
Add the call to dbgprint_mem_range() into the ARM version of
get_memory_ranges().

Reviewed-by: Pratyush Anand <panand@redhat.com>
Signed-off-by: Russell King <rmk@arm.linux.org.uk>
Signed-off-by: Simon Horman <horms@verge.net.au>
2016-06-08 09:24:09 +09:00
Russell King
ccb582a439 arm: report if crash kernel is out of bounds
Report an error if the crash kernel memory region is outside of the
boot-view memory range - this can happen with systems such as
Keystone 2.

Signed-off-by: Russell King <rmk@arm.linux.org.uk>
Signed-off-by: Simon Horman <horms@verge.net.au>
2016-06-08 09:24:09 +09:00
Russell King
8431da92d9 arm: return proper error for missing crash kernel
Return the proper error code (ENOCRASHKERNEL) for a missing crash
kernel region in /proc/iomem, so the error handling in kexec.c can
print the appropriate message.

Reviewed-by: Pratyush Anand <panand@redhat.com>
Signed-off-by: Russell King <rmk@arm.linux.org.uk>
Signed-off-by: Simon Horman <horms@verge.net.au>
2016-06-08 09:24:09 +09:00
Russell King
a5eacd1651 arm: fix ELF32/ELF64 check
Rather than using ULONG_MAX to decide whether to use the ELF64 or ELF32
core dump format, use UINT32_MAX instead - we include stdint.h, so we
might as well use a constant which is meaningful for the limits of
the 32-bit ELF format.

Signed-off-by: Russell King <rmk@arm.linux.org.uk>
Reviewed-by: Pratyush Anand <panand@redhat.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
2016-06-08 09:24:03 +09:00
Russell King
38c18bb7d1 arm: fix get_kernel_stext_sym() to close its file
Fix get_kernel_stext_sym() so that it closes its file once it's
finsihed with it - there's no need to leak file descriptors.

Reviewed-by: Pratyush Anand <panand@redhat.com>
Signed-off-by: Russell King <rmk@arm.linux.org.uk>
Signed-off-by: Simon Horman <horms@verge.net.au>
2016-06-08 09:22:28 +09:00
Russell King
2185c79d3b arm: fix off-by-one on memory end
The memory range end is inclusive, not exclusive (see x86).  We should
not be adding one to the value parsed from the /proc/iomem resources.

Reviewed-by: Pratyush Anand <panand@redhat.com>
Signed-off-by: Russell King <rmk@arm.linux.org.uk>
Signed-off-by: Simon Horman <horms@verge.net.au>
2016-06-08 09:22:24 +09:00
Russell King
45251676e5 arm: fix pointer signedness warning in kexec-uImage-arm.c
kexec/arch/arm/kexec-uImage-arm.c: In function 'uImage_arm_probe':
kexec/arch/arm/kexec-uImage-arm.c:14:2: warning: pointer targets in passing argument 1 of 'uImage_probe_kernel' differ in signedness [-Wpointer-sign]

Reviewed-by: Pratyush Anand <panand@redhat.com>
Signed-off-by: Russell King <rmk@arm.linux.org.uk>
Signed-off-by: Simon Horman <horms@verge.net.au>
2016-06-08 09:22:20 +09:00