summaryrefslogtreecommitdiff
path: root/drivers/xen
diff options
context:
space:
mode:
authorIan Campbell <ian.campbell@citrix.com>2010-10-08 16:59:12 +0100
committerGreg Kroah-Hartman <gregkh@suse.de>2010-12-09 13:26:42 -0800
commitf78785f8745489972717b7f9ee994c96a8d8978c (patch)
tree3b8c85f91b62a9bb2e5a2c7236f53d2d781c4859 /drivers/xen
parent1e251f22b6ef6e018286e9a9745e66409131e353 (diff)
xen: ensure that all event channels start off bound to VCPU 0
commit b0097adeec27e30223c989561ab0f7aa60d1fe93 upstream. All event channels startbound to VCPU 0 so ensure that cpu_evtchn_mask is initialised to reflect this. Otherwise there is a race after registering an event channel but before the affinity is explicitly set where the event channel can be delivered. If this happens then the event channel remains pending in the L1 (evtchn_pending) array but is cleared in L2 (evtchn_pending_sel), this means the event channel cannot be reraised until another event channel happens to trigger the same L2 entry on that VCPU. sizeof(cpu_evtchn_mask(0))==sizeof(unsigned long*) which is not correct, and causes only the first 32 or 64 event channels (depending on architecture) to be initially bound to VCPU0. Use sizeof(struct cpu_evtchn_s) instead. Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Cc: Jeremy Fitzhardinge <jeremy@goop.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/xen')
-rw-r--r--drivers/xen/events.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/xen/events.c b/drivers/xen/events.c
index ac91a4e3a9a7..141701598b3e 100644
--- a/drivers/xen/events.c
+++ b/drivers/xen/events.c
@@ -255,7 +255,7 @@ static void init_evtchn_cpu_bindings(void)
}
#endif
- memset(cpu_evtchn_mask(0), ~0, sizeof(cpu_evtchn_mask(0)));
+ memset(cpu_evtchn_mask(0), ~0, sizeof(struct cpu_evtchn_s));
}
static inline void clear_evtchn(int port)