]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: vmx: fix underflow in TSC deadline calculation
authorPaolo Bonzini <pbonzini@redhat.com>
Mon, 27 Jun 2016 13:08:01 +0000 (15:08 +0200)
committerPaolo Bonzini <pbonzini@redhat.com>
Fri, 1 Jul 2016 09:03:39 +0000 (11:03 +0200)
commit0b5dde5eb16421eef038e502626a6e7908c2789f
treecb8268447f8a95149214b807c987d7d84f0dc098
parent96b61884b310d8fd4f1b6c344cf0e61ebda2df9c
KVM: vmx: fix underflow in TSC deadline calculation

If the TSC deadline timer is programmed really close to the deadline or
even in the past, the computation in vmx_set_hv_timer can underflow and
cause delta_tsc to be set to a huge value.  This generally results
in vmx_set_hv_timer returning -ERANGE, but we can fix it by limiting
delta_tsc to be positive or zero.

Reported-by: Wanpeng Li <wanpeng.li@hotmail.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/vmx.c