linux-mips
[Top] [All Lists]

Re: [PATCH 20/31] mips/kvm: Hook into TLB fault handlers.

To: David Daney <ddaney.cavm@gmail.com>
Subject: Re: [PATCH 20/31] mips/kvm: Hook into TLB fault handlers.
From: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Date: Sat, 08 Jun 2013 03:34:26 +0400
Cc: linux-mips@linux-mips.org, ralf@linux-mips.org, kvm@vger.kernel.org, Sanjay Lal <sanjayl@kymasys.com>, linux-kernel@vger.kernel.org, David Daney <david.daney@cavium.com>
In-reply-to: <1370646215-6543-21-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>
Organization: Cogent Embedded
Original-recipient: rfc822;linux-mips@linux-mips.org
References: <1370646215-6543-1-git-send-email-ddaney.cavm@gmail.com> <1370646215-6543-21-git-send-email-ddaney.cavm@gmail.com>
Sender: linux-mips-bounce@linux-mips.org
User-agent: Mozilla/5.0 (X11; Linux i686; rv:17.0) Gecko/20130509 Thunderbird/17.0.6
Hello.

On 06/08/2013 03:03 AM, David Daney wrote:

From: David Daney <david.daney@cavium.com>

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@cavium.com>
---
  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))

   Any reason not to collapse these into single *if*?

+                       return;
+       }
+#endif
+



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