History

KVM: s390: Base infrastructure for enabling capabilities.

Make s390 support KVM_ENABLE_CAP.

Cornelia Huck committed 13 years ago

Commit d6712df1 parent f379aae2 files · +27 −1Browse files

Unified · Split

2 files
  1. Documentation/virtual/kvm/api.txt +1 −1
  2. arch/s390/kvm/kvm-s390.c +26 −0
Documentation/virtual/kvm/api.txt+1−1
@@ -913,7 +913,7 @@ documentation when it pops into existence). · 912 unmodified lines
913913 4.37 KVM_ENABLE_CAP
914914
915915 Capability: KVM_CAP_ENABLE_CAP
916−Architectures: ppc
916+Architectures: ppc, s390
917917 Type: vcpu ioctl
918918 Parameters: struct kvm_enable_cap (in)
919919 Returns: 0 on success; -1 on error
arch/s390/kvm/kvm-s390.c+26−0
@@ -140,6 +140,7 @@ int kvm_dev_ioctl_check_extension(long ext) · 139 unmodified lines
140140 #endif
141141 case KVM_CAP_SYNC_REGS:
142142 case KVM_CAP_ONE_REG:
143+ case KVM_CAP_ENABLE_CAP:
143144 r = 1;
144145 break;
145146 case KVM_CAP_NR_VCPUS:
@@ -808,6 +809,22 @@ int kvm_s390_vcpu_store_status(struct kvm_vcpu *vcpu, unsigned long addr) · 662 unmodified lines
808809 return 0;
809810 }
810811
812+static int kvm_vcpu_ioctl_enable_cap(struct kvm_vcpu *vcpu,
813+ struct kvm_enable_cap *cap)
814+{
815+ int r;
816+
817+ if (cap->flags)
818+ return -EINVAL;
819+
820+ switch (cap->cap) {
821+ default:
822+ r = -EINVAL;
823+ break;
824+ }
825+ return r;
826+}
827+
811828 long kvm_arch_vcpu_ioctl(struct file *filp,
812829 unsigned int ioctl, unsigned long arg)
813830 {
@@ -894,6 +911,15 @@ long kvm_arch_vcpu_ioctl(struct file *filp, · 80 unmodified lines
894911 r = 0;
895912 break;
896913 }
914+ case KVM_ENABLE_CAP:
915+ {
916+ struct kvm_enable_cap cap;
917+ r = -EFAULT;
918+ if (copy_from_user(&cap, argp, sizeof(cap)))
919+ break;
920+ r = kvm_vcpu_ioctl_enable_cap(vcpu, &cap);
921+ break;
922+ }
897923 default:
898924 r = -ENOTTY;
899925 }

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t