]> git.ipfire.org Git - people/ms/linux.git/commit
KVM: x86: update masterclock values on TSC writes
authorMarcelo Tosatti <mtosatti@redhat.com>
Tue, 4 Nov 2014 23:30:44 +0000 (21:30 -0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 6 Mar 2015 22:53:02 +0000 (14:53 -0800)
commitd204feb2946a5b9f9a73c1d20c25a3930dc56fcd
tree6f82225e12ba9027405125800fe6810892067d16
parentf21d9d44483d12e21a8c7adc05dd382fdb2895d5
KVM: x86: update masterclock values on TSC writes

commit 7f187922ddf6b67f2999a76dcb71663097b75497 upstream.

When the guest writes to the TSC, the masterclock TSC copy must be
updated as well along with the TSC_OFFSET update, otherwise a negative
tsc_timestamp is calculated at kvm_guest_time_update.

Once "if (!vcpus_matched && ka->use_master_clock)" is simplified to
"if (ka->use_master_clock)", the corresponding "if (!ka->use_master_clock)"
becomes redundant, so remove the do_request boolean and collapse
everything into a single condition.

Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/x86/kvm/x86.c