aboutsummaryrefslogtreecommitdiffstats
path: root/tools/libxc/xc_minios.c
diff options
context:
space:
mode:
authorKeir Fraser <keir.fraser@citrix.com>2008-03-18 11:29:18 +0000
committerKeir Fraser <keir.fraser@citrix.com>2008-03-18 11:29:18 +0000
commitb9d1950675c67f10870debe164a226eef64f65d5 (patch)
treeacd93ea007ed7289d7bacc728997d698e050c276 /tools/libxc/xc_minios.c
parent62341d01ee88ecc87d6995000383446e3bf43ec7 (diff)
downloadxen-b9d1950675c67f10870debe164a226eef64f65d5.tar.gz
xen-b9d1950675c67f10870debe164a226eef64f65d5.tar.bz2
xen-b9d1950675c67f10870debe164a226eef64f65d5.zip
minios: Fix lost events
evtchn_bind_interdomain used to clear any already pending event before binding a handler, because else the handler may be called before it is ready. That however leads to missed events, which I had to workaround for the HVM case. This changes the semantics of bind_evtchn, and thus of all the event channel binding functions (bind_virq, evtchn_alloc_unbound, evtchn_bind_interdomain) into not unmasking the event itself, hence letting the caller initialize properly before unmasking the port (e.g. record the port number in an appropriate place). Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
Diffstat (limited to 'tools/libxc/xc_minios.c')
-rw-r--r--tools/libxc/xc_minios.c14
1 files changed, 3 insertions, 11 deletions
diff --git a/tools/libxc/xc_minios.c b/tools/libxc/xc_minios.c
index 53f7a148da..2131ed543e 100644
--- a/tools/libxc/xc_minios.c
+++ b/tools/libxc/xc_minios.c
@@ -165,14 +165,6 @@ static int port_alloc(int xce_handle) {
return i;
}
-static void poke_port(int xce_handle, evtchn_port_t port)
-{
- shared_info_t *s = HYPERVISOR_shared_info;
- printk("poking port %d\n", port);
- synch_set_bit(port, &s->evtchn_pending[0]);
- xc_evtchn_unmask(xce_handle, port);
-}
-
static void evtchn_handler(evtchn_port_t port, struct pt_regs *regs, void *data)
{
int xce_handle = (intptr_t) data;
@@ -211,6 +203,7 @@ evtchn_port_or_error_t xc_evtchn_bind_unbound_port(int xce_handle, int domid)
}
files[xce_handle].evtchn.ports[i].bound = 1;
files[xce_handle].evtchn.ports[i].port = port;
+ unmask_evtchn(port);
return port;
}
@@ -235,9 +228,7 @@ evtchn_port_or_error_t xc_evtchn_bind_interdomain(int xce_handle, int domid,
}
files[xce_handle].evtchn.ports[i].bound = 1;
files[xce_handle].evtchn.ports[i].port = local_port;
-/* Poke port on start: HVM won't send an event for the very first request since
- * we were not ready yet */
- poke_port(xce_handle, local_port);
+ unmask_evtchn(local_port);
return local_port;
}
@@ -275,6 +266,7 @@ evtchn_port_or_error_t xc_evtchn_bind_virq(int xce_handle, unsigned int virq)
}
files[xce_handle].evtchn.ports[i].bound = 1;
files[xce_handle].evtchn.ports[i].port = port;
+ unmask_evtchn(port);
return port;
}