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@xxxxxxxxxx> Cc: Yanan Wang <wangyanan55@xxxxxxxxxx> 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 -- 2.38.1.431.g37b22c650d-goog