On Thu, Mar 18, 2021 at 02:02:08PM -0300, Marcelo Tosatti wrote: > On Tue, Mar 16, 2021 at 03:37:34PM +0100, Vitaly Kuznetsov wrote: > > When KVM_REQ_MASTERCLOCK_UPDATE request is issued (e.g. after migration) > > we need to make sure no vCPU sees stale values in PV clock structures and > > thus all vCPUs are kicked with KVM_REQ_CLOCK_UPDATE. Hyper-V TSC page > > clocksource is global and kvm_guest_time_update() only updates in on vCPU0 > > but this is not entirely correct: nothing blocks some other vCPU from > > entering the guest before we finish the update on CPU0 and it can read > > stale values from the page. > > > > Invalidate TSC page in kvm_gen_update_masterclock() to switch all vCPUs > > to using MSR based clocksource (HV_X64_MSR_TIME_REF_COUNT). > > Hi Vitaly, > > Not clear why this is necessary, if the choice was to not touch TSC page > at all, when invariant TSC is supported on the host... s/invariant TSC/TSC scaling/ > Ah, OK, this is not for the migration with iTSC on destination case, > but any call to kvm_gen_update_masterclock, correct?