[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [IA64] Fix domain reboot bug



# HG changeset patch
# User awilliam@xxxxxxxxxxx
# Node ID 6796157b5f8a8cd0ffcdb81a794b228e6314ae3b
# Parent  a40e66748ee96d2120f84baccdf552c0d6e505fa
[IA64] Fix domain reboot bug

Actually domain reboot issue is not caused by our previous patch 
to solve schedule_tail, which instead helps to find a severe HOST_SMP 
plus domain destroy bug.

The major reason is that currently VHPT table for dom0/domU is per LP, 
while domain destroy only issues vhpt_flush on current LP (dom0 is running). 
So VHPT table is not flushed on the LP that destroyed domU is running. 

The mechanism of domain reboot is to kill current domain and create a new 
domain with same configuration. Since region id recycle is added last time 
with domain destroy support, the new created domain will inherit same 
region id as previous one. Under this case, the stale entries in 
VHPT table will make new domU halt.

Before applying our schedule_tail patch, domU will keep same pta 
value as idle domain when first created where vhpt walker is disabled. 
Because we use bvt as default scheduler, context switch never happens 
as long as domU is runnable. That means domU will have vhpt DISABLED 
in whole life cycle. So even vhpt on that LP is not flushed, domU 
still runs correctly.

So we need to send IPI to target LP to flush right vhpt table. Especially, 
based on our previous patch for schedule_tail, domU can get performance 
gain by enabling vhpt walker.

Signed-off-by: Zhang xiantao <xiantao.zhang@xxxxxxxxx>
Signed-off-by: Kevin Tian    <kevin.tian@xxxxxxxxx>

diff -r a40e66748ee9 -r 6796157b5f8a xen/arch/ia64/linux-xen/smp.c
--- a/xen/arch/ia64/linux-xen/smp.c     Thu Mar 30 12:40:24 2006 -0700
+++ b/xen/arch/ia64/linux-xen/smp.c     Thu Mar 30 12:41:48 2006 -0700
@@ -47,6 +47,7 @@
 #include <asm/tlbflush.h>
 #include <asm/unistd.h>
 #include <asm/mca.h>
+#include <asm/vhpt.h>
 #ifdef XEN
 #include <asm/hw_irq.h>
 #endif
@@ -289,6 +290,11 @@ smp_flush_tlb_all (void)
 smp_flush_tlb_all (void)
 {
        on_each_cpu((void (*)(void *))local_flush_tlb_all, NULL, 1, 1);
+}
+void
+smp_vhpt_flush_all(void)
+{
+    on_each_cpu((void (*)(void *))vhpt_flush, NULL, 1, 1);
 }
 
 #ifndef XEN
diff -r a40e66748ee9 -r 6796157b5f8a xen/arch/ia64/xen/domain.c
--- a/xen/arch/ia64/xen/domain.c        Thu Mar 30 12:40:24 2006 -0700
+++ b/xen/arch/ia64/xen/domain.c        Thu Mar 30 12:41:48 2006 -0700
@@ -106,7 +106,7 @@ void arch_domain_destroy(struct domain *
        flush_tlb_all();
 
        /* It is really good in this? */
-       vhpt_flush();
+       vhpt_flush_all();
 }
 
 static void default_idle(void)
diff -r a40e66748ee9 -r 6796157b5f8a xen/arch/ia64/xen/vhpt.c
--- a/xen/arch/ia64/xen/vhpt.c  Thu Mar 30 12:40:24 2006 -0700
+++ b/xen/arch/ia64/xen/vhpt.c  Thu Mar 30 12:41:48 2006 -0700
@@ -20,7 +20,7 @@ DEFINE_PER_CPU (unsigned long, vhpt_pend
 
 void vhpt_flush(void)
 {
-       struct vhpt_lf_entry *v = (void *)VHPT_ADDR;
+       struct vhpt_lf_entry *v =__va(__ia64_per_cpu_var(vhpt_paddr));
        int i;
 #if 0
 static int firsttime = 2;
diff -r a40e66748ee9 -r 6796157b5f8a xen/include/asm-ia64/vhpt.h
--- a/xen/include/asm-ia64/vhpt.h       Thu Mar 30 12:40:24 2006 -0700
+++ b/xen/include/asm-ia64/vhpt.h       Thu Mar 30 12:41:48 2006 -0700
@@ -16,6 +16,12 @@
 
 #define        VHPT_PAGE_SHIFT                 VHPT_SIZE_LOG2
 
+
+#ifdef CONFIG_SMP
+# define vhpt_flush_all()      smp_vhpt_flush_all()
+#else
+# define vhpt_flush_all()   vhpt_flush()
+#endif
 // FIXME: These should be automatically generated
 
 #define        VLE_PGFLAGS_OFFSET              0

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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.