KVM: s390: Introduce BCD Vector Instructions to the guest
authorGuenther Hutzl <hutzl@linux.vnet.ibm.com>
Fri, 3 Jun 2016 12:37:17 +0000 (14:37 +0200)
committerChristian Borntraeger <borntraeger@de.ibm.com>
Mon, 30 Jan 2017 10:17:30 +0000 (11:17 +0100)
We can directly forward the vector BCD instructions 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.

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

index 1fd4b854efdc39b074b2c291f81cade9a31bf236..69401b8d4521a0bf266084bf2254da8bc2185fb2 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(134)) {
+                               set_kvm_facility(kvm->arch.model.fac_mask, 134);
+                               set_kvm_facility(kvm->arch.model.fac_list, 134);
+                       }
                        if (test_facility(135)) {
                                set_kvm_facility(kvm->arch.model.fac_mask, 135);
                                set_kvm_facility(kvm->arch.model.fac_list, 135);