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-changelog

[Xen-changelog] This patch fixes a race between when the disable cpu is

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] This patch fixes a race between when the disable cpu is marked online
From: Xen patchbot -unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Wed, 28 Sep 2005 17:16:11 +0000
Delivery-date: Wed, 28 Sep 2005 17:13:44 +0000
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User kaf24@xxxxxxxxxxxxxxxxxxxx
# Node ID f9a806ba838a85a4b92efb42e333897bbaf195e2
# Parent  c7f58e86446fc75856e4361f3e9fdd32bbc111a8
This patch fixes a race between when the disable cpu is marked online
and binding IPIs back to the CPU.  In some cases, an IPI would be sent
to CPU1 before it had allocated a new evtchn.  Moving smp_resume() call
before setting the cpu online fixes this race.  This fixes bug #228
(http://bugzilla.xensource.com/bugzilla/show_bug.cgi?id=228).

Signed-off-by: Ryan Harper <ryanh@xxxxxxxxxx>

diff -r c7f58e86446f -r f9a806ba838a 
linux-2.6-xen-sparse/arch/xen/i386/kernel/process.c
--- a/linux-2.6-xen-sparse/arch/xen/i386/kernel/process.c       Wed Sep 28 
17:01:40 2005
+++ b/linux-2.6-xen-sparse/arch/xen/i386/kernel/process.c       Wed Sep 28 
17:03:20 2005
@@ -112,6 +112,10 @@
 
 #ifdef CONFIG_HOTPLUG_CPU
 #include <asm/nmi.h>
+#ifdef CONFIG_SMP
+extern void smp_suspend(void);
+extern void smp_resume(void);
+#endif
 /* We don't actually take CPU down, just spin without interrupts. */
 static inline void play_dead(void)
 {
@@ -120,6 +124,13 @@
                HYPERVISOR_yield();
 
        __flush_tlb_all();
+   /* 
+    * Restore IPI/IRQ mappings before marking online to prevent 
+    * race between pending interrupts and restoration of handler. 
+    */
+#ifdef CONFIG_SMP
+       smp_resume();
+#endif
        cpu_set(smp_processor_id(), cpu_online_map);
 }
 #else
@@ -135,10 +146,6 @@
  * low exit latency (ie sit in a loop waiting for
  * somebody to say that they'd like to reschedule)
  */
-#ifdef CONFIG_SMP
-extern void smp_suspend(void);
-extern void smp_resume(void);
-#endif
 void cpu_idle (void)
 {
        int cpu = _smp_processor_id();
@@ -166,9 +173,6 @@
                                HYPERVISOR_vcpu_down(cpu);
 #endif
                                play_dead();
-#ifdef CONFIG_SMP
-                               smp_resume();
-#endif
                                local_irq_enable();
                        }
 

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] This patch fixes a race between when the disable cpu is marked online, Xen patchbot -unstable <=