|
|
@@ -281,16 +281,22 @@ 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, both file offset and device offset, 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 = {
|