[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH 2/2] x86/HVM: Use fixed TSC value when saving or restoring domain

> From: Boris Ostrovsky [mailto:boris.ostrovsky@xxxxxxxxxx]
> Sent: Sunday, March 30, 2014 11:06 AM
> When a domain is saved each VCPU's TSC value needs to be preserved. To get
> it we
> use hvm_get_guest_tsc(). This routine (either itself or via get_s_time() which
> it may call) calculates VCPU's TSC based on current host's TSC value (by doing
> a
> rdtscll()). Since this is performed for each VCPU separately we end up with
> un-synchronized TSCs.
> Similarly, during a restore each VCPU is assigned its TSC based on host's
> current
> tick, causing virtual TSCs to diverge further.
> With this, we can easily get into situation where a guest may see time going
> backwards.
> Instead of reading new TSC value for each VCPU when saving/restoring it we
> should
> use the same value across all VCPUs.
> Signed-off-by: Boris Ostrovsky <boris.ostrovsky@xxxxxxxxxx>

Somehow the new ***_fixed interfaces looked a bit overkilled, however I don't
have a better idea now except introducing a new hypercall to save/restore all
VCPU TSCs together, which however doesn't solve the existing versions.

Reviewed-by: Kevin Tian <kevin.tian@xxxxxxxxx>


Xen-devel mailing list



Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.