KVM: polling: add architecture backend to disable polling
There are cases where halt polling is unwanted. For example when running KVM on an over committed LPAR we rather want to give back the CPU to neighbour LPARs instead of polling. Let us provide a callback that allows architectures to disable polling. Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com> Acked-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Cornelia Huck <cohuck@redhat.com> Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
This commit is contained in:
@@ -57,3 +57,6 @@ config HAVE_KVM_VCPU_ASYNC_IOCTL
|
||||
|
||||
config HAVE_KVM_VCPU_RUN_PID_CHANGE
|
||||
bool
|
||||
|
||||
config HAVE_KVM_NO_POLL
|
||||
bool
|
||||
|
@@ -2253,7 +2253,7 @@ void kvm_vcpu_block(struct kvm_vcpu *vcpu)
|
||||
u64 block_ns;
|
||||
|
||||
start = cur = ktime_get();
|
||||
if (vcpu->halt_poll_ns) {
|
||||
if (vcpu->halt_poll_ns && !kvm_arch_no_poll(vcpu)) {
|
||||
ktime_t stop = ktime_add_ns(ktime_get(), vcpu->halt_poll_ns);
|
||||
|
||||
++vcpu->stat.halt_attempted_poll;
|
||||
|
Reference in New Issue
Block a user