]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commit
KVM: MIPS: Improve kvm_get_inst() error return
authorJames Hogan <james.hogan@imgtec.com>
Mon, 28 Nov 2016 17:23:14 +0000 (17:23 +0000)
committerJames Hogan <james.hogan@imgtec.com>
Fri, 3 Feb 2017 15:21:06 +0000 (15:21 +0000)
commit122e51d47418f74a69a93bf02f5535d11ff75bf5
tree38aad30f6698d4397b75e0f9f05f2c03f6ea2db6
parenta1ecc54d7ea629538116351a3ccc7d86bb9a3c69
KVM: MIPS: Improve kvm_get_inst() error return

Currently kvm_get_inst() returns KVM_INVALID_INST in the event of a
fault reading the guest instruction. This has the rather arbitrary magic
value 0xdeadbeef. This API isn't very robust, and in fact 0xdeadbeef is
a valid MIPS64 instruction encoding, namely "ld t1,-16657(s5)".

Therefore change the kvm_get_inst() API to return 0 or -EFAULT, and to
return the instruction via a u32 *out argument. We can then drop the
KVM_INVALID_INST definition entirely.

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
arch/mips/include/asm/kvm_host.h
arch/mips/kvm/emulate.c
arch/mips/kvm/mips.c
arch/mips/kvm/mmu.c