|
|
|
|
|
|
|
|
|
|
xen-devel
[Xen-devel] [PATCH 08/11] xen/hvm kexec: unregister the watch of the "ba
The watch of the xenstore "backend" node has to be unregistered during a
kexec reboot. Otherwise the kexec kernel will crash due to a memory
corruption because more than one watch is registered on that node.
v2:
use kexec_is_loaded() function
Signed-off-by: Olaf Hering <olaf@xxxxxxxxx>
---
drivers/xen/xenbus/xenbus_probe_backend.c | 15 +++++++++++++++
1 file changed, 15 insertions(+)
Index: linux-3.0/drivers/xen/xenbus/xenbus_probe_backend.c
===================================================================
--- linux-3.0.orig/drivers/xen/xenbus/xenbus_probe_backend.c
+++ linux-3.0/drivers/xen/xenbus/xenbus_probe_backend.c
@@ -42,6 +42,8 @@
#include <linux/fcntl.h>
#include <linux/mm.h>
#include <linux/notifier.h>
+#include <linux/kexec.h>
+#include <linux/syscore_ops.h>
#include <asm/page.h>
#include <asm/pgtable.h>
@@ -255,6 +257,18 @@ static int backend_probe_and_watch(struc
return NOTIFY_DONE;
}
+static void xenbus_backend_shutdown_watcher(void)
+{
+ if (!kexec_is_loaded())
+ return;
+
+ unregister_xenbus_watch(&be_watch);
+}
+
+static struct syscore_ops xenbus_backend_watcher_syscore_ops = {
+ .shutdown = xenbus_backend_shutdown_watcher,
+};
+
static int __init xenbus_probe_backend_init(void)
{
static struct notifier_block xenstore_notifier = {
@@ -270,6 +284,7 @@ static int __init xenbus_probe_backend_i
return err;
register_xenstore_notifier(&xenstore_notifier);
+ register_syscore_ops(&xenbus_backend_watcher_syscore_ops);
return 0;
}
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
|
<Prev in Thread] |
Current Thread |
[Next in Thread>
|
- [Xen-devel] [PATCH 00/11] [v2] misc changes for kexec in pv-on-hvm guests, Olaf Hering
- [Xen-devel] [PATCH 03/11] xen: use static initializers in xen-balloon.c, Olaf Hering
- [Xen-devel] [PATCH 06/11] xen/hvm kexec: unregister shutdown+sysrq watches during reboot, Olaf Hering
- [Xen-devel] [PATCH 05/11] xen/hvm kexec: unregister debugirq during reboot, Olaf Hering
- [Xen-devel] [PATCH 04/11] xen/hvm kexec: unregister timer interrupt during reboot, Olaf Hering
- [Xen-devel] [PATCH 02/11] xen: remove BUG_ON from xen_teardown_timer, Olaf Hering
- [Xen-devel] [PATCH 08/11] xen/hvm kexec: unregister the watch of the "backend" node during reboot,
Olaf Hering <=
- [Xen-devel] [PATCH 07/11] xen/hvm kexec: unregister memory/target watch in xen-balloon.c, Olaf Hering
- [Xen-devel] [PATCH 01/11] kexec: add kexec_is_loaded function, Olaf Hering
- [Xen-devel] [PATCH 10/11] xen kexec: reset device state to Initializing during reboot, Olaf Hering
- [Xen-devel] [PATCH 11/11] xen/hvm kdump: reset PV devices in crash kernel, Olaf Hering
- [Xen-devel] [PATCH 09/11] xen/hvm kexec: unregister the watch of the "device" node during reboot, Olaf Hering
- Re: [Xen-devel] [PATCH 00/11] [v2] misc changes for kexec in pv-on-hvm guests, Keir Fraser
- Re: [Xen-devel] [PATCH 00/11] [v2] misc changes for kexec in pv-on-hvm guests, Konrad Rzeszutek Wilk
|
|
|
|
|