aboutsummaryrefslogtreecommitdiffstats
path: root/xen/arch/x86/irq.c
diff options
context:
space:
mode:
authorAndrew Cooper <andrew.cooper3@citrix.com>2012-05-22 16:28:45 +0200
committerAndrew Cooper <andrew.cooper3@citrix.com>2012-05-22 16:28:45 +0200
commit8c09a7869b615141a60e798f6699b93084a57fd4 (patch)
tree4f06c80ea67e419447a0a1f37eebef3481b9d45a /xen/arch/x86/irq.c
parent759e255deba72f94365d35643fb4ae72ce59f237 (diff)
downloadxen-8c09a7869b615141a60e798f6699b93084a57fd4.tar.gz
xen-8c09a7869b615141a60e798f6699b93084a57fd4.tar.bz2
xen-8c09a7869b615141a60e798f6699b93084a57fd4.zip
x86: prevent call to xfree() in dump_irqs() while in an irq context
Because of c/s 24707:96987c324a4f, dump_irqs() can now be called in an irq context when a bug condition is encountered. If this is the case, ignore the call to xsm_show_irq_ssid() and the subsequent call to xfree(). This prevents an assertion failure in xfree(), and should allow all the debug information to be dumped, before failing with a BUG() because of the underlying race condition we are attempting to reproduce. Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com> Rather than using the non-obvious conditional around an xfree() that would be passed NULL only in the inverse case (which could easily get removed by a future change on the basis that calling xfree(NULL) is benign), switch the order of checks in xfree() itself and only suppress the call to XSM that could potentially call xmalloc(). Signed-off-by: Jan Beulich <jbeulich@suse.com> Acked-by: Keir Fraser <keir@xen.org> Committed-by: Jan Beulich <jbeulich@suse.com>
Diffstat (limited to 'xen/arch/x86/irq.c')
-rw-r--r--xen/arch/x86/irq.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/xen/arch/x86/irq.c b/xen/arch/x86/irq.c
index 496c8048ae..78a02e3290 100644
--- a/xen/arch/x86/irq.c
+++ b/xen/arch/x86/irq.c
@@ -2060,7 +2060,7 @@ static void dump_irqs(unsigned char key)
if ( !irq_desc_initialized(desc) || desc->handler == &no_irq_type )
continue;
- ssid = xsm_show_irq_sid(irq);
+ ssid = in_irq() ? NULL : xsm_show_irq_sid(irq);
spin_lock_irqsave(&desc->lock, flags);