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] Re: [PATCH] irq: Exclude percpu IRQs from being fixed up

To: Jan Beulich <JBeulich@xxxxxxxxxx>
Subject: [Xen-devel] Re: [PATCH] irq: Exclude percpu IRQs from being fixed up
From: Fengzhe Zhang <fengzhe.zhang@xxxxxxxxx>
Date: Thu, 17 Feb 2011 08:15:43 +0800
Cc: Jeremy Fitzhardinge <jeremy@xxxxxxxx>, xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxx>, "Dong, Eddie" <eddie.dong@xxxxxxxxx>, "Li, Xin" <xin.li@xxxxxxxxx>
Delivery-date: Wed, 16 Feb 2011 16:16:40 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <4D5BF2FE02000078000322EB@xxxxxxxxxxxxxxxxxx>
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>
References: <1A42CE6F5F474C41B63392A5F80372B2335E978D@xxxxxxxxxxxxxxxxxxxxxxxxxxxx> <4D5BF2FE02000078000322EB@xxxxxxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.13) Gecko/20101207 Thunderbird/3.1.7
On 2011/2/16 22:53, Jan Beulich wrote:
On 16.02.11 at 15:26, "Zhang, Fengzhe"<fengzhe.zhang@xxxxxxxxx>  wrote:
irq: Exclude percpu IRQs from being fixed up

Xen spin unlock uses spurious ipi "lock_kicker_irq" to wake up blocked vCPUs
waiting on that lock. This irq should always be disabled. However, when Dom0
is shuting down, function fixup_irqs is called which unmasks all irqs.
Function unmask_irq effectively re-enables lock_kicker_irq and its irq handler
is invoked which reports bug and crashes Dom0.

This patch sets IRQ_PER_CPU flag in irq desc and excludes percpu IRQs from
being fixed up when taking CPUs down.

Signed-off-by: Fengzhe Zhang<fengzhe.zhang@xxxxxxxxx>

diff --git a/arch/x86/kernel/irq_64.c b/arch/x86/kernel/irq_64.c
index 977d8b4..f0f9450 100644
--- a/arch/x86/kernel/irq_64.c
+++ b/arch/x86/kernel/irq_64.c
@@ -80,6 +80,9 @@ void fixup_irqs(void)
                if (irq == 2)
                        continue;

+               if (desc->status&  IRQ_PER_CPU)
+                       continue;
+
                /* interrupt's are disabled at this point */
                spin_lock(&desc->lock);

diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c
index f34e231..26bc55a 100644
--- a/kernel/irq/manage.c
+++ b/kernel/irq/manage.c
@@ -727,10 +727,9 @@ __setup_irq(unsigned int irq, struct irq_desc *desc,
struct irqaction *new)
                                goto out_thread;
                } else
                        compat_irq_chip_set_default_handler(desc);
-#if defined(CONFIG_IRQ_PER_CPU)

Why? XEN should select IRQ_PER_CPU instead in its Kconfig.

Jan

IRQ_PER_CPU switch is not found in current Kconfig. I'm not sure if this feature is going to be brought back in the short term. I remove the ifdef to set IRQ_PER_CPU flag in desc by default but still leave the IRQ handling logic unchanged. This is a temporary solution to fix system crash on poweroff. And this is the fix with minimum impact among the several solutions we tried.

-Fengzhe

+
                if (new->flags&  IRQF_PERCPU)
                        desc->status |= IRQ_PER_CPU;
-#endif

                desc->status&= ~(IRQ_AUTODETECT | IRQ_WAITING | IRQ_ONESHOT |
                                  IRQ_INPROGRESS | IRQ_SPURIOUS_DISABLED);




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