Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752582AbdFRIkk (ORCPT ); Sun, 18 Jun 2017 04:40:40 -0400 Received: from verein.lst.de ([213.95.11.211]:51417 "EHLO newverein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750968AbdFRIki (ORCPT ); Sun, 18 Jun 2017 04:40:38 -0400 Date: Sun, 18 Jun 2017 10:40:36 +0200 From: Christoph Hellwig To: Dan Williams Cc: linux-nvdimm@lists.01.org, Jan Kara , dm-devel@redhat.com, Matthew Wilcox , x86@kernel.org, linux-kernel@vger.kernel.org, hch@lst.de, Jeff Moyer , Ingo Molnar , "Oliver O'Halloran" , viro@zeniv.linux.org.uk, "H. Peter Anvin" , linux-fsdevel@vger.kernel.org, Thomas Gleixner , Ross Zwisler Subject: Re: [PATCH v3 08/14] x86, dax, libnvdimm: move wb_cache_pmem() to libnvdimm Message-ID: <20170618084036.GC26456@lst.de> References: <149703982465.20620.14881139332926778446.stgit@dwillia2-desk3.amr.corp.intel.com> <149703986971.20620.10303247412197996310.stgit@dwillia2-desk3.amr.corp.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <149703986971.20620.10303247412197996310.stgit@dwillia2-desk3.amr.corp.intel.com> User-Agent: Mutt/1.5.17 (2007-11-01) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1227 Lines: 35 > +void clean_cache_range(void *addr, size_t size); > > static inline int > __copy_from_user_inatomic_nocache(void *dst, const void __user *src, > diff --git a/arch/x86/lib/usercopy_64.c b/arch/x86/lib/usercopy_64.c > index f42d2fd86ca3..baa80ff29da8 100644 > --- a/arch/x86/lib/usercopy_64.c > +++ b/arch/x86/lib/usercopy_64.c > @@ -85,7 +85,7 @@ copy_user_handle_tail(char *to, char *from, unsigned len) > * instruction. Note that @size is internally rounded up to be cache > * line size aligned. > */ > -static void clean_cache_range(void *addr, size_t size) > +void clean_cache_range(void *addr, size_t size) Can you keep clean_cache_range private please? Just add arch_wb_cache_pmem to usercopy_64.c just behind it so that the compiler can tail-call and export that instead. > --- a/drivers/nvdimm/pmem.h > +++ b/drivers/nvdimm/pmem.h > @@ -4,6 +4,13 @@ > #include > #include > #include > +#include > + > +#ifndef CONFIG_ARCH_HAS_PMEM_API > +static inline void arch_wb_cache_pmem(void *addr, size_t size) > +{ > +} > +#endif And our normal Linux style would be to have this linux linux/pmem.h, which should always be included for the asm version.