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

Re: [Xen-devel] [PATCH v2] x86/vtsc: update vcpu_time in hvm_set_guest_time



On Tue, Jun 4, 2013 at 1:49 PM, Roger Pau Monne <roger.pau@xxxxxxxxxx> wrote:
> When using a vtsc, hvm_set_guest_time changes hvm_vcpu.stime_offset,
> which is used in the vcpu time structure to calculate the
> tsc_timestamp, so after updating stime_offset we need to propagate the
> change to vcpu_time in order for the guest to get the right time if
> using the PV clock.

Just for public record:

I looked into the other elements that go into the system_time update
calculation, to make sure we weren't missing anything else that might
need updating.  They are:
 1. d->arch.hvm_domain.pl_time.stime_offset
 2. d->arch.vtsc_offset (if the VM is not an hvm_domain)
 3. d->arch.ns_to_vtsc

#1 is set once in xen/arch/x86/hvm/vpt.c:hvm_init_guest_time() and
never touched again.

#2 and #3 are set in xen/arch/x86/time.c:tsc_set_info, with a comment
saying that the info needs to be set and stabilized before the first
guest RDTSC; so they *should* never be updated while the guest is
running.  It  might be nice to have a check to make sure of that, but
it's just a bit more work than I feel like doing at the moment
(probably checking all the individual vcpus in a domain).

 -George

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

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