Message ID | 155837931725.876528.6291628638777172042.stgit@dwillia2-desk3.amr.corp.intel.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | [v2] libnvdimm/pmem: Bypass CONFIG_HARDENED_USERCOPY overhead | expand |
Hi, [This is an automated email] This commit has been processed because it contains a "Fixes:" tag, fixing commit: 0aed55af8834 x86, uaccess: introduce copy_from_iter_flushcache for pmem / cache-bypass operations. The bot has tested the following trees: v5.1.3, v5.0.17, v4.19.44, v4.14.120. v5.1.3: Build OK! v5.0.17: Build OK! v4.19.44: Build OK! v4.14.120: Failed to apply! Possible dependencies: 6dfdb2b6d877 ("pmem: Switch to copy_to_iter_mcsafe()") 976431b02c2e ("dax, dm: allow device-mapper to operate without dax support") 98d82f48f198 ("dm log writes: add support for DAX") b3a9a0c36e1f ("dax: Introduce a ->copy_to_iter dax operation") How should we proceed with this patch? -- Thanks, Sasha
diff --git a/drivers/nvdimm/pmem.c b/drivers/nvdimm/pmem.c index 845c5b430cdd..c894f45e5077 100644 --- a/drivers/nvdimm/pmem.c +++ b/drivers/nvdimm/pmem.c @@ -281,16 +281,21 @@ static long pmem_dax_direct_access(struct dax_device *dax_dev, return __pmem_direct_access(pmem, pgoff, nr_pages, kaddr, pfn); } +/* + * Use the 'no check' versions of copy_from_iter_flushcache() and + * copy_to_iter_mcsafe() to bypass HARDENED_USERCOPY overhead. Bounds + * checking is handled by dax_iomap_actor() + */ static size_t pmem_copy_from_iter(struct dax_device *dax_dev, pgoff_t pgoff, void *addr, size_t bytes, struct iov_iter *i) { - return copy_from_iter_flushcache(addr, bytes, i); + return _copy_from_iter_flushcache(addr, bytes, i); } static size_t pmem_copy_to_iter(struct dax_device *dax_dev, pgoff_t pgoff, void *addr, size_t bytes, struct iov_iter *i) { - return copy_to_iter_mcsafe(addr, bytes, i); + return _copy_to_iter_mcsafe(addr, bytes, i); } static const struct dax_operations pmem_dax_ops = {