From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id A851C2194235A for ; Tue, 11 Apr 2017 08:49:15 -0700 (PDT) Date: Tue, 11 Apr 2017 09:49:13 -0600 From: Ross Zwisler Subject: Re: [PATCH v3] x86, pmem: fix broken __copy_user_nocache cache-bypass assumptions Message-ID: <20170411154913.GA20725@linux.intel.com> References: <149187075199.40875.9829505688202257056.stgit@dwillia2-desk3.amr.corp.intel.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <149187075199.40875.9829505688202257056.stgit@dwillia2-desk3.amr.corp.intel.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: linux-nvdimm-bounces@lists.01.org Sender: "Linux-nvdimm" To: Dan Williams Cc: Jan Kara , Matthew Wilcox , x86@kernel.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org, linux-nvdimm@lists.01.org, Ingo Molnar , Al Viro , "H. Peter Anvin" , Thomas Gleixner , Christoph Hellwig List-ID: On Mon, Apr 10, 2017 at 05:35:02PM -0700, Dan Williams wrote: > Before we rework the "pmem api" to stop abusing __copy_user_nocache() > for memcpy_to_pmem() we need to fix cases where we may strand dirty data > in the cpu cache. The problem occurs when copy_from_iter_pmem() is used > for arbitrary data transfers from userspace. There is no guarantee that > these transfers, performed by dax_iomap_actor(), will have aligned > destinations or aligned transfer lengths. Backstop the usage > __copy_user_nocache() with explicit cache management in these unaligned > cases. > > Yes, copy_from_iter_pmem() is now too big for an inline, but addressing > that is saved for a later patch that moves the entirety of the "pmem > api" into the pmem driver directly. > > Fixes: 5de490daec8b ("pmem: add copy_from_iter_pmem() and clear_pmem()") > Cc: > Cc: > Cc: Jan Kara > Cc: Jeff Moyer > Cc: Ingo Molnar > Cc: Christoph Hellwig > Cc: "H. Peter Anvin" > Cc: Al Viro > Cc: Thomas Gleixner > Cc: Matthew Wilcox > Cc: Ross Zwisler > Signed-off-by: Toshi Kani > Signed-off-by: Dan Williams This looks good to me, thanks for fixing this. Reviewed-by: Ross Zwisler _______________________________________________ Linux-nvdimm mailing list Linux-nvdimm@lists.01.org https://lists.01.org/mailman/listinfo/linux-nvdimm