[PATCH 7/12] ppc64: Add CONFIG_KDUMP_CAPTURE_KERNEL

Michael Ellerman michael at ellerman.id.au
Fri Aug 26 12:53:27 EST 2005


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

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

Signed-off-by: Michael Ellerman <michael at ellerman.id.au>
---

 arch/ppc64/Kconfig       |   10 ++++++++++
 include/asm-ppc64/page.h |   17 ++++++++++-------
 2 files changed, 20 insertions(+), 7 deletions(-)

Index: work/include/asm-ppc64/page.h
===================================================================
--- work.orig/include/asm-ppc64/page.h
+++ work/include/asm-ppc64/page.h
@@ -206,15 +206,18 @@ extern u64 ppc64_pft_size;		/* Log 2 of 
 #endif
 
 
-/* This must match the -Ttext linker address            */
-/* Note: tophys & tovirt make assumptions about how     */
-/*       KERNELBASE is defined for performance reasons. */
-/*       When KERNELBASE moves, those macros may have   */
-/*             to change!                               */
-#define PAGE_OFFSET     ASM_CONST(0xC000000000000000)
-#define KERNELBASE      PAGE_OFFSET
+#define PAGE_OFFSET		ASM_CONST(0xC000000000000000)
 #define VMALLOC_OFFSET		ASM_CONST(0xD000000000000000)
 
+#ifdef CONFIG_KDUMP_CAPTURE_KERNEL
+/* 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 VMALLOC_REGION_ID	(VMALLOC_OFFSET >> REGION_SHIFT)
 #define KERNEL_REGION_ID   (KERNELBASE >> REGION_SHIFT)
 #define USER_REGION_ID     (0UL)
Index: work/arch/ppc64/Kconfig
===================================================================
--- work.orig/arch/ppc64/Kconfig
+++ work/arch/ppc64/Kconfig
@@ -142,6 +142,16 @@ config PPC_SPLPAR
 	  processors, that is, which share physical processors between
 	  two or more partitions.
 
+config KDUMP_CAPTURE_KERNEL
+	bool "kdump capture kernel"
+	depends on PPC_MULTIPLATFORM && 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 KEXEC
 	bool "kexec system call (EXPERIMENTAL)"
 	depends on PPC_MULTIPLATFORM && EXPERIMENTAL



More information about the Linuxppc64-dev mailing list