xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] irq: Exclude percpu IRQs from being fixed up
@ 2011-02-16 14:26 Zhang, Fengzhe
  2011-02-16 14:53 ` Jan Beulich
  0 siblings, 1 reply; 9+ messages in thread
From: Zhang, Fengzhe @ 2011-02-16 14:26 UTC (permalink / raw)
  To: Jeremy Fitzhardinge; +Cc: xen-devel, Dong, Eddie, Li, Xin, Jan Beulich

[-- Attachment #1: Type: text/plain, Size: 1502 bytes --]

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@intel.com>

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)
+
 		if (new->flags & IRQF_PERCPU)
 			desc->status |= IRQ_PER_CPU;
-#endif
 
 		desc->status &= ~(IRQ_AUTODETECT | IRQ_WAITING | IRQ_ONESHOT |
 				  IRQ_INPROGRESS | IRQ_SPURIOUS_DISABLED);

[-- Attachment #2: lock_kicker_irq_bug.patch --]
[-- Type: application/octet-stream, Size: 1502 bytes --]

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@intel.com>

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)
+
 		if (new->flags & IRQF_PERCPU)
 			desc->status |= IRQ_PER_CPU;
-#endif
 
 		desc->status &= ~(IRQ_AUTODETECT | IRQ_WAITING | IRQ_ONESHOT |
 				  IRQ_INPROGRESS | IRQ_SPURIOUS_DISABLED);

[-- Attachment #3: Type: text/plain, Size: 138 bytes --]

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

^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2011-05-05  6:55 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-02-16 14:26 [PATCH] irq: Exclude percpu IRQs from being fixed up Zhang, Fengzhe
2011-02-16 14:53 ` Jan Beulich
2011-02-17  0:15   ` Fengzhe Zhang
2011-02-17  7:52     ` Jan Beulich
2011-02-17  8:25       ` Fengzhe Zhang
2011-04-28 11:05         ` Li, Xin
2011-05-03 11:55           ` Ian Campbell
2011-02-17  9:09       ` Ian Campbell
2011-05-05  6:55         ` Tian, Kevin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).