summaryrefslogtreecommitdiffstats
path: root/arch/powerpc/include/asm/string.h
diff options
context:
space:
mode:
authorBalbir Singh <bsingharora@gmail.com>2019-08-20 10:13:51 +0200
committerMichael Ellerman <mpe@ellerman.id.au>2019-08-21 14:23:48 +0200
commit4d4a273854c9eac1a1b163830658dc825e183ad5 (patch)
tree18b6a919f5cb50880c8b81d96bfd9f6fb881e59d /arch/powerpc/include/asm/string.h
parentpowerpc/mce: Handle UE event for memcpy_mcsafe (diff)
downloadlinux-4d4a273854c9eac1a1b163830658dc825e183ad5.tar.xz
linux-4d4a273854c9eac1a1b163830658dc825e183ad5.zip
powerpc/memcpy: Add memcpy_mcsafe for pmem
The pmem infrastructure uses memcpy_mcsafe in the pmem layer so as to convert machine check exceptions into a return value on failure in case a machine check exception is encountered during the memcpy. The return value is the number of bytes remaining to be copied. This patch largely borrows from the copyuser_power7 logic and does not add the VMX optimizations, largely to keep the patch simple. If needed those optimizations can be folded in. Signed-off-by: Balbir Singh <bsingharora@gmail.com> [arbab@linux.ibm.com: Added symbol export] Co-developed-by: Santosh Sivaraj <santosh@fossix.org> Signed-off-by: Santosh Sivaraj <santosh@fossix.org> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Link: https://lore.kernel.org/r/20190820081352.8641-7-santosh@fossix.org
Diffstat (limited to 'arch/powerpc/include/asm/string.h')
-rw-r--r--arch/powerpc/include/asm/string.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/arch/powerpc/include/asm/string.h b/arch/powerpc/include/asm/string.h
index 9bf6dffb4090..b72692702f35 100644
--- a/arch/powerpc/include/asm/string.h
+++ b/arch/powerpc/include/asm/string.h
@@ -53,7 +53,9 @@ void *__memmove(void *to, const void *from, __kernel_size_t n);
#ifndef CONFIG_KASAN
#define __HAVE_ARCH_MEMSET32
#define __HAVE_ARCH_MEMSET64
+#define __HAVE_ARCH_MEMCPY_MCSAFE
+extern int memcpy_mcsafe(void *dst, const void *src, __kernel_size_t sz);
extern void *__memset16(uint16_t *, uint16_t v, __kernel_size_t);
extern void *__memset32(uint32_t *, uint32_t v, __kernel_size_t);
extern void *__memset64(uint64_t *, uint64_t v, __kernel_size_t);