diff options
| author | Jan Beulich <jbeulich@suse.com> | 2013-06-13 11:17:46 +0200 |
|---|---|---|
| committer | Jan Beulich <jbeulich@suse.com> | 2013-06-13 11:17:46 +0200 |
| commit | 6cafdac52c638cc83f800c9c23ff06f4ed4c947a (patch) | |
| tree | 90c89ccab0ca987f01b0a5ed7672369ca84518ad /tools/lib/sys_string.h | |
| parent | ec01a2789ec06e02cdff55d0868816cd19fb2680 (diff) | |
| download | xen-6cafdac52c638cc83f800c9c23ff06f4ed4c947a.tar.gz xen-6cafdac52c638cc83f800c9c23ff06f4ed4c947a.tar.bz2 xen-6cafdac52c638cc83f800c9c23ff06f4ed4c947a.zip | |
x86: fix ordering of operations in destroy_irq()
The fix for XSA-36, switching the default of vector map management to
be per-device, exposed more readily a problem with the cleanup of these
vector maps: dynamic_irq_cleanup() clearing desc->arch.used_vectors
keeps the subsequently invoked clear_irq_vector() from clearing the
bits for both the in-use and a possibly still outstanding old vector.
Fix this by folding dynamic_irq_cleanup() into destroy_irq(), which was
its only caller, deferring the clearing of the vector map pointer until
after clear_irq_vector().
Once at it, also defer resetting of desc->handler until after the loop
around smp_mb() checking for IRQ_INPROGRESS to be clear, fixing a
(mostly theoretical) issue with the intercation with do_IRQ(): If we
don't defer the pointer reset, do_IRQ() could, for non-guest IRQs, call
->ack() and ->end() with different ->handler pointers, potentially
leading to an IRQ remaining un-acked. The issue is mostly theoretical
because non-guest IRQs are subject to destroy_irq() only on (boot time)
error paths.
As to the changed locking: Invoking clear_irq_vector() with desc->lock
held is okay because vector_lock already nests inside desc->lock (proven
by set_desc_affinity(), which takes vector_lock and gets called from
various desc->handler->ack implementations, getting invoked with
desc->lock held).
Reported-by: Andrew Cooper <andrew.cooper3@citrix.com>
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: George Dunlap <george.dunlap@eu.citrix.com>
master commit: 43427e65ccfea0c6dc0232f358287e6cc616b507
master date: 2013-05-31 08:35:22 +0200
Diffstat (limited to 'tools/lib/sys_string.h')
0 files changed, 0 insertions, 0 deletions
