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 0F34EC433B4 for ; Mon, 17 May 2021 13:38:41 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 53640611BF for ; Mon, 17 May 2021 13:38:40 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 53640611BF 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=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 815EC6B0036; Mon, 17 May 2021 09:38:39 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 79EF26B006E; Mon, 17 May 2021 09:38:39 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 5C97F6B0070; Mon, 17 May 2021 09:38:39 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0046.hostedemail.com [216.40.44.46]) by kanga.kvack.org (Postfix) with ESMTP id 2625A6B0036 for ; Mon, 17 May 2021 09:38:39 -0400 (EDT) Received: from smtpin22.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id ABDA499B4 for ; Mon, 17 May 2021 13:38:38 +0000 (UTC) X-FDA: 78150827916.22.D8E40A9 Received: from mail-qk1-f172.google.com (mail-qk1-f172.google.com [209.85.222.172]) by imf24.hostedemail.com (Postfix) with ESMTP id 59981A00039F for ; Mon, 17 May 2021 13:38:36 +0000 (UTC) Received: by mail-qk1-f172.google.com with SMTP id a22so5665935qkl.10 for ; Mon, 17 May 2021 06:38:38 -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=emhmNPri0FGT1Fom3X4ydRWWA/r5jWPMOPug96ZvFlwQe8CTW78X+50diboUksXb5z 3eG2tnoK6Ui+sRKb6dna6nlbdSBlzy5g5T+m4ezYe0IFkIW9P/fcP6oLmTqrVW3KqUKK ncZ6oQh02bAtvqKMth0xPNl7ii1WqvO3TfUiA+83xiZ/PtV3d/CWMngFGJnuFTn19zhE bIOcHoYvWE7gkGYyhv+gOtBSLM0ahJn/Eq47HtLkaHeV7Xrnl0c/HYa0g9Ic4On7OCyZ e+LjBmA9AfXSOjAmhrccON6wIIfE0E9tsn0mW9N6iBpGkTXGVg92Def0pbvbZX2dsA6T WEOg== X-Gm-Message-State: AOAM530gO2AGNPe/V85MAbUSrkCMRrACQAsxddHdgNqxG4FrREPmpYRf rM88VQQK/ZW9lwodX6QNJBk= 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" Cc: linux-mm@kvack.org, akpm@linux-foundation.org, mpe@ellerman.id.au, linuxppc-dev@lists.ozlabs.org, kaleshsingh@google.com, npiggin@gmail.com, joel@joelfernandes.org, Christophe Leroy 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 X-Rspamd-Queue-Id: 59981A00039F Authentication-Results: imf24.hostedemail.com; dkim=pass header.d=gmail.com header.s=20161025 header.b=JoliJRMj; dmarc=none; spf=pass (imf24.hostedemail.com: domain of groeck7@gmail.com designates 209.85.222.172 as permitted sender) smtp.mailfrom=groeck7@gmail.com X-Rspamd-Server: rspam03 X-Stat-Signature: a8jzhzn51mu6wuaq59t5eb4p7y9xuohr X-HE-Tag: 1621258716-197096 Content-Transfer-Encoding: quoted-printable X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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 >>> --- >>> =C2=A0 .../include/asm/book3s/64/tlbflush-radix.h=C2=A0=C2=A0=C2=A0 |= 19 +++++++----- >>> =C2=A0 arch/powerpc/include/asm/book3s/64/tlbflush.h | 23 +++++++++++= +--- >>> =C2=A0 arch/powerpc/mm/book3s64/radix_hugetlbpage.c=C2=A0 |=C2=A0 4 += -- >>> =C2=A0 arch/powerpc/mm/book3s64/radix_tlb.c=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0 | 29 +++++++------------ >>> =C2=A0 4 files changed, 42 insertions(+), 33 deletions(-) >>> >>> diff --git a/arch/powerpc/include/asm/book3s/64/tlbflush-radix.h b/ar= ch/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(un= signed int lpid) >>> =C2=A0 } >>> =C2=A0 #endif >>> -extern void radix__flush_hugetlb_tlb_range(struct vm_area_struct *vm= a, >>> -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 unsigned = long start, unsigned long end); >>> -extern void radix__flush_tlb_range_psize(struct mm_struct *mm, unsig= ned long start, >>> -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 unsigned long end, in= t psize); >>> -extern void radix__flush_pmd_tlb_range(struct vm_area_struct *vma, >>> -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 unsigned = long start, unsigned long end); >>> -extern void radix__flush_tlb_range(struct vm_area_struct *vma, unsig= ned long start, >>> +void radix__flush_hugetlb_tlb_range(struct vm_area_struct *vma, >>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 unsigned long start, unsign= ed long end, >>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 bool flush_pwc); >>> +void radix__flush_pmd_tlb_range(struct vm_area_struct *vma, >>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0 unsigned long start, unsigned long end, >>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0 bool flush_pwc); >>> +void radix__flush_tlb_pwc_range_psize(struct mm_struct *mm, unsigned= long start, >>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 unsigned long e= nd, int psize, bool flush_pwc); >>> +void radix__flush_tlb_range(struct vm_area_struct *vma, unsigned lon= g start, >>> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 unsigned long end); >>> -extern void radix__flush_tlb_kernel_range(unsigned long start, unsig= ned long end); >>> +void radix__flush_tlb_kernel_range(unsigned long start, unsigned lon= g end); >>> + >>> =C2=A0 extern void radix__local_flush_tlb_mm(struct mm_struct *mm); >>> =C2=A0 extern void radix__local_flush_all_mm(struct mm_struct *mm); >>> diff --git a/arch/powerpc/include/asm/book3s/64/tlbflush.h b/arch/pow= erpc/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) >>> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 hash__tlbiel_a= ll(TLB_INVAL_SCOPE_LPID); >>> =C2=A0 } >>> +static inline void flush_pmd_tlb_pwc_range(struct vm_area_struct *vm= a, >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ^^^^ >>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 unsigned = long start, >>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 unsigned = long end, >>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 bool flus= h_pwc) >>> +{ >>> +=C2=A0=C2=A0=C2=A0 if (radix_enabled()) >>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 return radix__flush_pmd_t= lb_range(vma, start, end, flush_pwc); >>> +=C2=A0=C2=A0=C2=A0 return hash__flush_tlb_range(vma, start, end); >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ^^^^^^^^^^^^^^^^^^^^^= ^^^^^^^^^^^^^^^^^^^^^^^^^ >> >>> +} >=20 > In this specific case we won't have=C2=A0 build errors because, >=20 > static inline void hash__flush_tlb_range(struct vm_area_struct *vma, > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 unsigned long start, uns= igned long end) > { >=20 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 >=20 > But I agree the below is better to read. >=20 > static inline void flush_pmd_tlb_pwc_range(struct vm_area_struct *vma, > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 unsigned lon= g start, > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 unsigned lon= g end, > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 bool flush_p= wc) > { > =C2=A0=C2=A0=C2=A0=C2=A0if (radix_enabled()) > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 radix__flush_pmd_tlb_range(= vma, start, end, flush_pwc); > =C2=A0=C2=A0=C2=A0=C2=A0else > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 hash__flush_tlb_range(vma, = start, end); > =C2=A0=C2=A0=C2=A0=C2=A0return > } >=20 >> >>> =C2=A0 #define __HAVE_ARCH_FLUSH_PMD_TLB_RANGE >>> =C2=A0 static inline void flush_pmd_tlb_range(struct vm_area_struct *= vma, >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ^^^^ >>> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= unsigned long start, unsigned long end) >>> +{ >>> +=C2=A0=C2=A0=C2=A0 return flush_pmd_tlb_pwc_range(vma, start, end, f= alse); >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ^^^^^^^^^^^^^^^^^^^^^= ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >> >> Doesn't that cause build warnings/errors all over the place ? >> >> Guenter >> >=20 >=20 > -aneesh 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