From: Joerg Roedel <joro@8bytes.org>
To: Zachary Amsden <zamsden@redhat.com>
Cc: kvm <kvm@vger.kernel.org>
Subject: Re: Fwd: [KVM TSC emulation 6/9] Allow adjust_tsc_offset to be in host or guest cycles
Date: Wed, 6 Jul 2011 12:00:11 +0200 [thread overview]
Message-ID: <20110706100010.GL29299@8bytes.org> (raw)
In-Reply-To: <4E008D05.8080705@redhat.com>
On Tue, Jun 21, 2011 at 05:22:29AM -0700, Zachary Amsden wrote:
> -static void svm_adjust_tsc_offset(struct kvm_vcpu *vcpu, s64 adjustment)
> +static void svm_adjust_tsc_offset(struct kvm_vcpu *vcpu, s64 adjustment, bool host)
> {
> struct vcpu_svm *svm = to_svm(vcpu);
>
> + WARN_ON(adjustment< 0);
> + if (host)
> + adjustment = svm_scale_tsc(vcpu, adjustment);
> +
This is not going to work out with tsc-scaling. The tsc-offset is
applied _after_ the hardware-tsc. Just scaling the offset with the same
factor will not give you the hardware tsc-value you expect.
Joerg
prev parent reply other threads:[~2011-07-06 10:00 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-06-21 12:22 Fwd: [KVM TSC emulation 6/9] Allow adjust_tsc_offset to be in host or guest cycles Zachary Amsden
2011-07-06 10:00 ` Joerg Roedel [this message]
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=20110706100010.GL29299@8bytes.org \
--to=joro@8bytes.org \
--cc=kvm@vger.kernel.org \
--cc=zamsden@redhat.com \
/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