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] Fix migration for SMP guests with 1 vcpu.

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] Fix migration for SMP guests with 1 vcpu.
From: Xen patchbot -unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Tue, 02 Aug 2005 19:14:10 -0400
Delivery-date: Tue, 02 Aug 2005 23:14:39 +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 cl349@xxxxxxxxxxxxxxxxxxxx
# Node ID 1032271a0abf3f11946e4d5b312560845d2baaed
# Parent  3cde4433ecdac12dee23132a47435b6af0b9dc30
Fix migration for SMP guests with 1 vcpu.
Free/setup timer irq on suspend/restore.
Only tested to localhost.  Also add initial code for >1 vcpu guests.
Signed-off-by: Christian Limpach <Christian.Limpach@xxxxxxxxxxxx>

diff -r 3cde4433ecda -r 1032271a0abf 
linux-2.6-xen-sparse/arch/xen/i386/kernel/smpboot.c
--- a/linux-2.6-xen-sparse/arch/xen/i386/kernel/smpboot.c       Tue Aug  2 
19:19:16 2005
+++ b/linux-2.6-xen-sparse/arch/xen/i386/kernel/smpboot.c       Tue Aug  2 
23:13:13 2005
@@ -1560,10 +1560,14 @@
 
 void smp_suspend(void)
 {
+       /* XXX todo: take down time and ipi's on all cpus */
+       local_teardown_timer_irq();
        smp_intr_exit();
 }
 
 void smp_resume(void)
 {
+       /* XXX todo: restore time and ipi's on all cpus */
        smp_intr_init();
-}
+       local_setup_timer_irq();
+}
diff -r 3cde4433ecda -r 1032271a0abf 
linux-2.6-xen-sparse/arch/xen/i386/kernel/time.c
--- a/linux-2.6-xen-sparse/arch/xen/i386/kernel/time.c  Tue Aug  2 19:19:16 2005
+++ b/linux-2.6-xen-sparse/arch/xen/i386/kernel/time.c  Tue Aug  2 23:13:13 2005
@@ -860,6 +860,8 @@
 void time_suspend(void)
 {
        /* nothing */
+       teardown_irq(per_cpu(timer_irq, 0), &irq_timer);
+       unbind_virq_from_irq(VIRQ_TIMER);
 }
 
 /* No locking required. We are only CPU running, and interrupts are off. */
@@ -874,10 +876,25 @@
        processed_system_time =
                per_cpu(shadow_time, smp_processor_id()).system_timestamp;
        per_cpu(processed_system_time, 0) = processed_system_time;
+
+       per_cpu(timer_irq, 0) = bind_virq_to_irq(VIRQ_TIMER);
+       (void)setup_irq(per_cpu(timer_irq, 0), &irq_timer);
 }
 
 #ifdef CONFIG_SMP
 static char timer_name[NR_CPUS][15];
+void local_setup_timer_irq(void)
+{
+       int cpu = smp_processor_id();
+
+       if (cpu == 0)
+               return;
+       per_cpu(timer_irq, cpu) = bind_virq_to_irq(VIRQ_TIMER);
+       sprintf(timer_name[cpu], "timer%d", cpu);
+       BUG_ON(request_irq(per_cpu(timer_irq, cpu), timer_interrupt,
+                          SA_INTERRUPT, timer_name[cpu], NULL));
+}
+
 void local_setup_timer(void)
 {
        int seq, cpu = smp_processor_id();
@@ -888,10 +905,17 @@
                        per_cpu(shadow_time, cpu).system_timestamp;
        } while (read_seqretry(&xtime_lock, seq));
 
-       per_cpu(timer_irq, cpu) = bind_virq_to_irq(VIRQ_TIMER);
-       sprintf(timer_name[cpu], "timer%d", cpu);
-       BUG_ON(request_irq(per_cpu(timer_irq, cpu), timer_interrupt,
-                          SA_INTERRUPT, timer_name[cpu], NULL));
+       local_setup_timer_irq();
+}
+
+void local_teardown_timer_irq(void)
+{
+       int cpu = smp_processor_id();
+
+       if (cpu == 0)
+               return;
+       free_irq(per_cpu(timer_irq, cpu), NULL);
+       unbind_virq_from_irq(VIRQ_TIMER);
 }
 #endif
 

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] Fix migration for SMP guests with 1 vcpu., Xen patchbot -unstable <=