Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753415AbdFSCGS (ORCPT ); Sun, 18 Jun 2017 22:06:18 -0400 Received: from mail-ot0-f175.google.com ([74.125.82.175]:35112 "EHLO mail-ot0-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753258AbdFSCGP (ORCPT ); Sun, 18 Jun 2017 22:06:15 -0400 MIME-Version: 1.0 In-Reply-To: <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> <20170618084036.GC26456@lst.de> From: Dan Williams Date: Sun, 18 Jun 2017 19:06:14 -0700 Message-ID: Subject: Re: [PATCH v3 08/14] x86, dax, libnvdimm: move wb_cache_pmem() to libnvdimm To: Christoph Hellwig Cc: "linux-nvdimm@lists.01.org" , Jan Kara , dm-devel@redhat.com, Matthew Wilcox , X86 ML , "linux-kernel@vger.kernel.org" , Jeff Moyer , Ingo Molnar , "Oliver O'Halloran" , Al Viro , "H. Peter Anvin" , linux-fsdevel , Thomas Gleixner , Ross Zwisler Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1350 Lines: 38 On Sun, Jun 18, 2017 at 1:40 AM, Christoph Hellwig wrote: >> +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. Ok, will do.