]> git.baikalelectronics.ru Git - kernel.git/commit
kvm: cap halt polling at exactly halt_poll_ns
authorDavid Matlack <dmatlack@google.com>
Wed, 9 Mar 2016 00:19:44 +0000 (16:19 -0800)
committerPaolo Bonzini <pbonzini@redhat.com>
Wed, 9 Mar 2016 10:54:14 +0000 (11:54 +0100)
commitae994b67f2d5acf25692635c703501c94506ca44
tree56e9b7133f98991b710c8776712a2e574c41b78c
parenta03775f9b3308ee269856968f5d122175cd406e6
kvm: cap halt polling at exactly halt_poll_ns

When growing halt-polling, there is no check that the poll time exceeds
the limit. It's possible for vcpu->halt_poll_ns grow once past
halt_poll_ns, and stay there until a halt which takes longer than
vcpu->halt_poll_ns. For example, booting a Linux guest with
halt_poll_ns=11000:

 ... kvm:kvm_halt_poll_ns: vcpu 0: halt_poll_ns 0 (shrink 10000)
 ... kvm:kvm_halt_poll_ns: vcpu 0: halt_poll_ns 10000 (grow 0)
 ... kvm:kvm_halt_poll_ns: vcpu 0: halt_poll_ns 20000 (grow 10000)

Signed-off-by: David Matlack <dmatlack@google.com>
Fixes: 42393240b47bfc700e16b137e3e22178e20d14c1
Cc: stable@vger.kernel.org
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
virt/kvm/kvm_main.c