linux: restrict IRQ probing
PATCH 1/1 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
I haven't got feedback from the reporting party, yet, but as the change seems correct in any case, I thought I'd submit it right away.
As usual, written and tested on 2.6.27-rc8 and made apply to the 2.6.18 tree without further testing.
Signed-off-by Jan Beulich <[email protected]>
drivers/xen/core/evtchn.c +12 -1
@@ -784,7 +784,16 @@ static struct irq_chip dynirq_chip = {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 )
@@ -1177,7 +1186,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;
@@ -1196,6 +1105,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;