From patchwork Fri Jun 7 23:03:26 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Daney X-Patchwork-Id: 2691311 Return-Path: X-Original-To: patchwork-kvm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 2D0883FC23 for ; Fri, 7 Jun 2013 23:09:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757512Ab3FGXIG (ORCPT ); Fri, 7 Jun 2013 19:08:06 -0400 Received: from mail-ie0-f178.google.com ([209.85.223.178]:61285 "EHLO mail-ie0-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757684Ab3FGXDx (ORCPT ); Fri, 7 Jun 2013 19:03:53 -0400 Received: by mail-ie0-f178.google.com with SMTP id at1so7878708iec.23 for ; Fri, 07 Jun 2013 16:03:53 -0700 (PDT) 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== X-Received: by 10.50.112.4 with SMTP id im4mr487775igb.1.1370646233487; Fri, 07 Jun 2013 16:03:53 -0700 (PDT) Received: from dl.caveonetworks.com (64.2.3.195.ptr.us.xo.net. [64.2.3.195]) by mx.google.com with ESMTPSA id r20sm1155684ign.8.2013.06.07.16.03.51 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Fri, 07 Jun 2013 16:03:52 -0700 (PDT) Received: from dl.caveonetworks.com (localhost.localdomain [127.0.0.1]) by dl.caveonetworks.com (8.14.5/8.14.5) with ESMTP id r57N3odd006698; Fri, 7 Jun 2013 16:03:50 -0700 Received: (from ddaney@localhost) by dl.caveonetworks.com (8.14.5/8.14.5/Submit) id r57N3oTR006697; Fri, 7 Jun 2013 16:03:50 -0700 From: David Daney To: linux-mips@linux-mips.org, ralf@linux-mips.org, kvm@vger.kernel.org, Sanjay Lal Cc: linux-kernel@vger.kernel.org, David Daney Subject: [PATCH 22/31] mips/kvm: Split get_new_mmu_context into two parts. Date: Fri, 7 Jun 2013 16:03:26 -0700 Message-Id: <1370646215-6543-23-git-send-email-ddaney.cavm@gmail.com> X-Mailer: git-send-email 1.7.11.7 In-Reply-To: <1370646215-6543-1-git-send-email-ddaney.cavm@gmail.com> References: <1370646215-6543-1-git-send-email-ddaney.cavm@gmail.com> Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org From: David Daney The new function (part) get_new_asid() can now be used from MIPSVZ code. Signed-off-by: David Daney Acked-by: Ralf Baechle --- 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; }