From mboxrd@z Thu Jan 1 00:00:00 1970 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=-15.1 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,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 72748C433ED for ; Mon, 17 May 2021 13:39:14 +0000 (UTC) Received: from lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (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 92DF7611BF for ; Mon, 17 May 2021 13:39:13 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 92DF7611BF Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=roeck-us.net Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4FkKww0tdhz3bsh for ; Mon, 17 May 2021 23:39:12 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=JoliJRMj; dkim-atps=neutral Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gmail.com (client-ip=2607:f8b0:4864:20::72e; helo=mail-qk1-x72e.google.com; envelope-from=groeck7@gmail.com; receiver=) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=JoliJRMj; dkim-atps=neutral Received: from mail-qk1-x72e.google.com (mail-qk1-x72e.google.com [IPv6:2607:f8b0:4864:20::72e]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4FkKwL1rPQz2xvc for ; Mon, 17 May 2021 23:38:41 +1000 (AEST) Received: by mail-qk1-x72e.google.com with SMTP id o27so5675680qkj.9 for ; Mon, 17 May 2021 06:38:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=mSevgqLkwFjJJ3znA3S2Bzcdr9oY0/kEsDuFSkTBZYo=; b=JoliJRMjU6W3g7ScapsPY0yIWSoABH1V9Agb56/kOXUJJ42HAQL/+8spk0tiO8EjHn lnhXqJA3FC7JojyyOMdy+IVnc6hsMz0wBI2yfz5/F6CJqAaeTYNMqrRS9p/TepOtTDS2 gre7N6DNXovrYYoZRyGyTyJvBnG0h8eTmaE5pKdLGpaM6u0gJETNkhyd3XgQQWKZ4YMy Bct9FsyKpIB/OsI/j5d3VjiEuP49hMyc46VmEi+RYcO/atswUwRYB5qFLzZzQsFmTrrn PrYgg97dAXc8YyWy54PAqbOjjJ8E10/YOkuT8BK7eHqsumGrnQ1Vl9Gqb4P1vX+WIFB8 SG4g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:subject:to:cc:references:from:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=mSevgqLkwFjJJ3znA3S2Bzcdr9oY0/kEsDuFSkTBZYo=; b=HEoEVF/OPO5zossF6cMqSnJJ8+NtWPUjWx8eSvDAFjCfW7hvRZlQ+TyvKRvkHRigRx 89yJM0NN6/ZtecoHkXazki1qO3UovB5EiJNwi8GBdgCWeqvuuYUGcf7z2UzG1fIuoNdK RYiHgfkScNCDoVbuQQ8kwfpzSZzTuEtGRzC10JkwDEpTyEmPpAffow3uQ/7Cd8MHxaCL RFVsnuh50R7wFNNAKM+OU/bQe2yjwwsZnqVoZTe74N46cqFir4o2Sn1ZlymJyhnePpNc r+u/YXaIR85s6Td61uNTcG5BeTLa0kywojbniRATs2Bpcm/1iF/h2/MOjdIrwKGzWGfC ZtKg== X-Gm-Message-State: AOAM531q8DO9vPew9seoAsqF4QB5B06WN/qbU8ZUf8B00lmobNHzmiaE TPpkc0MtSHdWrxNnEw0+xlU= X-Google-Smtp-Source: ABdhPJxibVYkxZSg1rKPxlp9tnrNyS45y+0GPZ97agBX5bjFzhj1OWRQs06n4vGUdtRnP8zFmt0Xxg== X-Received: by 2002:a05:620a:29c4:: with SMTP id s4mr19567637qkp.22.1621258717580; Mon, 17 May 2021 06:38:37 -0700 (PDT) Received: from server.roeck-us.net ([2600:1700:e321:62f0:329c:23ff:fee3:9d7c]) by smtp.gmail.com with ESMTPSA id 25sm376207qtd.51.2021.05.17.06.38.35 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 17 May 2021 06:38:36 -0700 (PDT) Subject: Re: [PATCH v5 5/9] powerpc/mm/book3s64: Update tlb flush routines to take a page walk cache flush argument To: "Aneesh Kumar K.V" References: <20210422054323.150993-1-aneesh.kumar@linux.ibm.com> <20210422054323.150993-6-aneesh.kumar@linux.ibm.com> <20210515163525.GA1106462@roeck-us.net> From: Guenter Roeck Message-ID: Date: Mon, 17 May 2021 06:38:34 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US 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: , Cc: npiggin@gmail.com, linux-mm@kvack.org, kaleshsingh@google.com, joel@joelfernandes.org, akpm@linux-foundation.org, linuxppc-dev@lists.ozlabs.org Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" On 5/17/21 1:40 AM, Aneesh Kumar K.V wrote: > On 5/15/21 10:05 PM, Guenter Roeck wrote: >> On Thu, Apr 22, 2021 at 11:13:19AM +0530, Aneesh Kumar K.V wrote: >>> No functional change in this patch >>> >>> Signed-off-by: Aneesh Kumar K.V >>> --- >>>   .../include/asm/book3s/64/tlbflush-radix.h    | 19 +++++++----- >>>   arch/powerpc/include/asm/book3s/64/tlbflush.h | 23 ++++++++++++--- >>>   arch/powerpc/mm/book3s64/radix_hugetlbpage.c  |  4 +-- >>>   arch/powerpc/mm/book3s64/radix_tlb.c          | 29 +++++++------------ >>>   4 files changed, 42 insertions(+), 33 deletions(-) >>> >>> diff --git a/arch/powerpc/include/asm/book3s/64/tlbflush-radix.h b/arch/powerpc/include/asm/book3s/64/tlbflush-radix.h >>> index 8b33601cdb9d..171441a43b35 100644 >>> --- a/arch/powerpc/include/asm/book3s/64/tlbflush-radix.h >>> +++ b/arch/powerpc/include/asm/book3s/64/tlbflush-radix.h >>> @@ -56,15 +56,18 @@ static inline void radix__flush_all_lpid_guest(unsigned int lpid) >>>   } >>>   #endif >>> -extern void radix__flush_hugetlb_tlb_range(struct vm_area_struct *vma, >>> -                       unsigned long start, unsigned long end); >>> -extern void radix__flush_tlb_range_psize(struct mm_struct *mm, unsigned long start, >>> -                     unsigned long end, int psize); >>> -extern void radix__flush_pmd_tlb_range(struct vm_area_struct *vma, >>> -                       unsigned long start, unsigned long end); >>> -extern void radix__flush_tlb_range(struct vm_area_struct *vma, unsigned long start, >>> +void radix__flush_hugetlb_tlb_range(struct vm_area_struct *vma, >>> +                    unsigned long start, unsigned long end, >>> +                    bool flush_pwc); >>> +void radix__flush_pmd_tlb_range(struct vm_area_struct *vma, >>> +                unsigned long start, unsigned long end, >>> +                bool flush_pwc); >>> +void radix__flush_tlb_pwc_range_psize(struct mm_struct *mm, unsigned long start, >>> +                      unsigned long end, int psize, bool flush_pwc); >>> +void radix__flush_tlb_range(struct vm_area_struct *vma, unsigned long start, >>>                   unsigned long end); >>> -extern void radix__flush_tlb_kernel_range(unsigned long start, unsigned long end); >>> +void radix__flush_tlb_kernel_range(unsigned long start, unsigned long end); >>> + >>>   extern void radix__local_flush_tlb_mm(struct mm_struct *mm); >>>   extern void radix__local_flush_all_mm(struct mm_struct *mm); >>> diff --git a/arch/powerpc/include/asm/book3s/64/tlbflush.h b/arch/powerpc/include/asm/book3s/64/tlbflush.h >>> index 215973b4cb26..f9f8a3a264f7 100644 >>> --- a/arch/powerpc/include/asm/book3s/64/tlbflush.h >>> +++ b/arch/powerpc/include/asm/book3s/64/tlbflush.h >>> @@ -45,13 +45,30 @@ static inline void tlbiel_all_lpid(bool radix) >>>           hash__tlbiel_all(TLB_INVAL_SCOPE_LPID); >>>   } >>> +static inline void flush_pmd_tlb_pwc_range(struct vm_area_struct *vma, >>                   ^^^^ >>> +                       unsigned long start, >>> +                       unsigned long end, >>> +                       bool flush_pwc) >>> +{ >>> +    if (radix_enabled()) >>> +        return radix__flush_pmd_tlb_range(vma, start, end, flush_pwc); >>> +    return hash__flush_tlb_range(vma, start, end); >>          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >> >>> +} > > In this specific case we won't have  build errors because, > > static inline void hash__flush_tlb_range(struct vm_area_struct *vma, >                      unsigned long start, unsigned long end) > { > Sorry, you completely lost me. Building parisc:allnoconfig ... failed -------------- Error log: In file included from arch/parisc/include/asm/cacheflush.h:7, from include/linux/highmem.h:12, from include/linux/pagemap.h:11, from include/linux/ksm.h:13, from mm/mremap.c:14: mm/mremap.c: In function 'flush_pte_tlb_pwc_range': arch/parisc/include/asm/tlbflush.h:20:2: error: 'return' with a value, in function returning void Guenter > > But I agree the below is better to read. > > static inline void flush_pmd_tlb_pwc_range(struct vm_area_struct *vma, >                        unsigned long start, >                        unsigned long end, >                        bool flush_pwc) > { >     if (radix_enabled()) >         radix__flush_pmd_tlb_range(vma, start, end, flush_pwc); >     else >         hash__flush_tlb_range(vma, start, end); >     return > } > >> >>>   #define __HAVE_ARCH_FLUSH_PMD_TLB_RANGE >>>   static inline void flush_pmd_tlb_range(struct vm_area_struct *vma, >>                   ^^^^ >>>                          unsigned long start, unsigned long end) >>> +{ >>> +    return flush_pmd_tlb_pwc_range(vma, start, end, false); >>          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >> >> Doesn't that cause build warnings/errors all over the place ? >> >> Guenter >> > > > -aneesh