All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Jintack Lim <jintack@cs.columbia.edu>, kvm@vger.kernel.org
Cc: Christoffer Dall <christofferdall@gmail.com>,
	Shih-Wei Li <shihwei@cs.columbia.edu>
Subject: Re: rdtsc() in kvm-unit-tests on x86
Date: Mon, 10 Aug 2015 11:02:16 +0200	[thread overview]
Message-ID: <55C86898.3000003@redhat.com> (raw)
In-Reply-To: <CAHyh4xjBcSRZSkWpAT6whpxnNhrr8K4Y-Z23aw2P0Q2nx=ySOQ@mail.gmail.com>



On 07/08/2015 21:19, Jintack Lim wrote:
> Hi all,
> 
> While I was looking at rdtsc() code in kvm-unit-tests (e.g. x86/vmexit.c),
> I was getting curious that out-of-order execution on the processor
> may make rdtsc() executed not in the place we expect.
> 
> Referring to this document from intel,
> http://www.intel.com/content/www/us/en/embedded/training/ia-32-ia-64-benchmark-code-execution-paper.html
> they suggested to use rdtscp instruction and other techniques to
> serialize reading tsc register.
> 
> I wonder how the serialization is achieved when using rdtsc() in
> kvm-unit-tests code.
> Or, maybe the serialization is not necessary for some reason?

kvm-unit-tests executes the instruction thousands of times, so any error
due to lack of serialization is lost in the noise.

Paolo

  reply	other threads:[~2015-08-10  9:02 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-07 19:19 rdtsc() in kvm-unit-tests on x86 Jintack Lim
2015-08-10  9:02 ` Paolo Bonzini [this message]
     [not found]   ` <CAEDV+g+hwvSqWUjNAKcJVcTf-6vXx5j+YiN=aaYKJbo=pmWcEw@mail.gmail.com>
2015-08-10 13:58     ` Paolo Bonzini
2015-08-10 14:14       ` Jintack Lim
2015-08-10 14:47         ` Paolo Bonzini
2015-08-10 15:38           ` Jintack Lim

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=55C86898.3000003@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=christofferdall@gmail.com \
    --cc=jintack@cs.columbia.edu \
    --cc=kvm@vger.kernel.org \
    --cc=shihwei@cs.columbia.edu \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.