aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/include/asm/kdump.h
diff options
context:
space:
mode:
authorMohan Kumar M <mohan@in.ibm.com>2008-10-21 13:38:10 -0400
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2008-10-22 00:01:22 -0400
commit54622f10a6aabb8bb2bdacf3dd070046f03dc246 (patch)
tree73eb5ad4eeb7174b8c0ae1904bbe80602c5e295d /arch/powerpc/include/asm/kdump.h
parent4792adbac9eb41cea77a45ab76258ea10d411173 (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/include/asm/kdump.h')
-rw-r--r--arch/powerpc/include/asm/kdump.h17
1 files changed, 12 insertions, 5 deletions
diff --git a/arch/powerpc/include/asm/kdump.h b/arch/powerpc/include/asm/kdump.h
index f6c93c716898..a503da9d56f3 100644
--- a/arch/powerpc/include/asm/kdump.h
+++ b/arch/powerpc/include/asm/kdump.h
@@ -9,6 +9,12 @@
9 * Reserve to the end of the FWNMI area, see head_64.S */ 9 * Reserve to the end of the FWNMI area, see head_64.S */
10#define KDUMP_RESERVE_LIMIT 0x10000 /* 64K */ 10#define KDUMP_RESERVE_LIMIT 0x10000 /* 64K */
11 11
12/*
13 * Used to differentiate between relocatable kdump kernel and other
14 * kernels
15 */
16#define KDUMP_SIGNATURE 0xfeed1234
17
12#ifdef CONFIG_CRASH_DUMP 18#ifdef CONFIG_CRASH_DUMP
13 19
14#define KDUMP_TRAMPOLINE_START 0x0100 20#define KDUMP_TRAMPOLINE_START 0x0100
@@ -19,17 +25,18 @@
19#endif /* CONFIG_CRASH_DUMP */ 25#endif /* CONFIG_CRASH_DUMP */
20 26
21#ifndef __ASSEMBLY__ 27#ifndef __ASSEMBLY__
22#ifdef CONFIG_CRASH_DUMP
23 28
29extern unsigned long __kdump_flag;
30
31#if defined(CONFIG_CRASH_DUMP) && !defined(CONFIG_RELOCATABLE)
24extern void reserve_kdump_trampoline(void); 32extern void reserve_kdump_trampoline(void);
25extern void setup_kdump_trampoline(void); 33extern void setup_kdump_trampoline(void);
26 34#else
27#else /* !CONFIG_CRASH_DUMP */ 35/* !CRASH_DUMP || RELOCATABLE */
28
29static inline void reserve_kdump_trampoline(void) { ; } 36static inline void reserve_kdump_trampoline(void) { ; }
30static inline void setup_kdump_trampoline(void) { ; } 37static inline void setup_kdump_trampoline(void) { ; }
38#endif
31 39
32#endif /* CONFIG_CRASH_DUMP */
33#endif /* __ASSEMBLY__ */ 40#endif /* __ASSEMBLY__ */
34 41
35#endif /* __PPC64_KDUMP_H */ 42#endif /* __PPC64_KDUMP_H */