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/platforms | |
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/platforms')
-rw-r--r-- | arch/powerpc/platforms/cell/ras.c | 6 | ||||
-rw-r--r-- | arch/powerpc/platforms/pseries/iommu.c | 6 |
2 files changed, 6 insertions, 6 deletions
diff --git a/arch/powerpc/platforms/cell/ras.c b/arch/powerpc/platforms/cell/ras.c index 2a14b052abcd..665af1c4195b 100644 --- a/arch/powerpc/platforms/cell/ras.c +++ b/arch/powerpc/platforms/cell/ras.c | |||
@@ -21,6 +21,7 @@ | |||
21 | #include <asm/machdep.h> | 21 | #include <asm/machdep.h> |
22 | #include <asm/rtas.h> | 22 | #include <asm/rtas.h> |
23 | #include <asm/cell-regs.h> | 23 | #include <asm/cell-regs.h> |
24 | #include <asm/kdump.h> | ||
24 | 25 | ||
25 | #include "ras.h" | 26 | #include "ras.h" |
26 | 27 | ||
@@ -111,9 +112,8 @@ static int __init cbe_ptcal_enable_on_node(int nid, int order) | |||
111 | int ret = -ENOMEM; | 112 | int ret = -ENOMEM; |
112 | unsigned long addr; | 113 | unsigned long addr; |
113 | 114 | ||
114 | #ifdef CONFIG_CRASH_DUMP | 115 | if (__kdump_flag) |
115 | rtas_call(ptcal_stop_tok, 1, 1, NULL, nid); | 116 | rtas_call(ptcal_stop_tok, 1, 1, NULL, nid); |
116 | #endif | ||
117 | 117 | ||
118 | area = kmalloc(sizeof(*area), GFP_KERNEL); | 118 | area = kmalloc(sizeof(*area), GFP_KERNEL); |
119 | if (!area) | 119 | if (!area) |
diff --git a/arch/powerpc/platforms/pseries/iommu.c b/arch/powerpc/platforms/pseries/iommu.c index a8c446697f9e..d56491d182d3 100644 --- a/arch/powerpc/platforms/pseries/iommu.c +++ b/arch/powerpc/platforms/pseries/iommu.c | |||
@@ -44,6 +44,7 @@ | |||
44 | #include <asm/tce.h> | 44 | #include <asm/tce.h> |
45 | #include <asm/ppc-pci.h> | 45 | #include <asm/ppc-pci.h> |
46 | #include <asm/udbg.h> | 46 | #include <asm/udbg.h> |
47 | #include <asm/kdump.h> | ||
47 | 48 | ||
48 | #include "plpar_wrappers.h" | 49 | #include "plpar_wrappers.h" |
49 | 50 | ||
@@ -291,9 +292,8 @@ static void iommu_table_setparms(struct pci_controller *phb, | |||
291 | 292 | ||
292 | tbl->it_base = (unsigned long)__va(*basep); | 293 | tbl->it_base = (unsigned long)__va(*basep); |
293 | 294 | ||
294 | #ifndef CONFIG_CRASH_DUMP | 295 | if (!__kdump_flag) |
295 | memset((void *)tbl->it_base, 0, *sizep); | 296 | memset((void *)tbl->it_base, 0, *sizep); |
296 | #endif | ||
297 | 297 | ||
298 | tbl->it_busno = phb->bus->number; | 298 | tbl->it_busno = phb->bus->number; |
299 | 299 | ||