Re: [patch 15/18] KVM: x86: implement PVCLOCK_TSC_STABLE_BIT pvclock flag

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

 



On 10/24/2012 05:13 PM, Marcelo Tosatti wrote:
> KVM added a global variable to guarantee monotonicity in the guest. 
> One of the reasons for that is that the time between
> 
> 	1. ktime_get_ts(&timespec);
> 	2. rdtscll(tsc);
> 
> Is variable. That is, given a host with stable TSC, suppose that
> two VCPUs read the same time via ktime_get_ts() above.
> 
> The time required to execute 2. is not the same on those two instances 
> executing in different VCPUS (cache misses, interrupts...).
> 
> If the TSC value that is used by the host to interpolate when 
> calculating the monotonic time is the same value used to calculate
> the tsc_timestamp value stored in the pvclock data structure, and
> a single <system_timestamp, tsc_timestamp> tuple is visible to all 
> vcpus simultaneously, this problem disappears. See comment on top
> of pvclock_update_vm_gtod_copy for details.
> 
> Monotonicity is then guaranteed by synchronicity of the host TSCs
> and guest TSCs. 
> 
> Set TSC stable pvclock flag in that case, allowing the guest to read
> clock from userspace.
> 
> Signed-off-by: Marcelo Tosatti <mtosatti@xxxxxxxxxx>

If you are using a master copy, with a stable host-side tsc, you can get
rid of the normal REQ_CLOCK updates during vcpu load.
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux