From: David Daney <david.daney@xxxxxxxxxx>[...]
If the CPU is operating in guest mode when a TLB related excpetion
occurs, give KVM a chance to do emulation.
Signed-off-by: David Daney <david.daney@xxxxxxxxxx>
---
arch/mips/mm/fault.c | 8 ++++++++
arch/mips/mm/tlbex-fault.S | 6 ++++++
2 files changed, 14 insertions(+)
diff --git a/arch/mips/mm/fault.c b/arch/mips/mm/fault.c
index 0fead53..9391da49 100644
--- a/arch/mips/mm/fault.c
+++ b/arch/mips/mm/fault.c
@@ -50,6 +51,13 @@ asmlinkage void __kprobes do_page_fault(struct pt_regs *regs, unsigned long writ
field, regs->cp0_epc);
#endif
+#ifdef CONFIG_KVM_MIPSVZ
+ if (test_tsk_thread_flag(current, TIF_GUESTMODE)) {
+ if (mipsvz_page_fault(regs, write, address))
+ return;
+ }
+#endif
+