]> git.baikalelectronics.ru Git - kernel.git/commit
MIPS: KVM: Sign extend MFC0/RDHWR results
authorJames Hogan <james.hogan@imgtec.com>
Fri, 8 Jul 2016 10:53:28 +0000 (11:53 +0100)
committerPaolo Bonzini <pbonzini@redhat.com>
Mon, 1 Aug 2016 16:42:25 +0000 (18:42 +0200)
commite7a3b543e4c8fc86374c48b42c5130703abf1bda
tree5aa672f62fde25a0eaedcdbca40b9db3001f877c
parent6a7c9cef4cf76f56a32ba67a97f003565392fa68
MIPS: KVM: Sign extend MFC0/RDHWR results

When emulating MFC0 instructions to load 32-bit values from guest COP0
registers and the RDHWR instruction to read the CC (Count) register,
sign extend the result to comply with the MIPS64 architecture. The
result must be in canonical 32-bit form or the guest may malfunction.

Signed-off-by: James Hogan <james.hogan@imgtec.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: "Radim Krčmář" <rkrcmar@redhat.com>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: linux-mips@linux-mips.org
Cc: kvm@vger.kernel.org
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/mips/kvm/emulate.c