[PATCH v17 03/13] arm64/kexec: Add core kexec support

2016-06-03 Thread Geoff Levand
Add three new files, kexec.h, machine_kexec.c and relocate_kernel.S to the arm64 architecture that add support for the kexec re-boot mechanism (CONFIG_KEXEC) on arm64 platforms. Signed-off-by: Geoff Levand --- arch/arm64/Kconfig | 10 ++ arch/arm64/include/asm/kexec.h | 4

[PATCH v17 00/13] arm64 kexec kernel patches

2016-06-03 Thread Geoff Levand
This series adds the core support for kexec re-boot and kdump on ARM64. This version of the series combines Takahiro's kdump patches with my kexec patches. Please consider all patches for inclusion. Takahiro has done some extensive testing for this version with various configurations af endian, i

[PATCH v17 13/13] Documentation: dt: usable-memory and elfcorehdr nodes for arm64 kexec

2016-06-03 Thread Geoff Levand
From: James Morse Add documentation for linux,usable-memory and linux,elfcorehdr chosen nodes used by arm64 kexec to decribe the kdump reserved area, and the elfcorehdr's location within it. Signed-off-by: James Morse --- Documentation/devicetree/bindings/chosen.txt | 28 ++

[PATCH v17 01/13] arm64: Add back cpu reset routines

2016-06-03 Thread Geoff Levand
Commit 68234df4ea7939f98431aa81113fbdce10c4a84b (arm64: kill flush_cache_all()) removed the global arm64 routines cpu_reset() and cpu_soft_restart() needed by the arm64 kexec and kdump support. Add simplified versions of those two routines back with some changes needed for kexec in the new files c

[PATCH v17 09/13] arm64: kdump: add kdump support

2016-06-03 Thread Geoff Levand
From: AKASHI Takahiro On crash dump kernel, all the information about primary kernel's system memory (core image) is available in elf core header. The primary kernel will set aside this header with reserve_elfcorehdr() at boot time and inform crash dump kernel of its location via a new device-tre

[PATCH v17 10/13] arm64: kdump: add VMCOREINFO for user-space coredump tools

2016-06-03 Thread Geoff Levand
From: AKASHI Takahiro For the current crash utility, we need to know, at least, a value of "kimage_voffset" to handle the contents of core dump file (/proc/vmcore) correctly due to the introduction of KASLR (CONFIG_RANDOMIZE_BASE) in v4.6. More VMCOREINFO may be added later for makedumpfile comm

[PATCH v17 12/13] arm64: kdump: update a kernel doc

2016-06-03 Thread Geoff Levand
From: AKASHI Takahiro This patch adds arch specific descriptions about kdump usage on arm64 to kdump.txt. Signed-off-by: AKASHI Takahiro --- Documentation/kdump/kdump.txt | 15 ++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/Documentation/kdump/kdump.txt b/Documen

[PATCH v17 11/13] arm64: kdump: enable kdump in the arm64 defconfig

2016-06-03 Thread Geoff Levand
From: AKASHI Takahiro Signed-off-by: AKASHI Takahiro --- arch/arm64/configs/defconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm64/configs/defconfig b/arch/arm64/configs/defconfig index 4ed4756..aa3e1dd 100644 --- a/arch/arm64/configs/defconfig +++ b/arch/arm64/configs/defconf

[PATCH v17 04/13] arm64/kexec: Add pr_debug output

