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-unstable] Merge

# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1258127218 0
# Node ID 49deb113cd4051f2bd0006102ad26bb91888fbbb
# Parent  5d80936ddcb151b312f5229f3010fe2b4e47e990
# Parent  32a27fe01e07b55a9390a575139f4d8a2d6fdbea
Merge
---
 xen/arch/x86/smpboot.c |   25 ++++++++++++++++++++++++-
 1 files changed, 24 insertions(+), 1 deletion(-)

diff -r 5d80936ddcb1 -r 49deb113cd40 xen/arch/x86/smpboot.c
--- a/xen/arch/x86/smpboot.c    Fri Nov 13 15:38:57 2009 +0000
+++ b/xen/arch/x86/smpboot.c    Fri Nov 13 15:46:58 2009 +0000
@@ -494,6 +494,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();
@@ -517,10 +535,15 @@ void __devinit start_secondary(void *unu
        flush_tlb_local();
 
        /* This must be done before setting cpu_online_map */
+       spin_debug_enable();
        set_cpu_sibling_map(raw_smp_processor_id());
        wmb();
 
-       /* Initlize vector_irq for BSPs */
+       /*
+        * We need to hold vector_lock so there the set of online cpus
+        * does not change while we are assigning vectors to cpus.  Holding
+        * this lock ensures we don't half assign or remove an irq from a cpu.
+        */
        lock_vector_lock();
        __setup_vector_irq(smp_processor_id());
        cpu_set(smp_processor_id(), cpu_online_map);

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] Merge, Xen patchbot-unstable <=