[PATCH 3/12] powerpc: Add CONFIG_CRASH_DUMP

Michael Ellerman michael at ellerman.id.au
Tue Nov 8 00:06:52 EST 2005


This patch adds a Kconfig variable, CONFIG_CRASH_DUMP, which configures the
built kernel for use as a Kdump kernel.

Currently "all" this involves is changing the value of KERNELBASE to 32 MB.

 arch/powerpc/Kconfig           |   11 +++++++++++
 arch/powerpc/kernel/setup_64.c |    3 +++
 include/asm-powerpc/page.h     |   10 +++++++++-
 3 files changed, 23 insertions(+), 1 deletion(-)

Index: kexec/arch/powerpc/Kconfig
===================================================================
--- kexec.orig/arch/powerpc/Kconfig
+++ kexec/arch/powerpc/Kconfig
@@ -379,6 +379,17 @@ config CELL_IIC
 	bool
 	default y
 
+config CRASH_DUMP
+	bool "kernel crash dumps (EXPERIMENTAL)"
+	depends on PPC_MULTIPLATFORM
+	depends on EXPERIMENTAL
+	help
+	  Build a kernel suitable for use as a kdump capture kernel.
+	  The kernel will be linked at a different address than normal, and
+	  so can only be used for Kdump.
+
+	  Don't change this unless you know what you are doing.
+
 config IBMVIO
 	depends on PPC_PSERIES || PPC_ISERIES
 	bool
Index: kexec/arch/powerpc/kernel/setup_64.c
===================================================================
--- kexec.orig/arch/powerpc/kernel/setup_64.c
+++ kexec/arch/powerpc/kernel/setup_64.c
@@ -528,6 +528,9 @@ void __init setup_system(void)
 			ppc64_caches.iline_size);
 	printk("htab_address                  = 0x%p\n", htab_address);
 	printk("htab_hash_mask                = 0x%lx\n", htab_hash_mask);
+#if PHYSICAL_START > 0
+	printk("physical_start                = 0x%lx\n", PHYSICAL_START);
+#endif
 	printk("-----------------------------------------------------\n");
 
 	mm_init_ppc64();
Index: kexec/include/asm-powerpc/page.h
===================================================================
--- kexec.orig/include/asm-powerpc/page.h
+++ kexec/include/asm-powerpc/page.h
@@ -103,7 +103,15 @@
 #define PAGE_OFFSET	CONFIG_KERNEL_START
 #endif /* __powerpc64__ */
 
-#define KERNELBASE	PAGE_OFFSET
+#ifdef CONFIG_CRASH_DUMP
+/* Kdump kernel runs at 32 MB, change at your peril. */
+#define PHYSICAL_START	ASM_CONST(0x2000000)
+#else
+#define PHYSICAL_START	ASM_CONST(0x0)
+#endif
+
+#define KERNELBASE	(PAGE_OFFSET + PHYSICAL_START)
+
 #define VMALLOCBASE     ASM_CONST(0xD000000000000000)
 
 /*



More information about the Linuxppc64-dev mailing list