diff options
author | David Vrabel <david.vrabel@citrix.com> | 2013-08-15 13:21:06 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-08-29 09:47:35 -0700 |
commit | d8251a942ff0318fd8fde8e69fac5480b60e26b3 (patch) | |
tree | 61843f397f8803b52d36e8dcf2003c4f783e1102 /drivers/xen | |
parent | 8a34139a0c0ab7ed616b3e50f061cac8bc1e0531 (diff) | |
download | linux-3.10-d8251a942ff0318fd8fde8e69fac5480b60e26b3.tar.gz linux-3.10-d8251a942ff0318fd8fde8e69fac5480b60e26b3.tar.bz2 linux-3.10-d8251a942ff0318fd8fde8e69fac5480b60e26b3.zip |
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: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/xen')
-rw-r--r-- | drivers/xen/events.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/xen/events.c b/drivers/xen/events.c index 6a6bbe4ede9..c7338868449 100644 --- a/drivers/xen/events.c +++ b/drivers/xen/events.c @@ -346,7 +346,7 @@ static void init_evtchn_cpu_bindings(void) for_each_possible_cpu(i) memset(per_cpu(cpu_evtchn_mask, i), - (i == 0) ? ~0 : 0, sizeof(*per_cpu(cpu_evtchn_mask, i))); + (i == 0) ? ~0 : 0, NR_EVENT_CHANNELS/8); } static inline void clear_evtchn(int port) |