All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] KVM: Halt-polling documentation cleanups
@ 2022-12-01 19:52 David Matlack
  2022-12-01 19:52 ` [PATCH 1/2] KVM: Move halt-polling documentation into common directory David Matlack
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: David Matlack @ 2022-12-01 19:52 UTC (permalink / raw)
  To: Paolo Bonzini
  Cc: David Matlack, Oliver Upton, Jim Mattson, kvm, Yanan Wang,
	Christian Borntraeger

This series makes some small cleanups to the existing halt-polling
documentation. Patch 1 moves halt-polling.rst out of the x86-specific
directory, and patch 2 clarifies the interaction between
KVM_CAP_HALT_POLL and kvm.halt_poll_ns, which was recently broken and a
source of confusion [1].

[1] https://lore.kernel.org/kvm/03f2f5ab-e809-2ba5-bd98-3393c3b843d2@de.ibm.com/

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

David Matlack (2):
  KVM: Move halt-polling documentation into common directory
  KVM: Document the interaction between KVM_CAP_HALT_POLL and
    halt_poll_ns

 Documentation/virt/kvm/api.rst                    | 15 +++++++--------
 Documentation/virt/kvm/{x86 => }/halt-polling.rst | 13 +++++++++++++
 Documentation/virt/kvm/index.rst                  |  1 +
 Documentation/virt/kvm/x86/index.rst              |  1 -
 4 files changed, 21 insertions(+), 9 deletions(-)
 rename Documentation/virt/kvm/{x86 => }/halt-polling.rst (92%)


base-commit: 7e3bba93f42e9d9abe81344bdba5ddc635b7c449
-- 
2.39.0.rc0.267.gcb52ba06e7-goog


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH 1/2] KVM: Move halt-polling documentation into common directory
  2022-12-01 19:52 [PATCH 0/2] KVM: Halt-polling documentation cleanups David Matlack
@ 2022-12-01 19:52 ` David Matlack
  2022-12-01 19:52 ` [PATCH 2/2] KVM: Document the interaction between KVM_CAP_HALT_POLL and halt_poll_ns David Matlack
  2022-12-02 18:28 ` [PATCH 0/2] KVM: Halt-polling documentation cleanups Paolo Bonzini
  2 siblings, 0 replies; 4+ messages in thread
From: David Matlack @ 2022-12-01 19:52 UTC (permalink / raw)
  To: Paolo Bonzini
  Cc: David Matlack, Oliver Upton, Jim Mattson, kvm, Yanan Wang,
	Christian Borntraeger

Move halt-polling.rst into the common KVM documentation directory and
out of the x86-specific directory. Halt-polling is a common feature and
the existing documentation is already written as such.

Signed-off-by: David Matlack <dmatlack@google.com>
---
 Documentation/virt/kvm/{x86 => }/halt-polling.rst | 0
 Documentation/virt/kvm/index.rst                  | 1 +
 Documentation/virt/kvm/x86/index.rst              | 1 -
 3 files changed, 1 insertion(+), 1 deletion(-)
 rename Documentation/virt/kvm/{x86 => }/halt-polling.rst (100%)

diff --git a/Documentation/virt/kvm/x86/halt-polling.rst b/Documentation/virt/kvm/halt-polling.rst
similarity index 100%
rename from Documentation/virt/kvm/x86/halt-polling.rst
rename to Documentation/virt/kvm/halt-polling.rst
diff --git a/Documentation/virt/kvm/index.rst b/Documentation/virt/kvm/index.rst
index e0a2c74e1043..ad13ec55ddfe 100644
--- a/Documentation/virt/kvm/index.rst
+++ b/Documentation/virt/kvm/index.rst
@@ -17,4 +17,5 @@ KVM
 
    locking
    vcpu-requests
+   halt-polling
    review-checklist
diff --git a/Documentation/virt/kvm/x86/index.rst b/Documentation/virt/kvm/x86/index.rst
index 7ff588826b9f..9ece6b8dc817 100644
--- a/Documentation/virt/kvm/x86/index.rst
+++ b/Documentation/virt/kvm/x86/index.rst
@@ -10,7 +10,6 @@ KVM for x86 systems
    amd-memory-encryption
    cpuid
    errata
-   halt-polling
    hypercalls
    mmu
    msr
