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)
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>

No differences found