From patchwork Thu Sep 17 12:50:15 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Will Deacon X-Patchwork-Id: 53792 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f69.google.com (mail-la0-f69.google.com [209.85.215.69]) by patches.linaro.org (Postfix) with ESMTPS id EBBC322E57 for ; Thu, 17 Sep 2015 12:52:51 +0000 (UTC) Received: by lagj9 with SMTP id j9sf6801250lag.0 for ; Thu, 17 Sep 2015 05:52:51 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:subject:date:message-id :in-reply-to:references:precedence:list-id:list-unsubscribe :list-archive:list-post:list-help:list-subscribe:cc:mime-version :content-type:content-transfer-encoding:sender:errors-to :x-original-sender:x-original-authentication-results:mailing-list; bh=b2ZBmKF42zUSYO3La7JD6BE2vPwJdLnKvHKVa2fJhm4=; b=VoXoPZeh6NUpuC6X2Y3naeSEPTv8Y7FLS9H7JmKSLygLlFI4NydAk7HecGwMiQ0xCC 4p82g/GOVDRpOCvAkw21rbrNroBxA9HKpipz+vYXgUkTtQ9lj5hKtffhF5fBkvOu2zUB 79Q5PuiLt/MDhiF4HICSOLxq5bb+zcl4DZ1r8uMzc/OEkFKCVUs3JfRnqyRFba2qTPVZ rqMsJz8PBHjtTiVcZhLoFneOCZU56F3PcK5jy8urVs6dZ8XgGpI7aFjBPeUf1Vvltx3i MafOQpFTOVgK6BGh6OUztCrI1IXdkeKUS1+HT7dKA2KM+Lss2YJQztY3+v7Q962HMMof P8Mw== X-Gm-Message-State: ALoCoQmhCtvzmkLcGR0VPY7IjdYsOxa8E5laLKFFLAQj+J+8RqvOZwv6AbIXJY4AI7gSVBt+BUf7 X-Received: by 10.180.188.211 with SMTP id gc19mr3074114wic.6.1442494370971; Thu, 17 Sep 2015 05:52:50 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.44.193 with SMTP id g1ls78920lam.108.gmail; Thu, 17 Sep 2015 05:52:50 -0700 (PDT) X-Received: by 10.152.6.34 with SMTP id x2mr15589740lax.120.1442494370783; Thu, 17 Sep 2015 05:52:50 -0700 (PDT) Received: from mail-lb0-f174.google.com (mail-lb0-f174.google.com. [209.85.217.174]) by mx.google.com with ESMTPS id v4si2181734lae.75.2015.09.17.05.52.50 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 17 Sep 2015 05:52:50 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.174 as permitted sender) client-ip=209.85.217.174; Received: by lbbmp1 with SMTP id mp1so8676725lbb.1 for ; Thu, 17 Sep 2015 05:52:50 -0700 (PDT) X-Received: by 10.152.5.133 with SMTP id s5mr36194643las.19.1442494370657; Thu, 17 Sep 2015 05:52:50 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.59.35 with SMTP id w3csp3052025lbq; Thu, 17 Sep 2015 05:52:49 -0700 (PDT) X-Received: by 10.68.242.130 with SMTP id wq2mr71002252pbc.117.1442494368951; Thu, 17 Sep 2015 05:52:48 -0700 (PDT) Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id tq7si5138259pbc.242.2015.09.17.05.52.48 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 17 Sep 2015 05:52:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org designates 2001:1868:205::9 as permitted sender) client-ip=2001:1868:205::9; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZcYfF-0007Xt-EX; Thu, 17 Sep 2015 12:51:49 +0000 Received: from cam-admin0.cambridge.arm.com ([217.140.96.50]) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZcYeu-0007Dz-H2 for linux-arm-kernel@lists.infradead.org; Thu, 17 Sep 2015 12:51:29 +0000 Received: from edgewater-inn.cambridge.arm.com (edgewater-inn.cambridge.arm.com [10.1.203.139]) by cam-admin0.cambridge.arm.com (8.12.6/8.12.6) with ESMTP id t8HCp5wo025745; Thu, 17 Sep 2015 13:51:05 +0100 (BST) Received: by edgewater-inn.cambridge.arm.com (Postfix, from userid 1000) id 129291AE3255; Thu, 17 Sep 2015 13:51:12 +0100 (BST) From: Will Deacon To: linux-arm-kernel@lists.infradead.org Subject: [PATCH 06/10] arm64: tlbflush: avoid flushing when fullmm == 1 Date: Thu, 17 Sep 2015 13:50:15 +0100 Message-Id: <1442494219-6133-7-git-send-email-will.deacon@arm.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1442494219-6133-1-git-send-email-will.deacon@arm.com> References: <1442494219-6133-1-git-send-email-will.deacon@arm.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150917_055129_010727_11F5C662 X-CRM114-Status: GOOD ( 11.48 ) X-Spam-Score: -6.9 (------) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (-6.9 points) pts rule name description ---- ---------------------- -------------------------------------------------- -5.0 RCVD_IN_DNSWL_HI RBL: Sender listed at http://www.dnswl.org/, high trust [217.140.96.50 listed in list.dnswl.org] -0.0 T_RP_MATCHES_RCVD Envelope sender domain matches handover relay domain -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , Cc: catalin.marinas@arm.com, Will Deacon MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: will.deacon@arm.com X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.174 as permitted sender) smtp.mailfrom=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 The TLB gather code sets fullmm=1 when tearing down the entire address space for an mm_struct on exit or execve. Given that the ASID allocator will never re-allocate a dirty ASID, this flushing is not needed and can simply be avoided in the flushing code. Signed-off-by: Will Deacon --- arch/arm64/include/asm/tlb.h | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/arch/arm64/include/asm/tlb.h b/arch/arm64/include/asm/tlb.h index d6e6b6660380..ffdaea7954bb 100644 --- a/arch/arm64/include/asm/tlb.h +++ b/arch/arm64/include/asm/tlb.h @@ -37,17 +37,21 @@ static inline void __tlb_remove_table(void *_table) static inline void tlb_flush(struct mmu_gather *tlb) { - if (tlb->fullmm) { - flush_tlb_mm(tlb->mm); - } else { - struct vm_area_struct vma = { .vm_mm = tlb->mm, }; - /* - * The intermediate page table levels are already handled by - * the __(pte|pmd|pud)_free_tlb() functions, so last level - * TLBI is sufficient here. - */ - __flush_tlb_range(&vma, tlb->start, tlb->end, true); - } + struct vm_area_struct vma = { .vm_mm = tlb->mm, }; + + /* + * The ASID allocator will either invalidate the ASID or mark + * it as used. + */ + if (tlb->fullmm) + return; + + /* + * The intermediate page table levels are already handled by + * the __(pte|pmd|pud)_free_tlb() functions, so last level + * TLBI is sufficient here. + */ + __flush_tlb_range(&vma, tlb->start, tlb->end, true); } static inline void __pte_free_tlb(struct mmu_gather *tlb, pgtable_t pte,