Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp766460ybl; Fri, 31 Jan 2020 07:38:53 -0800 (PST) X-Google-Smtp-Source: APXvYqwKq4huKOgEHPlpvVHRY9iOhPQCiw/Jz/g8zQVeUyWDPkKdAfFbV7XNpNOJzwibAM7G9Xpf X-Received: by 2002:a05:6808:b22:: with SMTP id t2mr6668593oij.40.1580485133797; Fri, 31 Jan 2020 07:38:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580485133; cv=none; d=google.com; s=arc-20160816; b=h/kHFqX0VyqyV29pA0p5r9aoKiv06nXq7NVVnq1YpLgP4RNFT1nlTnhQe4KoU3cdxC TgLE80yfvod/0C/i5VU40nZZ2GPxy3Ey592dUvvT/dExkYma44d0YNinckckr334Ld0r w54udrXJX00x+YaQvF5K8oJb32bE7yumjESu3qzAyy/eSz/x757ynIqaHhM+Ms22zUxe 7zhuHEHVmdn5k4n1Kk4q2A8AKpJxsOWpYumkUEqOfDxwFxaPk0fCUvexAU3Dsdc7euR8 OC2bGug8/NEnRxMuB+dy5IjCKcVN9WVwjjqdxniKKMsKS5fTfVGB9lgvXzBgeTQp4yeI sKlw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:date:cc:to:subject:from:message-id :dkim-signature; bh=qxGZgbj/FD/IJ6W0teXBPBNvikZf0YYVM3GmTICCJWI=; b=b9or3oRySSIoNnCWS4wbZWUB3UrW/M1ucBslksAuWoWLnZvMdChfkVmHdLr4U/86hr yo0R2aTQ01o57jIvMxjThKnkANqx4wuHFFPMpuqvOvRepwGIqz2Hcn/hcJKNrCZcZfV2 fQgxrr1sJpuKLyldrWMVg72TIAQ0KeqtuFkCHlP0KSjIThTYvQmE28ZcRS6EUiVZ6QDq 8AlhP0C2afoXQlRokzchoJIO3fTyROwk5zJc88NyIGrzN2hbC4qcOSpdKiPYF6KCTDFW PjbnSTqT9B0YScjntuvBnpdk4oBo3tcCL+jJbX0uhS87oXxgI9s3ofcNvRMc+EigZgtD nJAA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@c-s.fr header.s=mail header.b=WJ8FUohC; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o18si4357325oic.18.2020.01.31.07.38.41; Fri, 31 Jan 2020 07:38:53 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@c-s.fr header.s=mail header.b=WJ8FUohC; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729136AbgAaPhg (ORCPT + 99 others); Fri, 31 Jan 2020 10:37:36 -0500 Received: from pegase1.c-s.fr ([93.17.236.30]:51817 "EHLO pegase1.c-s.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728839AbgAaPhg (ORCPT ); Fri, 31 Jan 2020 10:37:36 -0500 Received: from localhost (mailhub1-int [192.168.12.234]) by localhost (Postfix) with ESMTP id 488LvK0tBHz9vBLW; Fri, 31 Jan 2020 16:37:33 +0100 (CET) Authentication-Results: localhost; dkim=pass reason="1024-bit key; insecure key" header.d=c-s.fr header.i=@c-s.fr header.b=WJ8FUohC; dkim-adsp=pass; dkim-atps=neutral X-Virus-Scanned: Debian amavisd-new at c-s.fr Received: from pegase1.c-s.fr ([192.168.12.234]) by localhost (pegase1.c-s.fr [192.168.12.234]) (amavisd-new, port 10024) with ESMTP id bKZuUQUrbMCp; Fri, 31 Jan 2020 16:37:33 +0100 (CET) Received: from messagerie.si.c-s.fr (messagerie.si.c-s.fr [192.168.25.192]) by pegase1.c-s.fr (Postfix) with ESMTP id 488LvJ6rtfz9vBL4; Fri, 31 Jan 2020 16:37:32 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=c-s.fr; s=mail; t=1580485053; bh=qxGZgbj/FD/IJ6W0teXBPBNvikZf0YYVM3GmTICCJWI=; h=From:Subject:To:Cc:Date:From; b=WJ8FUohCIAn8QkB0O5Nba7L22e6x0wh0WuFfgdqqAT3nsvcii2hshCYtTvtw9DoDR 9fkkGoQXHbG12WwztLB9AGEWMmbkXfObzbDL/FWK21v5E1k8pTlUyfHTXxhtV6MpsA 5GTz7HJd0KT0vOYWW8foc9GkvtIgZf7Ej6Vxrxkw= Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 743C08B8B6; Fri, 31 Jan 2020 16:37:34 +0100 (CET) X-Virus-Scanned: amavisd-new at c-s.fr Received: from messagerie.si.c-s.fr ([127.0.0.1]) by localhost (messagerie.si.c-s.fr [127.0.0.1]) (amavisd-new, port 10023) with ESMTP id N9uyqklYTQCc; Fri, 31 Jan 2020 16:37:34 +0100 (CET) Received: from po14934vm.idsi0.si.c-s.fr (unknown [192.168.4.90]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 3D2188B8B4; Fri, 31 Jan 2020 16:37:34 +0100 (CET) Received: by po14934vm.idsi0.si.c-s.fr (Postfix, from userid 0) id 227966528B; Fri, 31 Jan 2020 15:37:34 +0000 (UTC) Message-Id: From: Christophe Leroy Subject: [PATCH] powerpc/32s: Don't flush all TLBs when flushing one page To: Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman Cc: linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org Date: Fri, 31 Jan 2020 15:37:34 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org When flushing a range, the flushing function flushes all TLBs. When the range is a single page, do a page flush instead. Signed-off-by: Christophe Leroy --- arch/powerpc/mm/book3s32/tlb.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/arch/powerpc/mm/book3s32/tlb.c b/arch/powerpc/mm/book3s32/tlb.c index 2fcd321040ff..8e0089065a7e 100644 --- a/arch/powerpc/mm/book3s32/tlb.c +++ b/arch/powerpc/mm/book3s32/tlb.c @@ -79,14 +79,17 @@ static void flush_range(struct mm_struct *mm, unsigned long start, int count; unsigned int ctx = mm->context.id; + start &= PAGE_MASK; + end = (end - 1) | ~PAGE_MASK; if (!Hash) { - _tlbia(); + if (end - start == PAGE_SIZE) + _tlbie(start); + else + _tlbia(); return; } - start &= PAGE_MASK; if (start >= end) return; - end = (end - 1) | ~PAGE_MASK; pmd = pmd_offset(pud_offset(pgd_offset(mm, start), start), start); for (;;) { pmd_end = ((start + PGDIR_SIZE) & PGDIR_MASK) - 1; -- 2.25.0