# HG changeset patch # Parent 3b563b2c79f991f226bd383d40402d96ddf9a168 x86/irq: 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 diff -r 3b563b2c79f9 xen/arch/x86/irq.c --- a/xen/arch/x86/irq.c +++ b/xen/arch/x86/irq.c @@ -2039,7 +2039,7 @@ static void dump_irqs(unsigned char key) struct domain *d; const struct pirq *info; unsigned long flags; - char *ssid; + char *ssid = NULL; printk("Guest interrupt information:\n"); @@ -2051,7 +2051,8 @@ static void dump_irqs(unsigned char key) if ( !irq_desc_initialized(desc) || desc->handler == &no_irq_type ) continue; - ssid = xsm_show_irq_sid(irq); + if ( ! in_irq() ) + ssid = xsm_show_irq_sid(irq); spin_lock_irqsave(&desc->lock, flags); @@ -2098,7 +2099,8 @@ static void dump_irqs(unsigned char key) spin_unlock_irqrestore(&desc->lock, flags); - xfree(ssid); + if ( ! in_irq() ) + xfree(ssid); } dump_ioapic_irq_info();