From patchwork Wed Mar 30 14:39:20 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John David Anglin X-Patchwork-Id: 12795889 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3692FC433F5 for ; Wed, 30 Mar 2022 14:39:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1347014AbiC3Ol1 (ORCPT ); Wed, 30 Mar 2022 10:41:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41652 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347031AbiC3OlZ (ORCPT ); Wed, 30 Mar 2022 10:41:25 -0400 Received: from cmx-mtlrgo001.bell.net (mta-mtl-005.bell.net [209.71.208.25]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 25FF355BE3 for ; Wed, 30 Mar 2022 07:39:35 -0700 (PDT) X-RG-CM-BuS: 0 X-RG-CM-SC: 0 X-RG-CM: Clean X-Originating-IP: [70.50.7.94] X-RG-Env-Sender: dave.anglin@bell.net X-RG-Rigid: 6243249C0021ED0D X-CM-Envelope: MS4xfGu5x2ml15Xjysg9hEErPNeEAtfmUxD6bshx4+r/NNgR0LryN8Fspq/MJnP2EEMuqEkQu1btp05gKVrxfjEbwfvdnFsyVCnqfTy93GyyZmE17Jmm+hpt J8pI4lpNReq67rVkll9B9icq2tP03tmOAHdWhQfmf5iSUeN6eKLAIY+DQ6fwzpELN6hf39URE3P81HxqDnWMnK43a0GbZKoJlqmcQ3kjN4Annx9JvosBDpUh qlOwkeSTSirx0xSqkb/sSxts/SSrwALrbTL+ys8NWeA42omdnmE5jR2KGw2q5+j1CxVR+cLdBT0laP+U8+y8f1fjuf4Nrgx9KUkI8I9jyiBFWHJMAwce4QeJ E3Lm0ReElCUjrie8xfkf1g9la4vHBScl7F8sGZQJ0dkcnvKanh6PSIHdtc3ak7qMzSMgFNQAsYaESjb6uSbl8KSZ0RwHj2m772zH72bAoIhA4DxAMtWyP6g8 OJmWBfNgnN8zFGI88eEFZlyq1JaTrRrihF/Vv4ca82uSCeTeZqBR8BhTSTBf6Z/+YCV6yJfMDrPo6jok0lBIGMq7KLwYSK+iStXZgSQ1/bC78tqM+LNxqOhD v5BpSsXerdOYSfsKzl6eibFCwFZWeXnnmHHP5vdkOZKKxw== X-CM-Analysis: v=2.4 cv=YYreWydf c=1 sm=1 tr=0 ts=62446b99 a=9k1bCY7nR7m1ZFzoCuQ56g==:117 a=9k1bCY7nR7m1ZFzoCuQ56g==:17 a=o8Y5sQTvuykA:10 a=FBHGMhGWAAAA:8 a=3kVGm1IiYS7Sbd7lve8A:9 a=CjuIK1q_8ugA:10 a=oFCfDGa8Ei_L46Sp8Z4A:9 a=FfaGCDsud1wA:10 a=9gvnlMMaQFpL9xblJ6ne:22 Received: from mx3210.localdomain (70.50.7.94) by cmx-mtlrgo001.bell.net (5.8.807) (authenticated as dave.anglin@bell.net) id 6243249C0021ED0D; Wed, 30 Mar 2022 10:39:21 -0400 Received: by mx3210.localdomain (Postfix, from userid 1000) id 2F999220116; Wed, 30 Mar 2022 14:39:21 +0000 (UTC) Date: Wed, 30 Mar 2022 14:39:20 +0000 From: John David Anglin To: linux-parisc@vger.kernel.org Cc: Helge Deller , Deller , James Bottomley Subject: [PATCH] parisc: Implement flush_cache_vmap_vunmap Message-ID: MIME-Version: 1.0 Content-Disposition: inline Precedence: bulk List-ID: X-Mailing-List: linux-parisc@vger.kernel.org Revise flush_cache_vmap and flush_cache_vunmap calls to use flush_cache_vmap_vunmap. It flushes tlb to inhibit move-in and checks that interrupts are disabled on SMP builds. Signed-off-by: John David Anglin diff --git a/arch/parisc/include/asm/cacheflush.h b/arch/parisc/include/asm/cacheflush.h index e8b4a03343d3..fa40709698de 100644 --- a/arch/parisc/include/asm/cacheflush.h +++ b/arch/parisc/include/asm/cacheflush.h @@ -37,8 +37,9 @@ void flush_kernel_dcache_page_addr(void *addr); flush_kernel_dcache_range_asm((start), (start)+(size)); #define ARCH_IMPLEMENTS_FLUSH_KERNEL_VMAP_RANGE 1 -void flush_kernel_vmap_range(void *vaddr, int size); -void invalidate_kernel_vmap_range(void *vaddr, int size); +void flush_cache_vmap_vunmap(unsigned long start, unsigned long end); +#define flush_cache_vmap(start,end) flush_cache_vmap_vunmap(start,end) +#define flush_cache_vunmap(start,end) flush_cache_vmap_vunmap(start,end) #define flush_cache_vmap(start, end) flush_cache_all() #define flush_cache_vunmap(start, end) flush_cache_all() diff --git a/arch/parisc/kernel/cache.c b/arch/parisc/kernel/cache.c index 91d218953b5c..533c5643c3fe 100644 --- a/arch/parisc/kernel/cache.c +++ b/arch/parisc/kernel/cache.c @@ -653,3 +653,15 @@ void invalidate_kernel_vmap_range(void *vaddr, int size) flush_tlb_kernel_range(start, end); } EXPORT_SYMBOL(invalidate_kernel_vmap_range); + +void flush_cache_vmap_vunmap(unsigned long start, unsigned long end) +{ + BUG_ON(IS_ENABLED(CONFIG_SMP) && arch_irqs_disabled()); + + /* Inhibit cache move-in */ + flush_tlb_all(); + + /* Flush the entire cache to remove all aliases */ + flush_cache_all(); +} +EXPORT_SYMBOL(flush_cache_vmap_vunmap);