]> git.baikalelectronics.ru Git - kernel.git/commit
kvm: x86: Fix kvm clock versioning.
authorOwen Hofmann <osh@google.com>
Tue, 4 Nov 2014 00:57:18 +0000 (16:57 -0800)
committerPaolo Bonzini <pbonzini@redhat.com>
Sat, 8 Nov 2014 07:20:54 +0000 (08:20 +0100)
commitf21b7b94c9989c33d77c28871473c900afcd8763
tree97dbcecc9d44cb67f97bac0a814fec8dff663ff0
parent917bfc6403a797092d0c834c8dbd1cca6291af41
kvm: x86: Fix kvm clock versioning.

kvm updates the version number for the guest paravirt clock structure by
incrementing the version of its private copy. It does not read the guest
version, so will write version = 2 in the first update for every new VM,
including after restoring a saved state. If guest state is saved during
reading the clock, it could read and accept struct fields and guest TSC
from two different updates. This changes the code to increment the guest
version and write it back.

Signed-off-by: Owen Hofmann <osh@google.com>
Reviewed-by: Marcelo Tosatti <mtosatti@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/x86.c