Commit c7b7de63 authored by Christian Borntraeger's avatar Christian Borntraeger

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: default avatarChristian Borntraeger <borntraeger@de.ibm.com>
Reviewed-by: default avatarDavid Hildenbrand <david@redhat.com>
Reviewed-by: default avatarCornelia Huck <cohuck@redhat.com>
parent 8474e5ca
...@@ -168,6 +168,10 @@ static int __diag_time_slice_end_directed(struct kvm_vcpu *vcpu) ...@@ -168,6 +168,10 @@ static int __diag_time_slice_end_directed(struct kvm_vcpu *vcpu)
if (!tcpu) if (!tcpu)
goto no_yield; goto no_yield;
/* target already running */
if (READ_ONCE(tcpu->cpu) >= 0)
goto no_yield;
if (kvm_vcpu_yield_to(tcpu) <= 0) if (kvm_vcpu_yield_to(tcpu) <= 0)
goto no_yield; goto no_yield;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment