ia64/linux-2.6.18-xen.hg

changeset 689:39a4dda735d3

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@novell.com>
author Keir Fraser <keir.fraser@citrix.com>
date Fri Oct 03 09:39:37 2008 +0100 (2008-10-03)
parents b54652ee29ef
children c3a007862994
files drivers/xen/core/evtchn.c
line diff
     1.1 --- a/drivers/xen/core/evtchn.c	Thu Oct 02 11:29:02 2008 +0100
     1.2 +++ b/drivers/xen/core/evtchn.c	Fri Oct 03 09:39:37 2008 +0100
     1.3 @@ -756,7 +756,16 @@ static struct hw_interrupt_type dynirq_t
     1.4  
     1.5  void evtchn_register_pirq(int irq)
     1.6  {
     1.7 +	struct irq_desc *desc;
     1.8 +	unsigned long flags;
     1.9 +
    1.10  	irq_info[irq] = mk_irq_info(IRQT_PIRQ, irq, 0);
    1.11 +
    1.12 +	/* Cannot call set_irq_probe(), as that's marked __init. */
    1.13 +	desc = irq_desc + irq;
    1.14 +	spin_lock_irqsave(&desc->lock, flags);
    1.15 +	desc->status &= ~IRQ_NOPROBE;
    1.16 +	spin_unlock_irqrestore(&desc->lock, flags);
    1.17  }
    1.18  
    1.19  #if defined(CONFIG_X86_IO_APIC)
    1.20 @@ -1105,7 +1114,7 @@ void __init xen_init_IRQ(void)
    1.21  	for (i = DYNIRQ_BASE; i < (DYNIRQ_BASE + NR_DYNIRQS); i++) {
    1.22  		irq_bindcount[i] = 0;
    1.23  
    1.24 -		irq_desc[i].status = IRQ_DISABLED;
    1.25 +		irq_desc[i].status = IRQ_DISABLED|IRQ_NOPROBE;
    1.26  		irq_desc[i].action = NULL;
    1.27  		irq_desc[i].depth = 1;
    1.28  		irq_desc[i].chip = &dynirq_type;
    1.29 @@ -1123,6 +1132,8 @@ void __init xen_init_IRQ(void)
    1.30  #endif
    1.31  
    1.32  		irq_desc[i].status = IRQ_DISABLED;
    1.33 +		if (!identity_mapped_irq(i))
    1.34 +			irq_desc[i].status |= IRQ_NOPROBE;
    1.35  		irq_desc[i].action = NULL;
    1.36  		irq_desc[i].depth = 1;
    1.37  		irq_desc[i].chip = &pirq_type;