• Zachary Amsden's avatar
    KVM: x86: Fix kvmclock bug · 28e4639a
    Zachary Amsden authored
    If preempted after kvmclock values are updated, but before hardware
    virtualization is entered, the last tsc time as read by the guest is
    never set.  It underflows the next time kvmclock is updated if there
    has not yet been a successful entry / exit into hardware virt.
    
    Fix this by simply setting last_tsc to the newly read tsc value so
    that any computed nsec advance of kvmclock is nulled.
    Signed-off-by: default avatarZachary Amsden <zamsden@redhat.com>
    Signed-off-by: default avatarMarcelo Tosatti <mtosatti@redhat.com>
    28e4639a
x86.c 147 KB