public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Avi Kivity <avi@redhat.com>
To: Julien Desfossez <ju@klipix.org>
Cc: kvm@vger.kernel.org
Subject: Re: Accessing host TSC from a guest kernel
Date: Sun, 26 Sep 2010 12:36:54 +0200	[thread overview]
Message-ID: <4C9F2246.209@redhat.com> (raw)
In-Reply-To: <4C9C11C7.70202@klipix.org>

  On 09/24/2010 04:49 AM, Julien Desfossez wrote:
> Hello,
>
> I'd like to access the host TSC from the inside of a guest kernel and I
> don't really know if it's possible.
>
> I'm working with kvm_clock and I have been playing with the
> pvclock_vcpu_time_info structure, but I'm not sure if I'm in the right
> direction.
>
> So could you tell me if there is an efficient way to access to access
> the host TSC (or at least the TSC_OFFSET) from a module inside a guest
> kernel ?
>
> I did it with an hypercall, but it's for tracing purpose and doing an
> hypercall every time I want to record an event, is way too costly.
>
>

It isn't possible.  If you need a coherent host/guest timestamp, I 
suggest using ktime_get().

-- 
error compiling committee.c: too many arguments to function


  reply	other threads:[~2010-09-26 10:37 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-24  2:49 Accessing host TSC from a guest kernel Julien Desfossez
2010-09-26 10:36 ` Avi Kivity [this message]
2010-09-26 11:02   ` Muli Ben-Yehuda

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=4C9F2246.209@redhat.com \
    --to=avi@redhat.com \
    --cc=ju@klipix.org \
    --cc=kvm@vger.kernel.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