From: Christian Borntraeger Date: Fri, 28 Dec 2018 08:43:37 +0000 (+0100) Subject: KVM: s390: add vector enhancements facility 2 to cpumodel X-Git-Url: http://git.cdn.openwrt.org/?a=commitdiff_plain;h=7832e91cd33f21f3cf82b003478c292915a1ec14;p=openwrt%2Fstaging%2Fblogic.git KVM: s390: add vector enhancements facility 2 to cpumodel If vector support is enabled, the vector enhancements facility 2 might also be enabled. We can directly forward this facility to the guest if available and VX is requested by user space. Please note that user space can and will have the final decision on the facility bits for a guests. Signed-off-by: Christian Borntraeger Reviewed-by: Janosch Frank Reviewed-by: Collin Walling Reviewed-by: David Hildenbrand --- diff --git a/arch/s390/kvm/kvm-s390.c b/arch/s390/kvm/kvm-s390.c index 4638303ba6a8..03ddbe5e62bc 100644 --- a/arch/s390/kvm/kvm-s390.c +++ b/arch/s390/kvm/kvm-s390.c @@ -657,6 +657,10 @@ int kvm_vm_ioctl_enable_cap(struct kvm *kvm, struct kvm_enable_cap *cap) set_kvm_facility(kvm->arch.model.fac_mask, 135); set_kvm_facility(kvm->arch.model.fac_list, 135); } + if (test_facility(148)) { + set_kvm_facility(kvm->arch.model.fac_mask, 148); + set_kvm_facility(kvm->arch.model.fac_list, 148); + } r = 0; } else r = -EINVAL;