]> git.kernelconcepts.de Git - karo-tx-linux.git/blobdiff - arch/s390/kernel/smp.c
[S390] kdump backend code
[karo-tx-linux.git] / arch / s390 / kernel / smp.c
index e4572601e91e0cf2d7f1d22103406b5761845399..e3f51dfa5cad67808bd3dc6b4b82fab56069bd17 100644 (file)
@@ -38,6 +38,7 @@
 #include <linux/timex.h>
 #include <linux/bootmem.h>
 #include <linux/slab.h>
+#include <linux/crash_dump.h>
 #include <asm/asm-offsets.h>
 #include <asm/ipl.h>
 #include <asm/setup.h>
@@ -304,11 +305,13 @@ void smp_ctl_clear_bit(int cr, int bit)
 }
 EXPORT_SYMBOL(smp_ctl_clear_bit);
 
-#ifdef CONFIG_ZFCPDUMP
+#if defined(CONFIG_ZFCPDUMP) || defined(CONFIG_CRASH_DUMP)
 
 static void __init smp_get_save_area(unsigned int cpu, unsigned int phy_cpu)
 {
-       if (ipl_info.type != IPL_TYPE_FCP_DUMP)
+       if (ipl_info.type != IPL_TYPE_FCP_DUMP && !OLDMEM_BASE)
+               return;
+       if (is_kdump_kernel())
                return;
        if (cpu >= NR_CPUS) {
                pr_warning("CPU %i exceeds the maximum %i and is excluded from "
@@ -426,6 +429,18 @@ static void __init smp_detect_cpus(void)
        info = kmalloc(sizeof(*info), GFP_KERNEL);
        if (!info)
                panic("smp_detect_cpus failed to allocate memory\n");
+#ifdef CONFIG_CRASH_DUMP
+       if (OLDMEM_BASE && !is_kdump_kernel()) {
+               struct save_area *save_area;
+
+               save_area = kmalloc(sizeof(*save_area), GFP_KERNEL);
+               if (!save_area)
+                       panic("could not allocate memory for save area\n");
+               copy_oldmem_page(1, (void *) save_area, sizeof(*save_area),
+                                0x200, 0);
+               zfcpdump_save_areas[0] = save_area;
+       }
+#endif
        /* Use sigp detection algorithm if sclp doesn't work. */
        if (sclp_get_cpu_info(info)) {
                smp_use_sigp_detection = 1;