aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/kvm/powerpc.c
diff options
context:
space:
mode:
authorAvi Kivity <avi@redhat.com>2010-05-13 05:35:17 -0400
committerAvi Kivity <avi@redhat.com>2010-08-01 03:35:48 -0400
commit93736624635235cc5372ffca6d62816d02170724 (patch)
tree801205636b4d6da4127a6d33873902d690431f52 /arch/powerpc/kvm/powerpc.c
parent19483d144023f7f4817dedafe26d5fe9ff2e7087 (diff)
KVM: Consolidate arch specific vcpu ioctl locking
Now that all arch specific ioctls have centralized locking, it is easy to move it to the central dispatcher. Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'arch/powerpc/kvm/powerpc.c')
-rw-r--r--arch/powerpc/kvm/powerpc.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/arch/powerpc/kvm/powerpc.c b/arch/powerpc/kvm/powerpc.c
index caeed7b31bf9..a1d87508892e 100644
--- a/arch/powerpc/kvm/powerpc.c
+++ b/arch/powerpc/kvm/powerpc.c
@@ -512,17 +512,16 @@ long kvm_arch_vcpu_ioctl(struct file *filp,
512 void __user *argp = (void __user *)arg; 512 void __user *argp = (void __user *)arg;
513 long r; 513 long r;
514 514
515 if (ioctl == KVM_INTERRUPT) { 515 switch (ioctl) {
516 case KVM_INTERRUPT: {
516 struct kvm_interrupt irq; 517 struct kvm_interrupt irq;
517 r = -EFAULT; 518 r = -EFAULT;
518 if (copy_from_user(&irq, argp, sizeof(irq))) 519 if (copy_from_user(&irq, argp, sizeof(irq)))
519 goto out_nolock; 520 goto out;
520 r = kvm_vcpu_ioctl_interrupt(vcpu, &irq); 521 r = kvm_vcpu_ioctl_interrupt(vcpu, &irq);
521 goto out_nolock; 522 goto out;
522 } 523 }
523 524
524 vcpu_load(vcpu);
525 switch (ioctl) {
526 case KVM_ENABLE_CAP: 525 case KVM_ENABLE_CAP:
527 { 526 {
528 struct kvm_enable_cap cap; 527 struct kvm_enable_cap cap;
@@ -537,8 +536,6 @@ long kvm_arch_vcpu_ioctl(struct file *filp,
537 } 536 }
538 537
539out: 538out:
540 vcpu_put(vcpu);
541out_nolock:
542 return r; 539 return r;
543} 540}
544 541