mbox series

[RFC,0/3] KVM: Restore original behavior of kvm.halt_poll_ns

Message ID 20221117001657.1067231-1-dmatlack@google.com (mailing list archive)
Headers show
Series KVM: Restore original behavior of kvm.halt_poll_ns | expand

Message

David Matlack Nov. 17, 2022, 12:16 a.m. UTC
This series restores the original behavior of the module parameter
kvm.halt_poll_ns in VMs not using KVM_CAP_HALT_POLL. This should allow
admins to administer VMs not using KVM_CAP_HALT_POLL just as they were
before this capability was introduced.

VMs that use KVM_CAP_HALT_POLL can be administered through userspace
changes that invoke KVM_CAP_HALT_POLL (i.e. the capability can be
invoked multiple times to change the max halt poll time).

If any admin needs a system-wide override of KVM_CAP_HALT_POLL we can
add that through a new mechanism (e.g. a new bool module parameter).

Compile-tested only. I want to get feedback from Christian and Yunan if
this approach would address their concerns.

Cc: Christian Borntraeger <borntraeger@de.ibm.com>
Cc: Yanan Wang <wangyanan55@huawei.com>

David Matlack (3):
  KVM: Cap vcpu->halt_poll_ns before halting rather than after
  KVM: Avoid re-reading kvm->max_halt_poll_ns during halt-polling
  KVM: Obey kvm.halt_poll_ns in VMs not using KVM_CAP_HALT_POLL

 include/linux/kvm_host.h |  1 +
 virt/kvm/kvm_main.c      | 52 ++++++++++++++++++++++++++++++++--------
 2 files changed, 43 insertions(+), 10 deletions(-)


base-commit: d663b8a285986072428a6a145e5994bc275df994