KVM: s390: handle floating point registers in the run ioctl not in vcpu_put/load
authorChristian Borntraeger <borntraeger@de.ibm.com>
Tue, 22 Nov 2016 08:29:38 +0000 (09:29 +0100)
committerChristian Borntraeger <borntraeger@de.ibm.com>
Tue, 22 Nov 2016 18:32:35 +0000 (19:32 +0100)
commite1788bb995befed5831c99cee6527dfb080a46c0
tree62cfe675eaef6a446b0c25724fcdee6be5257051
parent31d8b8d41a7e3e8db081972a63ef1de276ef8ab4
KVM: s390: handle floating point registers in the run ioctl not in vcpu_put/load

Right now we switch the host fprs/vrs in kvm_arch_vcpu_load and switch
back in kvm_arch_vcpu_put. This process is already optimized
since commit 9977e886cbbc7 ("s390/kernel: lazy restore fpu registers")
avoiding double save/restores on schedule. We still reload the pointers
and test the guest fpc on each context switch, though.

We can minimize the cost of vcpu_load/put by doing the test in the
VCPU_RUN ioctl itself. As most VCPU threads almost never exit to
userspace in the common fast path, this allows to avoid this overhead
for the common case (eventfd driven I/O, all exits including sleep
handled in the kernel) - making kvm_arch_vcpu_load/put basically
disappear in perf top.

Also adapt the fpu get/set ioctls.

Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
Reviewed-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
arch/s390/kvm/kvm-s390.c