KVM: s390: introduce AIS capability
authorYi Min Zhao <zyimin@linux.vnet.ibm.com>
Fri, 10 Mar 2017 08:29:38 +0000 (09:29 +0100)
committerChristian Borntraeger <borntraeger@de.ibm.com>
Fri, 7 Apr 2017 07:11:11 +0000 (09:11 +0200)
Introduce a cap to enable AIS facility bit, and add documentation
for this capability.

Signed-off-by: Yi Min Zhao <zyimin@linux.vnet.ibm.com>
Signed-off-by: Fei Li <sherrylf@linux.vnet.ibm.com>
Reviewed-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
Documentation/virtual/kvm/api.txt
arch/s390/kvm/kvm-s390.c
include/uapi/linux/kvm.h

index 72525085847908defb0e5bc55e3a67f69db51750..598278cd0dc5d39d165fb430938fe26781a1ab43 100644 (file)
@@ -4110,6 +4110,14 @@ Returns: 0 on success; -EINVAL if the machine does not support
 
 Allows use of guarded storage for the KVM guest.
 
+7.10 KVM_CAP_S390_AIS
+
+Architectures: s390
+Parameters: none
+
+Allow use of adapter-interruption suppression.
+Returns: 0 on success; -EBUSY if a VCPU has already been created.
+
 8. Other capabilities.
 ----------------------
 
index 977cc1660a83865374ff5875738075c345309ad6..11b7d66389916bbb8d2d2474143ead5e9b7caa27 100644 (file)
@@ -380,6 +380,7 @@ int kvm_vm_ioctl_check_extension(struct kvm *kvm, long ext)
        case KVM_CAP_S390_SKEYS:
        case KVM_CAP_S390_IRQ_STATE:
        case KVM_CAP_S390_USER_INSTR0:
+       case KVM_CAP_S390_AIS:
                r = 1;
                break;
        case KVM_CAP_S390_MEM_OP:
@@ -544,6 +545,20 @@ static int kvm_vm_ioctl_enable_cap(struct kvm *kvm, struct kvm_enable_cap *cap)
                VM_EVENT(kvm, 3, "ENABLE: CAP_S390_RI %s",
                         r ? "(not available)" : "(success)");
                break;
+       case KVM_CAP_S390_AIS:
+               mutex_lock(&kvm->lock);
+               if (kvm->created_vcpus) {
+                       r = -EBUSY;
+               } else {
+                       set_kvm_facility(kvm->arch.model.fac_mask, 72);
+                       set_kvm_facility(kvm->arch.model.fac_list, 72);
+                       kvm->arch.float_int.ais_enabled = 1;
+                       r = 0;
+               }
+               mutex_unlock(&kvm->lock);
+               VM_EVENT(kvm, 3, "ENABLE: AIS %s",
+                        r ? "(not available)" : "(success)");
+               break;
        case KVM_CAP_S390_GS:
                r = -EINVAL;
                mutex_lock(&kvm->lock);
index c9d522765f8f77f2c12413b45d88bf6db8a8c0b5..33dd2a4e36dc3f124756f92ef1ce586e8456a3d3 100644 (file)
@@ -884,6 +884,7 @@ struct kvm_ppc_resize_hpt {
 #define KVM_CAP_PPC_MMU_HASH_V3 135
 #define KVM_CAP_IMMEDIATE_EXIT 136
 #define KVM_CAP_S390_GS 137
+#define KVM_CAP_S390_AIS 138
 
 #ifdef KVM_CAP_IRQ_ROUTING