ia64/xen-unstable

changeset 9481:6796157b5f8a

[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@intel.com>
Signed-off-by: Kevin Tian <kevin.tian@intel.com>
author awilliam@xenbuild.aw
date Thu Mar 30 12:41:48 2006 -0700 (2006-03-30)
parents a40e66748ee9
children 0665256a7a53
files xen/arch/ia64/linux-xen/smp.c xen/arch/ia64/xen/domain.c xen/arch/ia64/xen/vhpt.c xen/include/asm-ia64/vhpt.h
line diff
     1.1 --- a/xen/arch/ia64/linux-xen/smp.c	Thu Mar 30 12:40:24 2006 -0700
     1.2 +++ b/xen/arch/ia64/linux-xen/smp.c	Thu Mar 30 12:41:48 2006 -0700
     1.3 @@ -47,6 +47,7 @@
     1.4  #include <asm/tlbflush.h>
     1.5  #include <asm/unistd.h>
     1.6  #include <asm/mca.h>
     1.7 +#include <asm/vhpt.h>
     1.8  #ifdef XEN
     1.9  #include <asm/hw_irq.h>
    1.10  #endif
    1.11 @@ -290,6 +291,11 @@ smp_flush_tlb_all (void)
    1.12  {
    1.13  	on_each_cpu((void (*)(void *))local_flush_tlb_all, NULL, 1, 1);
    1.14  }
    1.15 +void
    1.16 +smp_vhpt_flush_all(void)
    1.17 +{
    1.18 +    on_each_cpu((void (*)(void *))vhpt_flush, NULL, 1, 1);
    1.19 +}
    1.20  
    1.21  #ifndef XEN
    1.22  void
     2.1 --- a/xen/arch/ia64/xen/domain.c	Thu Mar 30 12:40:24 2006 -0700
     2.2 +++ b/xen/arch/ia64/xen/domain.c	Thu Mar 30 12:41:48 2006 -0700
     2.3 @@ -106,7 +106,7 @@ void arch_domain_destroy(struct domain *
     2.4  	flush_tlb_all();
     2.5  
     2.6  	/* It is really good in this? */
     2.7 -	vhpt_flush();
     2.8 +	vhpt_flush_all();
     2.9  }
    2.10  
    2.11  static void default_idle(void)
     3.1 --- a/xen/arch/ia64/xen/vhpt.c	Thu Mar 30 12:40:24 2006 -0700
     3.2 +++ b/xen/arch/ia64/xen/vhpt.c	Thu Mar 30 12:41:48 2006 -0700
     3.3 @@ -20,7 +20,7 @@ DEFINE_PER_CPU (unsigned long, vhpt_pend
     3.4  
     3.5  void vhpt_flush(void)
     3.6  {
     3.7 -	struct vhpt_lf_entry *v = (void *)VHPT_ADDR;
     3.8 +	struct vhpt_lf_entry *v =__va(__ia64_per_cpu_var(vhpt_paddr));
     3.9  	int i;
    3.10  #if 0
    3.11  static int firsttime = 2;
     4.1 --- a/xen/include/asm-ia64/vhpt.h	Thu Mar 30 12:40:24 2006 -0700
     4.2 +++ b/xen/include/asm-ia64/vhpt.h	Thu Mar 30 12:41:48 2006 -0700
     4.3 @@ -16,6 +16,12 @@
     4.4  
     4.5  #define	VHPT_PAGE_SHIFT			VHPT_SIZE_LOG2
     4.6  
     4.7 +
     4.8 +#ifdef CONFIG_SMP
     4.9 +# define vhpt_flush_all()	smp_vhpt_flush_all()
    4.10 +#else
    4.11 +# define vhpt_flush_all()   vhpt_flush()
    4.12 +#endif
    4.13  // FIXME: These should be automatically generated
    4.14  
    4.15  #define	VLE_PGFLAGS_OFFSET		0