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 previous changeset: idle domains were not initialisi

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] Fix previous changeset: idle domains were not initialising correctly.
From: BitKeeper Bot <riel@xxxxxxxxxxx>
Date: Thu, 28 Apr 2005 21:32:15 +0000
Delivery-date: Thu, 28 Apr 2005 22:03:46 +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 Development List <xen-devel@xxxxxxxxxxxxxxxxxxx>
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
ChangeSet 1.1394.1.2, 2005/04/28 22:32:15+01:00, kaf24@xxxxxxxxxxxxxxxxxxxx

        Fix previous changeset: idle domains were not initialising correctly.
        Signed-off-by: Keir Fraser <keir@xxxxxxxxxxxxx>



 domain.c |   60 ++++++++++++++++++++++++++++++++----------------------------
 1 files changed, 32 insertions(+), 28 deletions(-)


diff -Nru a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c
--- a/xen/arch/x86/domain.c     2005-04-28 18:04:11 -04:00
+++ b/xen/arch/x86/domain.c     2005-04-28 18:04:11 -04:00
@@ -50,6 +50,16 @@
 } __cacheline_aligned;
 static struct percpu_ctxt percpu_ctxt[NR_CPUS];
 
+static void continue_idle_task(struct exec_domain *ed)
+{
+    reset_stack_and_jump(idle_loop);
+}
+
+static void continue_nonidle_task(struct exec_domain *ed)
+{
+    reset_stack_and_jump(ret_from_intr);
+}
+
 static void default_idle(void)
 {
     local_irq_disable();
@@ -74,24 +84,32 @@
     }
 }
 
+static void __startup_cpu_idle_loop(struct exec_domain *ed)
+{
+    /* Signal to boot CPU that we are done. */
+    init_idle();
+
+    /* Start normal idle loop. */
+    ed->arch.schedule_tail = continue_idle_task;
+    reset_stack_and_jump(idle_loop);
+}
+
 void startup_cpu_idle_loop(void)
 {
+    struct exec_domain *ed = current;
+
     /* Just some sanity to ensure that the scheduler is set up okay. */
-    ASSERT(current->domain->id == IDLE_DOMAIN_ID);
-    percpu_ctxt[smp_processor_id()].curr_ed = current;
-    set_bit(smp_processor_id(), &current->domain->cpuset);
-    domain_unpause_by_systemcontroller(current->domain);
+    ASSERT(ed->domain->id == IDLE_DOMAIN_ID);
+    percpu_ctxt[smp_processor_id()].curr_ed = ed;
+    set_bit(smp_processor_id(), &ed->domain->cpuset);
+    domain_unpause_by_systemcontroller(ed->domain);
+
+    ed->arch.schedule_tail = __startup_cpu_idle_loop;
     raise_softirq(SCHEDULE_SOFTIRQ);
     do_softirq();
 
-    /*
-     * Declares CPU setup done to the boot processor.
-     * Therefore memory barrier to ensure state is visible.
-     */
-    smp_mb();
-    init_idle();
-
-    idle_loop();
+    /* End up in __startup_cpu_idle_loop, not here. */
+    BUG();
 }
 
 static long no_idt[2];
@@ -219,16 +237,6 @@
 #endif
 }
 
-static void continue_idle_task(struct exec_domain *ed)
-{
-    reset_stack_and_jump(idle_loop);
-}
-
-static void continue_nonidle_task(struct exec_domain *ed)
-{
-    reset_stack_and_jump(ret_from_intr);
-}
-
 void arch_do_createdomain(struct exec_domain *ed)
 {
     struct domain *d = ed->domain;
@@ -237,11 +245,7 @@
 
     ed->arch.flags = TF_kernel_mode;
 
-    if ( d->id == IDLE_DOMAIN_ID )
-    {
-        ed->arch.schedule_tail = continue_idle_task;
-    }
-    else
+    if ( d->id != IDLE_DOMAIN_ID )
     {
         ed->arch.schedule_tail = continue_nonidle_task;
 
@@ -657,7 +661,7 @@
 
 long do_switch_to_user(void)
 {
-    struct cpu_user_regs       *regs = get_cpu_user_regs();
+    struct cpu_user_regs  *regs = get_cpu_user_regs();
     struct switch_to_user  stu;
     struct exec_domain    *ed = current;
 

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] Fix previous changeset: idle domains were not initialising correctly., BitKeeper Bot <=