]> rtime.felk.cvut.cz Git - lisovros/linux_canprio.git/commit
xen: ensure that all event channels start off bound to VCPU 0
authorIan Campbell <ian.campbell@citrix.com>
Fri, 8 Oct 2010 15:59:12 +0000 (16:59 +0100)
committerGreg Kroah-Hartman <gregkh@suse.de>
Thu, 9 Dec 2010 21:32:37 +0000 (13:32 -0800)
commite1dff96fef0489b0899299bcd5e3e5701d995d2e
tree561b898a51ce303c83a2867d19d231917b1eb9b1
parentea475ea78d1db87c6d08d28ca394c9e2dbbc47d8
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>
drivers/xen/events.c