diff options
author | David Wilder <dwilder@us.ibm.com> | 2006-06-23 18:29:34 -0400 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2006-06-28 01:18:52 -0400 |
commit | c0ce7d0886cf0c2579c604eac41a7e125bc0e96d (patch) | |
tree | f31448371b4295e98753f1551178fdddb8d18b0e /include | |
parent | 2cd90bc8fba8720ef7f3fdfd1e0c1a5397a18271 (diff) |
[POWERPC] Add the use of the firmware soft-reset-nmi to kdump.
With this patch, kdump uses the firmware soft-reset NMI for two purposes:
1) Initiate the kdump (take a crash dump) by issuing a soft-reset.
2) Break a CPU out of a deadlock condition that is detected during kdump
processing.
When a soft-reset is initiated each CPU will enter
system_reset_exception() and set its corresponding bit in the global
bit-array cpus_in_sr then call die(). When die() finds the CPU's bit set
in cpu_in_sr crash_kexec() is called to initiate a crash dump. The first
CPU to enter crash_kexec() is called the "crashing CPU". All other CPUs
are "secondary CPUs". The secondary CPU's pass through to
crash_kexec_secondary() and sleep. The crashing CPU waits for all CPUs
to enter via soft-reset then boots the kdump kernel (see
crash_soft_reset_check())
When the system crashes due to a panic or exception, crash_kexec() is
called by panic() or die(). The crashing CPU sends an IPI to all other
CPUs to notify them of the pending shutdown. If a CPU is in a deadlock
or hung state with interrupts disabled, the IPI will not be delivered.
The result being, that the kdump kernel is not booted. This problem is
solved with the use of a firmware generated soft-reset. After the
crashing_cpu has issued the IPI, it waits for 10 sec for all CPUs to
enter crash_ipi_callback(). A CPU signifies its entry to
crash_ipi_callback() by setting its corresponding bit in the
cpus_in_crash bit array. After 10 sec, if one or more CPUs have not set
their bit in cpus_in_crash we assume that the CPU(s) is deadlocked. The
operator is then prompted to generate a soft-reset to break the
deadlock. Each CPU enters the soft reset handler as described above.
Two conditions must be handled at this point:
1) The system crashed because the operator generated a soft-reset. See
2) The system had crashed before the soft-reset was generated ( in the
case of a Panic or oops).
The first CPU to enter crash_kexec() uses the state of the kexec_lock to
determine this state. If kexec_lock is already held then condition 2 is
true and crash_kexec_secondary() is called, else; this CPU is flagged as
the crashing CPU, the kexec_lock is acquired and crash_kexec() proceeds
as described above.
Each additional CPUs responding to the soft-reset will pass through
crash_kexec() to kexec_secondary(). All secondary CPUs call
crash_ipi_callback() readying them self's for the shutdown. When ready
they clear their bit in cpus_in_sr. The crashing CPU waits in
kexec_secondary() until all other CPUs have cleared their bits in
cpus_in_sr. The kexec kernel boot is then started.
Signed-off-by: Haren Myneni <haren@us.ibm.com>
Signed-off-by: David Wilder <dwilder@us.ibm.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/asm-powerpc/kexec.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/include/asm-powerpc/kexec.h b/include/asm-powerpc/kexec.h index 234bd684c7f0..8f7fd5cfec34 100644 --- a/include/asm-powerpc/kexec.h +++ b/include/asm-powerpc/kexec.h | |||
@@ -114,6 +114,11 @@ extern void kexec_smp_wait(void); /* get and clear naca physid, wait for | |||
114 | master to copy new code to 0 */ | 114 | master to copy new code to 0 */ |
115 | extern int crashing_cpu; | 115 | extern int crashing_cpu; |
116 | extern void crash_send_ipi(void (*crash_ipi_callback)(struct pt_regs *)); | 116 | extern void crash_send_ipi(void (*crash_ipi_callback)(struct pt_regs *)); |
117 | extern cpumask_t cpus_in_sr; | ||
118 | static inline int kexec_sr_activated(int cpu) | ||
119 | { | ||
120 | return cpu_isset(cpu,cpus_in_sr); | ||
121 | } | ||
117 | #endif /* __powerpc64 __ */ | 122 | #endif /* __powerpc64 __ */ |
118 | 123 | ||
119 | struct kimage; | 124 | struct kimage; |
@@ -123,10 +128,13 @@ extern int default_machine_kexec_prepare(struct kimage *image); | |||
123 | extern void default_machine_crash_shutdown(struct pt_regs *regs); | 128 | extern void default_machine_crash_shutdown(struct pt_regs *regs); |
124 | 129 | ||
125 | extern void machine_kexec_simple(struct kimage *image); | 130 | extern void machine_kexec_simple(struct kimage *image); |
131 | extern void crash_kexec_secondary(struct pt_regs *regs); | ||
126 | extern int overlaps_crashkernel(unsigned long start, unsigned long size); | 132 | extern int overlaps_crashkernel(unsigned long start, unsigned long size); |
127 | extern void reserve_crashkernel(void); | 133 | extern void reserve_crashkernel(void); |
128 | 134 | ||
129 | #else /* !CONFIG_KEXEC */ | 135 | #else /* !CONFIG_KEXEC */ |
136 | static inline int kexec_sr_activated(int cpu) { return 0; } | ||
137 | static inline void crash_kexec_secondary(struct pt_regs *regs) { } | ||
130 | 138 | ||
131 | static inline int overlaps_crashkernel(unsigned long start, unsigned long size) | 139 | static inline int overlaps_crashkernel(unsigned long start, unsigned long size) |
132 | { | 140 | { |