xen/events: initialize local per-cpu mask for all possible events
authorDavid Vrabel <david.vrabel@citrix.com>
Thu, 15 Aug 2013 12:21:06 +0000 (13:21 +0100)
committerBen Hutchings <ben@decadent.org.uk>
Tue, 10 Sep 2013 00:57:26 +0000 (01:57 +0100)
commit63493b3e3db6d027fe9b9a53616b8c1a9038ea44
tree277b05c738c26a0f40ea87c01805d4ca77f86242
parent343077dc5d8ec1fe65caf734d5d4205ac35b3ab2
xen/events: initialize local per-cpu mask for all possible events

commit 84ca7a8e45dafb49cd5ca90a343ba033e2885c17 upstream.

The sizeof() argument in init_evtchn_cpu_bindings() is incorrect
resulting in only the first 64 (or 32 in 32-bit guests) ports having
their bindings being initialized to VCPU 0.

In most cases this does not cause a problem as request_irq() will set
the irq affinity which will set the correct local per-cpu mask.
However, if the request_irq() is called on a VCPU other than 0, there
is a window between the unmasking of the event and the affinity being
set were an event may be lost because it is not locally unmasked on
any VCPU. If request_irq() is called on VCPU 0 then local irqs are
disabled during the window and the race does not occur.

Fix this by initializing all NR_EVENT_CHANNEL bits in the local
per-cpu masks.

Signed-off-by: David Vrabel <david.vrabel@citrix.com>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
drivers/xen/events.c