[SRU][B][D][Patch 3/9] KVM: s390: add vector enhancements facility 2 to cpumodel

frank.heimes at canonical.com frank.heimes at canonical.com
Tue Jul 16 06:54:33 UTC 2019

From: Christian Borntraeger <borntraeger at de.ibm.com>

BugLink: https://bugs.launchpad.net/bugs/1836153

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 <borntraeger at de.ibm.com>
Reviewed-by: Janosch Frank <frankja at linux.ibm.com>
Reviewed-by: Collin Walling <walling at linux.ibm.com>
Reviewed-by: David Hildenbrand <david at redhat.com>
(cherry picked from commit 7832e91cd33f21f3cf82b003478c292915a1ec14)
Signed-off-by: Frank Heimes <frank.heimes at canonical.com>
 arch/s390/kvm/kvm-s390.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/arch/s390/kvm/kvm-s390.c b/arch/s390/kvm/kvm-s390.c
index 951cb26..8378668 100644
--- a/arch/s390/kvm/kvm-s390.c
+++ b/arch/s390/kvm/kvm-s390.c
@@ -599,6 +599,10 @@ static 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;

More information about the kernel-team mailing list