public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
* [patch 0/8] KVM: Remaining body of TSC emulation work (Zachary Amsden)
@ 2012-02-03 17:43 Marcelo Tosatti
  2012-02-03 17:43 ` [patch 1/8] Infrastructure for software and hardware based TSC rate scaling Marcelo Tosatti
                   ` (7 more replies)
  0 siblings, 8 replies; 13+ messages in thread
From: Marcelo Tosatti @ 2012-02-03 17:43 UTC (permalink / raw)
  To: kvm; +Cc: zamsden, joerg.roedel

Rebase Zachary's last TSC series. From his original email:

"This is the remaining bulk of work I have related to TSC emulation.
In summary, I believe this fixes all known issues with TSC.  A few
rather subtle issues are cleaned up, S4 suspend is fixed, and the
API for adjust_tsc_offset is expanded to take arguments in either
guest cycles or optionally host cycles.  The final patch adds
software TSC emulation, with a configurable default setting.

Note that TSC trapping will only be used when other methods fail
due to unstable TSC or lack of scaling hardware.  With the improved
offset matching, I was even able to get SMP guests to boot with a
TSC clock; cycle testing showed a maximum backwards leap of around
0.25 ms, which is actually fairly good.  With the last patch applied,
software TSC emulation kicks in and the backwards TSC count even on
my broken hardware dropped to zero.

Some of this code (the S4 suspend compensation) has already been
ported into RHEL to fix various bugs - however upstream had diverged
a bit from the original course I planned; I had to add a few things
that had been optimized out of upstream back in (last_host_tsc).

In the course of doing this, I think the new code looks much
cleaner, with well documented and easy to understand variables.
Yes, there are a lot of tracking variables to maintain this whole
infrastructure - and yes, some of them appear to be redundant of
easily computable from others - but in actuality, the information
they provide is easy to understand, and the resulting code is much
easier to verify than a complex system where some quantities may
be undefined or computed on the fly and thus causing subtle races.
"

The last patch which introduces TSC trapping has not been included: 
it unconditionally enables TSC trapping if the guest frequency 
differs from the host or the host TSC is unstable. It should instead
use tsc catchup if the guest frequency is higher than the host. Also, 
there is no need for trapping if the guest is using kvmclock.




^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2012-02-09 14:29 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
2012-02-03 17:43 ` [patch 8/8] Track TSC synchronization in generations Marcelo Tosatti

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox