WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] [PATCH] linux: restrict IRQ probing

To: <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-devel] [PATCH] linux: restrict IRQ probing
From: "Jan Beulich" <jbeulich@xxxxxxxxxx>
Date: Thu, 02 Oct 2008 16:42:23 +0100
Delivery-date: Thu, 02 Oct 2008 08:42:13 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
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 <jbeulich@xxxxxxxxxx>

Index: head-2008-10-01/drivers/xen/core/evtchn.c
===================================================================
--- head-2008-10-01.orig/drivers/xen/core/evtchn.c      2008-09-17 
14:06:19.000000000 +0200
+++ head-2008-10-01/drivers/xen/core/evtchn.c   2008-10-02 16:52:17.000000000 
+0200
@@ -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;




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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] [PATCH] linux: restrict IRQ probing, Jan Beulich <=