aboutsummaryrefslogtreecommitdiffstats
path: root/arch/s390/kvm
diff options
context:
space:
mode:
authorHendrik Brueckner <brueckner@linux.vnet.ibm.com>2015-09-29 04:04:41 -0400
committerMartin Schwidefsky <schwidefsky@de.ibm.com>2015-10-14 08:32:08 -0400
commitb5510d9b68c33964abd938148f407ad3789e369f (patch)
tree7cf0eb3e5e74e861030f850c8c0894095ac70bc9 /arch/s390/kvm
parent395e6aa1d0ffbc493a04469aa8f6751ed2aad8c5 (diff)
s390/fpu: always enable the vector facility if it is available
If the kernel detects that the s390 hardware supports the vector facility, it is enabled by default at an early stage. To force it off, use the novx kernel parameter. Note that there is a small time window, where the vector facility is enabled before it is forced to be off. With enabling the vector facility by default, the FPU save and restore functions can be improved. They do not longer require to manage expensive control register updates to enable or disable the vector enablement control for particular processes. Signed-off-by: Hendrik Brueckner <brueckner@linux.vnet.ibm.com> Reviewed-by: Heiko Carstens <heiko.carstens@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'arch/s390/kvm')
-rw-r--r--arch/s390/kvm/kvm-s390.c6
1 files changed, 0 insertions, 6 deletions
diff --git a/arch/s390/kvm/kvm-s390.c b/arch/s390/kvm/kvm-s390.c
index 0a67c40eece9..c6b4063fce29 100644
--- a/arch/s390/kvm/kvm-s390.c
+++ b/arch/s390/kvm/kvm-s390.c
@@ -1292,7 +1292,6 @@ int kvm_arch_vcpu_init(struct kvm_vcpu *vcpu)
1292static inline void save_fpu_to(struct fpu *dst) 1292static inline void save_fpu_to(struct fpu *dst)
1293{ 1293{
1294 dst->fpc = current->thread.fpu.fpc; 1294 dst->fpc = current->thread.fpu.fpc;
1295 dst->flags = current->thread.fpu.flags;
1296 dst->regs = current->thread.fpu.regs; 1295 dst->regs = current->thread.fpu.regs;
1297} 1296}
1298 1297
@@ -1303,7 +1302,6 @@ static inline void save_fpu_to(struct fpu *dst)
1303static inline void load_fpu_from(struct fpu *from) 1302static inline void load_fpu_from(struct fpu *from)
1304{ 1303{
1305 current->thread.fpu.fpc = from->fpc; 1304 current->thread.fpu.fpc = from->fpc;
1306 current->thread.fpu.flags = from->flags;
1307 current->thread.fpu.regs = from->regs; 1305 current->thread.fpu.regs = from->regs;
1308} 1306}
1309 1307
@@ -1315,15 +1313,12 @@ void kvm_arch_vcpu_load(struct kvm_vcpu *vcpu, int cpu)
1315 1313
1316 if (test_kvm_facility(vcpu->kvm, 129)) { 1314 if (test_kvm_facility(vcpu->kvm, 129)) {
1317 current->thread.fpu.fpc = vcpu->run->s.regs.fpc; 1315 current->thread.fpu.fpc = vcpu->run->s.regs.fpc;
1318 current->thread.fpu.flags = FPU_USE_VX;
1319 /* 1316 /*
1320 * Use the register save area in the SIE-control block 1317 * Use the register save area in the SIE-control block
1321 * for register restore and save in kvm_arch_vcpu_put() 1318 * for register restore and save in kvm_arch_vcpu_put()
1322 */ 1319 */
1323 current->thread.fpu.vxrs = 1320 current->thread.fpu.vxrs =
1324 (__vector128 *)&vcpu->run->s.regs.vrs; 1321 (__vector128 *)&vcpu->run->s.regs.vrs;
1325 /* Always enable the vector extension for KVM */
1326 __ctl_set_vx();
1327 } else 1322 } else
1328 load_fpu_from(&vcpu->arch.guest_fpregs); 1323 load_fpu_from(&vcpu->arch.guest_fpregs);
1329 1324
@@ -2326,7 +2321,6 @@ int kvm_s390_vcpu_store_status(struct kvm_vcpu *vcpu, unsigned long addr)
2326 * registers and the FPC value and store them in the 2321 * registers and the FPC value and store them in the
2327 * guest_fpregs structure. 2322 * guest_fpregs structure.
2328 */ 2323 */
2329 WARN_ON(!is_vx_task(current)); /* XXX remove later */
2330 vcpu->arch.guest_fpregs.fpc = current->thread.fpu.fpc; 2324 vcpu->arch.guest_fpregs.fpc = current->thread.fpu.fpc;
2331 convert_vx_to_fp(vcpu->arch.guest_fpregs.fprs, 2325 convert_vx_to_fp(vcpu->arch.guest_fpregs.fprs,
2332 current->thread.fpu.vxrs); 2326 current->thread.fpu.vxrs);