From patchwork Sat Feb 23 06:47:27 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xuefeng Wang X-Patchwork-Id: 10827259 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 6EDE513B5 for ; Sat, 23 Feb 2019 06:48:40 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 460213060D for ; Sat, 23 Feb 2019 06:48:40 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 220823061E; Sat, 23 Feb 2019 06:48:40 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 874143060D for ; Sat, 23 Feb 2019 06:48:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:Subject:To :From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=LtkEmnPgQxoHeJTbJ6Z9vH+K4JY+kfHOi1o61koV/gg=; b=O7ZTixRWThfYYP GhTQE3xRJrvgdMxiFiLbI54Uv43SBMxHWi4oeRdrky7OulaWKgqPLKbA27g7eVVPJ70T6x104vfLd qCxqi+JavQp09oYm+/R1kmQnICDo0WKaWIgL7mi30LFe/SY8/alxHm6xwar9oernuyk+qUHSI87XB gAqDBqZZybIejzUUW/WMiksqdNrybYCJdUs6ffDj0VaSIA3Nmo0AnzyRf4OrymzE8WyfciUTxg5jo /VcUbnoHBpPcCbNi+zOm5I3dAAiRJRrJRSySLmENo3ZpolGR/Z/XR2J4AJKBw/7OzBJkZ7fkDWMMK EpfZ6j4HRRcRfj2+/npg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gxR6w-0006ox-5A; Sat, 23 Feb 2019 06:48:34 +0000 Received: from szxga05-in.huawei.com ([45.249.212.191] helo=huawei.com) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gxR6s-0006oE-Sw for linux-arm-kernel@lists.infradead.org; Sat, 23 Feb 2019 06:48:32 +0000 Received: from DGGEMS410-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id A4F7CDC8D62B86813F93; Sat, 23 Feb 2019 14:48:16 +0800 (CST) Received: from linux-ibm.site (10.175.102.37) by DGGEMS410-HUB.china.huawei.com (10.3.19.210) with Microsoft SMTP Server id 14.3.408.0; Sat, 23 Feb 2019 14:48:05 +0800 From: Xuefeng Wang To: , , , Subject: [PATCH] Use flush tlb last level when change protection Date: Sat, 23 Feb 2019 14:47:27 +0800 Message-ID: <1550904447-45567-1-git-send-email-wxf.wang@hisilicon.com> X-Mailer: git-send-email 1.7.12.4 MIME-Version: 1.0 X-Originating-IP: [10.175.102.37] X-CFilter-Loop: Reflected X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190222_224831_097500_86E0CBB3 X-CRM114-Status: UNSURE ( 9.11 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: guohanjun@huawei.com, wxf.wang@hisilicon.com Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP The protection attributes are only kept in last level tlb, so protection changing only need invalidate last level tlb, exclude the PWC entries. Signed-off-by: Xuefeng Wang --- mm/mprotect.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/mprotect.c b/mm/mprotect.c index 36cb358..0c4303d 100644 --- a/mm/mprotect.c +++ b/mm/mprotect.c @@ -287,7 +287,7 @@ static unsigned long change_protection_range(struct vm_area_struct *vma, /* Only flush the TLB if we actually modified any entries: */ if (pages) - flush_tlb_range(vma, start, end); + __flush_tlb_range(vma, start, end, PAGE_SIZE, true); dec_tlb_flush_pending(mm); return pages;