[PATCH 23/31] mips/kvm: Hook into CP unusable exception handler.

From: David Daney
Date: Fri Jun 07 2013 - 19:06:56 EST


From: David Daney <david.daney@xxxxxxxxxx>

The MIPS VZ KVM code needs this to be able to manage the FPU.

Signed-off-by: David Daney <david.daney@xxxxxxxxxx>
---
arch/mips/kernel/traps.c | 8 ++++++++
1 file changed, 8 insertions(+)

diff --git a/arch/mips/kernel/traps.c b/arch/mips/kernel/traps.c
index fca0a2f..2bdeb32 100644
--- a/arch/mips/kernel/traps.c
+++ b/arch/mips/kernel/traps.c
@@ -56,6 +56,7 @@
#include <asm/types.h>
#include <asm/stacktrace.h>
#include <asm/uasm.h>
+#include <asm/kvm_mips_vz.h>

extern void check_wait(void);
extern asmlinkage void rollback_handle_int(void);
@@ -1045,6 +1046,13 @@ asmlinkage void do_cpu(struct pt_regs *regs)
int status;
unsigned long __maybe_unused flags;

+#ifdef CONFIG_KVM_MIPSVZ
+ if (test_tsk_thread_flag(current, TIF_GUESTMODE)) {
+ if (mipsvz_cp_unusable(regs))
+ return;
+ }
+#endif
+
die_if_kernel("do_cpu invoked from kernel context!", regs);

cpid = (regs->cp0_cause >> CAUSEB_CE) & 3;
--
1.7.11.7

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/