direct-io.hg

changeset 12250:a910bf123e58

[HVM] Initialise AP TSC to same as BP TSC.
Signed-off-by: Keir Fraser <keir@xensource.com>
author kfraser@localhost.localdomain
date Mon Nov 06 15:46:28 2006 +0000 (2006-11-06)
parents 1db00df48218
children 8eb8c0085604
files xen/arch/x86/hvm/hvm.c xen/arch/x86/hvm/vmx/vmcs.c
line diff
     1.1 --- a/xen/arch/x86/hvm/hvm.c	Mon Nov 06 15:40:30 2006 +0000
     1.2 +++ b/xen/arch/x86/hvm/hvm.c	Mon Nov 06 15:46:28 2006 +0000
     1.3 @@ -69,9 +69,9 @@ void hvm_stts(struct vcpu *v)
     1.4  void hvm_set_guest_time(struct vcpu *v, u64 gtime)
     1.5  {
     1.6      u64 host_tsc;
     1.7 -   
     1.8 +
     1.9      rdtscll(host_tsc);
    1.10 -    
    1.11 +
    1.12      v->arch.hvm_vcpu.cache_tsc_offset = gtime - host_tsc;
    1.13      hvm_funcs.set_tsc_offset(v, v->arch.hvm_vcpu.cache_tsc_offset);
    1.14  }
    1.15 @@ -541,6 +541,11 @@ int hvm_bringup_ap(int vcpuid, int tramp
    1.16  
    1.17      hvm_init_ap_context(ctxt, vcpuid, trampoline_vector);
    1.18  
    1.19 +    /* Sync AP's TSC with BSP's. */
    1.20 +    v->arch.hvm_vcpu.cache_tsc_offset =
    1.21 +        v->domain->vcpu[0]->arch.hvm_vcpu.cache_tsc_offset;
    1.22 +    hvm_funcs.set_tsc_offset(v, v->arch.hvm_vcpu.cache_tsc_offset);
    1.23 +
    1.24      LOCK_BIGLOCK(d);
    1.25      rc = -EEXIST;
    1.26      if ( !test_bit(_VCPUF_initialised, &v->vcpu_flags) )
     2.1 --- a/xen/arch/x86/hvm/vmx/vmcs.c	Mon Nov 06 15:40:30 2006 +0000
     2.2 +++ b/xen/arch/x86/hvm/vmx/vmcs.c	Mon Nov 06 15:46:28 2006 +0000
     2.3 @@ -285,19 +285,6 @@ static void vmx_set_host_env(struct vcpu
     2.4      error |= __vmwrite(HOST_RSP, (unsigned long)get_stack_bottom());
     2.5  }
     2.6  
     2.7 -#if 0
     2.8 -static void vmx_do_launch(struct vcpu *v)
     2.9 -{
    2.10 -    if ( v->vcpu_id != 0 )
    2.11 -    {
    2.12 -        /* Sync AP's TSC with BSP's */
    2.13 -        v->arch.hvm_vcpu.cache_tsc_offset = 
    2.14 -            v->domain->vcpu[0]->arch.hvm_vcpu.cache_tsc_offset;
    2.15 -        hvm_funcs.set_tsc_offset(v, v->arch.hvm_vcpu.cache_tsc_offset);
    2.16 -    }
    2.17 -}
    2.18 -#endif
    2.19 -
    2.20  static int construct_vmcs(struct vcpu *v)
    2.21  {
    2.22      int error = 0;