KVM: x86: rewrite handling of scaled TSC for kvmclock
authorPaolo Bonzini <pbonzini@redhat.com>
Mon, 8 Feb 2016 13:51:40 +0000 (14:51 +0100)
committerPaolo Bonzini <pbonzini@redhat.com>
Tue, 16 Feb 2016 17:48:34 +0000 (18:48 +0100)
commit78db6a5037965429c04d708281f35a6e5562d31b
tree69df8a7348f8d7c2377a5b8acd3c9a46c156a14f
parent4941b8cb3746f09bb102f7a5d64d878e96a0c6cd
KVM: x86: rewrite handling of scaled TSC for kvmclock

This is the same as before:

    kvm_scale_tsc(tgt_tsc_khz)
        = tgt_tsc_khz * ratio
        = tgt_tsc_khz * user_tsc_khz / tsc_khz   (see set_tsc_khz)
        = user_tsc_khz                           (see kvm_guest_time_update)
        = vcpu->arch.virtual_tsc_khz             (see kvm_set_tsc_khz)

However, computing it through kvm_scale_tsc will make it possible
to include the NTP correction in tgt_tsc_khz.

Reviewed-by: Marcelo Tosatti <mtosatti@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/x86.c