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

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

To: xen-ia64-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-ia64-devel] [PATCH] fix shadow_op hypercall
From: Kouya Shimura <kouya@xxxxxxxxxxxxxx>
Date: Wed, 6 Feb 2008 19:55:48 +0900
Delivery-date: Wed, 06 Feb 2008 03:01:24 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
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/cgi-bin/mailman/listinfo/xen-ia64-devel>, <mailto:xen-ia64-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-ia64-devel>, <mailto:xen-ia64-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-ia64-devel-bounces@xxxxxxxxxxxxxxxxxxx
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
<Prev in Thread] Current Thread [Next in Thread>