]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
KVM: allow userspace to adjust kvmclock offset
authorGlauber Costa <glommer@redhat.com>
Mon, 1 Feb 2010 18:54:05 +0000 (16:54 -0200)
committerGreg Kroah-Hartman <gregkh@suse.de>
Tue, 9 Feb 2010 12:50:56 +0000 (04:50 -0800)
commit4f7d6662c57dbaa6be09cc0bad2c01d005638a4d
treeb0ad11a70fc0aae87001c29e1996156ab5e2526e
parenta74e62c2ef1fda92ad697556261b0e00fee5d581
KVM: allow userspace to adjust kvmclock offset

(cherry picked from afbcf7ab8d1bc8c2d04792f6d9e786e0adeb328d)

When we migrate a kvm guest that uses pvclock between two hosts, we may
suffer a large skew. This is because there can be significant differences
between the monotonic clock of the hosts involved. When a new host with
a much larger monotonic time starts running the guest, the view of time
will be significantly impacted.

Situation is much worse when we do the opposite, and migrate to a host with
a smaller monotonic clock.

This proposed ioctl will allow userspace to inform us what is the monotonic
clock value in the source host, so we can keep the time skew short, and
more importantly, never goes backwards. Userspace may also need to trigger
the current data, since from the first migration onwards, it won't be
reflected by a simple call to clock_gettime() anymore.

[marcelo: future-proof abi with a flags field]
[jan: fix KVM_GET_CLOCK by clearing flags field instead of checking it]

Signed-off-by: Glauber Costa <glommer@redhat.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Documentation/kvm/api.txt
arch/x86/include/asm/kvm_host.h
arch/x86/kvm/x86.c
include/linux/kvm.h