]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: x86: apply kvmclock offset to guest wall clock time
authorBruce Rogers <brogers@suse.com>
Fri, 20 Jul 2012 16:44:24 +0000 (10:44 -0600)
committerMarcelo Tosatti <mtosatti@redhat.com>
Wed, 1 Aug 2012 20:23:50 +0000 (17:23 -0300)
commit20f5189abb7643af734a806a6eda81677ab9a0d0
treec5d6b29bb6c8658c3310fc91d0a6a4ccb8c4f99c
parente32aef90d226f74b6fa7b866bc20805a3aae5bee
KVM: x86: apply kvmclock offset to guest wall clock time

When a guest migrates to a new host, the system time difference from the
previous host is used in the updates to the kvmclock system time visible
to the guest, resulting in a continuation of correct kvmclock based guest
timekeeping.

The wall clock component of the kvmclock provided time is currently not
updated with this same time offset. Since the Linux guest caches the
wall clock based time, this discrepency is not noticed until the guest is
rebooted. After reboot the guest's time calculations are off.

This patch adjusts the wall clock by the kvmclock_offset, resulting in
correct guest time after a reboot.

Cc: Zachary Amsden <zamsden@gmail.com>
Signed-off-by: Bruce Rogers <brogers@suse.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
arch/x86/kvm/x86.c