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] Baby step toward host SMP support

# HG changeset patch
# User djm@xxxxxxxxxxxxxxx
# Node ID 44316ce8327754a7a70c80ffff551e7c4619e066
# Parent  f5c4042212b013d7750e5270d98c047c8419e5a7
Baby step toward host SMP support

diff -r f5c4042212b0 -r 44316ce83277 xen/arch/ia64/linux-xen/mm_contig.c
--- a/xen/arch/ia64/linux-xen/mm_contig.c       Tue Aug 30 18:41:54 2005
+++ b/xen/arch/ia64/linux-xen/mm_contig.c       Tue Aug 30 23:51:51 2005
@@ -192,8 +192,8 @@
         */
        if (smp_processor_id() == 0) {
 #ifdef XEN
-               cpu_data = alloc_xenheap_pages(PERCPU_PAGE_SIZE -
-                       PAGE_SIZE + get_order(NR_CPUS));
+               cpu_data = alloc_xenheap_pages(PERCPU_PAGE_SHIFT -
+                       PAGE_SHIFT + get_order(NR_CPUS));
 #else
                cpu_data = __alloc_bootmem(PERCPU_PAGE_SIZE * NR_CPUS,
                                           PERCPU_PAGE_SIZE, 
__pa(MAX_DMA_ADDRESS));
diff -r f5c4042212b0 -r 44316ce83277 xen/arch/ia64/linux-xen/smp.c
--- a/xen/arch/ia64/linux-xen/smp.c     Tue Aug 30 18:41:54 2005
+++ b/xen/arch/ia64/linux-xen/smp.c     Tue Aug 30 23:51:51 2005
@@ -63,7 +63,8 @@
 //Huh? This seems to be used on ia64 even if !CONFIG_SMP
 void smp_send_event_check_mask(cpumask_t mask)
 {
-       dummy();
+       printf("smp_send_event_check_mask called\n");
+       //dummy();
        //send_IPI_mask(cpu_mask, EVENT_CHECK_VECTOR);
 }
 
@@ -378,7 +379,11 @@
 
        /* Can deadlock when called with interrupts disabled */
 #ifdef XEN
-       if (irqs_disabled()) panic("smp_call_function called with interrupts 
disabled\n");
+       if (irqs_disabled()) {
+               printk("smp_call_function called with interrupts disabled...");
+               printk("enabling interrupts\n");
+               local_irq_enable();
+       }
 #else
        WARN_ON(irqs_disabled());
 #endif
@@ -390,11 +395,15 @@
        if (wait)
                atomic_set(&data.finished, 0);
 
+       printk("smp_call_function: about to spin_lock \n");
        spin_lock(&call_lock);
+       printk("smp_call_function: done with spin_lock \n");
 
        call_data = &data;
        mb();   /* ensure store to call_data precedes setting of IPI_CALL_FUNC 
*/
+       printk("smp_call_function: about to send_IPI \n");
        send_IPI_allbutself(IPI_CALL_FUNC);
+       printk("smp_call_function: done with send_IPI \n");
 
        /* Wait for response */
        while (atomic_read(&data.started) != cpus)
@@ -405,7 +414,9 @@
                        cpu_relax();
        call_data = NULL;
 
+       printk("smp_call_function: about to spin_unlock \n");
        spin_unlock(&call_lock);
+       printk("smp_call_function: DONE WITH spin_unlock, returning \n");
        return 0;
 }
 EXPORT_SYMBOL(smp_call_function);
diff -r f5c4042212b0 -r 44316ce83277 xen/arch/ia64/linux-xen/smpboot.c
--- a/xen/arch/ia64/linux-xen/smpboot.c Tue Aug 30 18:41:54 2005
+++ b/xen/arch/ia64/linux-xen/smpboot.c Tue Aug 30 23:51:51 2005
@@ -68,7 +68,8 @@
 
 #ifdef CONFIG_SMP /* ifdef XEN */
 
-#define SMP_DEBUG 0
+//#define SMP_DEBUG 0
+#define SMP_DEBUG 1
 
 #if SMP_DEBUG
 #define Dprintk(x...)  printk(x)
diff -r f5c4042212b0 -r 44316ce83277 xen/arch/ia64/vcpu.c
--- a/xen/arch/ia64/vcpu.c      Tue Aug 30 18:41:54 2005
+++ b/xen/arch/ia64/vcpu.c      Tue Aug 30 23:51:51 2005
@@ -586,6 +586,7 @@
        PSCB(vcpu,pending_interruption) = 1;
     }
 
+#if 0
     /* Keir: I think you should unblock when an interrupt is pending. */
     {
         int running = test_bit(_VCPUF_running, &vcpu->vcpu_flags);
@@ -593,6 +594,7 @@
         if ( running )
             smp_send_event_check_cpu(vcpu->processor);
     }
+#endif
 }
 
 void early_tick(VCPU *vcpu)
diff -r f5c4042212b0 -r 44316ce83277 xen/arch/ia64/xenmisc.c
--- a/xen/arch/ia64/xenmisc.c   Tue Aug 30 18:41:54 2005
+++ b/xen/arch/ia64/xenmisc.c   Tue Aug 30 23:51:51 2005
@@ -28,7 +28,12 @@
 void ia64_mca_cpu_init(void *x) { }
 void ia64_patch_mckinley_e9(unsigned long a, unsigned long b) { }
 void ia64_patch_vtop(unsigned long a, unsigned long b) { }
-void hpsim_setup(char **x) { }
+void hpsim_setup(char **x)
+{
+#ifdef CONFIG_SMP
+       init_smp_config();
+#endif
+}
 
 // called from mem_init... don't think s/w I/O tlb is needed in Xen
 //void swiotlb_init(void) { }  ...looks like it IS needed
diff -r f5c4042212b0 -r 44316ce83277 xen/arch/ia64/xensetup.c
--- a/xen/arch/ia64/xensetup.c  Tue Aug 30 18:41:54 2005
+++ b/xen/arch/ia64/xensetup.c  Tue Aug 30 23:51:51 2005
@@ -260,6 +260,41 @@
 printk("About to call ac_timer_init()\n");
     ac_timer_init();
 // init_xen_time(); ???
+
+#ifdef CONFIG_SMP
+    if ( opt_nosmp )
+    {
+        max_cpus = 0;
+        smp_num_siblings = 1;
+        //boot_cpu_data.x86_num_cores = 1;
+    }
+
+    smp_prepare_cpus(max_cpus);
+
+    /* We aren't hotplug-capable yet. */
+    //BUG_ON(!cpus_empty(cpu_present_map));
+    for_each_cpu ( i )
+        cpu_set(i, cpu_present_map);
+
+    //BUG_ON(!local_irq_is_enabled());
+
+printk("num_online_cpus=%d, max_cpus=%d\n",num_online_cpus(),max_cpus);
+    for_each_present_cpu ( i )
+    {
+        if ( num_online_cpus() >= max_cpus )
+            break;
+        if ( !cpu_online(i) ) {
+printk("About to call __cpu_up(%d)\n",i);
+            __cpu_up(i);
+       }
+    }
+
+    printk("Brought up %ld CPUs\n", (long)num_online_cpus());
+    smp_cpus_done(max_cpus);
+#endif
+
+
+       // FIXME: Should the following be swapped and moved later?
     schedulers_start();
     do_initcalls();
 printk("About to call sort_main_extable()\n");

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] Baby step toward host SMP support, Xen patchbot -unstable <=