s390/kvm: validate the floating-point control before restoring it
authorHendrik Brueckner <brueckner@linux.vnet.ibm.com>
Fri, 12 Jun 2015 11:53:51 +0000 (13:53 +0200)
committerMartin Schwidefsky <schwidefsky@de.ibm.com>
Wed, 22 Jul 2015 07:57:59 +0000 (09:57 +0200)
commit96b2d7a83a27fbae10fc57c39577a7e2689d9f0a
treeb091792af14cd9f1ffcf54cdce37c1f4f402664d
parent4084eb7767418861a81d9e24d222f2536537f58e
s390/kvm: validate the floating-point control before restoring it

The kvm_arch_vcpu_load() does not validate whether the floating-point
control (FPC) is valid.  Further, the return code of the restore is not
checked too.  If the FPC is invalid, the restore fails and the host FPC
value might remain.  The correct behavior would be to clear the FPC if it
is not valid.  Hence, validate the FPC value and, optionally, reset the
value before restoring it.

Reviewed-by: David Hildenbrand <dahi@linux.vnet.ibm.com>
Signed-off-by: Hendrik Brueckner <brueckner@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
arch/s390/kvm/kvm-s390.c