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-ia64-devel

Re: [Xen-ia64-devel] [RFC][Patch] fix boot xen-ia64 on some ia64 platfor

To: Isaku Yamahata <yamahata@xxxxxxxxxxxxx>
Subject: Re: [Xen-ia64-devel] [RFC][Patch] fix boot xen-ia64 on some ia64 platforms
From: Akio Takebe <takebe_akio@xxxxxxxxxxxxxx>
Date: Tue, 21 Apr 2009 11:43:59 +0900
Cc: "xen-ia64-devel@xxxxxxxxxxxxxxxxxxx" <xen-ia64-devel@xxxxxxxxxxxxxxxxxxx>
Delivery-date: Mon, 20 Apr 2009 19:44:07 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <20090421021906.GG24626%yamahata@xxxxxxxxxxxxx>
List-help: <mailto:xen-ia64-devel-request@lists.xensource.com?subject=help>
List-id: Discussion of the ia64 port of Xen <xen-ia64-devel.lists.xensource.com>
List-post: <mailto:xen-ia64-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-ia64-devel>, <mailto:xen-ia64-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-ia64-devel>, <mailto:xen-ia64-devel-request@lists.xensource.com?subject=unsubscribe>
References: <49ED20E6.4030500@xxxxxxxxxxxxxx> <20090421021906.GG24626%yamahata@xxxxxxxxxxxxx>
Sender: xen-ia64-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Thunderbird 2.0.0.21 (X11/20090320)
Hi,

Thank you for comments.
Isaku Yamahata wrote:
On Tue, Apr 21, 2009 at 10:27:02AM +0900, Akio Takebe wrote:
Hi,

The following changeset broke booting xen-ia64 on some kinds of ia64 boxes.
http://xenbits.xensource.com/ext/ia64/xen-unstable.hg/rev/3fd8f9b34941

The tasklet_schedule call raise_softirq().
Because raise_softirq() use per_cpu, if we access per_cpu before cpu_init()
the behavior would be unexpected.

I make the following patch for this investigation.
It can boot xen-ia64 on the ia64 boxes.
I'm not sure why Tiger4 can boot the latest xen-ia64.
I didn't find a good-looking solution, what do you think about it?

Unfortunately, it happened to boot on my tiger4 so that I pushed out
the change set.
I Understood the issue. Looking into the boot sequence, it seems
to somewhat difficult to move down init_console() after cpu_init()
and remove all the printk() before cpu_init().
Hmm, it needs some consideration.
I also move some function after cpu_init().
But it failed to boot. So we may need such a early_printk().
I think we should not call tasklet_schedule() before softirq_init() at least on 
x86.
So how about the attached patch?

BTW, is there similar issue on ia64 linux case before?

No, I have not met.

Best Regards,

Akio Takebe

---
diff -r 8c806c66a597 xen/arch/ia64/xen/xensetup.c
--- a/xen/arch/ia64/xen/xensetup.c      Tue Apr 14 14:04:58 2009 +0900
+++ b/xen/arch/ia64/xen/xensetup.c      Tue Apr 21 13:42:26 2009 +0900
@@ -564,9 +564,9 @@ skip_move:

     end_boot_allocator();

+    late_setup_arch(&cmdline);
+
     softirq_init();
-
-    late_setup_arch(&cmdline);

     scheduler_init();
     idle_vcpu[0] = (struct vcpu*) ia64_r13;
diff -r 8c806c66a597 xen/common/softirq.c
--- a/xen/common/softirq.c      Tue Apr 14 14:04:58 2009 +0900
+++ b/xen/common/softirq.c      Tue Apr 21 13:42:26 2009 +0900
@@ -20,7 +20,7 @@ irq_cpustat_t irq_stat[NR_CPUS];
 irq_cpustat_t irq_stat[NR_CPUS];
 #endif

-static softirq_handler softirq_handlers[NR_SOFTIRQS];
+softirq_handler softirq_handlers[NR_SOFTIRQS];

 asmlinkage void do_softirq(void)
 {
diff -r 8c806c66a597 xen/drivers/char/console.c
--- a/xen/drivers/char/console.c        Tue Apr 14 14:04:58 2009 +0900
+++ b/xen/drivers/char/console.c        Tue Apr 21 13:42:26 2009 +0900
@@ -117,6 +117,8 @@ custom_param("loglvl", parse_loglvl);
 custom_param("loglvl", parse_loglvl);
 custom_param("guest_loglvl", parse_guest_loglvl);

+extern softirq_handler softirq_handlers[NR_SOFTIRQS];
+
 static atomic_t print_everything = ATOMIC_INIT(0);

 #define ___parse_loglvl(s, ps, lvlstr, lvlnum)          \
@@ -354,7 +356,10 @@ static long guest_console_write(XEN_GUES
         {
             for ( kptr = kbuf; *kptr != '\0'; kptr++ )
                 putchar_console_ring(*kptr);
-            tasklet_schedule(&notify_dom0_con_ring_tasklet);
+              if (softirq_handlers[TASKLET_SOFTIRQ])
+                tasklet_schedule(&notify_dom0_con_ring_tasklet);
+              else
+                send_guest_global_virq(dom0, VIRQ_CON_RING);
         }

         spin_unlock_irq(&console_lock);
@@ -435,7 +440,10 @@ static void __putstr(const char *str)
     {
         while ( (c = *str++) != '\0' )
             putchar_console_ring(c);
-        tasklet_schedule(&notify_dom0_con_ring_tasklet);
+        if (softirq_handlers[TASKLET_SOFTIRQ])
+            tasklet_schedule(&notify_dom0_con_ring_tasklet);
+       else
+            send_guest_global_virq(dom0, VIRQ_CON_RING);
     }
 }



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