Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp2436598ybi; Thu, 18 Jul 2019 08:21:39 -0700 (PDT) X-Google-Smtp-Source: APXvYqyOww44hdTIM5aP9nFT/Bxc8ixriUxBDh7CvlenLpZ4P5j48KsDgkB9yT93K4ZWQiYBhdlq X-Received: by 2002:a17:902:aa8a:: with SMTP id d10mr51575590plr.154.1563463299847; Thu, 18 Jul 2019 08:21:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563463299; cv=none; d=google.com; s=arc-20160816; b=KompkKeQ5Urn2ZftF4eBTR7SQNhIxGZ6gv/7lAstnASa2DZIfDf1ADJ3gU81d95/k0 h2dOuyPAaTjk2N8UHxgTmZdZAMJFpzyHB7Bq8uvpdWOo3A0OXrXD3DxkqA8CnnuOCYyB htqdG+6SnrfwZGHZcKNSdyNhdFYNiRM5bBFOIgNGUSMv3TgbSNRfo69tN1XFH+/+s9UC xFbCXTYxtetA1XmF2DGt4HXy5qqMNEVGPGSfb5yuus9q1c9rrYqChXyU0g1Cpk90XTYx ANQWo0Y+vGq+v1OB01lqbfqwPnBx4sHZ90QdCwLrG1Z6I95Ub6y1e575/b+vbRzrXInH r/xA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:message-id :subject:cc:to:from:date:dkim-signature; bh=Tbdphi8CrHqxWHaUURv6oHYNP9deEDGvOFqbwoY/Y0A=; b=kYmvGucLC0395oSEr+YBiNkAwLLoHibSmnpdGQE6/Gt/a7TkjmREWWfY9kcFRhWkg1 xGqSqgwrBfWncFmI0OoRWg1VZOL51cqdottTLT2xmPh8BW1yL9h11yIpQMbgVRnjy5YW tNC6+O64rWlhXfHIMI1xz6dkEyFMrmZBH5Fvv124Z5zFEX2D0y1tWvy0Sl4faWiiNvwh TET++4smTH9Iqvfz5b3y4H3RdPpbKWLvUXBajeBf+fCKJ5/Q6oW1n4NxYiu19Rn1vh3n ez2+V9CKhP2HfYbi4Xt/mc47SjwDXMxG84fgTyS56ozmv/Wa3KLVbgi+LijFp5sG2HkI /eQA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sifive.com header.s=google header.b=Whrg4ctJ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m22si832974pgh.190.2019.07.18.08.21.22; Thu, 18 Jul 2019 08:21:39 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@sifive.com header.s=google header.b=Whrg4ctJ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727781AbfGRPTW (ORCPT + 99 others); Thu, 18 Jul 2019 11:19:22 -0400 Received: from mail-io1-f67.google.com ([209.85.166.67]:45057 "EHLO mail-io1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726040AbfGRPTW (ORCPT ); Thu, 18 Jul 2019 11:19:22 -0400 Received: by mail-io1-f67.google.com with SMTP id g20so51991659ioc.12 for ; Thu, 18 Jul 2019 08:19:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sifive.com; s=google; h=date:from:to:cc:subject:message-id:user-agent:mime-version; bh=Tbdphi8CrHqxWHaUURv6oHYNP9deEDGvOFqbwoY/Y0A=; b=Whrg4ctJ0WfkjGBYTaCrG+D6OUBE6Tnw2Q7NONAXv+ZDC7WaJk7O/zUK8LXgq2k3Ug +qTt5c8636LeXcgwlJEcjTHzHptqGk1UqFvxsyI6zIN+THsqZBsdSVj8LzsXyKyCIHRL 0USaC0X5nlwytiSP2kYkwdGcBwd73zv3lfOCjv12guAZ3v/OBTP3oDgvutNdUS5L4K6J 0qkHT1cN+JskUi2h+eLROZtGK4Cr4BxwokYvj2FD2q1566I6cyMJmiPLHO6BgLyvxFox IJkRT/G6wFPPC7XKT9TUQzPO6gRdtKQSeOVhIRwjy+FLmyG5B0MzDr31eEE9A+s15B+r v5fA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:user-agent :mime-version; bh=Tbdphi8CrHqxWHaUURv6oHYNP9deEDGvOFqbwoY/Y0A=; b=QxoNAHRipCM8V/h+1R329SW5XMOYbmYbLlxbORf+wexr9fN1l2hkbxSMZ3N7nbDBUm 7DI0Se8x2buEQ1JCeWHMKqYRnJhNd7c/jyyCIS773Kklg0zRWB7zLERn4aJwMUL9qKuE uyZCc7WcgL16k95Mce182oEZFX/1ArQMl0twwX0u7GwOu1j8JSR+pSCtZXWpKUwWwXRD HuRJfau45Ucod9ujwOunNHj348xpdIeP8xxUf7eTnnb7uQHblihCYsCcZa0itz+j/dsU IeXn4xB6SwNsn/bXtPRz4LVcGBdvKF3lm4mrwiFoVZfuUUZSrz7XjPfJb30g5n83I/wQ QDYQ== X-Gm-Message-State: APjAAAWePNpEraLYJvPH5mrmHTydT12hqX4GEQ/SCThNVI4DYxymVLiB TFD0uEkaQazMD6+4ULxJon2NYA== X-Received: by 2002:a5d:8e08:: with SMTP id e8mr46043389iod.139.1563463161307; Thu, 18 Jul 2019 08:19:21 -0700 (PDT) Received: from localhost (67-0-62-24.albq.qwest.net. [67.0.62.24]) by smtp.gmail.com with ESMTPSA id n7sm20848114ioo.79.2019.07.18.08.19.20 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Thu, 18 Jul 2019 08:19:20 -0700 (PDT) Date: Thu, 18 Jul 2019 08:19:19 -0700 (PDT) From: Paul Walmsley X-X-Sender: paulw@viisi.sifive.com To: cai@lca.pw, arnd@arndb.de, akpm@linux-foundation.org, torvalds@linux-foundation.org cc: linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org Subject: [PATCH] riscv: fix build break after macro-to-function conversion in generic cacheflush.h Message-ID: User-Agent: Alpine 2.21.9999 (DEB 301 2018-08-15) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit c296d4dc13ae ("asm-generic: fix a compilation warning") converted the various flush_*cache_* macros in asm-generic/cacheflush.h to static inline functions. This breaks RISC-V builds, since RISC-V's cacheflush.h includes the generic cacheflush.h and then undefines the macros to be overridden. Fix by copying the subset of the no-op functions that are reused from the generic cacheflush.h into the RISC-V cacheflush.h, and dropping the include of the generic cacheflush.h. Fixes: c296d4dc13ae ("asm-generic: fix a compilation warning") Signed-off-by: Paul Walmsley Cc: Qian Cai Cc: Arnd Bergmann Cc: Andrew Morton Cc: Linus Torvalds --- Queued with the other arch/riscv patches for the 5.3 merge window. arch/riscv/include/asm/cacheflush.h | 63 +++++++++++++++++++++++++++-- 1 file changed, 59 insertions(+), 4 deletions(-) diff --git a/arch/riscv/include/asm/cacheflush.h b/arch/riscv/include/asm/cacheflush.h index ad8678f1b54a..555b20b11dc3 100644 --- a/arch/riscv/include/asm/cacheflush.h +++ b/arch/riscv/include/asm/cacheflush.h @@ -6,11 +6,66 @@ #ifndef _ASM_RISCV_CACHEFLUSH_H #define _ASM_RISCV_CACHEFLUSH_H -#include +#include -#undef flush_icache_range -#undef flush_icache_user_range -#undef flush_dcache_page +#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 *mapping) +{ +} + +static inline void flush_dcache_mmap_unlock(struct address_space *mapping) +{ +} + +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 long 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) { -- 2.22.0