From patchwork Wed Oct 31 15:20:42 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sanjay Lal X-Patchwork-Id: 1679671 Return-Path: X-Original-To: patchwork-kvm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 58B82DFE15 for ; Wed, 31 Oct 2012 15:27:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935681Ab2JaP1b (ORCPT ); Wed, 31 Oct 2012 11:27:31 -0400 Received: from kymasys.com ([64.62.140.43]:44947 "HELO kymasys.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1757983Ab2JaP1S convert rfc822-to-8bit (ORCPT ); Wed, 31 Oct 2012 11:27:18 -0400 Received: from ::ffff:173.33.185.184 ([173.33.185.184]) by kymasys.com for ; Wed, 31 Oct 2012 08:20:45 -0700 From: Sanjay Lal Subject: [PATCH 15/20] MIPS: If KVM is enabled then use the KVM specific routine to flush the TLBs on a ASID wrap Date: Wed, 31 Oct 2012 11:20:42 -0400 Message-Id: <333219EB-AEDE-47AE-BD69-2B69BBECD188@kymasys.com> To: kvm@vger.kernel.org, linux-mips@linux-mips.org Mime-Version: 1.0 (Apple Message framework v1283) X-Mailer: Apple Mail (2.1283) Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org Signed-off-by: Sanjay Lal --- arch/mips/include/asm/mmu_context.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/arch/mips/include/asm/mmu_context.h b/arch/mips/include/asm/mmu_context.h index 9b02cfb..9c7024c 100644 --- a/arch/mips/include/asm/mmu_context.h +++ b/arch/mips/include/asm/mmu_context.h @@ -112,15 +112,21 @@ static inline void enter_lazy_tlb(struct mm_struct *mm, struct task_struct *tsk) static inline void get_new_mmu_context(struct mm_struct *mm, unsigned long cpu) { + extern void kvm_local_flush_tlb_all(void); unsigned long asid = asid_cache(cpu); if (! ((asid += ASID_INC) & ASID_MASK) ) { if (cpu_has_vtag_icache) flush_icache_all(); +#ifdef CONFIG_VIRTUALIZATION + kvm_local_flush_tlb_all(); /* start new asid cycle */ +#else local_flush_tlb_all(); /* start new asid cycle */ +#endif if (!asid) /* fix version if needed */ asid = ASID_FIRST_VERSION; } + cpu_context(cpu, mm) = asid_cache(cpu) = asid; }