Skip to content

Commit

Permalink
KVM: fix polling for guest halt continued even if disable it
Browse files Browse the repository at this point in the history
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 <borntraeger@de.ibm.com>
Signed-off-by: Wanpeng Li <wanpeng.li@hotmail.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
  • Loading branch information
Wanpeng Li authored and Paolo Bonzini committed Sep 14, 2015
1 parent 6ff33f3 commit edb9272
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion virt/kvm/kvm_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -2043,7 +2043,8 @@ void kvm_vcpu_block(struct kvm_vcpu *vcpu)
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);
}
Expand Down

0 comments on commit edb9272

Please sign in to comment.