xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Haozhong Zhang <haozhong.zhang@intel.com>
To: Jan Beulich <JBeulich@suse.com>
Cc: Kevin Tian <kevin.tian@intel.com>, Keir Fraser <keir@xen.org>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	xen-devel@lists.xen.org,
	Aravind Gopalakrishnan <Aravind.Gopalakrishnan@amd.com>,
	Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>,
	Boris Ostrovsky <boris.ostrovsky@oracle.com>
Subject: Re: [PATCH v6 2/5] x86/hvm: Replace architecture TSC scaling by a common function
Date: Mon, 29 Feb 2016 22:03:18 +0800	[thread overview]
Message-ID: <20160229140318.GD29565@hz-desktop.sh.intel.com> (raw)
In-Reply-To: <56D4593602000078000D757E@prv-mh.provo.novell.com>

On 02/29/16 06:44, Jan Beulich wrote:
> >>> On 28.02.16 at 13:54, <haozhong.zhang@intel.com> 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@lists.xen.org
http://lists.xen.org/xen-devel

  reply	other threads:[~2016-02-29 14:03 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-28 12:54 [PATCH v6 0/5] Add VMX TSC scaling support Haozhong Zhang
2016-02-28 12:54 ` [PATCH v6 1/5] x86/hvm: Setup TSC scaling ratio Haozhong Zhang
2016-02-29 13:41   ` Jan Beulich
2016-02-29 13:49     ` Boris Ostrovsky
2016-02-29 13:55       ` Haozhong Zhang
2016-02-29 13:55       ` Jan Beulich
2016-02-29 14:09         ` Boris Ostrovsky
2016-02-28 12:54 ` [PATCH v6 2/5] x86/hvm: Replace architecture TSC scaling by a common function Haozhong Zhang
2016-02-29 13:44   ` Jan Beulich
2016-02-29 14:03     ` Haozhong Zhang [this message]
2016-02-29 14:21   ` Boris Ostrovsky
2016-03-01  1:39   ` [PATCH v7 " Haozhong Zhang
2016-03-01 10:13     ` Jan Beulich
2016-02-28 12:54 ` [PATCH v6 3/5] x86/hvm: Move saving/loading vcpu's TSC to common code Haozhong Zhang
2016-02-28 12:54 ` [PATCH v6 4/5] vmx: Add VMX RDTSC(P) scaling support Haozhong Zhang
2016-02-28 12:54 ` [PATCH v6 5/5] docs: Add descriptions of TSC scaling in xl.cfg and tscmode.txt Haozhong Zhang
2016-03-01 14:09   ` Ian Jackson
2016-03-01 14:21     ` Jan Beulich

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160229140318.GD29565@hz-desktop.sh.intel.com \
    --to=haozhong.zhang@intel.com \
    --cc=Aravind.Gopalakrishnan@amd.com \
    --cc=JBeulich@suse.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=boris.ostrovsky@oracle.com \
    --cc=keir@xen.org \
    --cc=kevin.tian@intel.com \
    --cc=suravee.suthikulpanit@amd.com \
    --cc=xen-devel@lists.xen.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).