kvm masterclock
While using the master clock among guests, when is it updated? Thought it had to be in
pvclock_gtod_notify() but it only triggers update of :
master_kernel_ns, master_cycle_now
if clocksource changes away from TSC :
if (gtod->clock.vclock_mode != VCLOCK_TSC &&
atomic_read(&kvm_guest_has_master_clock) != 0)
queue_work(system_long_wq, &pvclock_gtod_work);And gtod work would set KVM_REQ_MASTERCLOCK_UPDATE if queued, which is not the case if always TSC.
So kvm_guest_time_update() always uses same values is use_master_clock ?
Maybe I missed some piece?
--Mika
Paolo Bonzini
maintainerQuoted 8 lines · Mika Penttilä
While using the master clock among guests, when is it updated? Thought it had to be in
pvclock_gtod_notify()but it only triggers update of :
master_kernel_ns,master_cycle_nowif clocksource changes away from TSC :
Quoted 7 lines
if (gtod->clock.vclock_mode != VCLOCK_TSC && atomic_read(&kvm_guest_has_master_clock) != 0) queue_work(system_long_wq, &pvclock_gtod_work);And gtod work would set
KVM_REQ_MASTERCLOCK_UPDATEif queued, which is not the case if always TSC.So
kvm_guest_time_update()always uses same values isuse_master_clock?
Yes, if the master clock is in use the kvmclock does _not_ adjust itself and, as a consequence, doesn't follow host NTP adjustments.
Paolo