kvmclock: reduce kvmclock difference on migration
commit6053a86fe7bd3d5b07b49dae6c05f2cd0d44e687
authorMarcelo Tosatti <mtosatti@redhat.com>
Mon, 21 Nov 2016 10:50:04 +0000 (21 08:50 -0200)
committerPaolo Bonzini <pbonzini@redhat.com>
Thu, 22 Dec 2016 15:00:56 +0000 (22 16:00 +0100)
tree2719d6b7ef95784f1499ec1ddc66f402129e1ba3
parentbc20403598702fac96b5a732bdb184ccbe1fcb48
kvmclock: reduce kvmclock difference on migration

Check for KVM_CAP_ADJUST_CLOCK capability KVM_CLOCK_TSC_STABLE, which
indicates that KVM_GET_CLOCK returns a value as seen by the guest at
that moment.

For new machine types, use this value rather than reading
from guest memory.

This reduces kvmclock difference on migration from 5s to 0.1s
(when max_downtime == 5s).

Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Message-Id: <20161121105052.598267440@redhat.com>
[Add comment explaining what is going on. - Paolo]
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
hw/i386/kvm/clock.c
include/hw/i386/pc.h
target/i386/kvm.c
target/i386/kvm_i386.h