From patchwork Wed Mar 3 11:45:12 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Gleixner X-Patchwork-Id: 12113321 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.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED 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 4490DC433E0 for ; Wed, 3 Mar 2021 11:54:52 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id A901164E99 for ; Wed, 3 Mar 2021 11:54:51 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A901164E99 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linutronix.de Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 8007B8D0135; Wed, 3 Mar 2021 06:54:20 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 663DC8D0159; Wed, 3 Mar 2021 06:54:20 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 48F948D0135; Wed, 3 Mar 2021 06:54:20 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0007.hostedemail.com [216.40.44.7]) by kanga.kvack.org (Postfix) with ESMTP id 2190C8D0157 for ; Wed, 3 Mar 2021 06:54:20 -0500 (EST) Received: from smtpin08.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id D096F613B for ; Wed, 3 Mar 2021 11:54:19 +0000 (UTC) X-FDA: 77878405038.08.938B7E7 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by imf18.hostedemail.com (Postfix) with ESMTP id ECB58200038A for ; Wed, 3 Mar 2021 11:54:18 +0000 (UTC) Message-Id: <20210303114727.967383885@linutronix.de> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1614772458; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: references:references; bh=eWdIiVkP8/X3j2/negs822pPzotc1RS3VDSLc2vlH3s=; b=KJGW07a0B+9U0rAjZaZ0eOfQUeUJTgZJxgiG6TjHLaVci9q/7crMVYj1Di/6TeLi352JEe AqFbndGwi9aMI//Et7nakmQmclVxTn41icrrpk8bmKGOJzjieFpgaCrHMkrlZozYJCu9s2 nvGxuDOA+kP44ZY/cxW+wA44FMm5+7r7f4wvsCXGv4veQX23kE/28XIMZ+snZCpaMGal0M PcJ8inqdKYuYwgeSdAtWCh2Ys/sTaQNfx4YcEPZFe7V8eK02ofuf5ISz4UpZSeR979WTX4 vfiVI6TEofzRAWjql4i4SBmJQ7M2nqO9AXtsqiGPM3O3PxBx7qjkGBOyxkrpYw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1614772458; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: references:references; bh=eWdIiVkP8/X3j2/negs822pPzotc1RS3VDSLc2vlH3s=; b=wscu+3YV+RmkZqcTLn44nZQTQMhbSfgQTfXb7ByZjvUKmrlA648K0PddMzi5GOpJTu603o psRRivF4wN0+bzCQ== Date: Wed, 03 Mar 2021 12:45:12 +0100 From: Thomas Gleixner To: LKML Cc: Russell King , linux-arm-kernel@lists.infradead.org, Andrew Morton , linux-mm@kvack.org Subject: [patch 1/2] ARM: mm: Replace kmap_atomic_pfn() References: <20210303114511.927078317@linutronix.de> MIME-Version: 1.0 Content-transfer-encoding: 8-bit X-Stat-Signature: nnfp1fartoeqxp5tbipikqqezm5forye X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: ECB58200038A Received-SPF: none (linutronix.de>: No applicable sender policy available) receiver=imf18; identity=mailfrom; envelope-from=""; helo=galois.linutronix.de; client-ip=193.142.43.55 X-HE-DKIM-Result: pass/pass X-HE-Tag: 1614772458-828579 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: From: Thomas Gleixner There is no requirement to disable pagefaults and preemption for these cache management mappings. Replace kmap_atomic_pfn() with kmap_local_pfn(). This allows to remove kmap_atomic_pfn() in the next step. Signed-off-by: Thomas Gleixner Cc: Russell King Cc: linux-arm-kernel@lists.infradead.org --- arch/arm/mm/cache-feroceon-l2.c | 6 +++--- arch/arm/mm/cache-xsc3l2.c | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) --- a/arch/arm/mm/cache-feroceon-l2.c +++ b/arch/arm/mm/cache-feroceon-l2.c @@ -49,9 +49,9 @@ static inline unsigned long l2_get_va(un * we simply install a virtual mapping for it only for the * TLB lookup to occur, hence no need to flush the untouched * memory mapping afterwards (note: a cache flush may happen - * in some circumstances depending on the path taken in kunmap_atomic). + * in some circumstances depending on the path taken in kunmap_local). */ - void *vaddr = kmap_atomic_pfn(paddr >> PAGE_SHIFT); + void *vaddr = kmap_local_pfn(paddr >> PAGE_SHIFT); return (unsigned long)vaddr + (paddr & ~PAGE_MASK); #else return __phys_to_virt(paddr); @@ -61,7 +61,7 @@ static inline unsigned long l2_get_va(un static inline void l2_put_va(unsigned long vaddr) { #ifdef CONFIG_HIGHMEM - kunmap_atomic((void *)vaddr); + kunmap_local((void *)vaddr); #endif } --- a/arch/arm/mm/cache-xsc3l2.c +++ b/arch/arm/mm/cache-xsc3l2.c @@ -59,7 +59,7 @@ static inline void l2_unmap_va(unsigned { #ifdef CONFIG_HIGHMEM if (va != -1) - kunmap_atomic((void *)va); + kunmap_local((void *)va); #endif } @@ -75,7 +75,7 @@ static inline unsigned long l2_map_va(un * in place for it. */ l2_unmap_va(prev_va); - va = (unsigned long)kmap_atomic_pfn(pa >> PAGE_SHIFT); + va = (unsigned long)kmap_local_pfn(pa >> PAGE_SHIFT); } return va + (pa_offset >> (32 - PAGE_SHIFT)); #else