[patch v3 6/8] s390: Do first kdump checksum test before really starting kdump

From: Michael Holzheu
Date: Fri Aug 12 2011 - 09:51:14 EST

From: Michael Holzheu <holzheu@xxxxxxxxxxxxxxxxxx>

With this patch first the kdump checksums in purgatory are verified (with
start_kdump(0)) before kdump is started. This allows us to do the shutdown
actions defined under /sys/firmware as recovery action in case kdump is
overwritten. The main use case is to define stand-alone dump as recovery

We have to split the purgatory function into "checksum test" and "real
execution", because we have to switch to the IPL CPU when we execute kdump.
After the switch it is not possible to return from the called function.

Signed-off-by: Michael Holzheu <holzheu@xxxxxxxxxxxxxxxxxx>
arch/s390/kernel/machine_kexec.c | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)

--- a/arch/s390/kernel/machine_kexec.c
+++ b/arch/s390/kernel/machine_kexec.c
@@ -325,8 +325,16 @@ void machine_kexec(struct kimage *image)
- if (image->type == KEXEC_TYPE_CRASH)
+ if (image->type == KEXEC_TYPE_CRASH) {
+ int (*start_kdump)(int) = (void *)image->start;
+ int rc;
+ __arch_local_irq_stnsm(0xfb); /* disable DAT */
+ rc = start_kdump(0);
+ __arch_local_irq_stosm(0x04); /* enable DAT */
+ if (rc)
+ return;
smp_switch_to_ipl_cpu(__machine_kdump, image);
+ }
smp_switch_to_ipl_cpu(__machine_kexec, image);

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/