KVM: x86: fix kvm_write_tsc() TSC matching thinko
authorMarcelo Tosatti <mtosatti@redhat.com>
Thu, 8 Mar 2012 21:46:57 +0000 (18:46 -0300)
committerAvi Kivity <avi@redhat.com>
Tue, 20 Mar 2012 10:40:36 +0000 (12:40 +0200)
commit02626b6af5d2bc62db3bb85fc2891b2725535d44
tree8f309c29c021118b72cd7f1323420120a27a676a
parentb74f05d61b73af584d0c39121980171389ecfaaa
KVM: x86: fix kvm_write_tsc() TSC matching thinko

kvm_write_tsc() converts from guest TSC to microseconds, not nanoseconds
as intended. The result is that the window for matching is 1000 seconds,
not 1 second.

Microsecond precision is enough for checking whether the TSC write delta
is within the heuristic values, so use it instead of nanoseconds.

Noted by Avi Kivity.

Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
arch/x86/kvm/x86.c