diff options
author | Andrew Cooper <andrew.cooper3@citrix.com> | 2011-08-16 15:17:43 +0100 |
---|---|---|
committer | Andrew Cooper <andrew.cooper3@citrix.com> | 2011-08-16 15:17:43 +0100 |
commit | 638f141e34103b84810ae8b44fbb809457b6e27c (patch) | |
tree | d22204c567075d39bcd04c9f4287b74af952cd3d | |
parent | cdfb1853bb2ddfee5ee7306ee48a882946cba2ff (diff) | |
download | xen-638f141e34103b84810ae8b44fbb809457b6e27c.tar.gz xen-638f141e34103b84810ae8b44fbb809457b6e27c.tar.bz2 xen-638f141e34103b84810ae8b44fbb809457b6e27c.zip |
x86: IRQ fix incorrect logic in __clear_irq_vector
In the old code, tmp_mask is the cpu_and of cfg->cpu_mask and
cpu_online_map. However, in the usual case of moving an IRQ from one
PCPU to another because the scheduler decides its a good idea,
cfg->cpu_mask and cfg->old_cpu_mask do not intersect. This causes the
old cpu vector_irq table to keep the irq reference when it shouldn't.
This leads to a resource leak if a domain is shut down wile an irq has
a move pending, which results in Xen's create_irq() eventually failing
with -ENOSPC when all vector_irq tables are full of stale references.
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
xen-unstable changeset: 23765:68b903bb1b01
xen-unstable date: Sat Aug 13 10:14:28 2011 +0100
-rw-r--r-- | xen/arch/x86/irq.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/xen/arch/x86/irq.c b/xen/arch/x86/irq.c index 9958b3c1c0..095ea77590 100644 --- a/xen/arch/x86/irq.c +++ b/xen/arch/x86/irq.c @@ -190,6 +190,7 @@ static void __clear_irq_vector(int irq) if (likely(!cfg->move_in_progress)) return; + cpus_and(tmp_mask, cfg->old_cpu_mask, cpu_online_map); for_each_cpu_mask(cpu, tmp_mask) { for (vector = FIRST_DYNAMIC_VECTOR; vector <= LAST_DYNAMIC_VECTOR; vector++) { |