-- 
2.39.0.rc0.267.gcb52ba06e7-goog


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 2/2] KVM: Document the interaction between KVM_CAP_HALT_POLL and halt_poll_ns
  2022-12-01 19:52 [PATCH 0/2] KVM: Halt-polling documentation cleanups David Matlack
  2022-12-01 19:52 ` [PATCH 1/2] KVM: Move halt-polling documentation into common directory David Matlack
@ 2022-12-01 19:52 ` David Matlack
  2022-12-02 18:28 ` [PATCH 0/2] KVM: Halt-polling documentation cleanups Paolo Bonzini
  2 siblings, 0 replies; 4+ messages in thread
From: David Matlack @ 2022-12-01 19:52 UTC (permalink / raw)
  To: Paolo Bonzini
  Cc: David Matlack, Oliver Upton, Jim Mattson, kvm, Yanan Wang,
	Christian Borntraeger

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 <dmatlack@google.com>
---
 Documentation/virt/kvm/api.rst          | 15 +++++++--------
 Documentation/virt/kvm/halt-polling.rst | 13 +++++++++++++
 2 files changed, 20 insertions(+), 8 deletions(-)

diff --git a/Documentation/virt/kvm/api.rst b/Documentation/virt/kvm/api.rst
index eee9f857a986..896914e3a847 100644
--- a/Documentation/virt/kvm/api.rst
+++ b/Documentation/virt/kvm/api.rst
@@ -7213,14 +7213,13 @@ veto the transition.
 :Parameters: args[0] is the maximum poll time in nanoseconds
 :Returns: 0 on success; -1 on error
 
-This capability overrides the kvm module parameter halt_poll_ns for the
-target VM.
-
-VCPU polling allows a VCPU to poll for wakeup events instead of immediately
-scheduling during guest halts. The maximum time a VCPU can spend polling is
-controlled by the kvm module parameter halt_poll_ns. This capability allows
-the maximum halt time to specified on a per-VM basis, effectively overriding
-the module parameter for the target VM.
+KVM_CAP_HALT_POLL overrides the kvm.halt_poll_ns module parameter to set the
+maximum halt-polling time for all vCPUs in the target VM. This capability can
+be invoked at any time and any number of times to dynamically change the
+maximum halt-polling time.
+
+See Documentation/virt/kvm/halt-polling.rst for more information on halt
+polling.
 
 7.21 KVM_CAP_X86_USER_SPACE_MSR
 -------------------------------
diff --git a/Documentation/virt/kvm/halt-polling.rst b/Documentation/virt/kvm/halt-polling.rst
index 4922e4a15f18..3fae39b1a5ba 100644
--- a/Documentation/virt/kvm/halt-polling.rst
+++ b/Documentation/virt/kvm/halt-polling.rst
@@ -119,6 +119,19 @@ These module parameters can be set from the debugfs files in:
 Note: that these module parameters are system wide values and are not able to
       be tuned on a per vm basis.
 
+Any changes to these parameters will be picked up by new and existing vCPUs the
+next time they halt, with the notable exception of VMs using KVM_CAP_HALT_POLL
+(see next section).
+
+KVM_CAP_HALT_POLL
+=================
+
+KVM_CAP_HALT_POLL is a VM capability that allows userspace to override halt_poll_ns
+on a per-VM basis. VMs using KVM_CAP_HALT_POLL ignore halt_poll_ns completely (but
+still obey halt_poll_ns_grow, halt_poll_ns_grow_start, and halt_poll_ns_shrink).
+
+See Documentation/virt/kvm/api.rst for more information on this capability.
+
 Further Notes
 =============
 
-- 
2.39.0.rc0.267.gcb52ba06e7-goog


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH 0/2] KVM: Halt-polling documentation cleanups
  2022-12-01 19:52 [PATCH 0/2] KVM: Halt-polling documentation cleanups David Matlack
  2022-12-01 19:52 ` [PATCH 1/2] KVM: Move halt-polling documentation into common directory David Matlack
  2022-12-01 19:52 ` [PATCH 2/2] KVM: Document the interaction between KVM_CAP_HALT_POLL and halt_poll_ns David Matlack
@ 2022-12-02 18:28 ` Paolo Bonzini
  2 siblings, 0 replies; 4+ messages in thread
From: Paolo Bonzini @ 2022-12-02 18:28 UTC (permalink / raw)
  To: David Matlack
  Cc: Oliver Upton, Jim Mattson, kvm, Yanan Wang, Christian Borntraeger

On 12/1/22 20:52, David Matlack wrote:
> This series makes some small cleanups to the existing halt-polling
> documentation. Patch 1 moves halt-polling.rst out of the x86-specific
> directory, and patch 2 clarifies the interaction between
> KVM_CAP_HALT_POLL and kvm.halt_poll_ns, which was recently broken and a
> source of confusion [1].
> 
> [1] https://lore.kernel.org/kvm/03f2f5ab-e809-2ba5-bd98-3393c3b843d2@de.ibm.com/
> 
> Cc: Yanan Wang <wangyanan55@huawei.com>
> Cc: Christian Borntraeger <borntraeger@linux.ibm.com>
> 
> David Matlack (2):
>    KVM: Move halt-polling documentation into common directory
>    KVM: Document the interaction between KVM_CAP_HALT_POLL and
>      halt_poll_ns
> 
>   Documentation/virt/kvm/api.rst                    | 15 +++++++--------
>   Documentation/virt/kvm/{x86 => }/halt-polling.rst | 13 +++++++++++++
>   Documentation/virt/kvm/index.rst                  |  1 +
>   Documentation/virt/kvm/x86/index.rst              |  1 -
>   4 files changed, 21 insertions(+), 9 deletions(-)
>   rename Documentation/virt/kvm/{x86 => }/halt-polling.rst (92%)
> 
> 
> base-commit: 7e3bba93f42e9d9abe81344bdba5ddc635b7c449

Queued, thanks.

Paolo


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-12-02 18:29 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-12-01 19:52 [PATCH 0/2] KVM: Halt-polling documentation cleanups David Matlack
2022-12-01 19:52 ` [PATCH 1/2] KVM: Move halt-polling documentation into common directory David Matlack
2022-12-01 19:52 ` [PATCH 2/2] KVM: Document the interaction between KVM_CAP_HALT_POLL and halt_poll_ns David Matlack
2022-12-02 18:28 ` [PATCH 0/2] KVM: Halt-polling documentation cleanups Paolo Bonzini

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.