On Fri, Oct 23, 2015 at 01:59:46AM -0600, Jan Beulich wrote:
> >>> On 23.10.15 at 09:44, <haozhong.zh...@intel.com> wrote:
> > On Thu, Oct 22, 2015 at 07:13:07AM -0600, Jan Beulich wrote:
> >> >>> On 28.09.15 at 09:13, <haozhong.zh...@intel.com> wrote:
> 
> Please remember to trim your replies.
> 
> >> > @@ -2023,6 +2051,9 @@ static int hvm_load_cpu_ctxt(struct domain *d, 
> >> > hvm_domain_context_t *h)
> >> >      if ( hvm_funcs.load_cpu_ctxt(v, &ctxt) < 0 )
> >> >          return -EINVAL;
> >> >  
> >> > +    if ( !v->domain->arch.vtsc && hvm_funcs.tsc_scaling_supported )
> >> > +        hvm_setup_tsc_scaling(v);
> >> 
> >> What's the rationale for putting it in this function?
> > 
> > hvm_load_cpu_ctxt() is called in the migration to restore vcpu's state
> > including TSC related things, so hvm_setup_tsc_scaling() is called
> > here.
> > 
> > hvm_vcpu_reset_state() is not called in the migration, so we cannot
> > rely on the call to hvm_setup_tsc_scaling() there.
> 
> All that is understood, but doesn't explain why the scaling setup gets
> done here instead of somewhere after _all_ state got loaded.
>
> Jan
> 

Because vcpu is waken up at the end of hvm_vcpu_reset_state(), the
setup of TSC scaling should be done before that.

Haozhong

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

Reply via email to