@@ -65,6 +65,12 @@ extern long __copy_user_flushcache(void *dst, const void __user *src, unsigned s
extern void memcpy_page_flushcache(char *to, struct page *page, size_t offset,
size_t len);
+static inline unsigned long
+__copy_from_user_nocache(void *dst, const void __user *src, unsigned long size)
+{
+ return (unsigned long)__copy_user_nocache(dst, src, (unsigned int) size, 0);
+}
+
static inline int
__copy_from_user_inatomic_nocache(void *dst, const void __user *src,
unsigned size)
@@ -234,6 +234,12 @@ static inline bool pagefault_disabled(void)
#ifndef ARCH_HAS_NOCACHE_UACCESS
static inline __must_check unsigned long
+__copy_from_user_nocache(void *to, const void __user *from, unsigned long n)
+{
+ return __copy_from_user(to, from, n);
+}
+
+static inline __must_check unsigned long
__copy_from_user_inatomic_nocache(void *to, const void __user *from,
unsigned long n)
{
Add a generic non-temporal wrapper to uaccess which can be overridden by arches that support non-temporal copies. An implementation is added for x86 which wraps an existing non-temporal copy in the kernel. Signed-off-by: Joe Damato <jdamato@fastly.com> --- arch/x86/include/asm/uaccess_64.h | 6 ++++++ include/linux/uaccess.h | 6 ++++++ 2 files changed, 12 insertions(+)