Skip to content

Commit 34e30eb

Browse files
dmatlackbonzini
authored andcommitted
KVM: Document the interaction between KVM_CAP_HALT_POLL and halt_poll_ns
Clarify the existing documentation about how KVM_CAP_HALT_POLL and halt_poll_ns interact to make it clear that VMs using KVM_CAP_HALT_POLL ignore halt_poll_ns. Signed-off-by: David Matlack <[email protected]> Message-Id: <[email protected]> Signed-off-by: Paolo Bonzini <[email protected]>
1 parent b8b43a4 commit 34e30eb

File tree

2 files changed

+20
-8
lines changed

2 files changed

+20
-8
lines changed

Documentation/virt/kvm/api.rst

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7213,14 +7213,13 @@ veto the transition.
72137213
:Parameters: args[0] is the maximum poll time in nanoseconds
72147214
:Returns: 0 on success; -1 on error
72157215

7216-
This capability overrides the kvm module parameter halt_poll_ns for the
7217-
target VM.
7218-
7219-
VCPU polling allows a VCPU to poll for wakeup events instead of immediately
7220-
scheduling during guest halts. The maximum time a VCPU can spend polling is
7221-
controlled by the kvm module parameter halt_poll_ns. This capability allows
7222-
the maximum halt time to specified on a per-VM basis, effectively overriding
7223-
the module parameter for the target VM.
7216+
KVM_CAP_HALT_POLL overrides the kvm.halt_poll_ns module parameter to set the
7217+
maximum halt-polling time for all vCPUs in the target VM. This capability can
7218+
be invoked at any time and any number of times to dynamically change the
7219+
maximum halt-polling time.
7220+
7221+
See Documentation/virt/kvm/halt-polling.rst for more information on halt
7222+
polling.
72247223

72257224
7.21 KVM_CAP_X86_USER_SPACE_MSR
72267225
-------------------------------

Documentation/virt/kvm/halt-polling.rst

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,19 @@ These module parameters can be set from the debugfs files in:
119119
Note: that these module parameters are system wide values and are not able to
120120
be tuned on a per vm basis.
121121

122+
Any changes to these parameters will be picked up by new and existing vCPUs the
123+
next time they halt, with the notable exception of VMs using KVM_CAP_HALT_POLL
124+
(see next section).
125+
126+
KVM_CAP_HALT_POLL
127+
=================
128+
129+
KVM_CAP_HALT_POLL is a VM capability that allows userspace to override halt_poll_ns
130+
on a per-VM basis. VMs using KVM_CAP_HALT_POLL ignore halt_poll_ns completely (but
131+
still obey halt_poll_ns_grow, halt_poll_ns_grow_start, and halt_poll_ns_shrink).
132+
133+
See Documentation/virt/kvm/api.rst for more information on this capability.
134+
122135
Further Notes
123136
=============
124137

0 commit comments

Comments
 (0)