]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
KVM: MIPS/T&E: Don't treat code fetch faults as MMIO
authorJames Hogan <james.hogan@imgtec.com>
Mon, 28 Nov 2016 18:39:24 +0000 (18:39 +0000)
committerJames Hogan <james.hogan@imgtec.com>
Fri, 3 Feb 2017 15:21:05 +0000 (15:21 +0000)
commita1ecc54d7ea629538116351a3ccc7d86bb9a3c69
tree3e012830ccb843c32c83eba923be93fbb86b883c
parenta98dd7410370634496aa500abf90ec6336b494ae
KVM: MIPS/T&E: Don't treat code fetch faults as MMIO

In order to make use of the CP0_BadInstr & CP0_BadInstrP registers we
need to be a bit more careful not to treat code fetch faults as MMIO,
lest we hit an UNPREDICTABLE register value when we try to emulate the
MMIO load instruction but there was no valid instruction word available
to the hardware.

Add a kvm_is_ifetch_fault() helper to try to figure out whether a load
fault was due to a code fetch, and prevent MMIO instruction emulation in
that case.

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/trap_emul.c