aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>2006-03-22 10:38:44 +0100
committerkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>2006-03-22 10:38:44 +0100
commit6e79784b9db2a6d5ab5dd6a8fc9cf6cebe711514 (patch)
tree07b2a67d72f4056643d46b4b6c19974b442f49c5
parent7ef969e97e42e81aad1c6f8e67220583c7447bb3 (diff)
downloadxen-6e79784b9db2a6d5ab5dd6a8fc9cf6cebe711514.tar.gz
xen-6e79784b9db2a6d5ab5dd6a8fc9cf6cebe711514.tar.bz2
xen-6e79784b9db2a6d5ab5dd6a8fc9cf6cebe711514.zip
On x86/64 a domU kernel just sits around forever on a panic because
the HV doesn't know it crashed. This patch sends the signal, which allows the kernel to be cleaned up (according to whatever guest.conf rules). It is basically copied and pasted from the i386 branch. From: Don Zickus Signed-off-by: Keir Fraser <keir@xensource.com>
-rw-r--r--linux-2.6-xen-sparse/arch/x86_64/kernel/setup-xen.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/linux-2.6-xen-sparse/arch/x86_64/kernel/setup-xen.c b/linux-2.6-xen-sparse/arch/x86_64/kernel/setup-xen.c
index c06c2b26a1..aa7d503a41 100644
--- a/linux-2.6-xen-sparse/arch/x86_64/kernel/setup-xen.c
+++ b/linux-2.6-xen-sparse/arch/x86_64/kernel/setup-xen.c
@@ -93,6 +93,11 @@ EXPORT_SYMBOL(hypercall_page);
/* Allows setting of maximum possible memory size */
unsigned long xen_override_max_pfn;
+static int xen_panic_event(struct notifier_block *, unsigned long, void *);
+static struct notifier_block xen_panic_block = {
+ xen_panic_event, NULL, 0 /* try to go last */
+};
+
unsigned long *phys_to_machine_mapping;
unsigned long *pfn_to_mfn_frame_list_list, *pfn_to_mfn_frame_list[512];
@@ -634,6 +639,9 @@ void __init setup_arch(char **cmdline_p)
unsigned long kernel_end;
#ifdef CONFIG_XEN
+ /* Register a call for panic conditions. */
+ notifier_chain_register(&panic_notifier_list, &xen_panic_block);
+
ROOT_DEV = MKDEV(RAMDISK_MAJOR,0);
kernel_end = 0; /* dummy */
screen_info = SCREEN_INFO;
@@ -989,6 +997,17 @@ void __init setup_arch(char **cmdline_p)
#endif /* !CONFIG_XEN */
}
+#ifdef CONFIG_XEN
+static int
+xen_panic_event(struct notifier_block *this, unsigned long event, void *ptr)
+{
+ HYPERVISOR_sched_op(SCHEDOP_shutdown, SHUTDOWN_crash);
+ /* we're never actually going to get here... */
+ return NOTIFY_DONE;
+}
+#endif /* !CONFIG_XEN */
+
+
static int __cpuinit get_model_name(struct cpuinfo_x86 *c)
{
unsigned int *v;