 
	
| [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 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? Also strictly speaking "=d" needs
to be switched to "=&d".
Jan
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel
 
 
 | 
|  | Lists.xenproject.org is hosted with RackSpace, monitoring our |