aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/kvm/powerpc.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/powerpc/kvm/powerpc.c')
-rw-r--r--arch/powerpc/kvm/powerpc.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/arch/powerpc/kvm/powerpc.c b/arch/powerpc/kvm/powerpc.c
index 0bb6a7e826d1..646bfd256e5d 100644
--- a/arch/powerpc/kvm/powerpc.c
+++ b/arch/powerpc/kvm/powerpc.c
@@ -150,6 +150,7 @@ int kvm_dev_ioctl_check_extension(long ext)
150 case KVM_CAP_PPC_SEGSTATE: 150 case KVM_CAP_PPC_SEGSTATE:
151 case KVM_CAP_PPC_PAIRED_SINGLES: 151 case KVM_CAP_PPC_PAIRED_SINGLES:
152 case KVM_CAP_PPC_UNSET_IRQ: 152 case KVM_CAP_PPC_UNSET_IRQ:
153 case KVM_CAP_ENABLE_CAP:
153 r = 1; 154 r = 1;
154 break; 155 break;
155 case KVM_CAP_COALESCED_MMIO: 156 case KVM_CAP_COALESCED_MMIO:
@@ -465,6 +466,23 @@ int kvm_vcpu_ioctl_interrupt(struct kvm_vcpu *vcpu, struct kvm_interrupt *irq)
465 return 0; 466 return 0;
466} 467}
467 468
469static int kvm_vcpu_ioctl_enable_cap(struct kvm_vcpu *vcpu,
470 struct kvm_enable_cap *cap)
471{
472 int r;
473
474 if (cap->flags)
475 return -EINVAL;
476
477 switch (cap->cap) {
478 default:
479 r = -EINVAL;
480 break;
481 }
482
483 return r;
484}
485
468int kvm_arch_vcpu_ioctl_get_mpstate(struct kvm_vcpu *vcpu, 486int kvm_arch_vcpu_ioctl_get_mpstate(struct kvm_vcpu *vcpu,
469 struct kvm_mp_state *mp_state) 487 struct kvm_mp_state *mp_state)
470{ 488{
@@ -493,6 +511,15 @@ long kvm_arch_vcpu_ioctl(struct file *filp,
493 r = kvm_vcpu_ioctl_interrupt(vcpu, &irq); 511 r = kvm_vcpu_ioctl_interrupt(vcpu, &irq);
494 break; 512 break;
495 } 513 }
514 case KVM_ENABLE_CAP:
515 {
516 struct kvm_enable_cap cap;
517 r = -EFAULT;
518 if (copy_from_user(&cap, argp, sizeof(cap)))
519 goto out;
520 r = kvm_vcpu_ioctl_enable_cap(vcpu, &cap);
521 break;
522 }
496 default: 523 default:
497 r = -EINVAL; 524 r = -EINVAL;
498 } 525 }