2016-06-03 Thread Geoff Levand
To aid in debugging kexec problems or when adding new functionality to kexec add a new routine kexec_image_info() and several inline pr_debug statements. Signed-off-by: Geoff Levand --- arch/arm64/kernel/machine_kexec.c | 63 +++ 1 file changed, 63 insertions(

[PATCH v17 05/13] arm64/kexec: Enable kexec in the arm64 defconfig

2016-06-03 Thread Geoff Levand
Signed-off-by: Geoff Levand --- arch/arm64/configs/defconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm64/configs/defconfig b/arch/arm64/configs/defconfig index fd2d74d..4ed4756 100644 --- a/arch/arm64/configs/defconfig +++ b/arch/arm64/configs/defconfig @@ -70,6 +70,7 @@ CONFIG

[PATCH v17 06/13] arm64: kdump: reserve memory for crash dump kernel

2016-06-03 Thread Geoff Levand
From: AKASHI Takahiro On the startup of primary kernel, the memory region used by crash dump kernel must be specified by "crashkernel=" kernel parameter. reserve_crashkernel() will allocate and reserve the region for later use. User space tools, like kexec-tools, will be able to find that region

[PATCH v17 07/13] arm64: limit memory regions based on DT property, usable-memory

2016-06-03 Thread Geoff Levand
From: AKASHI Takahiro Crash dump kernel will be run with a limited range of memory as System RAM. On arm64, we will use a device-tree property under /chosen, linux,usable-memory = in order for primary kernel either on uefi or non-uefi (device tree only) system to hand over the information ab

[PATCH v17 02/13] arm64: Add cpus_are_stuck_in_kernel

2016-06-03 Thread Geoff Levand
From: James Morse kernel/smp.c has a fancy counter that keeps track of the number of CPUs it marked as not-present and left in cpu_park_loop(). If there are any CPUs spinning in here, kexec will release them once the memory is re-used by the new kernel. We can't return an error once we reach mac

[PATCH v17 08/13] arm64: kdump: implement machine_crash_shutdown()

2016-06-03 Thread Geoff Levand
From: AKASHI Takahiro Primary kernel calls machine_crash_shutdown() to shut down non-boot cpus and save registers' status in per-cpu ELF notes before starting crash dump kernel. See kernel_kexec(). Even if not all secondary cpus have shut down, we do kdump anyway. As we don't have to make non-bo

[PATCH 2/8] ARM: kexec: advertise location of bootable RAM

2016-06-03 Thread Russell King
Advertise the location of bootable RAM to kexec-tools. kexec needs to know where it can place the kernel in RAM, and so be executable when the system needs to jump into it. Advertise these areas in /proc/iomem with a "System RAM (boot alias)" tag. Reviewed-by: Pratyush Anand Signed-off-by: Russ

[PATCH 8/8] ARM: kexec: fix kexec for Keystone 2

2016-06-03 Thread Russell King
Provide kexec with the boot view of memory by overriding the normal kexec translation functions added in a previous patch. We also need to fix a call to memblock in machine_kexec_prepare() so that we provide it with a running-view physical address rather than a boot- view physical address. Signed

[PATCH 6/8] kexec: allow architectures to override boot mapping

2016-06-03 Thread Russell King
kexec physical addresses are the boot-time view of the system. For certain ARM systems (such as Keystone 2), the boot view of the system does not match the kernel's view of the system: the boot view uses a special alias in the lower 4GB of the physical address space. To cater for these kinds of s

[PATCH 5/8] kdump: arrange for paddr_vmcoreinfo_note() to return phys_addr_t

2016-06-03 Thread Russell King
On PAE systems (eg, ARM LPAE) the vmcore note may be located above 4GB physical on 32-bit architectures, so we need a wider type than "unsigned long" here. Arrange for paddr_vmcoreinfo_note() to return a phys_addr_t, thereby allowing it to be located above 4GB. This makes no difference for kexec-

[PATCH 1/8] ARM: kdump: advertise boot aliased crash kernel resource

2016-06-03 Thread Russell King
Advertise a resource which describes where the crash kernel is located in the boot view of RAM. This allows kexec-tools to have this vital information. Signed-off-by: Russell King --- arch/arm/kernel/setup.c | 16 1 file changed, 16 insertions(+) diff --git a/arch/arm/kernel/s

[PATCH 3/8] kexec: don't invoke OOM-killer for control page allocation

2016-06-03 Thread Russell King
If we are unable to find a suitable page when allocating the control page, do not invoke the OOM-killer: killing processes probably isn't going to help. Acked-by: Baoquan He Reviewed-by: Pratyush Anand Signed-off-by: Russell King --- include/linux/kexec.h | 2 +- 1 file changed, 1 insertion(+)

[PATCH 4/8] kexec: ensure user memory sizes do not wrap

2016-06-03 Thread Russell King
Ensure that user memory sizes do not wrap around when validating the user input, which can lead to the following input validation working incorrectly. Acked-by: Baoquan He Reviewed-by: Pratyush Anand Signed-off-by: Russell King --- kernel/kexec_core.c | 2 ++ 1 file changed, 2 insertions(+) d

[PATCH 7/8] ARM: keystone: dts: add psci command definition

2016-06-03 Thread Russell King
From: Vitaly Andrianov This commit adds definition for cpu_on, cpu_off and cpu_suspend commands. These definitions must match the corresponding PSCI definitions in boot monitor. Having those command and corresponding PSCI support in boot monitor allows run time CPU hot plugin. Signed-off-by: Ke