From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Date: Fri, 11 Mar 2016 15:50:01 -0700 From: Ross Zwisler Subject: Re: [PATCH] x86, pmem: use memcpy_mcsafe() for memcpy_from_pmem() Message-ID: <20160311225001.GA30106@linux.intel.com> References: <20160310191507.29771.46591.stgit@dwillia2-desk3.jf.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160310191507.29771.46591.stgit@dwillia2-desk3.jf.intel.com> Sender: owner-linux-mm@kvack.org To: Dan Williams Cc: akpm@linux-foundation.org, Ingo Molnar , Tony Luck , linux-nvdimm@lists.01.org, Peter Zijlstra , linux-kernel@vger.kernel.org, Andy Lutomirski , linux-mm@kvack.org, Borislav Petkov , Ross Zwisler , Linus Torvalds , Thomas Gleixner List-ID: On Thu, Mar 10, 2016 at 11:15:53AM -0800, Dan Williams wrote: > Update the definition of memcpy_from_pmem() to return 0 or -EIO on > error. Implement x86::arch_memcpy_from_pmem() with memcpy_mcsafe(). > > Cc: Borislav Petkov > Cc: Ingo Molnar > Cc: Tony Luck > Cc: Thomas Gleixner > Cc: Andy Lutomirski > Cc: Peter Zijlstra > Cc: Andrew Morton > Cc: Ross Zwisler > Cc: Linus Torvalds > Signed-off-by: Dan Williams > --- > Andrew, now that all the pre-requisites for this patch are in -next > (tip/core/ras, tip/x86/asm, nvdimm/libnvdimm-for-next) may I ask you to > carry it in -mm? > > Alternatively I can do an octopus merge and post a branch, but that > seems messy/risky for me to be merging 3 branches that are still subject > to a merge window disposition. > > arch/x86/include/asm/pmem.h | 9 +++++++++ > drivers/nvdimm/pmem.c | 4 ++-- > include/linux/pmem.h | 14 ++++++++------ > 3 files changed, 19 insertions(+), 8 deletions(-) <> > diff --git a/include/linux/pmem.h b/include/linux/pmem.h > index 3ec5309e29f3..c46c5cf6538e 100644 > --- a/include/linux/pmem.h > +++ b/include/linux/pmem.h > @@ -66,14 +66,16 @@ static inline void arch_invalidate_pmem(void __pmem *addr, size_t size) > #endif > > /* > - * Architectures that define ARCH_HAS_PMEM_API must provide > - * implementations for arch_memcpy_to_pmem(), arch_wmb_pmem(), > - * arch_copy_from_iter_pmem(), arch_clear_pmem(), arch_wb_cache_pmem() > - * and arch_has_wmb_pmem(). Why did you delete the above comment? I believe it adds value? Or do you think the fact that another architecture will get compile errors if the arch_* functions aren't defined is documentation enough? > + * memcpy_from_pmem - read from persistent memory with error handling > + * @dst: destination buffer > + * @src: source buffer Missing kerneldoc for @size? Aside from those tiny nits: Reviewed-by: Ross Zwisler -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753052AbcCKWuk (ORCPT ); Fri, 11 Mar 2016 17:50:40 -0500 Received: from mga09.intel.com ([134.134.136.24]:54997 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752771AbcCKWug (ORCPT ); Fri, 11 Mar 2016 17:50:36 -0500 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.24,321,1455004800"; d="scan'208";a="667910174" Date: Fri, 11 Mar 2016 15:50:01 -0700 From: Ross Zwisler To: Dan Williams Cc: akpm@linux-foundation.org, Ingo Molnar , Tony Luck , linux-nvdimm@ml01.01.org, Peter Zijlstra , linux-kernel@vger.kernel.org, Andy Lutomirski , linux-mm@kvack.org, Borislav Petkov , Ross Zwisler , Linus Torvalds , Thomas Gleixner Subject: Re: [PATCH] x86, pmem: use memcpy_mcsafe() for memcpy_from_pmem() Message-ID: <20160311225001.GA30106@linux.intel.com> References: <20160310191507.29771.46591.stgit@dwillia2-desk3.jf.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160310191507.29771.46591.stgit@dwillia2-desk3.jf.intel.com> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Mar 10, 2016 at 11:15:53AM -0800, Dan Williams wrote: > Update the definition of memcpy_from_pmem() to return 0 or -EIO on > error. Implement x86::arch_memcpy_from_pmem() with memcpy_mcsafe(). > > Cc: Borislav Petkov > Cc: Ingo Molnar > Cc: Tony Luck > Cc: Thomas Gleixner > Cc: Andy Lutomirski > Cc: Peter Zijlstra > Cc: Andrew Morton > Cc: Ross Zwisler > Cc: Linus Torvalds > Signed-off-by: Dan Williams > --- > Andrew, now that all the pre-requisites for this patch are in -next > (tip/core/ras, tip/x86/asm, nvdimm/libnvdimm-for-next) may I ask you to > carry it in -mm? > > Alternatively I can do an octopus merge and post a branch, but that > seems messy/risky for me to be merging 3 branches that are still subject > to a merge window disposition. > > arch/x86/include/asm/pmem.h | 9 +++++++++ > drivers/nvdimm/pmem.c | 4 ++-- > include/linux/pmem.h | 14 ++++++++------ > 3 files changed, 19 insertions(+), 8 deletions(-) <> > diff --git a/include/linux/pmem.h b/include/linux/pmem.h > index 3ec5309e29f3..c46c5cf6538e 100644 > --- a/include/linux/pmem.h > +++ b/include/linux/pmem.h > @@ -66,14 +66,16 @@ static inline void arch_invalidate_pmem(void __pmem *addr, size_t size) > #endif > > /* > - * Architectures that define ARCH_HAS_PMEM_API must provide > - * implementations for arch_memcpy_to_pmem(), arch_wmb_pmem(), > - * arch_copy_from_iter_pmem(), arch_clear_pmem(), arch_wb_cache_pmem() > - * and arch_has_wmb_pmem(). Why did you delete the above comment? I believe it adds value? Or do you think the fact that another architecture will get compile errors if the arch_* functions aren't defined is documentation enough? > + * memcpy_from_pmem - read from persistent memory with error handling > + * @dst: destination buffer > + * @src: source buffer Missing kerneldoc for @size? Aside from those tiny nits: Reviewed-by: Ross Zwisler