This driver reads time-keeping information from the para-virtualized clock
device provided by the KVM hypervisor on Linux hosts.
The
kvmclock
driver is only implemented on i386 and amd64 platforms.
It acts as a
timecounters(4)
device and is preferred over the Time Stamp Counter (TSC) when available.
The driver exports timekeeping information via
/dev/pvclock,
enabling the implementation of
clock_gettime(2)
and related functions without entering the kernel.
The
kvmclock
driver works by accessing a per-vCPU timekeeping structure maintained by the
hypervisor.
It uses a combination of TSC readings and information from the shared structure
to produce a high-resolution timecounter which is invariant under hypervisor
events such as vCPU migration and live VM migration.