]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: x86: make backwards_tsc_observed a per-VM variable
authorLadi Prosek <lprosek@redhat.com>
Mon, 26 Jun 2017 07:56:43 +0000 (09:56 +0200)
committerRadim Krčmář <rkrcmar@redhat.com>
Thu, 13 Jul 2017 15:25:39 +0000 (17:25 +0200)
commitab0ca7167bed122d2304f4a64f4a927630dc6006
tree1ff5da7c983841535db6088b05facbbfba7c876e
parent50bac4a4c6e09ba0bb3de1dd09c8880a890b106c
KVM: x86: make backwards_tsc_observed a per-VM variable

The backwards_tsc_observed global introduced in commit 5d723a1 is never
reset to false. If a VM happens to be running while the host is suspended
(a common source of the TSC jumping backwards), master clock will never
be enabled again for any VM. In contrast, if no VM is running while the
host is suspended, master clock is unaffected. This is inconsistent and
unnecessarily strict. Let's track the backwards_tsc_observed variable
separately and let each VM start with a clean slate.

Real world impact: My Windows VMs get slower after my laptop undergoes a
suspend/resume cycle. The only way to get the perf back is unloading and
reloading the kvm module.

Signed-off-by: Ladi Prosek <lprosek@redhat.com>
Signed-off-by: Radim Krčmář <rkrcmar@redhat.com>
arch/x86/include/asm/kvm_host.h
arch/x86/kvm/x86.c