From patchwork Sat Oct 20 00:33:29 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John David Anglin X-Patchwork-Id: 10650231 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 2ECEA13B0 for ; Sat, 20 Oct 2018 00:33:34 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 11CED22376 for ; Sat, 20 Oct 2018 00:33:34 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 008D025E97; Sat, 20 Oct 2018 00:33:33 +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=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 88FC022376 for ; Sat, 20 Oct 2018 00:33:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726542AbeJTIl5 (ORCPT ); Sat, 20 Oct 2018 04:41:57 -0400 Received: from simcoe207srvr.owm.bell.net ([184.150.200.207]:35491 "EHLO torfep01.bell.net" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726513AbeJTIl5 (ORCPT ); Sat, 20 Oct 2018 04:41:57 -0400 Received: from bell.net torfep01 184.150.200.158 by torfep01.bell.net with ESMTP id <20181020003331.DRCL31136.torfep01.bell.net@torspm02.bell.net> for ; Fri, 19 Oct 2018 20:33:31 -0400 Received: from mx3210.localdomain ([70.53.62.196]) by torspm02.bell.net with ESMTP id <20181020003330.CCIN19016.torspm02.bell.net@mx3210.localdomain>; Fri, 19 Oct 2018 20:33:30 -0400 Received: by mx3210.localdomain (Postfix, from userid 1000) id 56CB02200ED; Fri, 19 Oct 2018 20:33:30 -0400 (EDT) Date: Fri, 19 Oct 2018 20:33:29 -0400 From: John David Anglin To: linux-parisc Cc: Helge Deller , James Bottomley Subject: [PATCH] parisc: Remove pte_inserted define Message-ID: <20181020003329.GA22259@mx3210.localdomain> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.10.1 (2018-07-13) X-Cloudmark-Analysis: v=2.2 cv=QIiHfkDL c=1 sm=0 tr=0 a=Zvhif4XNTjWcJyJCfFIh1A==:17 a=smKx5t2vBNcA:10 a=FBHGMhGWAAAA:8 a=cMyLs57EJLp5gbmuruIA:9 a=CjuIK1q_8ugA:10 a=wv-Jr-afdCP7NWSxpeIA:9 a=ONNS8QRKHyMA:10 a=9gvnlMMaQFpL9xblJ6ne:22 Sender: linux-parisc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-parisc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The attached change removes the pte_inserted from pgtable.h. As a result, we always flush the TLB entry when the associated page table entry is changed. This change doesn't impact performance signifcantly and it may catch some cases where the TLB needs flushing but wasn't. Signed-off-by: John David Anglin diff --git a/arch/parisc/include/asm/pgtable.h b/arch/parisc/include/asm/pgtable.h index 94c0ef7a9e03..b941ac7d4e70 100644 --- a/arch/parisc/include/asm/pgtable.h +++ b/arch/parisc/include/asm/pgtable.h @@ -55,10 +55,6 @@ static inline void purge_tlb_entries(struct mm_struct *mm, unsigned long addr) *(pteptr) = (pteval); \ } while(0) -#define pte_inserted(x) \ - ((pte_val(x) & (_PAGE_PRESENT|_PAGE_ACCESSED)) \ - == (_PAGE_PRESENT|_PAGE_ACCESSED)) - #define set_pte_at(mm, addr, ptep, pteval) \ do { \ pte_t old_pte; \ @@ -66,8 +62,7 @@ static inline void purge_tlb_entries(struct mm_struct *mm, unsigned long addr) spin_lock_irqsave(&pa_tlb_lock, flags); \ old_pte = *ptep; \ set_pte(ptep, pteval); \ - if (pte_inserted(old_pte)) \ - purge_tlb_entries(mm, addr); \ + purge_tlb_entries(mm, addr); \ spin_unlock_irqrestore(&pa_tlb_lock, flags); \ } while (0) @@ -493,8 +488,7 @@ static inline pte_t ptep_get_and_clear(struct mm_struct *mm, unsigned long addr, spin_lock_irqsave(&pa_tlb_lock, flags); old_pte = *ptep; set_pte(ptep, __pte(0)); - if (pte_inserted(old_pte)) - purge_tlb_entries(mm, addr); + purge_tlb_entries(mm, addr); spin_unlock_irqrestore(&pa_tlb_lock, flags); return old_pte;