]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: x86: Fix kvmclock bug
authorZachary Amsden <zamsden@redhat.com>
Sun, 19 Sep 2010 00:38:12 +0000 (14:38 -1000)
committerAvi Kivity <avi@redhat.com>
Sun, 24 Oct 2010 08:52:56 +0000 (10:52 +0200)
commit0fd5e6e0eb76e579f8d830620884400840e3fa55
tree0d20f168f33bc0165ee4a9d18c386a7cdbad63c4
parent62b0e6b54ac52385b3ad021981c8f566a7bec7ec
KVM: x86: Fix kvmclock bug

If preempted after kvmclock values are updated, but before hardware
virtualization is entered, the last tsc time as read by the guest is
never set.  It underflows the next time kvmclock is updated if there
has not yet been a successful entry / exit into hardware virt.

Fix this by simply setting last_tsc to the newly read tsc value so
that any computed nsec advance of kvmclock is nulled.

Signed-off-by: Zachary Amsden <zamsden@redhat.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
arch/x86/kvm/x86.c