Skip to content

Commit 5b3e0cd

Browse files
committed
Merge tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm
Pull kvm fixes from Paolo Bonzini: "Unless anything comes from the ARM side, this should be the last pull request for this release - and it's mostly documentation: - Document the interaction between KVM_CAP_HALT_POLL and halt_poll_ns - s390: fix multi-epoch extension in nested guests - x86: fix uninitialized variable on nested triple fault" * tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm: KVM: Document the interaction between KVM_CAP_HALT_POLL and halt_poll_ns KVM: Move halt-polling documentation into common directory KVM: x86: fix uninitialized variable use on KVM_REQ_TRIPLE_FAULT KVM: s390: vsie: Fix the initialization of the epoch extension (epdx) field
2 parents b71101d + 34e30eb commit 5b3e0cd

File tree

6 files changed

+25
-11
lines changed

6 files changed

+25
-11
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/x86/halt-polling.rst renamed to 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

Documentation/virt/kvm/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,5 @@ KVM
1717

1818
locking
1919
vcpu-requests
20+
halt-polling
2021
review-checklist

Documentation/virt/kvm/x86/index.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ KVM for x86 systems
1010
amd-memory-encryption
1111
cpuid
1212
errata
13-
halt-polling
1413
hypercalls
1514
mmu
1615
msr

arch/s390/kvm/vsie.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -546,8 +546,10 @@ static int shadow_scb(struct kvm_vcpu *vcpu, struct vsie_page *vsie_page)
546546
if (test_kvm_cpu_feat(vcpu->kvm, KVM_S390_VM_CPU_FEAT_CEI))
547547
scb_s->eca |= scb_o->eca & ECA_CEI;
548548
/* Epoch Extension */
549-
if (test_kvm_facility(vcpu->kvm, 139))
549+
if (test_kvm_facility(vcpu->kvm, 139)) {
550550
scb_s->ecd |= scb_o->ecd & ECD_MEF;
551+
scb_s->epdx = scb_o->epdx;
552+
}
551553

552554
/* etoken */
553555
if (test_kvm_facility(vcpu->kvm, 156))

arch/x86/kvm/x86.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10574,8 +10574,8 @@ static int vcpu_enter_guest(struct kvm_vcpu *vcpu)
1057410574
vcpu->run->exit_reason = KVM_EXIT_SHUTDOWN;
1057510575
vcpu->mmio_needed = 0;
1057610576
r = 0;
10577+
goto out;
1057710578
}
10578-
goto out;
1057910579
}
1058010580
if (kvm_check_request(KVM_REQ_APF_HALT, vcpu)) {
1058110581
/* Page is swapped out. Do synthetic halt */

0 commit comments

Comments
 (0)