ia64/xen-unstable

changeset 10381:d33add81096b

[IA64] let VMM do itc sync for guest on VTI domain

Previously, on SMP VTI-domain, Guest OS was responsible for
syncing itc by calling ia64_sync_itc, but the round trip may
be very large on VTI domain, that may cause guest itcs are
not synced well and cause guest wall clock is not accurate.

This patch intends to fix this issue, when guest wants to sync
itc( vcpus other than vcpu0 write itc), VMM directly get vcpu0
itc for other vcpus.

Signed-off-by: Anthony Xu <anthony.xu@intel.com>
author awilliam@xenbuild.aw
date Wed Jun 14 16:05:45 2006 -0600 (2006-06-14)
parents d0a77e90eaa3
children 11f228aa783a
files xen/arch/ia64/vmx/vlsapic.c
line diff
     1.1 --- a/xen/arch/ia64/vmx/vlsapic.c	Wed Jun 14 16:05:44 2006 -0600
     1.2 +++ b/xen/arch/ia64/vmx/vlsapic.c	Wed Jun 14 16:05:45 2006 -0600
     1.3 @@ -140,8 +140,6 @@ uint64_t vtm_get_itc(VCPU *vcpu)
     1.4  }
     1.5  
     1.6  
     1.7 -
     1.8 -
     1.9  void vtm_set_itc(VCPU *vcpu, uint64_t new_itc)
    1.10  {
    1.11      uint64_t    vitm, vitv;
    1.12 @@ -149,8 +147,15 @@ void vtm_set_itc(VCPU *vcpu, uint64_t ne
    1.13      vitm = VCPU(vcpu,itm);
    1.14      vitv = VCPU(vcpu,itv);
    1.15      vtm=&(vcpu->arch.arch_vmx.vtm);
    1.16 -    vtm->vtm_offset = new_itc - ia64_get_itc();
    1.17 -    vtm->last_itc = new_itc;
    1.18 +    if(vcpu->vcpu_id == 0){
    1.19 +        vtm->vtm_offset = new_itc - ia64_get_itc();
    1.20 +        vtm->last_itc = new_itc;
    1.21 +    }
    1.22 +    else{
    1.23 +        vtm->vtm_offset = vcpu->domain->vcpu[0]->arch.arch_vmx.vtm.vtm_offset;
    1.24 +        new_itc=vtm->vtm_offset + ia64_get_itc();
    1.25 +        vtm->last_itc = new_itc;
    1.26 +    }
    1.27      if(vitm < new_itc){
    1.28          clear_bit(ITV_VECTOR(vitv), &VCPU(vcpu, irr[0]));
    1.29          stop_timer(&vtm->vtm_timer);