]> www.infradead.org Git - users/dwmw2/linux.git/commit
KVM: x86: Add KVM_VCPU_TSC_SCALE and fix the documentation on TSC migration
authorDavid Woodhouse <dwmw@amazon.co.uk>
Wed, 13 Sep 2023 14:08:22 +0000 (16:08 +0200)
committerDavid Woodhouse <dwmw@amazon.co.uk>
Wed, 22 May 2024 00:05:40 +0000 (17:05 -0700)
commit1c5d428ec116e6520e29ef5f9e7f0572e8181d2f
tree2b0efbe32ec00dd2c2f995e88220032ff90f660f
parent1bc9d5863c907eff0ce302776e2f52448d28805a
KVM: x86: Add KVM_VCPU_TSC_SCALE and fix the documentation on TSC migration

The documentation on TSC migration using KVM_VCPU_TSC_OFFSET is woefully
inadequate. It ignores TSC scaling, and ignores the fact that the host
TSC may differ from one host to the next (and in fact because of the way
the kernel calibrates it, it generally differs from one boot to the next
even on the same hardware).

Add KVM_VCPU_TSC_SCALE to extract the actual scale ratio and frac_bits,
and attempt to document the process that userspace needs to follow to
preserve the TSC across migration.

Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
Reviewed-by: Paul Durrant <paul@xen.org>
Documentation/virt/kvm/devices/vcpu.rst
arch/x86/include/uapi/asm/kvm.h
arch/x86/kvm/x86.c