]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
x86/xen/enlighten: Add init and crash kexec/kdump hooks
authorDaniel Kiper <daniel.kiper@oracle.com>
Thu, 21 Jun 2012 13:38:02 +0000 (15:38 +0200)
committerDaniel Kiper <daniel.kiper@oracle.com>
Thu, 28 Jun 2012 07:50:11 +0000 (09:50 +0200)
Add init and crash kexec/kdump hooks.

Signed-off-by: Daniel Kiper <daniel.kiper@oracle.com>
arch/x86/xen/enlighten.c

index f767b04090b2fdf8e141a776b92f142cd73dd7cd..4390dbd0b2c445caf22e998d2e6ad88be5fb3ac2 100644 (file)
@@ -31,6 +31,7 @@
 #include <linux/pci.h>
 #include <linux/gfp.h>
 #include <linux/memblock.h>
+#include <linux/kexec.h>
 
 #include <xen/xen.h>
 #include <xen/interface/xen.h>
@@ -66,6 +67,7 @@
 #include <asm/hypervisor.h>
 #include <asm/mwait.h>
 #include <asm/pci_x86.h>
+#include <asm/xen/kexec.h>
 
 #ifdef CONFIG_ACPI
 #include <asm/acpi.h>
@@ -1194,6 +1196,12 @@ static void xen_machine_power_off(void)
 
 static void xen_crash_shutdown(struct pt_regs *regs)
 {
+#ifdef CONFIG_KEXEC
+       if (kexec_crash_image) {
+               crash_save_cpu(regs, safe_smp_processor_id());
+               return;
+       }
+#endif
        xen_reboot(SHUTDOWN_crash);
 }
 
@@ -1272,6 +1280,10 @@ asmlinkage void __init xen_start_kernel(void)
 
        xen_init_mmu_ops();
 
+#ifdef CONFIG_KEXEC
+       xen_init_kexec_ops();
+#endif
+
        /* Prevent unwanted bits from being set in PTEs. */
        __supported_pte_mask &= ~_PAGE_GLOBAL;
        if (!xen_initial_domain())