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)
commit09a0c3f110b2fbe3bd03817c416d00968666fd74
tree97dbcecc9d44cb67f97bac0a814fec8dff663ff0
parented9aad215ff3374ffd720b83d26fda91e4367090
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