• Owen Hofmann's avatar
    kvm: x86: Fix kvm clock versioning. · 09a0c3f1
    Owen Hofmann authored
    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: default avatarOwen Hofmann <osh@google.com>
    Reviewed-by: default avatarMarcelo Tosatti <mtosatti@redhat.com>
    Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
    09a0c3f1
x86.c 195 KB