|
@@ -33,6 +33,10 @@
|
|
|
#include <linux/memblock.h>
|
|
|
#include <linux/edd.h>
|
|
|
|
|
|
+#ifdef CONFIG_KEXEC_CORE
|
|
|
+#include <linux/kexec.h>
|
|
|
+#endif
|
|
|
+
|
|
|
#include <xen/xen.h>
|
|
|
#include <xen/events.h>
|
|
|
#include <xen/interface/xen.h>
|
|
@@ -1808,6 +1812,21 @@ static struct notifier_block xen_hvm_cpu_notifier = {
|
|
|
.notifier_call = xen_hvm_cpu_notify,
|
|
|
};
|
|
|
|
|
|
+#ifdef CONFIG_KEXEC_CORE
|
|
|
+static void xen_hvm_shutdown(void)
|
|
|
+{
|
|
|
+ native_machine_shutdown();
|
|
|
+ if (kexec_in_progress)
|
|
|
+ xen_reboot(SHUTDOWN_soft_reset);
|
|
|
+}
|
|
|
+
|
|
|
+static void xen_hvm_crash_shutdown(struct pt_regs *regs)
|
|
|
+{
|
|
|
+ native_machine_crash_shutdown(regs);
|
|
|
+ xen_reboot(SHUTDOWN_soft_reset);
|
|
|
+}
|
|
|
+#endif
|
|
|
+
|
|
|
static void __init xen_hvm_guest_init(void)
|
|
|
{
|
|
|
if (xen_pv_domain())
|
|
@@ -1827,6 +1846,10 @@ static void __init xen_hvm_guest_init(void)
|
|
|
x86_init.irqs.intr_init = xen_init_IRQ;
|
|
|
xen_hvm_init_time_ops();
|
|
|
xen_hvm_init_mmu_ops();
|
|
|
+#ifdef CONFIG_KEXEC_CORE
|
|
|
+ machine_ops.shutdown = xen_hvm_shutdown;
|
|
|
+ machine_ops.crash_shutdown = xen_hvm_crash_shutdown;
|
|
|
+#endif
|
|
|
}
|
|
|
#endif
|
|
|
|