[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [linux-2.6.18-xen] linux: restrict IRQ probing



# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1223023177 -3600
# Node ID 39a4dda735d373195f57f56e30f614cb564184da
# Parent  b54652ee29ef09b4a0cc0e3460629c5638d9cafb
linux: restrict IRQ probing

Since IRQ probing may touch all currently unused interrupts, we must
prevent probing for those where it doesn't make sense (to avoid
triggering BUG()s or de-referencing NULL function pointers):
- dynamic IRQs must never be probed
- physical IRQs should only be probed when registered or
identity-mapped

Signed-off-by: Jan Beulich <jbeulich@xxxxxxxxxx>
---
 drivers/xen/core/evtchn.c |   13 ++++++++++++-
 1 files changed, 12 insertions(+), 1 deletion(-)

diff -r b54652ee29ef -r 39a4dda735d3 drivers/xen/core/evtchn.c
--- a/drivers/xen/core/evtchn.c Thu Oct 02 11:29:02 2008 +0100
+++ b/drivers/xen/core/evtchn.c Fri Oct 03 09:39:37 2008 +0100
@@ -756,7 +756,16 @@ static struct hw_interrupt_type dynirq_t
 
 void evtchn_register_pirq(int irq)
 {
+       struct irq_desc *desc;
+       unsigned long flags;
+
        irq_info[irq] = mk_irq_info(IRQT_PIRQ, irq, 0);
+
+       /* Cannot call set_irq_probe(), as that's marked __init. */
+       desc = irq_desc + irq;
+       spin_lock_irqsave(&desc->lock, flags);
+       desc->status &= ~IRQ_NOPROBE;
+       spin_unlock_irqrestore(&desc->lock, flags);
 }
 
 #if defined(CONFIG_X86_IO_APIC)
@@ -1105,7 +1114,7 @@ void __init xen_init_IRQ(void)
        for (i = DYNIRQ_BASE; i < (DYNIRQ_BASE + NR_DYNIRQS); i++) {
                irq_bindcount[i] = 0;
 
-               irq_desc[i].status = IRQ_DISABLED;
+               irq_desc[i].status = IRQ_DISABLED|IRQ_NOPROBE;
                irq_desc[i].action = NULL;
                irq_desc[i].depth = 1;
                irq_desc[i].chip = &dynirq_type;
@@ -1123,6 +1132,8 @@ void __init xen_init_IRQ(void)
 #endif
 
                irq_desc[i].status = IRQ_DISABLED;
+               if (!identity_mapped_irq(i))
+                       irq_desc[i].status |= IRQ_NOPROBE;
                irq_desc[i].action = NULL;
                irq_desc[i].depth = 1;
                irq_desc[i].chip = &pirq_type;

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.