All of lore.kernel.org
 help / color / mirror / Atom feed
* [Xen-devel] [PATCH 0/1] Avoiding RDTSC emulation due to host clock drift
@ 2019-09-02 18:27 Edwin Török
  2019-09-02 18:27 ` [Xen-devel] [PATCH 1/1] x86/arch: VM resume: avoid " Edwin Török
  0 siblings, 1 reply; 4+ messages in thread
From: Edwin Török @ 2019-09-02 18:27 UTC (permalink / raw)
  To: xen-devel
  Cc: Andrew Cooper, Wei Liu, Edwin Török, Jan Beulich,
	Roger Pau Monné

I noticed that RDTSC emulation got turned on for a VM after a
suspend/host-reboot/resume cycle.
Xen currently expects an exact match between host CPU and saved guest CPU
frequency in KHz, otherwise it turns on RDTSC emulation if the CPU doesn't
support TSC scaling.

An exact match would require ~0.4 ppm accuracy, and even on physical hardware
the platform timer used for calibration is not that accurate.  The best
accuracy I could find that datasheets/specifications require is 100 ppm, so let
Xen accept a 100 ppm difference in clock frequency as "the same" and do not
turn on RDTSC emulation due to that.

So far I have manually tested this on Intel(R) Xeon(R) CPU E5-2697 v3 and a
Debian 9 guest, more tests pending.

See the commit for more details.

Edwin Török (1):
  x86/arch: VM resume: avoid RDTSC emulation due to host clock drift

 xen/arch/x86/time.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

-- 
2.20.1


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

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

end of thread, other threads:[~2019-09-03  9:26 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-09-02 18:27 [Xen-devel] [PATCH 0/1] Avoiding RDTSC emulation due to host clock drift Edwin Török
2019-09-02 18:27 ` [Xen-devel] [PATCH 1/1] x86/arch: VM resume: avoid " Edwin Török
2019-09-03  7:54   ` Jan Beulich
2019-09-03  9:26     ` Edwin Török

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.