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 From patchwork Wed Mar 3 11:45:13 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Gleixner X-Patchwork-Id: 12113317 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 1E04BC433DB for ; Wed, 3 Mar 2021 11:54:46 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 7E0AF64EDC for ; Wed, 3 Mar 2021 11:54:45 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7E0AF64EDC 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 864088D0159; Wed, 3 Mar 2021 06:54:21 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 814208D0157; Wed, 3 Mar 2021 06:54:21 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 6B46B8D0159; Wed, 3 Mar 2021 06:54:21 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0149.hostedemail.com [216.40.44.149]) by kanga.kvack.org (Postfix) with ESMTP id 4E20A8D0157 for ; Wed, 3 Mar 2021 06:54:21 -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 10EAE180ACEF3 for ; Wed, 3 Mar 2021 11:54:21 +0000 (UTC) X-FDA: 77878405122.27.59C91F8 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by imf22.hostedemail.com (Postfix) with ESMTP id 0784FC0001EE for ; Wed, 3 Mar 2021 11:54:19 +0000 (UTC) Message-Id: <20210303114728.116465616@linutronix.de> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1614772459; 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=fyXAXFo8eCnowgRuIPCWwAQhgeXmf7C8IGgmmB3q6v4=; b=CneQKvWhXwpcXZgyKK3bDCZAp08rEdGX3rWxYi7apwvy9P6YnHp3FM6ZCtWXSL9LuMeshM u/u8k1ESsqqTYehN4fh9BlZwXviQHn5lmHpIizxR9zdVHMyKOid2Dqe9QAVtDdDw7L7lYa FoTNsreg6jRZcjP70R33YUXeMu8QzQ5kV2w1h8jHRgki12d4a1zBrtYIQwJxiqjz3hgevb f71mmT7jqfJ6+vQnh2qc95/9c91FhSqc0OeNnzUsPRSfiPT64O/IkyUPfCnC+gzcm0B3Gs DITLLCAU6zUOgX/GvN75r0+RAlqNPMl8Oh/G1Tct9loMxCnfFsbZRm4RU4GVNQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1614772459; 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=fyXAXFo8eCnowgRuIPCWwAQhgeXmf7C8IGgmmB3q6v4=; b=2cn6lCn6FIP/v1Qjqqb2r/ls62egPvoaelBViLqGUFY0qJ1D9krvWumSqaS6NfG5Y3aZEp jXfzujTeFFeKq+Cg== Date: Wed, 03 Mar 2021 12:45:13 +0100 From: Thomas Gleixner To: LKML Cc: Andrew Morton , linux-mm@kvack.org, Russell King , linux-arm-kernel@lists.infradead.org Subject: [patch 2/2] highmem: Remove kmap_atomic_pfn() References: <20210303114511.927078317@linutronix.de> MIME-Version: 1.0 Content-transfer-encoding: 8-bit X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: 0784FC0001EE X-Stat-Signature: sk1xyxfy4jkn4bsgg4bdkcegnunrumay Received-SPF: none (linutronix.de>: No applicable sender policy available) receiver=imf22; identity=mailfrom; envelope-from=""; helo=galois.linutronix.de; client-ip=193.142.43.55 X-HE-DKIM-Result: pass/pass X-HE-Tag: 1614772459-534717 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 No more users. Signed-off-by: Thomas Gleixner Cc: Thomas Gleixner Cc: Andrew Morton Cc: linux-mm@kvack.org --- include/linux/highmem-internal.h | 12 ------------ 1 file changed, 12 deletions(-) --- a/include/linux/highmem-internal.h +++ b/include/linux/highmem-internal.h @@ -99,13 +99,6 @@ static inline void *kmap_atomic(struct p return kmap_atomic_prot(page, kmap_prot); } -static inline void *kmap_atomic_pfn(unsigned long pfn) -{ - preempt_disable(); - pagefault_disable(); - return __kmap_local_pfn_prot(pfn, kmap_prot); -} - static inline void __kunmap_atomic(void *addr) { kunmap_local_indexed(addr); @@ -193,11 +186,6 @@ static inline void *kmap_atomic_prot(str return kmap_atomic(page); } -static inline void *kmap_atomic_pfn(unsigned long pfn) -{ - return kmap_atomic(pfn_to_page(pfn)); -} - static inline void __kunmap_atomic(void *addr) { #ifdef ARCH_HAS_FLUSH_ON_KUNMAP