aboutsummaryrefslogtreecommitdiffstats
path: root/arch/s390
diff options
context:
space:
mode:
authorEric Farman <farman@linux.vnet.ibm.com>2014-04-30 13:39:46 -0400
committerChristian Borntraeger <borntraeger@de.ibm.com>2015-03-06 07:49:35 -0500
commit13211ea7b47db3d8ee2ff258a9a973a6d3aa3d43 (patch)
treebbaabf7f0ff3f8df71c38c0d507315b2aed14993 /arch/s390
parentbc17de7c966504b287a1dceb76a523d8b7816731 (diff)
KVM: s390: Enable vector support for capable guest
We finally have all the pieces in place, so let's include the vector facility bit in the mask of available hardware facilities for the guest to recognize. Also, enable the vector functionality in the guest control blocks, to avoid a possible vector data exception that would otherwise occur when a vector instruction is issued by the guest operating system. Signed-off-by: Eric Farman <farman@linux.vnet.ibm.com> Reviewed-by: Thomas Huth <thuth@linux.vnet.ibm.com> Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
Diffstat (limited to 'arch/s390')
-rw-r--r--arch/s390/include/asm/kvm_host.h4
-rw-r--r--arch/s390/kvm/kvm-s390.c5
2 files changed, 8 insertions, 1 deletions
diff --git a/arch/s390/include/asm/kvm_host.h b/arch/s390/include/asm/kvm_host.h
index 3fe2597e4a4e..347a3333d618 100644
--- a/arch/s390/include/asm/kvm_host.h
+++ b/arch/s390/include/asm/kvm_host.h
@@ -172,7 +172,9 @@ struct kvm_s390_sie_block {
172 __u32 fac; /* 0x01a0 */ 172 __u32 fac; /* 0x01a0 */
173 __u8 reserved1a4[20]; /* 0x01a4 */ 173 __u8 reserved1a4[20]; /* 0x01a4 */
174 __u64 cbrlo; /* 0x01b8 */ 174 __u64 cbrlo; /* 0x01b8 */
175 __u8 reserved1c0[30]; /* 0x01c0 */ 175 __u8 reserved1c0[8]; /* 0x01c0 */
176 __u32 ecd; /* 0x01c8 */
177 __u8 reserved1cc[18]; /* 0x01cc */
176 __u64 pp; /* 0x01de */ 178 __u64 pp; /* 0x01de */
177 __u8 reserved1e6[2]; /* 0x01e6 */ 179 __u8 reserved1e6[2]; /* 0x01e6 */
178 __u64 itdba; /* 0x01e8 */ 180 __u64 itdba; /* 0x01e8 */
diff --git a/arch/s390/kvm/kvm-s390.c b/arch/s390/kvm/kvm-s390.c
index 0c045cfdce9b..02e03c862a60 100644
--- a/arch/s390/kvm/kvm-s390.c
+++ b/arch/s390/kvm/kvm-s390.c
@@ -104,6 +104,7 @@ struct kvm_stats_debugfs_item debugfs_entries[] = {
104unsigned long kvm_s390_fac_list_mask[] = { 104unsigned long kvm_s390_fac_list_mask[] = {
105 0xff82fffbf4fc2000UL, 105 0xff82fffbf4fc2000UL,
106 0x005c000000000000UL, 106 0x005c000000000000UL,
107 0x4000000000000000UL,
107}; 108};
108 109
109unsigned long kvm_s390_fac_list_mask_size(void) 110unsigned long kvm_s390_fac_list_mask_size(void)
@@ -1186,6 +1187,10 @@ int kvm_arch_vcpu_setup(struct kvm_vcpu *vcpu)
1186 vcpu->arch.sie_block->eca |= 1; 1187 vcpu->arch.sie_block->eca |= 1;
1187 if (sclp_has_sigpif()) 1188 if (sclp_has_sigpif())
1188 vcpu->arch.sie_block->eca |= 0x10000000U; 1189 vcpu->arch.sie_block->eca |= 0x10000000U;
1190 if (vcpu->kvm->arch.use_vectors) {
1191 vcpu->arch.sie_block->eca |= 0x00020000;
1192 vcpu->arch.sie_block->ecd |= 0x20000000;
1193 }
1189 vcpu->arch.sie_block->ictl |= ICTL_ISKE | ICTL_SSKE | ICTL_RRBE; 1194 vcpu->arch.sie_block->ictl |= ICTL_ISKE | ICTL_SSKE | ICTL_RRBE;
1190 1195
1191 if (kvm_s390_cmma_enabled(vcpu->kvm)) { 1196 if (kvm_s390_cmma_enabled(vcpu->kvm)) {