aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJames Hogan <james.hogan@imgtec.com>2016-10-17 11:37:45 -0400
committerJames Hogan <james.hogan@imgtec.com>2017-02-03 10:21:01 -0500
commit8af0e3c2e89e56dc5b064e5854b87a19e70e2710 (patch)
tree47a0684736ec776f4d280f92400f0caaf721da7c
parentdacc3ed1dd608ff9553dcede6cd05369030ed099 (diff)
KVM: MIPS/Emulate: Fix CACHE emulation for EVA hosts
Use protected_writeback_dcache_line() instead of flush_dcache_line(), and protected_flush_icache_line() instead of flush_icache_line(), so that CACHEE (the EVA variant) is used on EVA host kernels. Without this, guest floating point branch delay slot emulation via a trampoline on the user stack fails on EVA host kernels due to failure of the icache sync, resulting in the break instruction getting skipped and execution from the stack. 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
-rw-r--r--arch/mips/kvm/emulate.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/arch/mips/kvm/emulate.c b/arch/mips/kvm/emulate.c
index 3ced662e012e..9ac8e45017ce 100644
--- a/arch/mips/kvm/emulate.c
+++ b/arch/mips/kvm/emulate.c
@@ -1792,7 +1792,7 @@ enum emulation_result kvm_mips_emulate_cache(union mips_instruction inst,
1792skip_fault: 1792skip_fault:
1793 /* XXXKYMA: Only a subset of cache ops are supported, used by Linux */ 1793 /* XXXKYMA: Only a subset of cache ops are supported, used by Linux */
1794 if (op_inst == Hit_Writeback_Inv_D || op_inst == Hit_Invalidate_D) { 1794 if (op_inst == Hit_Writeback_Inv_D || op_inst == Hit_Invalidate_D) {
1795 flush_dcache_line(va); 1795 protected_writeback_dcache_line(va);
1796 1796
1797#ifdef CONFIG_KVM_MIPS_DYN_TRANS 1797#ifdef CONFIG_KVM_MIPS_DYN_TRANS
1798 /* 1798 /*
@@ -1802,8 +1802,8 @@ skip_fault:
1802 kvm_mips_trans_cache_va(inst, opc, vcpu); 1802 kvm_mips_trans_cache_va(inst, opc, vcpu);
1803#endif 1803#endif
1804 } else if (op_inst == Hit_Invalidate_I) { 1804 } else if (op_inst == Hit_Invalidate_I) {
1805 flush_dcache_line(va); 1805 protected_writeback_dcache_line(va);
1806 flush_icache_line(va); 1806 protected_flush_icache_line(va);
1807 1807
1808#ifdef CONFIG_KVM_MIPS_DYN_TRANS 1808#ifdef CONFIG_KVM_MIPS_DYN_TRANS
1809 /* Replace the CACHE instruction, with a SYNCI */ 1809 /* Replace the CACHE instruction, with a SYNCI */