Received: by 2002:a05:6a10:2785:0:0:0:0 with SMTP id ia5csp161684pxb; Tue, 12 Jan 2021 23:47:30 -0800 (PST) X-Google-Smtp-Source: ABdhPJyJceYQWL9/q1i08pPDNL90eJuwTLwNHvjf90Kp+YGSD5JW04AVkECjGMcvwi7Ptm/K7914 X-Received: by 2002:a17:906:3b4d:: with SMTP id h13mr633135ejf.289.1610524050208; Tue, 12 Jan 2021 23:47:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610524050; cv=none; d=google.com; s=arc-20160816; b=IpWrTpKpHKql/tMgBIQVu0XZm5RwKQIQf2oQR8BPotYT08yCn3cLVq1a1yhhHMz6th CrHkUEI/4uV8WFuZ69/492eVosJbsGJb4bMamBQc5uUa8bErPJCkgKSLsycwMjxpxC+P Nw4LRis8PEmSyoKWZYrXP9bEptJSw3rrrNcQ+S3bB5pQR6eCz1/VlrH24YXZpUble2cv U5YUU/zIRuxEuFWfjjQUPCMXPH4w4ohaZuiEKmdp56wLxZCG9hst/dmgUNc28Ul8a/WR LVHN9eoo6C9c1tEoIZMRQdPsa39wlRgHQFVyc6gOK4JGLK+EnyU86HFXR9/abnQzJtYl eb5Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:authorized-sender; bh=NhPfRRCZH4jGenJpCIpA1YgRhyVR7Rudwb7D2gs7u54=; b=JHsEtZpxtJiqmoGgHJv0el9Ywtco7mGZq4cvLaVafB9ATP21L2oaOaGk1hTHb9yk+Q EXrlPOqLPj8a/g067W9G7dHWp+PnIlO/ahPaG7R8FfdZZUjymmUQg8A0nzHCaKravp28 jLSCmwnLmDuzYLhic5UyPziUmRDPehba4tUivlwkAHA2v9mVm6bSFfOYYbnc4UadVDEw Kf2hk1+eTBJ/BSTB46JwgN+hAnS+csxd+wBibkJ6MIktHEmvh4OZAJnGKVOGExIkVc3N WB9fwqQGFoMJklyAXVCBUDt4OLuwWQywEneiPOQ3/m81NBIgHynL3Str3QMsxyTxKOOV bx1g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v4si626063edt.439.2021.01.12.23.47.07; Tue, 12 Jan 2021 23:47:30 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725924AbhAMHpW (ORCPT + 99 others); Wed, 13 Jan 2021 02:45:22 -0500 Received: from bin-mail-out-06.binero.net ([195.74.38.229]:37993 "EHLO bin-mail-out-06.binero.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725902AbhAMHpW (ORCPT ); Wed, 13 Jan 2021 02:45:22 -0500 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 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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