|
@@ -35,6 +35,7 @@ struct ms_hyperv_info ms_hyperv;
|
|
|
EXPORT_SYMBOL_GPL(ms_hyperv);
|
|
|
|
|
|
static void (*hv_kexec_handler)(void);
|
|
|
+static void (*hv_crash_handler)(struct pt_regs *regs);
|
|
|
|
|
|
#if IS_ENABLED(CONFIG_HYPERV)
|
|
|
static void (*vmbus_handler)(void);
|
|
@@ -83,6 +84,18 @@ void hv_remove_kexec_handler(void)
|
|
|
hv_kexec_handler = NULL;
|
|
|
}
|
|
|
EXPORT_SYMBOL_GPL(hv_remove_kexec_handler);
|
|
|
+
|
|
|
+void hv_setup_crash_handler(void (*handler)(struct pt_regs *regs))
|
|
|
+{
|
|
|
+ hv_crash_handler = handler;
|
|
|
+}
|
|
|
+EXPORT_SYMBOL_GPL(hv_setup_crash_handler);
|
|
|
+
|
|
|
+void hv_remove_crash_handler(void)
|
|
|
+{
|
|
|
+ hv_crash_handler = NULL;
|
|
|
+}
|
|
|
+EXPORT_SYMBOL_GPL(hv_remove_crash_handler);
|
|
|
#endif
|
|
|
|
|
|
static void hv_machine_shutdown(void)
|
|
@@ -92,6 +105,14 @@ static void hv_machine_shutdown(void)
|
|
|
native_machine_shutdown();
|
|
|
}
|
|
|
|
|
|
+static void hv_machine_crash_shutdown(struct pt_regs *regs)
|
|
|
+{
|
|
|
+ if (hv_crash_handler)
|
|
|
+ hv_crash_handler(regs);
|
|
|
+ native_machine_crash_shutdown(regs);
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
static uint32_t __init ms_hyperv_platform(void)
|
|
|
{
|
|
|
u32 eax;
|
|
@@ -165,6 +186,7 @@ static void __init ms_hyperv_init_platform(void)
|
|
|
#endif
|
|
|
|
|
|
machine_ops.shutdown = hv_machine_shutdown;
|
|
|
+ machine_ops.crash_shutdown = hv_machine_crash_shutdown;
|
|
|
}
|
|
|
|
|
|
const __refconst struct hypervisor_x86 x86_hyper_ms_hyperv = {
|