Skip to content

Commit c7b7de6

Browse files
committed
KVM: s390: Do not yield when target is already running
If the target is already running we do not need to yield. Signed-off-by: Christian Borntraeger <[email protected]> Reviewed-by: David Hildenbrand <[email protected]> Reviewed-by: Cornelia Huck <[email protected]>
1 parent 8474e5c commit c7b7de6

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

arch/s390/kvm/diag.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,10 @@ static int __diag_time_slice_end_directed(struct kvm_vcpu *vcpu)
168168
if (!tcpu)
169169
goto no_yield;
170170

171+
/* target already running */
172+
if (READ_ONCE(tcpu->cpu) >= 0)
173+
goto no_yield;
174+
171175
if (kvm_vcpu_yield_to(tcpu) <= 0)
172176
goto no_yield;
173177

0 commit comments

Comments
 (0)