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

[Xen-ia64-devel] [PATCH] fix shadow_op hypercall



Fix SHADOW_OP_ENABLE_LOGDIRTY and SHADOW_OP_CLEAN hypercall.

Live migation doesn't work because the VHPT is not flushed.

Signed-off-by: Kouya Shimura <kouya@xxxxxxxxxxxxxx>

# HG changeset patch
# User Kouya Shimura <kouya@xxxxxxxxxxxxxx>
# Date 1202293305 -32400
# Node ID 6b89a0f027c2b438d1f369cce0bc670cda1390d9
# Parent  e83d2b840e88223a92f8473b23ae57876e298fc8
Live migation doesn't work because the VHPT is not flushed.

diff -r e83d2b840e88 -r 6b89a0f027c2 xen/arch/ia64/xen/domain.c
--- a/xen/arch/ia64/xen/domain.c        Tue Feb 05 09:36:48 2008 -0700
+++ b/xen/arch/ia64/xen/domain.c        Wed Feb 06 19:21:45 2008 +0900
@@ -1785,7 +1785,7 @@ int shadow_mode_control(struct domain *d
                                v->arch.shadow_bitmap = d->arch.shadow_bitmap;
                        /* Flush vhtp and tlb to enable dirty bit
                           virtualization.  */
-                       domain_flush_tlb_vhpt(d);
+                       flush_tlb_for_log_dirty(d);
                }
                break;
 
@@ -1824,6 +1824,7 @@ int shadow_mode_control(struct domain *d
 
                        memset((uint8_t *)d->arch.shadow_bitmap + i, 0, size);
                }
+               flush_tlb_for_log_dirty(d);
                
                break;
          }
diff -r e83d2b840e88 -r 6b89a0f027c2 xen/arch/ia64/xen/vhpt.c
--- a/xen/arch/ia64/xen/vhpt.c  Tue Feb 05 09:36:48 2008 -0700
+++ b/xen/arch/ia64/xen/vhpt.c  Wed Feb 06 19:21:45 2008 +0900
@@ -521,6 +521,30 @@ void domain_flush_tlb_vhpt(struct domain
        cpus_clear (d->domain_dirty_cpumask);
 }
 
+void flush_tlb_for_log_dirty(struct domain *d)
+{
+       struct vcpu *v;
+
+       /* NB. There is no race because all vcpus are paused. */
+       if (is_hvm_domain(d)) {
+               for_each_vcpu (d, v) {
+                       /* XXX: local_flush_tlb_all is called redundantly */
+                       thash_purge_all(v);
+               }
+               smp_call_function((void (*)(void *))local_flush_tlb_all, 
+                                       NULL, 1, 1);
+       } else if (HAS_PERVCPU_VHPT(d)) {
+               for_each_vcpu (d, v) {
+                       vcpu_purge_tr_entry(&PSCBX(v,dtlb));
+                       vcpu_purge_tr_entry(&PSCBX(v,itlb));
+                       vcpu_vhpt_flush(v);
+               }
+               on_each_cpu((void (*)(void *))local_flush_tlb_all, NULL, 1, 1);
+       } else
+               on_each_cpu((void (*)(void *))flush_tlb_vhpt_all, d, 1, 1);
+       cpus_clear (d->domain_dirty_cpumask);
+}
+
 void flush_tlb_mask(cpumask_t mask)
 {
     int cpu;
diff -r e83d2b840e88 -r 6b89a0f027c2 xen/include/asm-ia64/tlbflush.h
--- a/xen/include/asm-ia64/tlbflush.h   Tue Feb 05 09:36:48 2008 -0700
+++ b/xen/include/asm-ia64/tlbflush.h   Wed Feb 06 19:21:45 2008 +0900
@@ -34,6 +34,9 @@ void domain_flush_vtlb_track_entry(struc
 /* Flush vhpt and mTLB on every dirty cpus.  */
 void domain_flush_tlb_vhpt(struct domain *d);
 
+/* Flush vhpt and mTLB for log-dirty mode.  */
+void flush_tlb_for_log_dirty(struct domain *d);
+
 /* Flush v-tlb on cpus set in mask for current domain.  */
 void flush_tlb_mask(cpumask_t mask);
 
_______________________________________________
Xen-ia64-devel mailing list
Xen-ia64-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-ia64-devel

 


Rackspace

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