kvm: Cap halt polling at kvm->max_halt_poll_ns
commit 258785ef08 upstream.
When growing halt-polling, there is no check that the poll time exceeds
the per-VM limit. It's possible for vcpu->halt_poll_ns to grow past
kvm->max_halt_poll_ns and stay there until a halt which takes longer
than kvm->halt_poll_ns.
Signed-off-by: David Matlack <dmatlack@google.com>
Signed-off-by: Venkatesh Srinivas <venkateshs@chromium.org>
Message-Id: <20210506152442.4010298-1-venkateshs@chromium.org>
Cc: stable@vger.kernel.org
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
53d7eed031
commit
21756f878e
1 changed files with 2 additions and 2 deletions
|
|
@ -2717,8 +2717,8 @@ static void grow_halt_poll_ns(struct kvm_vcpu *vcpu)
|
|||
if (val < grow_start)
|
||||
val = grow_start;
|
||||
|
||||
if (val > halt_poll_ns)
|
||||
val = halt_poll_ns;
|
||||
if (val > vcpu->kvm->max_halt_poll_ns)
|
||||
val = vcpu->kvm->max_halt_poll_ns;
|
||||
|
||||
vcpu->halt_poll_ns = val;
|
||||
out:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue