debuggers.hg

changeset 20672:2d072636c4f8

Pvrdtscp: move write_rdtscp_aux() to paravirt_ctxt_switch_to() -
Currently write_rdtscp_aux() is placed in update_vcpu_system_time(),
which is called by schedule() before context_switch(). This will break
the HVM guest TSC_AUX state because at this point, MSR hasn't beed
saved for HVM guests.So put the function in the point when a PV vcpu
is really scheduled in.

Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
author Keir Fraser <keir.fraser@citrix.com>
date Mon Dec 14 07:45:04 2009 +0000 (2009-12-14)
parents b928797213ac
children c61953922215
files xen/arch/x86/domain.c xen/arch/x86/time.c
line diff
     1.1 --- a/xen/arch/x86/domain.c	Fri Dec 11 09:17:09 2009 +0000
     1.2 +++ b/xen/arch/x86/domain.c	Mon Dec 14 07:45:04 2009 +0000
     1.3 @@ -1298,6 +1298,10 @@ static void paravirt_ctxt_switch_to(stru
     1.4          write_debugreg(6, v->arch.guest_context.debugreg[6]);
     1.5          write_debugreg(7, v->arch.guest_context.debugreg[7]);
     1.6      }
     1.7 +
     1.8 +    if ( (v->domain->arch.tsc_mode ==  TSC_MODE_PVRDTSCP) &&
     1.9 +         boot_cpu_has(X86_FEATURE_RDTSCP) )
    1.10 +        write_rdtscp_aux(v->domain->arch.incarnation);
    1.11  }
    1.12  
    1.13  /* Update per-VCPU guest runstate shared memory area (if registered). */
     2.1 --- a/xen/arch/x86/time.c	Fri Dec 11 09:17:09 2009 +0000
     2.2 +++ b/xen/arch/x86/time.c	Mon Dec 14 07:45:04 2009 +0000
     2.3 @@ -832,10 +832,6 @@ static void __update_vcpu_system_time(st
     2.4      else
     2.5          tsc_stamp = t->local_tsc_stamp;
     2.6  
     2.7 -    if ( (d->arch.tsc_mode ==  TSC_MODE_PVRDTSCP) &&
     2.8 -         boot_cpu_has(X86_FEATURE_RDTSCP) )
     2.9 -        write_rdtscp_aux(d->arch.incarnation);
    2.10 -
    2.11      /* Don't bother unless timestamps have changed or we are forced. */
    2.12      if ( !force && (u->tsc_timestamp == tsc_stamp) )
    2.13          return;