kvm: fix wrong address when writing Hyper-V tsc page
authorXiaoming Gao <newtongao@tencent.com>
Thu, 19 Jun 2014 11:14:57 +0000 (19:14 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 9 Jul 2014 18:18:27 +0000 (11:18 -0700)
commit4c8c5a45d44452212a26af9a80f580707f1f77d1
tree1f910611fb4c4e2fe0248e3f345b6b4361d7bf1c
parenta46438472e31a9766352c97e37caaa2848ddea10
kvm: fix wrong address when writing Hyper-V tsc page

commit e1fa108d24697b78348fd4e5a531029a50d0d36d upstream.

When kvm_write_guest writes the tsc_ref structure to the guest, or it will lead
the low HV_X64_MSR_TSC_REFERENCE_ADDRESS_SHIFT bits of the TSC page address
must be cleared, or the guest can see a non-zero sequence number.

Otherwise Windows guests would not be able to get a correct clocksource
(QueryPerformanceCounter will always return 0) which causes serious chaos.

Signed-off-by: Xiaoming Gao <newtongao@tencnet.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/x86/kvm/x86.c