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] [xen-3.4-testing] x86: Disable spinlock checks temporari

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-3.4-testing] x86: Disable spinlock checks temporarily while bringing a CPU online.
From: "Xen patchbot-3.4-testing" <patchbot-3.4-testing@xxxxxxxxxxxxxxxxxxx>
Date: Fri, 27 Nov 2009 00:40:40 -0800
Delivery-date: Fri, 27 Nov 2009 00:41:06 -0800
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/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/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 Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1259310277 0
# Node ID f937968640d804942d8b779633f9c04045ea1142
# Parent  8c5708bc87adb3ae7dd5f0ccc7a84bb57f7ca8f4
x86: Disable spinlock checks temporarily while bringing a CPU online.

This is safe, as described in a code comment.

Signed-off-by: Keir Fraser <keir.fraser@xxxxxxxxxx>
xen-unstable changeset:   20441:32a27fe01e07
xen-unstable date:        Thu Nov 12 15:34:37 2009 +0000
---
 xen/arch/x86/smpboot.c |   19 +++++++++++++++++++
 1 files changed, 19 insertions(+)

diff -r 8c5708bc87ad -r f937968640d8 xen/arch/x86/smpboot.c
--- a/xen/arch/x86/smpboot.c    Fri Nov 27 08:22:41 2009 +0000
+++ b/xen/arch/x86/smpboot.c    Fri Nov 27 08:24:37 2009 +0000
@@ -489,6 +489,24 @@ void __devinit start_secondary(void *unu
             rdmsrl(MSR_EFER, this_cpu(efer));
        asm volatile ( "mov %%cr4,%0" : "=r" (this_cpu(cr4)) );
 
+       /*
+        * Just as during early bootstrap, it is convenient here to disable
+        * spinlock checking while we have IRQs disabled. This allows us to
+        * acquire IRQ-unsafe locks when it would otherwise be disallowed.
+        * 
+        * It is safe because the race we are usually trying to avoid involves
+        * a group of CPUs rendezvousing in an IPI handler, where one cannot
+        * join because it is spinning with IRQs disabled waiting to acquire a
+        * lock held by another in the rendezvous group (the lock must be an
+        * IRQ-unsafe lock since the CPU took the IPI after acquiring it, and
+        * hence had IRQs enabled). This is a deadlock scenario.
+        * 
+        * However, no CPU can be involved in rendezvous until it is online,
+        * hence no such group can be waiting for this CPU until it is
+        * visible in cpu_online_map. Hence such a deadlock is not possible.
+        */
+       spin_debug_disable();
+
        percpu_traps_init();
 
        cpu_init();
@@ -515,6 +533,7 @@ void __devinit start_secondary(void *unu
        set_cpu_sibling_map(raw_smp_processor_id());
        wmb();
 
+       spin_debug_enable();
        cpu_set(smp_processor_id(), cpu_online_map);
        per_cpu(cpu_state, smp_processor_id()) = CPU_ONLINE;
 

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-3.4-testing] x86: Disable spinlock checks temporarily while bringing a CPU online., Xen patchbot-3.4-testing <=