xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] pvops: Avoid re-alloc_intr_gate of hvm evtchn callback
@ 2011-03-05 10:11 Frank Pan
  2011-03-05 10:54 ` Ian Campbell
  0 siblings, 1 reply; 4+ messages in thread
From: Frank Pan @ 2011-03-05 10:11 UTC (permalink / raw)
  To: xen-devel, Jeremy Fitzhardinge, Konrad Rzeszutek Wilk,
	Ian Campbell

[-- Attachment #1: Type: text/plain, Size: 1199 bytes --]

I've met a issue that a PV-on-HVM domain become stucked after migration.
The alloc_intr_gate(HVM_XEN_EVTCHN_CALLBACK) is called the second time
after the migration and leads to BUG(). (The first time is at system
initialization)

The following patch fixes this by check whether this callback is
registered or not before calling alloc_intr_gate.
---
 linux-2.6-xen/drivers/xen/events.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/linux-2.6-xen/drivers/xen/events.c
b/linux-2.6-xen/drivers/xen/events.c
index ac7b42f..77ffceb 100644
--- a/linux-2.6-xen/drivers/xen/events.c
+++ b/linux-2.6-xen/drivers/xen/events.c
@@ -1500,7 +1500,9 @@ void xen_callback_vector(void)
 		}
 		printk(KERN_INFO "Xen HVM callback vector for event delivery is "
 				"enabled\n");
-		alloc_intr_gate(XEN_HVM_EVTCHN_CALLBACK, xen_hvm_callback_vector);
+		/* xen_callback_vector will be called after every domU resume */
+		if (!test_bit(XEN_HVM_EVTCHN_CALLBACK, used_vectors))
+			alloc_intr_gate(XEN_HVM_EVTCHN_CALLBACK, xen_hvm_callback_vector);
 	}
 }
 #else
-- 
1.7.0.4


-- 
潘震皓, Frank Pan

Computer Science and Technology
Tsinghua University

[-- Attachment #2: 0001-Avoid-re-alloc_intr_gate-of-hvm-evtchn-callback.patch --]
[-- Type: text/x-patch, Size: 1295 bytes --]

From dc04b1fbddbc428bb1453187a69be88a036a5d1e Mon Sep 17 00:00:00 2001
From: Frank Pan <frankpzh@gmail.com>
Date: Sat, 5 Mar 2011 16:16:45 +0800
Subject: [PATCH] Avoid re-alloc_intr_gate of hvm evtchn callback

I've met a issue that a PV-on-HVM domain become stucked after migration.
The alloc_intr_gate(HVM_XEN_EVTCHN_CALLBACK) is called the second time after the migration and leads to BUG(). (The first time is at system initialization)

The following patch fixes this by check whether this callback is registered or not before calling alloc_intr_gate.
---
 linux-2.6-xen/drivers/xen/events.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/linux-2.6-xen/drivers/xen/events.c b/linux-2.6-xen/drivers/xen/events.c
index ac7b42f..77ffceb 100644
--- a/linux-2.6-xen/drivers/xen/events.c
+++ b/linux-2.6-xen/drivers/xen/events.c
@@ -1500,7 +1500,9 @@ void xen_callback_vector(void)
 		}
 		printk(KERN_INFO "Xen HVM callback vector for event delivery is "
 				"enabled\n");
-		alloc_intr_gate(XEN_HVM_EVTCHN_CALLBACK, xen_hvm_callback_vector);
+		/* xen_callback_vector will be called after every domU resume */
+		if (!test_bit(XEN_HVM_EVTCHN_CALLBACK, used_vectors))
+			alloc_intr_gate(XEN_HVM_EVTCHN_CALLBACK, xen_hvm_callback_vector);
 	}
 }
 #else
-- 
1.7.0.4


[-- Attachment #3: Type: text/plain, Size: 138 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-03-05 11:59 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-03-05 10:11 [PATCH] pvops: Avoid re-alloc_intr_gate of hvm evtchn callback Frank Pan
2011-03-05 10:54 ` Ian Campbell
2011-03-05 11:45   ` Frank Pan
2011-03-05 11:59     ` Ian Campbell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).