All of lore.kernel.org
 help / color / mirror / Atom feed
* KVM: Remaining body of TSC emulation work
@ 2011-06-20 23:59 Zachary Amsden
  2011-06-20 23:59 ` [KVM TSC emulation 1/9] Infrastructure for software and hardware based TSC rate scaling Zachary Amsden
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: Zachary Amsden @ 2011-06-20 23:59 UTC (permalink / raw)
  To: Avi Kivity, Marcelo Tosatti, Glauber Costa, Frank Arnold,
	Joerg Roedel, Jan Kiszka, linux-kvm, linux-kernel, Zachary Amsden

In-Reply-To: 

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.

Zach


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

end of thread, other threads:[~2011-06-21 12:21 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-06-20 23:59 KVM: Remaining body of TSC emulation work Zachary Amsden
2011-06-20 23:59 ` [KVM TSC emulation 1/9] Infrastructure for software and hardware based TSC rate scaling Zachary Amsden
2011-06-20 23:59 ` [KVM TSC emulation 2/9] Improve TSC offset matching Zachary Amsden
2011-06-20 23:59 ` [KVM TSC emulation 3/9] Leave TSC synchronization window open with each new sync Zachary Amsden
2011-06-20 23:59 ` [KVM TSC emulation 4/9] Fix last_guest_tsc / tsc_offset semantics Zachary Amsden
2011-06-20 23:59 ` [KVM TSC emulation 5/9] Add last_host_tsc tracking back to KVM Zachary Amsden
2011-06-20 23:59 ` [KVM TSC emulation 6/9] Allow adjust_tsc_offset to be in host or guest cycles Zachary Amsden
2011-06-20 23:59 ` [KVM TSC emulation 7/9] Don't mark TSC unstable due to S4 suspend Zachary Amsden
2011-06-20 23:59 ` [KVM TSC emulation 8/9] Track TSC synchronization in generations Zachary Amsden
2011-06-20 23:59 ` [KVM TSC emulation 9/9] Add software TSC emulation Zachary Amsden
     [not found] ` <4E005B5B.7090401@siemens.com>
2011-06-21 12:21   ` KVM: Remaining body of TSC emulation work Zachary Amsden

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.