Skip to content

Commit

Permalink
KVM: s390: Do not yield when target is already running
Browse files Browse the repository at this point in the history
If the target is already running we do not need to yield.

Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
Reviewed-by: David Hildenbrand <david@redhat.com>
Reviewed-by: Cornelia Huck <cohuck@redhat.com>
  • Loading branch information
Christian Borntraeger committed Oct 10, 2019
1 parent 8474e5c commit c7b7de6
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions arch/s390/kvm/diag.c
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,10 @@ static int __diag_time_slice_end_directed(struct kvm_vcpu *vcpu)
if (!tcpu)
goto no_yield;

/* target already running */
if (READ_ONCE(tcpu->cpu) >= 0)
goto no_yield;

if (kvm_vcpu_yield_to(tcpu) <= 0)
goto no_yield;

Expand Down

0 comments on commit c7b7de6

Please sign in to comment.