debuggers.hg
changeset 17109:7823534b28ca
[IA64] 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@jp.fujitsu.com>
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@jp.fujitsu.com>
author | Alex Williamson <alex.williamson@hp.com> |
---|---|
date | Wed Feb 06 11:23:16 2008 -0700 (2008-02-06) |
parents | 741ac532eb79 |
children | e3e8bdb5d52d |
files | xen/arch/ia64/xen/domain.c xen/arch/ia64/xen/vhpt.c xen/include/asm-ia64/tlbflush.h |
line diff
1.1 --- a/xen/arch/ia64/xen/domain.c Thu Feb 07 09:19:53 2008 -0700 1.2 +++ b/xen/arch/ia64/xen/domain.c Wed Feb 06 11:23:16 2008 -0700 1.3 @@ -1785,7 +1785,7 @@ int shadow_mode_control(struct domain *d 1.4 v->arch.shadow_bitmap = d->arch.shadow_bitmap; 1.5 /* Flush vhtp and tlb to enable dirty bit 1.6 virtualization. */ 1.7 - domain_flush_tlb_vhpt(d); 1.8 + flush_tlb_for_log_dirty(d); 1.9 } 1.10 break; 1.11 1.12 @@ -1824,6 +1824,7 @@ int shadow_mode_control(struct domain *d 1.13 1.14 memset((uint8_t *)d->arch.shadow_bitmap + i, 0, size); 1.15 } 1.16 + flush_tlb_for_log_dirty(d); 1.17 1.18 break; 1.19 }
2.1 --- a/xen/arch/ia64/xen/vhpt.c Thu Feb 07 09:19:53 2008 -0700 2.2 +++ b/xen/arch/ia64/xen/vhpt.c Wed Feb 06 11:23:16 2008 -0700 2.3 @@ -521,6 +521,31 @@ void domain_flush_tlb_vhpt(struct domain 2.4 cpus_clear (d->domain_dirty_cpumask); 2.5 } 2.6 2.7 +void flush_tlb_for_log_dirty(struct domain *d) 2.8 +{ 2.9 + struct vcpu *v; 2.10 + 2.11 + /* NB. There is no race because all vcpus are paused. */ 2.12 + if (is_hvm_domain(d)) { 2.13 + for_each_vcpu (d, v) { 2.14 + /* XXX: local_flush_tlb_all is called redundantly */ 2.15 + thash_purge_all(v); 2.16 + } 2.17 + smp_call_function((void (*)(void *))local_flush_tlb_all, 2.18 + NULL, 1, 1); 2.19 + } else if (HAS_PERVCPU_VHPT(d)) { 2.20 + for_each_vcpu (d, v) { 2.21 + vcpu_purge_tr_entry(&PSCBX(v,dtlb)); 2.22 + vcpu_purge_tr_entry(&PSCBX(v,itlb)); 2.23 + vcpu_vhpt_flush(v); 2.24 + } 2.25 + on_each_cpu((void (*)(void *))local_flush_tlb_all, NULL, 1, 1); 2.26 + } else { 2.27 + on_each_cpu((void (*)(void *))flush_tlb_vhpt_all, d, 1, 1); 2.28 + } 2.29 + cpus_clear (d->domain_dirty_cpumask); 2.30 +} 2.31 + 2.32 void flush_tlb_mask(cpumask_t mask) 2.33 { 2.34 int cpu;
3.1 --- a/xen/include/asm-ia64/tlbflush.h Thu Feb 07 09:19:53 2008 -0700 3.2 +++ b/xen/include/asm-ia64/tlbflush.h Wed Feb 06 11:23:16 2008 -0700 3.3 @@ -34,6 +34,9 @@ void domain_flush_vtlb_track_entry(struc 3.4 /* Flush vhpt and mTLB on every dirty cpus. */ 3.5 void domain_flush_tlb_vhpt(struct domain *d); 3.6 3.7 +/* Flush vhpt and mTLB for log-dirty mode. */ 3.8 +void flush_tlb_for_log_dirty(struct domain *d); 3.9 + 3.10 /* Flush v-tlb on cpus set in mask for current domain. */ 3.11 void flush_tlb_mask(cpumask_t mask); 3.12