All of lore.kernel.org
 help / color / mirror / Atom feed
From: Don Zickus <dzickus@redhat.com>
To: xen-devel@lists.xensource.com
Subject: [PATCH x86_64] x86_64 doesn't tell the HV it is panicing
Date: Mon, 20 Mar 2006 15:40:12 -0500	[thread overview]
Message-ID: <20060320204012.GA12138@redhat.com> (raw)

Hello,

I apologize if this patch makes it to the list.  Didn't realize I needed
to subscribe first. 

As the subject says, the 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.  

Cheers,
Don



--- linux-2.6.15.noarch/arch/x86_64/kernel/setup-xen.c.orig	2006-03-16 15:04:45.000000000 -0500
+++ linux-2.6.15.noarch/arch/x86_64/kernel/setup-xen.c	2006-03-16 15:11:53.000000000 -0500
@@ -91,6 +91,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];
 
@@ -632,6 +637,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;
@@ -980,6 +988,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;


----- End forwarded message -----

             reply	other threads:[~2006-03-20 20:40 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-03-20 20:40 Don Zickus [this message]
  -- strict thread matches above, loose matches on Subject: below --
2006-03-21 19:56 [PATCH x86_64] x86_64 doesn't tell the HV it is panicing Don Zickus
2006-03-17 21:55 Don Zickus
2006-03-16 22:59 Don Zickus

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20060320204012.GA12138@redhat.com \
    --to=dzickus@redhat.com \
    --cc=xen-devel@lists.xensource.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.