Re: [PATCH v4 03/13] KVM: x86: Expose TSC offset controls to userspace

2021-07-29 Thread Paolo Bonzini
On 29/07/21 02:10, Oliver Upton wrote: +6. Adjust the guest TSC offsets for every vCPU to account for (1) time + elapsed since recording state and (2) difference in TSCs between the + source and destination machine: + + new_off_n = t_0 + off_n = (k_1 - k_0) * freq - t_1 The second =

[PATCH v4 03/13] KVM: x86: Expose TSC offset controls to userspace

2021-07-28 Thread Oliver Upton
To date, VMM-directed TSC synchronization and migration has been a bit messy. KVM has some baked-in heuristics around TSC writes to infer if the VMM is attempting to synchronize. This is problematic, as it depends on host userspace writing to the guest's TSC within 1 second of the last write. A