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=-3.5 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=no 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 77541C2D0F8 for ; Tue, 12 May 2020 23:00:31 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 2ADD120740 for ; Tue, 12 May 2020 23:00:31 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=dabbelt-com.20150623.gappssmtp.com header.i=@dabbelt-com.20150623.gappssmtp.com header.b="YV0IEXO5" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2ADD120740 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=dabbelt.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id BC62C9000F6; Tue, 12 May 2020 19:00:30 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id B77CC9000F3; Tue, 12 May 2020 19:00:30 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A65BB9000F6; Tue, 12 May 2020 19:00:30 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 8F4BE9000F3 for ; Tue, 12 May 2020 19:00:30 -0400 (EDT) Received: from smtpin08.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 58E562476 for ; Tue, 12 May 2020 23:00:30 +0000 (UTC) X-FDA: 76809587820.08.knee00_3e8d866ecc44a X-HE-Tag: knee00_3e8d866ecc44a X-Filterd-Recvd-Size: 6701 Received: from mail-pl1-f195.google.com (mail-pl1-f195.google.com [209.85.214.195]) by imf05.hostedemail.com (Postfix) with ESMTP for ; Tue, 12 May 2020 23:00:29 +0000 (UTC) Received: by mail-pl1-f195.google.com with SMTP id t16so6040179plo.7 for ; Tue, 12 May 2020 16:00:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dabbelt-com.20150623.gappssmtp.com; s=20150623; h=date:subject:in-reply-to:cc:from:to:message-id:mime-version :content-transfer-encoding; bh=TxR+iMR41NNC8Tp0Yh5G0J9anaHo/y+mAo5OJ6FnE3w=; b=YV0IEXO5IABYUMUtMWw6Y0a2xNZhYt4iDNMNdBJAdhkLz+DhDJrEb2/tely+kMRfBe elzT7mfwntttCi0+nBJzpxqW1RzbdA4k2z5m0sbPhXbgm86NhUGJ6ezv1UWvqUAF6AFb GwYEyZnEpPlXtS0AdB1oOMIXhoSzH1oQ3QYdKyFvf7rV9a0F5474HoxquQdEEcVsoVZk mkFDvy/LaDlTuj+uY+/sZnyRH+3w/Rut2ArIzwHPIrhPI856FrWtiOC99MOqCPnAlAt1 y5de0EiQgDBn8VhocdW7T7X+feJnXd114pzMo7qEMcn1qfbF3zf4gbB8O6Pkx7p0q4QB ZmJw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:subject:in-reply-to:cc:from:to:message-id :mime-version:content-transfer-encoding; bh=TxR+iMR41NNC8Tp0Yh5G0J9anaHo/y+mAo5OJ6FnE3w=; b=kRdi24v/HlV70y5wwQ/vGweJ5AcLG4P0a4cT7JKeDNGPFDUdtv8xedtPsaTBio6OC1 eZjTYBAK6k5H/qmA1ic9gSLCixqXdyYx8MIj+QooZG/r0lpLuTpOp5hcIXOVafpWkToN uQ/Gz/hz75fj7Cfb5VcHm27wPT3JY0G2qQA1ZILn7j9ATV+kvchKKGzgkPFV9UaXcGbc BMpDowzYjZ8w5yflr6PKvxSLG9W8P1x2LdNBVsfglUcyVJ75U+K4h1WtCB7ZLMZI1o4X ZePCd3rSrdXFXQDKBYwG7On6EvHInBfFrRNn/BR20BWnZ625EHfKIY1Fx27wnEaUdUjY FgWg== X-Gm-Message-State: AGi0PuYlatwkUxWRf1DcDzbMN7RoRP5Llm1lI9TyoVGuoj3fjPUFB+bi VmeownflmpaNlOfMCYBIYQlsGw== X-Google-Smtp-Source: APiQypKPbiNIuzOhnfWZK3aSuAimZ6kMvjtjoB3PUVWkLgrXCsrrvonJs2vHPqxiHQA1YoMJYuJ02Q== X-Received: by 2002:a17:90a:2281:: with SMTP id s1mr31687737pjc.68.1589324428530; Tue, 12 May 2020 16:00:28 -0700 (PDT) Received: from localhost (76-210-143-223.lightspeed.sntcca.sbcglobal.net. [76.210.143.223]) by smtp.gmail.com with ESMTPSA id w143sm12602170pfc.165.2020.05.12.16.00.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 May 2020 16:00:26 -0700 (PDT) Date: Tue, 12 May 2020 16:00:26 -0700 (PDT) X-Google-Original-Date: Tue, 12 May 2020 15:59:50 PDT (-0700) Subject: Re: [PATCH 19/31] riscv: use asm-generic/cacheflush.h In-Reply-To: <20200510075510.987823-20-hch@lst.de> CC: akpm@linux-foundation.org, Arnd Bergmann , zippel@linux-m68k.org, linux-arch@vger.kernel.org, linux-xtensa@linux-xtensa.org, monstr@monstr.eu, jeyu@kernel.org, linux-ia64@vger.kernel.org, linux-c6x-dev@linux-c6x.org, linux-sh@vger.kernel.org, linux-hexagon@vger.kernel.org, x86@kernel.org, linux-um@lists.infradead.org, linux-kernel@vger.kernel.org, linux-mips@vger.kernel.org, linux-mm@kvack.org, linux-m68k@lists.linux-m68k.org, openrisc@lists.librecores.org, linux-alpha@vger.kernel.org, sparclinux@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-riscv@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, linux-arm-kernel@lists.infradead.org From: Palmer Dabbelt To: Christoph Hellwig Message-ID: Mime-Version: 1.0 (MHng) Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable 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 Sun, 10 May 2020 00:54:58 PDT (-0700), Christoph Hellwig wrote: > RISC-V needs almost no cache flushing routines of its own. Rely on > asm-generic/cacheflush.h for the defaults. > > Also remove the pointless __KERNEL__ ifdef while we're at it. > --- > arch/riscv/include/asm/cacheflush.h | 62 ++--------------------------- > 1 file changed, 3 insertions(+), 59 deletions(-) > > diff --git a/arch/riscv/include/asm/cacheflush.h b/arch/riscv/include/a= sm/cacheflush.h > index c8677c75f82cb..a167b4fbdf007 100644 > --- a/arch/riscv/include/asm/cacheflush.h > +++ b/arch/riscv/include/asm/cacheflush.h > @@ -8,65 +8,6 @@ > > #include > > -#define ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE 0 > - > -/* > - * The cache doesn't need to be flushed when TLB entries change when > - * the cache is mapped to physical memory, not virtual memory > - */ > -static inline void flush_cache_all(void) > -{ > -} > - > -static inline void flush_cache_mm(struct mm_struct *mm) > -{ > -} > - > -static inline void flush_cache_dup_mm(struct mm_struct *mm) > -{ > -} > - > -static inline void flush_cache_range(struct vm_area_struct *vma, > - unsigned long start, > - unsigned long end) > -{ > -} > - > -static inline void flush_cache_page(struct vm_area_struct *vma, > - unsigned long vmaddr, > - unsigned long pfn) > -{ > -} > - > -static inline void flush_dcache_mmap_lock(struct address_space *mappin= g) > -{ > -} > - > -static inline void flush_dcache_mmap_unlock(struct address_space *mapp= ing) > -{ > -} > - > -static inline void flush_icache_page(struct vm_area_struct *vma, > - struct page *page) > -{ > -} > - > -static inline void flush_cache_vmap(unsigned long start, unsigned long= end) > -{ > -} > - > -static inline void flush_cache_vunmap(unsigned long start, unsigned lo= ng end) > -{ > -} > - > -#define copy_to_user_page(vma, page, vaddr, dst, src, len) \ > - do { \ > - memcpy(dst, src, len); \ > - flush_icache_user_range(vma, page, vaddr, len); \ > - } while (0) > -#define copy_from_user_page(vma, page, vaddr, dst, src, len) \ > - memcpy(dst, src, len) > - > static inline void local_flush_icache_all(void) > { > asm volatile ("fence.i" ::: "memory"); > @@ -79,6 +20,7 @@ static inline void flush_dcache_page(struct page *pag= e) > if (test_bit(PG_dcache_clean, &page->flags)) > clear_bit(PG_dcache_clean, &page->flags); > } > +#define ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE 1 > > /* > * RISC-V doesn't have an instruction to flush parts of the instructio= n cache, > @@ -105,4 +47,6 @@ void flush_icache_mm(struct mm_struct *mm, bool loca= l); > #define SYS_RISCV_FLUSH_ICACHE_LOCAL 1UL > #define SYS_RISCV_FLUSH_ICACHE_ALL (SYS_RISCV_FLUSH_ICACHE_LOCAL) > > +#include > + > #endif /* _ASM_RISCV_CACHEFLUSH_H */ Thanks! Reviewed-by: Palmer Dabbelt Acked-by: Palmer Dabbelt Were you trying to get these all in at once, or do you want me to take it= into my tree?