linux-mips
[Top] [All Lists]

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

To: linux-mips@linux-mips.org, ralf@linux-mips.org, kvm@vger.kernel.org, Sanjay Lal <sanjayl@kymasys.com>
Subject: [PATCH 23/31] mips/kvm: Hook into CP unusable exception handler.
From: David Daney <ddaney.cavm@gmail.com>
Date: Fri, 7 Jun 2013 16:03:27 -0700
Cc: linux-kernel@vger.kernel.org, David Daney <david.daney@cavium.com>
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; bh=StQaX6e1pWjJQ/0Stg2SvHNvDHAERV6u5Uy43XvmoZQ=; b=L5EZi12ilIs8fBSLiI/lAg43IwJSxA+nk094jFfYCQmQtmwKjXRX2K0N2tlSRqeTnp OZ7j2DER3JSdej+ZlKuyhPIGjmHPIbU05WMCfwpA3b4UJdOVVG698Ax3wXvJMXLjTirA zdZUZ7OFUvGXHgaSvW3WrSn/m7jH4soeF9T8371pn7FMebW0HoL+bSaeCIvETB+Xa75H 0ICcJLTvgJtZGvuwzc+ZbkTZO3kckKAufQcWfL18KxP6lVjmm79kUkbbakkCncFYqqyB 1uFT6xU2QhFKxNDdRuEkUdgG31Tg8OfVho6vwniwglZZtL89QkLukFF9vAKAZ0V3F7Z2 RLkg==
In-reply-to: <1370646215-6543-1-git-send-email-ddaney.cavm@gmail.com>
List-archive: <http://www.linux-mips.org/archives/linux-mips/>
List-help: <mailto:ecartis@linux-mips.org?Subject=help>
List-id: linux-mips <linux-mips.eddie.linux-mips.org>
List-owner: <mailto:ralf@linux-mips.org>
List-post: <mailto:linux-mips@linux-mips.org>
List-software: Ecartis version 1.0.0
List-subscribe: <mailto:ecartis@linux-mips.org?subject=subscribe%20linux-mips>
List-unsubscribe: <mailto:ecartis@linux-mips.org?subject=unsubscribe%20linux-mips>
Original-recipient: rfc822;linux-mips@linux-mips.org
References: <1370646215-6543-1-git-send-email-ddaney.cavm@gmail.com>
Sender: linux-mips-bounce@linux-mips.org
From: David Daney <david.daney@cavium.com>

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

Signed-off-by: David Daney <david.daney@cavium.com>
---
 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


<Prev in Thread] Current Thread [Next in Thread>