aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGeoff Levand <geoff@infradead.org>2016-07-18 17:32:55 -0700
committerGeoff Levand <geoff@infradead.org>2016-12-02 10:08:46 -0800
commit39c0b52d1a113b15b4df6ef61a8a72c7cde68044 (patch)
tree15e3baee4139dbfdfe118319e66d16dfdb7364c3
parent41d7ae787e9b1b840024e6e89a7b6730367415f4 (diff)
downloadlinux-kexec-39c0b52d1a113b15b4df6ef61a8a72c7cde68044.tar.gz
debugging: Bypass purgatory
-rw-r--r--arch/arm64/kernel/machine_kexec.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/arch/arm64/kernel/machine_kexec.c b/arch/arm64/kernel/machine_kexec.c
index 55954ffd22e0d..2d1050dd7cb37 100644
--- a/arch/arm64/kernel/machine_kexec.c
+++ b/arch/arm64/kernel/machine_kexec.c
@@ -24,6 +24,10 @@
#include "cpu-reset.h"
+/* Bypass purgatory for debugging. */
+static bool bypass_purgatory;
+core_param(bypass_purgatory, bypass_purgatory, bool, 0644);
+
/* Global variables for the arm64_relocate_new_kernel routine. */
extern const unsigned char arm64_relocate_new_kernel[];
extern const unsigned long arm64_relocate_new_kernel_size;
@@ -112,6 +116,20 @@ static unsigned long kexec_find_dtb(const struct kimage *kimage)
return 0;
}
+static struct bypass {
+ unsigned long kernel;
+ unsigned long dtb;
+} bypass;
+
+static void fill_bypass(const struct kimage *kimage)
+{
+ bypass.kernel = kexec_find_kernel(kimage);
+ bypass.dtb = kexec_find_dtb(kimage);
+
+ pr_debug("%s: kernel: %016lx\n", __func__, bypass.kernel);
+ pr_debug("%s: dtb: %016lx\n", __func__, bypass.dtb);
+}
+
/**
* kexec_list_walk - Helper to walk the kimage page list.
*/
@@ -281,6 +299,7 @@ int machine_kexec_prepare(struct kimage *kimage)
kimage_start = kimage->start;
kexec_image_info(kimage);
+ fill_bypass(kimage);
if (kimage->type != KEXEC_TYPE_CRASH && cpus_are_stuck_in_kernel()) {
pr_err("Can't kexec: CPUs are stuck in the kernel.\n");
@@ -417,6 +436,10 @@ void machine_kexec(struct kimage *kimage)
* relocation is complete.
*/
+ if (bypass_purgatory)
+ cpu_soft_restart(1, reboot_code_buffer_phys, kimage->head,
+ bypass.kernel, bypass.dtb);
+ else
cpu_soft_restart(1, reboot_code_buffer_phys, kimage->head,
kimage_start, 0);