MIPS KVM Guest FPU & SIMD (MSA) Support

Add guest FPU and MIPS SIMD Architecture (MSA) support to MIPS KVM, by
enabling the host FPU/MSA while in guest mode. This adds two new KVM
capabilities, KVM_CAP_MIPS_FPU & KVM_CAP_MIPS_MSA, and supports the 3 FP
register modes (FR=0, FR=1, FRE=1), and 128-bit MSA vector registers,
with lazy FPU/MSA context save and restore.

Some required MIPS FP/MSA fixes are merged in from a branch in the MIPS
tree first.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iQIcBAABAgAGBQJVFc3aAAoJEGwLaZPeOHZ6DjwQAI4yYxOD3QmyIGMekQpFj3iE
5DhOpkXGTC6UHm2bI9ftvfkpfRVTc3ow4EnY+ytx4YIXjSnNn/xHnYmNJxVWQimQ
jPCUuTQhPTX7BcYd/TGwu6inXe3f1I0vP7oLXUXA239wc/b/Y6KOfYJdewEGefqC
2kPxd/Towtx+HfGb8bicXYpHYDP0JrFfUClDtCHIsWmm2tlv4rkT0TD9gkhRjkP+
hQTyZlWF2279Cmk2c+r5ou7HRqK2EnUnry1N5YuY7+hKnqBvMW3mD8XNMvzIqKIJ
CksFLKtHBx4OJojP3q6HX5BYFRzCItG3uUirQ3xZTzjZBEl8nKTKWIAoPtT7STgu
qe9WCIelMvLp0tW1zVodS1L9tYXm2ijbqcrzAM0XaaysBiT3YrgN6R/m8fHyT3VP
0oqg8ozUTLPj6kjH6CsVAgjLhRvWFCZB+YH8kqRphmLXOXCWDmkdbaLL16R7kjGQ
ajsx9lSkqFicUgycTpmlXlY6VdvPMekGbxBewf2H6PMuVHIO3LPnD80Z190yoMZs
9KzNQAFoy2uJs4nHVupa+dgqViQHMFt4wFGLg9+qnolcclA9PCQ/6nnMqSc2jQJ7
B8UGqesUR5j/9KD6vXE6Y9v7qZtTEc7NLwWVVfzXaHRmBIaFlWP9o0rJnFm3pGsZ
WDC/bktf1XzCsHvCwIrS
=jsOv
-----END PGP SIGNATURE-----
MIPS: KVM: Wire up MSA capability

Now that the code is in place for KVM to support MIPS SIMD Architecutre
(MSA) in MIPS guests, wire up the new KVM_CAP_MIPS_MSA capability.

For backwards compatibility, the capability must be explicitly enabled
in order to detect or make use of MSA from the guest.

The capability is not supported if the hardware supports MSA vector
partitioning, since the extra support cannot be tested yet and it
extends the state that the userland program would have to save.

Signed-off-by: James Hogan <james.hogan@imgtec.com>
Acked-by: Paolo Bonzini <pbonzini@redhat.com>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: Gleb Natapov <gleb@kernel.org>
Cc: Jonathan Corbet <corbet@lwn.net>
Cc: linux-mips@linux-mips.org
Cc: kvm@vger.kernel.org
Cc: linux-api@vger.kernel.org
Cc: linux-doc@vger.kernel.org
3 files changed