aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation/kdump/kdump.txt
diff options
context:
space:
mode:
Diffstat (limited to 'Documentation/kdump/kdump.txt')
-rw-r--r--Documentation/kdump/kdump.txt149
1 files changed, 79 insertions, 70 deletions
diff --git a/Documentation/kdump/kdump.txt b/Documentation/kdump/kdump.txt
index 5f08f9ce6046..212cf3c21abf 100644
--- a/Documentation/kdump/kdump.txt
+++ b/Documentation/kdump/kdump.txt
@@ -4,10 +4,10 @@ Documentation for kdump - the kexec-based crash dumping solution
4DESIGN 4DESIGN
5====== 5======
6 6
7Kdump uses kexec to reboot to a second kernel whenever a dump needs to be taken. 7Kdump uses kexec to reboot to a second kernel whenever a dump needs to be
8This second kernel is booted with very little memory. The first kernel reserves 8taken. This second kernel is booted with very little memory. The first kernel
9the section of memory that the second kernel uses. This ensures that on-going 9reserves the section of memory that the second kernel uses. This ensures that
10DMA from the first kernel does not corrupt the second kernel. 10on-going DMA from the first kernel does not corrupt the second kernel.
11 11
12All the necessary information about Core image is encoded in ELF format and 12All the necessary information about Core image is encoded in ELF format and
13stored in reserved area of memory before crash. Physical address of start of 13stored in reserved area of memory before crash. Physical address of start of
@@ -35,77 +35,82 @@ In the second kernel, "old memory" can be accessed in two ways.
35SETUP 35SETUP
36===== 36=====
37 37
381) Download http://www.xmission.com/~ebiederm/files/kexec/kexec-tools-1.101.tar.gz 381) Download the upstream kexec-tools userspace package from
39 and apply http://lse.sourceforge.net/kdump/patches/kexec-tools-1.101-kdump.patch 39 http://www.xmission.com/~ebiederm/files/kexec/kexec-tools-1.101.tar.gz.
40 and after that build the source.
41 40
422) Download and build the appropriate (2.6.13-rc1 onwards) vanilla kernel. 41 Apply the latest consolidated kdump patch on top of kexec-tools-1.101
42 from http://lse.sourceforge.net/kdump/. This arrangment has been made
43 till all the userspace patches supporting kdump are integrated with
44 upstream kexec-tools userspace.
43 45
462) Download and build the appropriate (2.6.13-rc1 onwards) vanilla kernels.
44 Two kernels need to be built in order to get this feature working. 47 Two kernels need to be built in order to get this feature working.
48 Following are the steps to properly configure the two kernels specific
49 to kexec and kdump features:
45 50
46 A) First kernel: 51 A) First kernel or regular kernel:
52 ----------------------------------
47 a) Enable "kexec system call" feature (in Processor type and features). 53 a) Enable "kexec system call" feature (in Processor type and features).
48 CONFIG_KEXEC=y 54 CONFIG_KEXEC=y
49 b) This kernel's physical load address should be the default value of 55 b) Enable "sysfs file system support" (in Pseudo filesystems).
50 0x100000 (0x100000, 1 MB) (in Processor type and features). 56 CONFIG_SYSFS=y
51 CONFIG_PHYSICAL_START=0x100000 57 c) make
52 c) Enable "sysfs file system support" (in Pseudo filesystems).
53 CONFIG_SYSFS=y
54 d) Boot into first kernel with the command line parameter "crashkernel=Y@X". 58 d) Boot into first kernel with the command line parameter "crashkernel=Y@X".
55 Use appropriate values for X and Y. Y denotes how much memory to reserve 59 Use appropriate values for X and Y. Y denotes how much memory to reserve
56 for the second kernel, and X denotes at what physical address the reserved 60 for the second kernel, and X denotes at what physical address the
57 memory section starts. For example: "crashkernel=64M@16M". 61 reserved memory section starts. For example: "crashkernel=64M@16M".
58 62
59 B) Second kernel: 63
60 a) Enable "kernel crash dumps" feature (in Processor type and features). 64 B) Second kernel or dump capture kernel:
61 CONFIG_CRASH_DUMP=y 65 ---------------------------------------
62 b) Specify a suitable value for "Physical address where the kernel is 66 a) For i386 architecture enable Highmem support
63 loaded" (in Processor type and features). Typically this value 67 CONFIG_HIGHMEM=y
64 should be same as X (See option d) above, e.g., 16 MB or 0x1000000. 68 b) Enable "kernel crash dumps" feature (under "Processor type and features")
65 CONFIG_PHYSICAL_START=0x1000000 69 CONFIG_CRASH_DUMP=y
66 c) Enable "/proc/vmcore support" (Optional, in Pseudo filesystems). 70 c) Make sure a suitable value for "Physical address where the kernel is
67 CONFIG_PROC_VMCORE=y 71 loaded" (under "Processor type and features"). By default this value
68 d) Disable SMP support and build a UP kernel (Until it is fixed). 72 is 0x1000000 (16MB) and it should be same as X (See option d above),
69 CONFIG_SMP=n 73 e.g., 16 MB or 0x1000000.
70 e) Enable "Local APIC support on uniprocessors". 74 CONFIG_PHYSICAL_START=0x1000000
71 CONFIG_X86_UP_APIC=y 75 d) Enable "/proc/vmcore support" (Optional, under "Pseudo filesystems").
72 f) Enable "IO-APIC support on uniprocessors" 76 CONFIG_PROC_VMCORE=y
73 CONFIG_X86_UP_IOAPIC=y 77
74 783) After booting to regular kernel or first kernel, load the second kernel
75 Note: i) Options a) and b) depend upon "Configure standard kernel features 79 using the following command:
76 (for small systems)" (under General setup).
77 ii) Option a) also depends on CONFIG_HIGHMEM (under Processor
78 type and features).
79 iii) Both option a) and b) are under "Processor type and features".
80
813) Boot into the first kernel. You are now ready to try out kexec-based crash
82 dumps.
83
844) Load the second kernel to be booted using:
85 80
86 kexec -p <second-kernel> --args-linux --elf32-core-headers 81 kexec -p <second-kernel> --args-linux --elf32-core-headers
87 --append="root=<root-dev> init 1 irqpoll" 82 --append="root=<root-dev> init 1 irqpoll maxcpus=1"
88 83
89 Note: i) <second-kernel> has to be a vmlinux image. bzImage will not work, 84 Notes:
90 as of now. 85 ======
91 ii) By default ELF headers are stored in ELF64 format. Option 86 i) <second-kernel> has to be a vmlinux image ie uncompressed elf image.
92 --elf32-core-headers forces generation of ELF32 headers. gdb can 87 bzImage will not work, as of now.
93 not open ELF64 headers on 32 bit systems. So creating ELF32 88 ii) --args-linux has to be speicfied as if kexec it loading an elf image,
94 headers can come handy for users who have got non-PAE systems and 89 it needs to know that the arguments supplied are of linux type.
95 hence have memory less than 4GB. 90 iii) By default ELF headers are stored in ELF64 format to support systems
96 iii) Specify "irqpoll" as command line parameter. This reduces driver 91 with more than 4GB memory. Option --elf32-core-headers forces generation
97 initialization failures in second kernel due to shared interrupts. 92 of ELF32 headers. The reason for this option being, as of now gdb can
98 iv) <root-dev> needs to be specified in a format corresponding to 93 not open vmcore file with ELF64 headers on a 32 bit systems. So ELF32
99 the root device name in the output of mount command. 94 headers can be used if one has non-PAE systems and hence memory less
100 v) If you have built the drivers required to mount root file 95 than 4GB.
101 system as modules in <second-kernel>, then, specify 96 iv) Specify "irqpoll" as command line parameter. This reduces driver
102 --initrd=<initrd-for-second-kernel>. 97 initialization failures in second kernel due to shared interrupts.
103 98 v) <root-dev> needs to be specified in a format corresponding to the root
1045) System reboots into the second kernel when a panic occurs. A module can be 99 device name in the output of mount command.
105 written to force the panic or "ALT-SysRq-c" can be used initiate a crash 100 vi) If you have built the drivers required to mount root file system as
106 dump for testing purposes. 101 modules in <second-kernel>, then, specify
107 102 --initrd=<initrd-for-second-kernel>.
1086) Write out the dump file using 103 vii) Specify maxcpus=1 as, if during first kernel run, if panic happens on
104 non-boot cpus, second kernel doesn't seem to be boot up all the cpus.
105 The other option is to always built the second kernel without SMP
106 support ie CONFIG_SMP=n
107
1084) After successfully loading the second kernel as above, if a panic occurs
109 system reboots into the second kernel. A module can be written to force
110 the panic or "ALT-SysRq-c" can be used initiate a crash dump for testing
111 purposes.
112
1135) Once the second kernel has booted, write out the dump file using
109 114
110 cp /proc/vmcore <dump-file> 115 cp /proc/vmcore <dump-file>
111 116
@@ -119,9 +124,9 @@ SETUP
119 124
120 Entire memory: dd if=/dev/oldmem of=oldmem.001 125 Entire memory: dd if=/dev/oldmem of=oldmem.001
121 126
127
122ANALYSIS 128ANALYSIS
123======== 129========
124
125Limited analysis can be done using gdb on the dump file copied out of 130Limited analysis can be done using gdb on the dump file copied out of
126/proc/vmcore. Use vmlinux built with -g and run 131/proc/vmcore. Use vmlinux built with -g and run
127 132
@@ -132,15 +137,19 @@ work fine.
132 137
133Note: gdb cannot analyse core files generated in ELF64 format for i386. 138Note: gdb cannot analyse core files generated in ELF64 format for i386.
134 139
140Latest "crash" (crash-4.0-2.18) as available on Dave Anderson's site
141http://people.redhat.com/~anderson/ works well with kdump format.
142
143
135TODO 144TODO
136==== 145====
137
1381) Provide a kernel pages filtering mechanism so that core file size is not 1461) Provide a kernel pages filtering mechanism so that core file size is not
139 insane on systems having huge memory banks. 147 insane on systems having huge memory banks.
1402) Modify "crash" tool to make it recognize this dump. 1482) Relocatable kernel can help in maintaining multiple kernels for crashdump
149 and same kernel as the first kernel can be used to capture the dump.
150
141 151
142CONTACT 152CONTACT
143======= 153=======
144
145Vivek Goyal (vgoyal@in.ibm.com) 154Vivek Goyal (vgoyal@in.ibm.com)
146Maneesh Soni (maneesh@in.ibm.com) 155Maneesh Soni (maneesh@in.ibm.com)