original_kernel/arch/mips/kvm
James Hogan e1e575f6b0 KVM: MIPS: Precalculate MMIO load resume PC
The advancing of the PC when completing an MMIO load is done before
re-entering the guest, i.e. before restoring the guest ASID. However if
the load is in a branch delay slot it may need to access guest code to
read the prior branch instruction. This isn't safe in TLB mapped code at
the moment, nor in the future when we'll access unmapped guest segments
using direct user accessors too, as it could read the branch from host
user memory instead.

Therefore calculate the resume PC in advance while we're still in the
right context and save it in the new vcpu->arch.io_pc (replacing the no
longer needed vcpu->arch.pending_load_cause), and restore it on MMIO
completion.

Fixes: e685c689f3 ("KVM/MIPS32: Privileged instruction/target branch emulation.")
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
Cc: <stable@vger.kernel.org> # 3.10.x-
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2016-10-26 13:43:55 +02:00
..
00README.txt
Kconfig
Makefile
callback.c
commpage.c MIPS: kvm: Audit and remove any unnecessary uses of module.h 2016-10-05 01:31:20 +02:00
commpage.h
dyntrans.c MIPS: kvm: Audit and remove any unnecessary uses of module.h 2016-10-05 01:31:20 +02:00
emulate.c KVM: MIPS: Precalculate MMIO load resume PC 2016-10-26 13:43:55 +02:00
entry.c
fpu.S
interrupt.c MIPS: kvm: Audit and remove any unnecessary uses of module.h 2016-10-05 01:31:20 +02:00
interrupt.h
mips.c KVM: MIPS: Fix lazy user ASID regenerate for SMP 2016-10-26 13:43:41 +02:00
mmu.c KVM: MIPS: Fix lazy user ASID regenerate for SMP 2016-10-26 13:43:41 +02:00
msa.S
stats.c
tlb.c MIPS: KVM: Reset CP0_PageMask during host TLB flush 2016-08-01 18:42:27 +02:00
trace.h
trap_emul.c Merge branch 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus 2016-10-15 09:26:12 -07:00