[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH v6 2/5] x86/hvm: Replace architecture TSC scaling by a common function



On 02/29/16 06:44, Jan Beulich wrote:
> >>> On 28.02.16 at 13:54, <haozhong.zhang@xxxxxxxxx> wrote:
> > --- a/xen/arch/x86/hvm/hvm.c
> > +++ b/xen/arch/x86/hvm/hvm.c
> > @@ -333,6 +333,23 @@ u64 hvm_get_tsc_scaling_ratio(u32 gtsc_khz)
> >      return ratio > max_ratio ? 0 : ratio;
> >  }
> >  
> > +u64 hvm_scale_tsc(const struct domain *d, u64 tsc)
> > +{
> > +    u64 ratio = d->arch.hvm_domain.tsc_scaling_ratio;
> > +    u64 dummy;
> > +
> > +    if ( ratio == hvm_default_tsc_scaling_ratio )
> > +        return tsc;
> > +
> > +    /* tsc = (tsc * ratio) >> hvm_funcs.tsc_scaling.ratio_frac_bits */
> > +    asm ( "mulq %[ratio]; shrdq %[frac],%%rdx,%[tsc]"
> > +          : [tsc] "+a" (tsc), "=d" (dummy)
> 
> Is mixing named and positional asm() operands supported by all
> gcc versions we care about?

I see in Config.mk the oldest version is gcc 4.1. I'll test on that
version.

> Also strictly speaking "=d" needs to be switched to "=&d".
>

I'll fix in the next version.

Thanks,
Haozhong

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

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.