summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-11-04 18:05:30 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-11-04 18:08:28 +0100
commit8b5145ba3afc24f9749e57d3c0e6bba0b129dc4d (patch)
tree1dbe5421be3596cd54a67878ecc3b919c7dc1bd3 /include
parent8406c90cdc780dc86d9daabe9d38f0583467dc4b (diff)
downloadlinux-stable-8b5145ba3afc24f9749e57d3c0e6bba0b129dc4d.tar.gz
linux-stable-8b5145ba3afc24f9749e57d3c0e6bba0b129dc4d.tar.bz2
linux-stable-8b5145ba3afc24f9749e57d3c0e6bba0b129dc4d.zip
Revert "x86, powerpc: Rename memcpy_mcsafe() to copy_mc_to_{user, kernel}()"
This reverts commit a85748ed9eb70108f9605558f2754ca94ee91401 which is commit ec6347bb43395cb92126788a1a5b25302543f815 upstream. We had a mistake when merging a later patch in this series due to some file movements, so revert this change for now, as we will add it back in a later commit. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'include')
-rw-r--r--include/linux/string.h9
-rw-r--r--include/linux/uaccess.h13
-rw-r--r--include/linux/uio.h10
3 files changed, 13 insertions, 19 deletions
diff --git a/include/linux/string.h b/include/linux/string.h
index b1f3894a0a3e..9b7a0632e87a 100644
--- a/include/linux/string.h
+++ b/include/linux/string.h
@@ -161,13 +161,20 @@ extern int bcmp(const void *,const void *,__kernel_size_t);
#ifndef __HAVE_ARCH_MEMCHR
extern void * memchr(const void *,int,__kernel_size_t);
#endif
+#ifndef __HAVE_ARCH_MEMCPY_MCSAFE
+static inline __must_check unsigned long memcpy_mcsafe(void *dst,
+ const void *src, size_t cnt)
+{
+ memcpy(dst, src, cnt);
+ return 0;
+}
+#endif
#ifndef __HAVE_ARCH_MEMCPY_FLUSHCACHE
static inline void memcpy_flushcache(void *dst, const void *src, size_t cnt)
{
memcpy(dst, src, cnt);
}
#endif
-
void *memchr_inv(const void *s, int c, size_t n);
char *strreplace(char *s, char old, char new);
diff --git a/include/linux/uaccess.h b/include/linux/uaccess.h
index 1ae36bc8db35..94b285411659 100644
--- a/include/linux/uaccess.h
+++ b/include/linux/uaccess.h
@@ -179,19 +179,6 @@ copy_in_user(void __user *to, const void __user *from, unsigned long n)
}
#endif
-#ifndef copy_mc_to_kernel
-/*
- * Without arch opt-in this generic copy_mc_to_kernel() will not handle
- * #MC (or arch equivalent) during source read.
- */
-static inline unsigned long __must_check
-copy_mc_to_kernel(void *dst, const void *src, size_t cnt)
-{
- memcpy(dst, src, cnt);
- return 0;
-}
-#endif
-
static __always_inline void pagefault_disabled_inc(void)
{
current->pagefault_disabled++;
diff --git a/include/linux/uio.h b/include/linux/uio.h
index f14410c678bd..3835a8a8e9ea 100644
--- a/include/linux/uio.h
+++ b/include/linux/uio.h
@@ -185,10 +185,10 @@ size_t _copy_from_iter_flushcache(void *addr, size_t bytes, struct iov_iter *i);
#define _copy_from_iter_flushcache _copy_from_iter_nocache
#endif
-#ifdef CONFIG_ARCH_HAS_COPY_MC
-size_t _copy_mc_to_iter(const void *addr, size_t bytes, struct iov_iter *i);
+#ifdef CONFIG_ARCH_HAS_UACCESS_MCSAFE
+size_t _copy_to_iter_mcsafe(const void *addr, size_t bytes, struct iov_iter *i);
#else
-#define _copy_mc_to_iter _copy_to_iter
+#define _copy_to_iter_mcsafe _copy_to_iter
#endif
static __always_inline __must_check
@@ -201,12 +201,12 @@ size_t copy_from_iter_flushcache(void *addr, size_t bytes, struct iov_iter *i)
}
static __always_inline __must_check
-size_t copy_mc_to_iter(void *addr, size_t bytes, struct iov_iter *i)
+size_t copy_to_iter_mcsafe(void *addr, size_t bytes, struct iov_iter *i)
{
if (unlikely(!check_copy_size(addr, bytes, true)))
return 0;
else
- return _copy_mc_to_iter(addr, bytes, i);
+ return _copy_to_iter_mcsafe(addr, bytes, i);
}
size_t iov_iter_zero(size_t bytes, struct iov_iter *);