From: Wanpeng Li Date: Mon, 14 Sep 2015 09:38:51 +0000 (+0800) Subject: KVM: fix polling for guest halt continued even if disable it X-Git-Tag: v4.3-rc2~11^2~11 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=edb9272f35d8bc97c86101a13f67d0ba16f3eecc;p=profile%2Fcommon%2Fplatform%2Fkernel%2Flinux-artik7.git 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: Christian Borntraeger Signed-off-by: Wanpeng Li Signed-off-by: Paolo Bonzini --- diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c index a25a731..eb4c9d2 100644 --- a/virt/kvm/kvm_main.c +++ b/virt/kvm/kvm_main.c @@ -2043,7 +2043,8 @@ out: else if (vcpu->halt_poll_ns < halt_poll_ns && block_ns < halt_poll_ns) grow_halt_poll_ns(vcpu); - } + } else + vcpu->halt_poll_ns = 0; trace_kvm_vcpu_wakeup(block_ns, waited); }