KVM: s390: Introduce Vector Enhancements facility 1 to the guest
authorMaxim Samoylov <max7255@linux.vnet.ibm.com>
Wed, 10 Feb 2016 09:31:23 +0000 (10:31 +0100)
committerChristian Borntraeger <borntraeger@de.ibm.com>
Mon, 30 Jan 2017 10:17:29 +0000 (11:17 +0100)
We can directly forward the vector enhancement facility 1 to the guest
if available and VX is requested by user space.

Please note that user space will have to take care of the final state
of the facility bit when migrating to older machines.

Reviewed-by: David Hildenbrand <dahi@linux.vnet.ibm.com>
Signed-off-by: Maxim Samoylov <max7255@linux.vnet.ibm.com>
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
arch/s390/kvm/kvm-s390.c

index 4f74511015b872d7c3c9d3c859305cb5b0f34fa2..1fd4b854efdc39b074b2c291f81cade9a31bf236 100644 (file)
@@ -505,6 +505,10 @@ static int kvm_vm_ioctl_enable_cap(struct kvm *kvm, struct kvm_enable_cap *cap)
                } else if (MACHINE_HAS_VX) {
                        set_kvm_facility(kvm->arch.model.fac_mask, 129);
                        set_kvm_facility(kvm->arch.model.fac_list, 129);
+                       if (test_facility(135)) {
+                               set_kvm_facility(kvm->arch.model.fac_mask, 135);
+                               set_kvm_facility(kvm->arch.model.fac_list, 135);
+                       }
                        r = 0;
                } else
                        r = -EINVAL;