viridian: unify time sources
authorPaul Durrant <paul.durrant@citrix.com>
Fri, 21 Jun 2019 15:57:51 +0000 (17:57 +0200)
committerJan Beulich <jbeulich@suse.com>
Fri, 21 Jun 2019 15:57:51 +0000 (17:57 +0200)
commit5a82d598d2d25cff223687b9948473a733a81ffd
tree8a641c444e978188b188c1e2a9ff402bb756be06
parent426f2afe2b51854bb200f4e533266f9297fd4bd3
viridian: unify time sources

Currently, the time_ref_count enlightened time source maintains an offset
such that time is frozen when the domain paused, but the reference_tsc
enlightened time source does not. After migrate, the reference_tsc source
may become invalidated (e.g. because of host cpu frequency mismatch) which
will cause Windows to fall back to time_ref_count. Thus, the guest will
observe a jump in time equivalent to the offset.

This patch unifies the two enlightened time sources such that the same
offset applies to both of them. Also, it's not really necessary to have
two different functions to calculating a 10MHz counter value, time_now() and
raw_trc_val(), so this patch removes the latter implementation. The
unification also allows removal of the reference_tsc_valid flag.

Whilst in the area, this patch also takes the opportunity to constify a few
pointers which were missed in earlier patches.

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
xen/arch/x86/hvm/viridian/time.c
xen/include/asm-x86/hvm/viridian.h