view docs/misc/kexec_and_kdump.txt @ 18947:2dffa6ceb0af

Support S3 for MSI interrupt

From: "Jiang, Yunhong" <yunhong.jiang@intel.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
author Keir Fraser <keir.fraser@citrix.com>
date Fri Dec 19 14:56:36 2008 +0000 (2008-12-19)
parents f9062ba4c54f
line source
2 =======================
3 Kexec and Kdump for Xen
4 =======================
6 This is a breif guide to using Kexec and Kdump in conjunction with Xen.
7 This functionaly works at the level of the hypervisor and dom0 kernel.
8 And will thus affect all guests running on a machine.
10 At this stage it does not work in conjunction with domU kernels.
12 This document should be read in conjunction with
13 Documentation/kdump/kdump.txt from the Linux kernel source.
14 Some of the information in this document has been
15 sourced from that document.
18 Kexec
19 =====
21 It is possible to kexec from Xen or Linux to either Xen or Linux.
23 Pattern | Before Kexec | After Kexec
24 ---------------+--------------------+--------------------
25 Xen -> Xen | first hypervisor & | second hypervisor &
26 | dom0 kernel | dom0 kernel
27 ---------------+--------------------+--------------------
28 Xen -> Linux | first hypervisor & | second kernel
29 | dom0 kernel |
30 ---------------+--------------------+--------------------
31 Linux -> Xen | first kernel | second hypervisor &
32 | | dom0 kernel
33 ---------------+--------------------+--------------------
34 Linux -> Linux | first kernel | second kernel
36 If you are kexecing to Xen then you will also need to preapare the second
37 hypervisor and dom0 kernel that will run after kexec. These may be the same
38 as the first hypervisor and dom0 kernel that are used before kexec if you
39 are kexecing from Xen to Xen.
41 If you are kexecing to Linux then you will need to prepare the second Linux
42 kernel that will run after kexec. In the case that you are kexecing from
43 Linux, it may be the same as the first kernel image that that runs before
44 kexec.
46 Regardless of which kexec pattern you wish to run, you will
47 need to have kexec-tools installed. This provides the kexec command.
49 1. Load
50 -------
52 Before kexecing the second kernel or hypervisor & dom0 kernel
53 need to be loaded into the running hypervisor or kernel using
54 the kexec command.
56 a. To kexec to Xen (Xen->Xen or Linux->Xen)
58 kexec -l --append="XEN_ARGS -- DOM0_ARGS" \
61 where:
62 XEN_ARGS: command line arguments to the xen hypervisor
63 On x86 the no-real-mode argument should be included
64 DOM0_ARGS: command line arguments to the dom0 kernel
65 XEN_IMAGE: xen hypervisor image
66 DOM0_IMAGE: dom0 kernel image
67 KEXEC_ARGS: additional kexec-tools command line arguments
69 e.g. kexec -l --append "no-real-mode" --vmm="/boot/xen.gz" /boot/vmlinuz.gz
71 OR
73 b. To kexec to Linux (Xen->Linux or Linux->Linux)
75 kexec -l LINUX_IMAGE --append "$LINUX_ARGS" KEXEC_ARGS
77 where:
78 LINUX_IMAGE: the second linux kernel image
79 LINUX_ARGS: command line arguments to the second linux kernel
80 KEXEC_ARGS: additional kexec-tools command line arguments
82 e.g. kexec -l /boot/second-vmlinuz.gz
84 2. Execute
85 ----------
87 Once the second kernel is loaded, it can be executed at any time.
88 If you don't see the second kernel booting within a second or so,
89 you are in trouble :(
91 kexec -e
93 Kdump
94 =====
96 It is possible to kdump from Xen or Linux to a Linux crash kernel.
97 It is not possible to use xen as a crash kernel.
99 Pattern | Before Kexec | After Kexec
100 ---------------+--------------------+--------------------
101 Xen -> Linux | first hypervisor & | crash kernel
102 | dom0 kernel |
103 ---------------+--------------------+--------------------
104 Linux -> Linux | first kernel | crash kernel
106 Regardless of if you are kdumping from Xen or Linux you will need to
107 prepare a linux crash kernel. You will also need to have kexec-tools
108 installed. This provides the kexec command.
110 0. Set-Up The Crash Kernel Region
111 ---------------------------------
113 In order to use kdump an area of memory has to be reserved at boot time.
114 This is the area of memory that the crash kernel will use, thus allowing it
115 to run without disrupting the memory used by the first kernel. This area is
116 called the crash kernel region and is reserved using the crashkernel
117 command line parameter to the Xen hypervisor. It has two forms:
119 i) crashkernel=size
121 This is the simplest and recommended way to reserve the crash kernel
122 region. Just specify how large the region should be and the hypervisor
123 will find a good location for it. A good size to start with is 128Mb
125 e.g.
127 crashkernel=128M
129 ii) crashkernel=size@base
131 In this form the base address is provided in addition to
132 the size. Use this if auto-placement doesn't work for some reason.
133 It is strongly recommended that the base address be aligned
134 to 64Mb, else memory below the alignment point will not
135 be usable.
137 e.g. crashkernel=128M@256M
139 Regardless of which of the two forms of the crashkernel command line you
140 use, the crash kernel region should appear in /proc/iomem on x86 or
141 /proc/iomem_machine on ia64. If it doesn't then either the crashkernel
142 parameter is missing, or for some reason the region couldn't be placed -
143 for instance because it is too large.
145 # cat /proc/iomem
146 ...
147 00100000-07feffff : System RAM
148 00100000-00bfffff : Hypervisor code and data
149 0533f000-0733efff : Crash kernel
150 ...
153 1. Load
154 -------
156 Once you are running in a kexec-enabled hypervisor and dom0,
157 you can prepare to kdump by loading the crash kernel into the
158 running kernel.
162 where:
163 CRASH_KERNEL_IMAGE: the crash kernel image
164 CRASH_KERNEL_ARGS: command line arguments to the crash kernel
165 init 1 is strongly recommended
166 irqpoll is strongly recommended
167 maxcpus=1 is required if the crash kernel is SMP
168 reset_devices is strongly recommended
169 KEXEC_ARGS: additional kexec-tools command line arguments
170 On x86 --args-linux should be supplied if an uncompressed
171 vmlinux image is used as the crash kernel
173 e.g. kexec -p /boot/crash-vmlinuz \
174 --append "init 1 irqpoll maxcpus=1 reset_devices" --args-linux
176 On x86 systems the crash kernel may be either
177 - A uncompressed vmlinux image if the kernel is not relocatable
178 - A compressed bzImage or vmlinuz image if the kernel is relocatable
179 - Relocatability is crontroled by the CONFIG_RELOCATABLE kernel
180 compile configuration parameter. This option may not be available
181 depending on the kernel version
182 On ia64
183 Either a vmlinuz or vmlinux.gz image may be used
186 2. Execute
187 ----------
189 Once the second kernel is loaded, the crash kernel will be executed if the
190 hypervisor panics. It will also be executed if dom0 panics or if dom0
191 oopses and /proc/sys/kernel/panic_on_oops is set to a non-zero value
193 echo 1 > /proc/sys/kernel/panic_on_oops
195 Kdump may also be triggered (for testing)
197 a. From Domain 0
199 echo c > /proc/sysrq-trigger
201 b. From Xen
203 Enter the xen console
205 ctrl^a ctrl^a (may be bound to a different key, this is the default)
207 Select C for "trigger a crashdump"
209 C
211 If you don't see the crash kernel booting within a second or so,
212 you are in trouble :(