On Mon, Jun 22, 2020 at 3:33 PM Paolo Bonzini <pbonzini@xxxxxxxxxx> wrote: > > On 16/06/20 01:07, Jim Mattson wrote: > > + } else if (vcpu->arch.this_tsc_generation != > > + kvm->arch.cur_tsc_generation) { > > u64 tsc_exp = kvm->arch.last_tsc_write + > > nsec_to_cycles(vcpu, elapsed); > > u64 tsc_hz = vcpu->arch.virtual_tsc_khz * 1000LL; > > Can this cause the same vCPU to be counted multiple times in > nr_vcpus_matched_tsc? I think you need to keep already_matched (see > also the commit message for 0d3da0d26e3c, "KVM: x86: fix TSC matching", > 2014-07-09, which introduced that variable). No. In the case where we previously might have counted the vCPU a second time, we now start a brand-new generation, and the vCPU is the first to be counted for the new generation.