aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/kvm
diff options
context:
space:
mode:
authorPaul Mackerras <paulus@samba.org>2013-09-05 23:23:21 -0400
committerAlexander Graf <agraf@suse.de>2013-10-17 08:45:00 -0400
commit42d7604d0c5a24f448983424eb19e3845cb031ba (patch)
treeb0d6683cbc35854fda611cb3a7b740b42c3dfb13 /arch/powerpc/kvm
parentc0867fd50943d71d9f0bc5078393ce4ec76b3923 (diff)
KVM: PPC: Book3S HV: Implement H_CONFER
The H_CONFER hypercall is used when a guest vcpu is spinning on a lock held by another vcpu which has been preempted, and the spinning vcpu wishes to give its timeslice to the lock holder. We implement this in the straightforward way using kvm_vcpu_yield_to(). Signed-off-by: Paul Mackerras <paulus@samba.org> Signed-off-by: Alexander Graf <agraf@suse.de>
Diffstat (limited to 'arch/powerpc/kvm')
-rw-r--r--arch/powerpc/kvm/book3s_hv.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/arch/powerpc/kvm/book3s_hv.c b/arch/powerpc/kvm/book3s_hv.c
index 56f57af7e738..a010aa4cd026 100644
--- a/arch/powerpc/kvm/book3s_hv.c
+++ b/arch/powerpc/kvm/book3s_hv.c
@@ -538,6 +538,15 @@ int kvmppc_pseries_do_hcall(struct kvm_vcpu *vcpu)
538 } 538 }
539 break; 539 break;
540 case H_CONFER: 540 case H_CONFER:
541 target = kvmppc_get_gpr(vcpu, 4);
542 if (target == -1)
543 break;
544 tvcpu = kvmppc_find_vcpu(vcpu->kvm, target);
545 if (!tvcpu) {
546 ret = H_PARAMETER;
547 break;
548 }
549 kvm_vcpu_yield_to(tvcpu);
541 break; 550 break;
542 case H_REGISTER_VPA: 551 case H_REGISTER_VPA:
543 ret = do_h_register_vpa(vcpu, kvmppc_get_gpr(vcpu, 4), 552 ret = do_h_register_vpa(vcpu, kvmppc_get_gpr(vcpu, 4),