linux-mips
[Top] [All Lists]

[PATCH 22/31] mips/kvm: Split get_new_mmu_context into two parts.

To: linux-mips@linux-mips.org, ralf@linux-mips.org, kvm@vger.kernel.org, Sanjay Lal <sanjayl@kymasys.com>
Subject: [PATCH 22/31] mips/kvm: Split get_new_mmu_context into two parts.
From: David Daney <ddaney.cavm@gmail.com>
Date: Fri, 7 Jun 2013 16:03:26 -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=/5Y8PTAm7wOs6BL5Cm8KYBKvOVPHJgA0Q1o7EwKsSKo=; b=aEijGJ+oq3mhGybSVIVfybAP/8o/D1T1AUMdDSQGqLBTz5cvrszm3kJv05/mfx8JTS 3QchEKontW7XYWemGIo7oPHSr47K6at0zmOhtIPbI9pgpcvIoyOEvKItGI3VO7jzJaLD TfbpEwy4b0dNRZj6OOgA9nvLzCt8KMdZYXddNt4rykCdJu9myIdtqTEo0kf3zmHC9wyK WstWHw86Ks9aNXVUlBEN002XnDMm4SM/U3H+5jiwYIT9hovebque3G9d63D+KxlObMjI kM6Pw7cfvvZRVxYLWvHC/guU81hm8aLlNtPoegKRowIvKhWUSR/GM0TGWw28l6Cp9Vfo WjZQ==
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 new function (part) get_new_asid() can now be used from MIPSVZ code.

Signed-off-by: David Daney <david.daney@cavium.com>
---
 arch/mips/include/asm/mmu_context.h | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/arch/mips/include/asm/mmu_context.h 
b/arch/mips/include/asm/mmu_context.h
index 8201160..5609a32 100644
--- a/arch/mips/include/asm/mmu_context.h
+++ b/arch/mips/include/asm/mmu_context.h
@@ -108,8 +108,8 @@ static inline void enter_lazy_tlb(struct mm_struct *mm, 
struct task_struct *tsk)
 
 #ifndef CONFIG_MIPS_MT_SMTC
 /* Normal, classic MIPS get_new_mmu_context */
-static inline void
-get_new_mmu_context(struct mm_struct *mm, unsigned long cpu)
+static inline unsigned long
+get_new_asid(unsigned long cpu)
 {
        extern void kvm_local_flush_tlb_all(void);
        unsigned long asid = asid_cache(cpu);
@@ -125,7 +125,13 @@ get_new_mmu_context(struct mm_struct *mm, unsigned long 
cpu)
                if (!asid)              /* fix version if needed */
                        asid = ASID_FIRST_VERSION;
        }
+       return asid;
+}
 
+static inline void
+get_new_mmu_context(struct mm_struct *mm, unsigned long cpu)
+{
+       unsigned long asid = get_new_asid(cpu);
        cpu_context(cpu, mm) = asid_cache(cpu) = asid;
 }
 
-- 
1.7.11.7


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