Commit edb9272f authored by Wanpeng Li's avatar Wanpeng Li Committed by Paolo Bonzini

KVM: fix polling for guest halt continued even if disable it

If there is already some polling ongoing, it's impossible to disable the
polling, since as soon as somebody sets halt_poll_ns to 0, polling will
never stop, as grow and shrink are only handled if halt_poll_ns is != 0.

This patch fix it by reset vcpu->halt_poll_ns in order to stop polling
when polling is disabled.
Reported-by: default avatarChristian Borntraeger <borntraeger@de.ibm.com>
Signed-off-by: default avatarWanpeng Li <wanpeng.li@hotmail.com>
Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
parent 6ff33f39
...@@ -2043,7 +2043,8 @@ void kvm_vcpu_block(struct kvm_vcpu *vcpu) ...@@ -2043,7 +2043,8 @@ void kvm_vcpu_block(struct kvm_vcpu *vcpu)
else if (vcpu->halt_poll_ns < halt_poll_ns && else if (vcpu->halt_poll_ns < halt_poll_ns &&
block_ns < halt_poll_ns) block_ns < halt_poll_ns)
grow_halt_poll_ns(vcpu); grow_halt_poll_ns(vcpu);
} } else
vcpu->halt_poll_ns = 0;
trace_kvm_vcpu_wakeup(block_ns, waited); trace_kvm_vcpu_wakeup(block_ns, waited);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment