Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.6 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 04313C4361B for ; Sun, 20 Dec 2020 11:41:15 +0000 (UTC) Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 0381A22D37 for ; Sun, 20 Dec 2020 11:41:13 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0381A22D37 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=csgroup.eu Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Received: from bilbo.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 4CzLK11GkszDqBV for ; Sun, 20 Dec 2020 22:41:09 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=csgroup.eu (client-ip=93.17.236.30; helo=pegase1.c-s.fr; envelope-from=christophe.leroy@csgroup.eu; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=csgroup.eu Received: from pegase1.c-s.fr (pegase1.c-s.fr [93.17.236.30]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4CzLFG0lfxzDqMx for ; Sun, 20 Dec 2020 22:37:45 +1100 (AEDT) Received: from localhost (mailhub1-int [192.168.12.234]) by localhost (Postfix) with ESMTP id 4CzLDv0SFtz9tyt4; Sun, 20 Dec 2020 12:37:35 +0100 (CET) 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 X1AU_5tc4Ftt; Sun, 20 Dec 2020 12:37:34 +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 4CzLDt6dpsz9tyt3; Sun, 20 Dec 2020 12:37:34 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 3A71D8B77E; Sun, 20 Dec 2020 12:37:38 +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 drW-rd6jzlLm; Sun, 20 Dec 2020 12:37:38 +0100 (CET) Received: from [192.168.4.90] (unknown [192.168.4.90]) by messagerie.si.c-s.fr (Postfix) with ESMTP id B607E8B75B; Sun, 20 Dec 2020 12:37:37 +0100 (CET) Subject: Re: [RFC PATCH 1/5] powerpc/64s: update_mmu_cache inline the radix test To: Nicholas Piggin , linuxppc-dev@lists.ozlabs.org References: <20201219234813.830747-1-npiggin@gmail.com> <20201219234813.830747-2-npiggin@gmail.com> From: Christophe Leroy Message-ID: <7190cf34-af03-ca35-d2b5-aa152d300ec0@csgroup.eu> Date: Sun, 20 Dec 2020 12:37:32 +0100 User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.5.1 MIME-Version: 1.0 In-Reply-To: <20201219234813.830747-2-npiggin@gmail.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: fr Content-Transfer-Encoding: 8bit X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" Le 20/12/2020 à 00:48, Nicholas Piggin a écrit : > This allows the function to be entirely noped if hash support is > compiled out (not possible yet). > > Signed-off-by: Nicholas Piggin > --- > arch/powerpc/include/asm/book3s/pgtable.h | 11 ++++++++++- > arch/powerpc/mm/book3s32/mmu.c | 4 ++-- > arch/powerpc/mm/book3s64/hash_utils.c | 7 ++----- > 3 files changed, 14 insertions(+), 8 deletions(-) > > diff --git a/arch/powerpc/include/asm/book3s/pgtable.h b/arch/powerpc/include/asm/book3s/pgtable.h > index 0e1263455d73..914e9fc7b069 100644 > --- a/arch/powerpc/include/asm/book3s/pgtable.h > +++ b/arch/powerpc/include/asm/book3s/pgtable.h > @@ -35,7 +35,16 @@ extern pgprot_t phys_mem_access_prot(struct file *file, unsigned long pfn, > * corresponding HPTE into the hash table ahead of time, instead of > * waiting for the inevitable extra hash-table miss exception. > */ > -void update_mmu_cache(struct vm_area_struct *vma, unsigned long address, pte_t *ptep); > +void hash__update_mmu_cache(struct vm_area_struct *vma, unsigned long address, pte_t *ptep); > + > +static inline void update_mmu_cache(struct vm_area_struct *vma, unsigned long address, pte_t *ptep) > +{ > +#ifdef CONFIG_PPC64 You shouldn't need that ifdef. radix_enabled() is always defined. > + if (radix_enabled()) > + return; > +#endif > + hash__update_mmu_cache(vma, address, ptep); > +} > > #endif /* __ASSEMBLY__ */ > #endif > diff --git a/arch/powerpc/mm/book3s32/mmu.c b/arch/powerpc/mm/book3s32/mmu.c > index 859e5bd603ac..c5a570ca37ff 100644 > --- a/arch/powerpc/mm/book3s32/mmu.c > +++ b/arch/powerpc/mm/book3s32/mmu.c > @@ -325,8 +325,8 @@ static void hash_preload(struct mm_struct *mm, unsigned long ea) > * > * This must always be called with the pte lock held. > */ > -void update_mmu_cache(struct vm_area_struct *vma, unsigned long address, > - pte_t *ptep) > +void hash__update_mmu_cache(struct vm_area_struct *vma, unsigned long address, > + pte_t *ptep) Now the limit is 100 chars per line. This should fit on a single line I think. > { > if (!mmu_has_feature(MMU_FTR_HPTE_TABLE)) > return; > diff --git a/arch/powerpc/mm/book3s64/hash_utils.c b/arch/powerpc/mm/book3s64/hash_utils.c > index 73b06adb6eeb..d52a3dee7cf2 100644 > --- a/arch/powerpc/mm/book3s64/hash_utils.c > +++ b/arch/powerpc/mm/book3s64/hash_utils.c > @@ -1667,8 +1667,8 @@ static void hash_preload(struct mm_struct *mm, pte_t *ptep, unsigned long ea, > * > * This must always be called with the pte lock held. > */ > -void update_mmu_cache(struct vm_area_struct *vma, unsigned long address, > - pte_t *ptep) > +void hash__update_mmu_cache(struct vm_area_struct *vma, unsigned long address, > + pte_t *ptep) Now the limit is 100 chars per line. This should fit on a single line I think. > { > /* > * We don't need to worry about _PAGE_PRESENT here because we are > @@ -1677,9 +1677,6 @@ void update_mmu_cache(struct vm_area_struct *vma, unsigned long address, > unsigned long trap; > bool is_exec; > > - if (radix_enabled()) > - return; > - > /* We only want HPTEs for linux PTEs that have _PAGE_ACCESSED set */ > if (!pte_young(*ptep) || address >= TASK_SIZE) > return; >