diff options
author | Mohan Kumar M <mohan@in.ibm.com> | 2008-10-21 13:38:10 -0400 |
---|---|---|
committer | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2008-10-22 00:01:22 -0400 |
commit | 54622f10a6aabb8bb2bdacf3dd070046f03dc246 (patch) | |
tree | 73eb5ad4eeb7174b8c0ae1904bbe80602c5e295d /arch/powerpc/kernel/misc_64.S | |
parent | 4792adbac9eb41cea77a45ab76258ea10d411173 (diff) |
powerpc: Support for relocatable kdump kernel
This adds relocatable kernel support for kdump. With this one can
use the same regular kernel to capture the kdump. A signature (0xfeed1234)
is passed in r6 from panic code to the next kernel through kexec_sequence
and purgatory code. The signature is used to differentiate between
kdump kernel and non-kdump kernels.
The purgatory code compares the signature and sets the __kdump_flag in
head_64.S. During the boot up, kernel code checks __kdump_flag and if it
is set, the kernel will behave as relocatable kdump kernel. This kernel
will boot at the address where it was loaded by kexec-tools ie. at the
address reserved through crashkernel boot parameter.
CONFIG_CRASH_DUMP depends on CONFIG_RELOCATABLE option to build kdump
kernel as relocatable. So the same kernel can be used as production and
kdump kernel.
This patch incorporates the changes suggested by Paul Mackerras to avoid
GOT use and to avoid two copies of the code.
Signed-off-by: Paul Mackerras <paulus@samba.org>
Signed-off-by: Mohan Kumar M <mohan@in.ibm.com>
Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc/kernel/misc_64.S')
-rw-r--r-- | arch/powerpc/kernel/misc_64.S | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/arch/powerpc/kernel/misc_64.S b/arch/powerpc/kernel/misc_64.S index 3053fe5c62f2..a243fd072a77 100644 --- a/arch/powerpc/kernel/misc_64.S +++ b/arch/powerpc/kernel/misc_64.S | |||
@@ -611,10 +611,12 @@ real_mode: /* assume normal blr return */ | |||
611 | 611 | ||
612 | 612 | ||
613 | /* | 613 | /* |
614 | * kexec_sequence(newstack, start, image, control, clear_all()) | 614 | * kexec_sequence(newstack, start, image, control, clear_all(), kdump_flag) |
615 | * | 615 | * |
616 | * does the grungy work with stack switching and real mode switches | 616 | * does the grungy work with stack switching and real mode switches |
617 | * also does simple calls to other code | 617 | * also does simple calls to other code |
618 | * | ||
619 | * kdump_flag says whether the next kernel should be a kdump kernel. | ||
618 | */ | 620 | */ |
619 | 621 | ||
620 | _GLOBAL(kexec_sequence) | 622 | _GLOBAL(kexec_sequence) |
@@ -647,7 +649,7 @@ _GLOBAL(kexec_sequence) | |||
647 | mr r29,r5 /* image (virt) */ | 649 | mr r29,r5 /* image (virt) */ |
648 | mr r28,r6 /* control, unused */ | 650 | mr r28,r6 /* control, unused */ |
649 | mr r27,r7 /* clear_all() fn desc */ | 651 | mr r27,r7 /* clear_all() fn desc */ |
650 | mr r26,r8 /* spare */ | 652 | mr r26,r8 /* kdump flag */ |
651 | lhz r25,PACAHWCPUID(r13) /* get our phys cpu from paca */ | 653 | lhz r25,PACAHWCPUID(r13) /* get our phys cpu from paca */ |
652 | 654 | ||
653 | /* disable interrupts, we are overwriting kernel data next */ | 655 | /* disable interrupts, we are overwriting kernel data next */ |
@@ -709,5 +711,6 @@ _GLOBAL(kexec_sequence) | |||
709 | mr r4,r30 # start, aka phys mem offset | 711 | mr r4,r30 # start, aka phys mem offset |
710 | mtlr 4 | 712 | mtlr 4 |
711 | li r5,0 | 713 | li r5,0 |
712 | blr /* image->start(physid, image->start, 0); */ | 714 | mr r6,r26 /* kdump_flag */ |
715 | blr /* image->start(physid, image->start, 0, kdump_flag); */ | ||
713 | #endif /* CONFIG_KEXEC */ | 716 | #endif /* CONFIG_KEXEC */ |