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.3 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,URIBL_BLOCKED, 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 77351C433E0 for ; Wed, 13 Jan 2021 07:44:46 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 3592023329 for ; Wed, 13 Jan 2021 07:44:45 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3592023329 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=gaisler.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 808858D0007; Wed, 13 Jan 2021 02:44:44 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 7B9D26B00E1; Wed, 13 Jan 2021 02:44:44 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 6CEC68D0007; Wed, 13 Jan 2021 02:44:44 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0131.hostedemail.com [216.40.44.131]) by kanga.kvack.org (Postfix) with ESMTP id 570EE6B00D4 for ; Wed, 13 Jan 2021 02:44:44 -0500 (EST) Received: from smtpin27.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 1D5BD180AD830 for ; Wed, 13 Jan 2021 07:44:44 +0000 (UTC) X-FDA: 77699964888.27.train50_0813bea2751c Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin27.hostedemail.com (Postfix) with ESMTP id 04C003D663 for ; Wed, 13 Jan 2021 07:44:44 +0000 (UTC) X-HE-Tag: train50_0813bea2751c X-Filterd-Recvd-Size: 3275 Received: from bin-mail-out-05.binero.net (bin-mail-out-05.binero.net [195.74.38.228]) by imf17.hostedemail.com (Postfix) with ESMTP for ; Wed, 13 Jan 2021 07:44:42 +0000 (UTC) X-Halon-ID: 27ebd293-5573-11eb-a076-005056917f90 Authorized-sender: andreas@gaisler.com Received: from andreas.got.gaisler.com (h-98-128-223-123.na.cust.bahnhof.se [98.128.223.123]) by bin-vsp-out-02.atm.binero.net (Halon) with ESMTPA id 27ebd293-5573-11eb-a076-005056917f90; Wed, 13 Jan 2021 08:44:33 +0100 (CET) Subject: Re: [patch 1/4] sparc/mm/highmem: Flush cache and TLB To: Thomas Gleixner , LKML Cc: Andrew Morton , linux-mm@kvack.org, Peter Zijlstra , "David S. Miller" , sparclinux@vger.kernel.org, Paul Cercueil , Thomas Bogendoerfer , Michael Ellerman , linuxppc-dev@lists.ozlabs.org References: <20210112170136.078559026@linutronix.de> <20210112170410.905976187@linutronix.de> From: Andreas Larsson Message-ID: <8a55c407-4fad-1a2f-5540-152e28b71617@gaisler.com> Date: Wed, 13 Jan 2021 08:44:24 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <20210112170410.905976187@linutronix.de> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit 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 2021-01-12 18:01, Thomas Gleixner wrote: > The recent conversion to the generic kmap_local infrastructure failed to > assign the proper pre/post map/unmap flush operations for sparc. > > Sparc requires cache flush before map/unmap and tlb flush afterwards. > > Fixes: 3293efa97807 ("sparc/mm/highmem: Switch to generic kmap atomic") > Reported-by: Andreas Larsson > Signed-off-by: Thomas Gleixner > Cc: "David S. Miller" > Cc: sparclinux@vger.kernel.org > --- > arch/sparc/include/asm/highmem.h | 9 +++++---- > 1 file changed, 5 insertions(+), 4 deletions(-) > > --- a/arch/sparc/include/asm/highmem.h > +++ b/arch/sparc/include/asm/highmem.h > @@ -50,10 +50,11 @@ extern pte_t *pkmap_page_table; > > #define flush_cache_kmaps() flush_cache_all() > > -/* FIXME: Use __flush_tlb_one(vaddr) instead of flush_cache_all() -- Anton */ > -#define arch_kmap_local_post_map(vaddr, pteval) flush_cache_all() > -#define arch_kmap_local_post_unmap(vaddr) flush_cache_all() > - > +/* FIXME: Use __flush_*_one(vaddr) instead of flush_*_all() -- Anton */ > +#define arch_kmap_local_pre_map(vaddr, pteval) flush_cache_all() > +#define arch_kmap_local_pre_unmap(vaddr) flush_cache_all() > +#define arch_kmap_local_post_map(vaddr, pteval) flush_tlb_all() > +#define arch_kmap_local_post_unmap(vaddr) flush_tlb_all() > > #endif /* __KERNEL__ */ Yes! I found, just an hour before your patched was posted, that an equivalent fix helped back where the switch-to-generic patch first occurred. This patch was successfully tested on master. Tested-by: Andreas Larsson -- Andreas Larsson Cobham Gaisler