linux/arch/mips/kvm
James Hogan 6df82a7b88 MIPS: KVM: Fix CACHE triggered exception emulation
When emulating TLB miss / invalid exceptions during CACHE instruction
emulation, be sure to set up the correct PC and host_cp0_badvaddr state
for the kvm_mips_emlulate_tlb*_ld() function to pick up for guest EPC
and BadVAddr.

PC needs to be rewound otherwise the guest EPC will end up pointing at
the next instruction after the faulting CACHE instruction.

host_cp0_badvaddr must be set because guest CACHE instructions trap with
a Coprocessor Unusable exception, which doesn't update the host BadVAddr
as a TLB exception would.

This doesn't tend to get hit when dynamic translation of emulated
instructions is enabled, since only the first execution of each CACHE
instruction actually goes through this code path, with subsequent
executions hitting the SYNCI instruction that it gets replaced with.

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: kvm@vger.kernel.org
Cc: linux-mips@linux-mips.org
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2016-06-14 10:59:45 +02:00
..
00README.txt KVM/MIPS32: Release notes and KVM module Makefile 2013-05-08 03:55:35 +02:00
Kconfig rcu: Make SRCU optional by using CONFIG_SRCU 2015-01-06 11:04:29 -08:00
Makefile MIPS: KVM: Add base guest MSA support 2015-03-27 21:25:19 +00:00
callback.c MIPS: KVM: Convert EXPORT_SYMBOL to _GPL 2016-01-24 03:13:24 +01:00
commpage.c MIPS: KVM: Skip memory cleaning in kvm_mips_commpage_init() 2014-06-30 16:52:03 +02:00
commpage.h MIPS: KVM: Rename files to remove the prefix "kvm_" and "kvm_mips_" 2014-06-30 16:52:03 +02:00
dyntrans.c MIPS: KVM: Refactor added offsetof()s 2016-01-24 03:14:15 +01:00
emulate.c MIPS: KVM: Fix CACHE triggered exception emulation 2016-06-14 10:59:45 +02:00
fpu.S MIPS: KVM: Add base guest FPU support 2015-03-27 21:25:14 +00:00
interrupt.c MIPS: Move Cause.ExcCode trap codes to mipsregs.h 2016-01-24 03:15:51 +01:00
interrupt.h MIPS: KVM: Fix modular KVM under QEMU 2016-06-14 10:59:44 +02:00
locore.S MIPS: KVM: Fix modular KVM under QEMU 2016-06-14 10:59:44 +02:00
mips.c MIPS: KVM: Fix modular KVM under QEMU 2016-06-14 10:59:44 +02:00
msa.S MIPS: KVM: Add base guest MSA support 2015-03-27 21:25:19 +00:00
stats.c MIPS: KVM: Add MSA exception handling 2015-03-27 21:25:20 +00:00
tlb.c Small release overall. 2016-05-19 11:27:09 -07:00
trace.h KVM: MIPS: Fix trace event to save PC directly 2015-03-02 19:17:52 -03:00
trap_emul.c Small release overall. 2016-05-19 11:27:09 -07:00