aboutsummaryrefslogtreecommitdiffstats
path: root/arch/s390/kvm/kvm-s390.c
diff options
context:
space:
mode:
authorCarsten Otte <cotte@de.ibm.com>2012-05-15 08:15:26 -0400
committerMarcelo Tosatti <mtosatti@redhat.com>2012-05-17 20:06:02 -0400
commit14eebd917d154f3181d2cb219e40b18eec314db7 (patch)
tree7e95ec1b713f26456f606e277526a8cc7b1f58e3 /arch/s390/kvm/kvm-s390.c
parent1526bf9ccf310f1d35c1275b8b477a249d25aaf2 (diff)
KVM: s390: KVM_GET/SET_ONEREG for s390
This patch enables KVM_CAP_ONE_REG for s390 and implements stubs for KVM_GET/SET_ONE_REG. This is based on the ppc implementation. Signed-off-by: Carsten Otte <cotte@de.ibm.com> Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Diffstat (limited to 'arch/s390/kvm/kvm-s390.c')
-rw-r--r--arch/s390/kvm/kvm-s390.c38
1 files changed, 38 insertions, 0 deletions
diff --git a/arch/s390/kvm/kvm-s390.c b/arch/s390/kvm/kvm-s390.c
index 5c761bffa02d..894b3e47b8c1 100644
--- a/arch/s390/kvm/kvm-s390.c
+++ b/arch/s390/kvm/kvm-s390.c
@@ -135,6 +135,7 @@ int kvm_dev_ioctl_check_extension(long ext)
135 case KVM_CAP_S390_UCONTROL: 135 case KVM_CAP_S390_UCONTROL:
136#endif 136#endif
137 case KVM_CAP_SYNC_REGS: 137 case KVM_CAP_SYNC_REGS:
138 case KVM_CAP_ONE_REG:
138 r = 1; 139 r = 1;
139 break; 140 break;
140 case KVM_CAP_NR_VCPUS: 141 case KVM_CAP_NR_VCPUS:
@@ -439,6 +440,31 @@ int kvm_arch_vcpu_should_kick(struct kvm_vcpu *vcpu)
439 return 0; 440 return 0;
440} 441}
441 442
443static int kvm_arch_vcpu_ioctl_get_one_reg(struct kvm_vcpu *vcpu,
444 struct kvm_one_reg *reg)
445{
446 int r = -EINVAL;
447
448 switch (reg->id) {
449 default:
450 break;
451 }
452
453 return r;
454}
455
456static int kvm_arch_vcpu_ioctl_set_one_reg(struct kvm_vcpu *vcpu,
457 struct kvm_one_reg *reg)
458{
459 int r = -EINVAL;
460
461 switch (reg->id) {
462 default:
463 break;
464 }
465
466 return r;
467}
442 468
443static int kvm_arch_vcpu_ioctl_initial_reset(struct kvm_vcpu *vcpu) 469static int kvm_arch_vcpu_ioctl_initial_reset(struct kvm_vcpu *vcpu)
444{ 470{
@@ -770,6 +796,18 @@ long kvm_arch_vcpu_ioctl(struct file *filp,
770 case KVM_S390_INITIAL_RESET: 796 case KVM_S390_INITIAL_RESET:
771 r = kvm_arch_vcpu_ioctl_initial_reset(vcpu); 797 r = kvm_arch_vcpu_ioctl_initial_reset(vcpu);
772 break; 798 break;
799 case KVM_SET_ONE_REG:
800 case KVM_GET_ONE_REG: {
801 struct kvm_one_reg reg;
802 r = -EFAULT;
803 if (copy_from_user(&reg, argp, sizeof(reg)))
804 break;
805 if (ioctl == KVM_SET_ONE_REG)
806 r = kvm_arch_vcpu_ioctl_set_one_reg(vcpu, &reg);
807 else
808 r = kvm_arch_vcpu_ioctl_get_one_reg(vcpu, &reg);
809 break;
810 }
773#ifdef CONFIG_KVM_S390_UCONTROL 811#ifdef CONFIG_KVM_S390_UCONTROL
774 case KVM_S390_UCAS_MAP: { 812 case KVM_S390_UCAS_MAP: {
775 struct kvm_s390_ucas_mapping ucasmap; 813 struct kvm_s390_ucas_mapping ucasmap;