diff options
author | Geoff Levand <geoff@infradead.org> | 2016-06-23 17:54:48 +0000 |
---|---|---|
committer | Catalin Marinas <catalin.marinas@arm.com> | 2016-06-27 16:31:26 +0100 |
commit | 221f2c770e10d3f8dca71e1e14e24e61dc8988dd (patch) | |
tree | 9688723e62bee92b7856ab83e66d73767a12a688 /arch/arm64/kernel/machine_kexec.c | |
parent | b26a4ae39963faf6f9014f6ff72e3661c83753ce (diff) | |
download | linux-stable-221f2c770e10d3f8dca71e1e14e24e61dc8988dd.tar.gz linux-stable-221f2c770e10d3f8dca71e1e14e24e61dc8988dd.tar.bz2 linux-stable-221f2c770e10d3f8dca71e1e14e24e61dc8988dd.zip |
arm64/kexec: Add pr_debug output
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 <geoff@infradead.org>
Reviewed-by: James Morse <james.morse@arm.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Diffstat (limited to 'arch/arm64/kernel/machine_kexec.c')
-rw-r--r-- | arch/arm64/kernel/machine_kexec.c | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/arch/arm64/kernel/machine_kexec.c b/arch/arm64/kernel/machine_kexec.c index c40e64607545..bc96c8a7fc79 100644 --- a/arch/arm64/kernel/machine_kexec.c +++ b/arch/arm64/kernel/machine_kexec.c @@ -24,6 +24,32 @@ extern const unsigned long arm64_relocate_new_kernel_size; static unsigned long kimage_start; +/** + * kexec_image_info - For debugging output. + */ +#define kexec_image_info(_i) _kexec_image_info(__func__, __LINE__, _i) +static void _kexec_image_info(const char *func, int line, + const struct kimage *kimage) +{ + unsigned long i; + + pr_debug("%s:%d:\n", func, line); + pr_debug(" kexec kimage info:\n"); + pr_debug(" type: %d\n", kimage->type); + pr_debug(" start: %lx\n", kimage->start); + pr_debug(" head: %lx\n", kimage->head); + pr_debug(" nr_segments: %lu\n", kimage->nr_segments); + + for (i = 0; i < kimage->nr_segments; i++) { + pr_debug(" segment[%lu]: %016lx - %016lx, 0x%lx bytes, %lu pages\n", + i, + kimage->segment[i].mem, + kimage->segment[i].mem + kimage->segment[i].memsz, + kimage->segment[i].memsz, + kimage->segment[i].memsz / PAGE_SIZE); + } +} + void machine_kexec_cleanup(struct kimage *kimage) { /* Empty routine needed to avoid build errors. */ @@ -40,6 +66,8 @@ int machine_kexec_prepare(struct kimage *kimage) { kimage_start = kimage->start; + kexec_image_info(kimage); + if (kimage->type != KEXEC_TYPE_CRASH && cpus_are_stuck_in_kernel()) { pr_err("Can't kexec: CPUs are stuck in the kernel.\n"); return -EBUSY; @@ -125,6 +153,20 @@ void machine_kexec(struct kimage *kimage) reboot_code_buffer_phys = page_to_phys(kimage->control_code_page); reboot_code_buffer = phys_to_virt(reboot_code_buffer_phys); + kexec_image_info(kimage); + + pr_debug("%s:%d: control_code_page: %p\n", __func__, __LINE__, + kimage->control_code_page); + pr_debug("%s:%d: reboot_code_buffer_phys: %pa\n", __func__, __LINE__, + &reboot_code_buffer_phys); + pr_debug("%s:%d: reboot_code_buffer: %p\n", __func__, __LINE__, + reboot_code_buffer); + pr_debug("%s:%d: relocate_new_kernel: %p\n", __func__, __LINE__, + arm64_relocate_new_kernel); + pr_debug("%s:%d: relocate_new_kernel_size: 0x%lx(%lu) bytes\n", + __func__, __LINE__, arm64_relocate_new_kernel_size, + arm64_relocate_new_kernel_size); + /* * Copy arm64_relocate_new_kernel to the reboot_code_buffer for use * after the kernel is shut down. |