]> git.baikalelectronics.ru Git - kernel.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)
commitc6d2775b902bde4662404852660d7db1b89df761
tree3e012830ccb843c32c83eba923be93fbb86b883c
parent2b10a4e01b150552b3548ab7af69ffcd72d964b0
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