public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Joerg Roedel <joerg.roedel@amd.com>
To: Marcelo Tosatti <mtosatti@redhat.com>
Cc: <kvm@vger.kernel.org>, <zamsden@gmail.com>
Subject: Re: [patch 7/8] Dont mark TSC unstable due to S4 suspend
Date: Thu, 9 Feb 2012 15:28:59 +0100	[thread overview]
Message-ID: <20120209142859.GO22598@amd.com> (raw)
In-Reply-To: <20120208155646.GB3398@amt.cnet>

On Wed, Feb 08, 2012 at 01:56:46PM -0200, Marcelo Tosatti wrote:
> On Wed, Feb 08, 2012 at 04:18:48PM +0100, Joerg Roedel wrote:

> > This is not going to work when tsc-scaling is enabled. The
> > adjust_tsc_offset_host() function just scales the offset the same way
> > the tsc is scaled. But that is broken because the tsc-offset is applied
> > _after_ the tsc-ratio by scaling hardware. So to get the desired
> > tsc-value in the guest the offset needs to be scaled in the opposite
> > direction as the tsc itself. This is rather complicated to implement.
> 
> By saying that "tsc-offset is applied _after_ the tsc-ratio by scaling
> hardware" you mean that guest tsc is calculated as
> 
> 	tsc = host_tsc_value * tsc_ratio
> 	tsc += tsc_offset
> 
> ?
> 
> If so, that means the tsc_offset must be scaled to guest tsc units.
> 
> Which is what both adjust_tsc_offset(host=true) and compute_tsc_offset()
> do.
> 
> What am i missing here?

Nothing. You are right, bad math on my side.


	Joerg

-- 
AMD Operating System Research Center

Advanced Micro Devices GmbH Einsteinring 24 85609 Dornach
General Managers: Alberto Bozzo
Registration: Dornach, Landkr. Muenchen; Registerger. Muenchen, HRB Nr. 43632


  reply	other threads:[~2012-02-09 14:29 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-03 17:43 [patch 0/8] KVM: Remaining body of TSC emulation work (Zachary Amsden) Marcelo Tosatti
2012-02-03 17:43 ` [patch 1/8] Infrastructure for software and hardware based TSC rate scaling Marcelo Tosatti
2012-02-08 14:28   ` Joerg Roedel
2012-02-03 17:43 ` [patch 2/8] Improve TSC offset matching Marcelo Tosatti
2012-02-03 17:43 ` [patch 3/8] Leave TSC synchronization window open with each new sync Marcelo Tosatti
2012-02-03 17:43 ` [patch 4/8] Fix last_guest_tsc / tsc_offset semantics Marcelo Tosatti
2012-02-03 17:43 ` [patch 5/8] Add last_host_tsc tracking back to KVM Marcelo Tosatti
2012-02-03 17:43 ` [patch 6/8] Allow adjust_tsc_offset to be in host or guest cycles Marcelo Tosatti
2012-02-03 17:43 ` [patch 7/8] Dont mark TSC unstable due to S4 suspend Marcelo Tosatti
2012-02-08 15:18   ` Joerg Roedel
2012-02-08 15:56     ` Marcelo Tosatti
2012-02-09 14:28       ` Joerg Roedel [this message]
2012-02-03 17:43 ` [patch 8/8] Track TSC synchronization in generations Marcelo Tosatti

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=20120209142859.GO22598@amd.com \
    --to=joerg.roedel@amd.com \
    --cc=kvm@vger.kernel.org \
    --cc=mtosatti@redhat.com \
    --cc=zamsden@gmail.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