]> git.ipfire.org Git - thirdparty/kernel/stable.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)
committerJiri Slaby <jslaby@suse.cz>
Thu, 5 Mar 2015 14:36:59 +0000 (15:36 +0100)
commit5202b3587e768e05f82349df0742a58e6824ec68
tree1791cdda4c30e5583dbefd50d4fbfcf3e9a00e8a
parent8ef0cf0e2fede8b5607986c197128ee2f21adf94
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: Jiri Slaby <jslaby@suse.cz>
arch/x86/kvm/x86.c