Commit e48b6853 authored by Heiko Carstens's avatar Heiko Carstens Committed by Vasily Gorbik

s390/kasan: remove override of mem*() functions

The kasan mem*() functions are not used anymore since s390 has switched
to GENERIC_ENTRY and commit 69d4c0d3 ("entry, kasan, x86: Disallow
overriding mem*() functions").

Therefore remove the now dead code, similar to x86.
While at it also use the SYM* macros in mem.S.
Signed-off-by: default avatarHeiko Carstens <hca@linux.ibm.com>
Signed-off-by: default avatarVasily Gorbik <gor@linux.ibm.com>
parent 2d1b21ec
...@@ -55,18 +55,6 @@ char *strstr(const char *s1, const char *s2); ...@@ -55,18 +55,6 @@ char *strstr(const char *s1, const char *s2);
#if defined(CONFIG_KASAN) && !defined(__SANITIZE_ADDRESS__) #if defined(CONFIG_KASAN) && !defined(__SANITIZE_ADDRESS__)
extern void *__memcpy(void *dest, const void *src, size_t n);
extern void *__memset(void *s, int c, size_t n);
extern void *__memmove(void *dest, const void *src, size_t n);
/*
* For files that are not instrumented (e.g. mm/slub.c) we
* should use not instrumented version of mem* functions.
*/
#define memcpy(dst, src, len) __memcpy(dst, src, len)
#define memmove(dst, src, len) __memmove(dst, src, len)
#define memset(s, c, n) __memset(s, c, n)
#define strlen(s) __strlen(s) #define strlen(s) __strlen(s)
#define __no_sanitize_prefix_strfunc(x) __##x #define __no_sanitize_prefix_strfunc(x) __##x
...@@ -79,6 +67,9 @@ extern void *__memmove(void *dest, const void *src, size_t n); ...@@ -79,6 +67,9 @@ extern void *__memmove(void *dest, const void *src, size_t n);
#define __no_sanitize_prefix_strfunc(x) x #define __no_sanitize_prefix_strfunc(x) x
#endif /* defined(CONFIG_KASAN) && !defined(__SANITIZE_ADDRESS__) */ #endif /* defined(CONFIG_KASAN) && !defined(__SANITIZE_ADDRESS__) */
void *__memcpy(void *dest, const void *src, size_t n);
void *__memset(void *s, int c, size_t n);
void *__memmove(void *dest, const void *src, size_t n);
void *__memset16(uint16_t *s, uint16_t v, size_t count); void *__memset16(uint16_t *s, uint16_t v, size_t count);
void *__memset32(uint32_t *s, uint32_t v, size_t count); void *__memset32(uint32_t *s, uint32_t v, size_t count);
void *__memset64(uint64_t *s, uint64_t v, size_t count); void *__memset64(uint64_t *s, uint64_t v, size_t count);
......
...@@ -14,8 +14,7 @@ ...@@ -14,8 +14,7 @@
/* /*
* void *memmove(void *dest, const void *src, size_t n) * void *memmove(void *dest, const void *src, size_t n)
*/ */
WEAK(memmove) SYM_FUNC_START(__memmove)
ENTRY(__memmove)
ltgr %r4,%r4 ltgr %r4,%r4
lgr %r1,%r2 lgr %r1,%r2
jz .Lmemmove_exit jz .Lmemmove_exit
...@@ -48,7 +47,10 @@ ENTRY(__memmove) ...@@ -48,7 +47,10 @@ ENTRY(__memmove)
BR_EX %r14 BR_EX %r14
.Lmemmove_mvc: .Lmemmove_mvc:
mvc 0(1,%r1),0(%r3) mvc 0(1,%r1),0(%r3)
ENDPROC(__memmove) SYM_FUNC_END(__memmove)
EXPORT_SYMBOL(__memmove)
SYM_FUNC_ALIAS(memmove, __memmove)
EXPORT_SYMBOL(memmove) EXPORT_SYMBOL(memmove)
/* /*
...@@ -66,8 +68,7 @@ EXPORT_SYMBOL(memmove) ...@@ -66,8 +68,7 @@ EXPORT_SYMBOL(memmove)
* return __builtin_memset(s, c, n); * return __builtin_memset(s, c, n);
* } * }
*/ */
WEAK(memset) SYM_FUNC_START(__memset)
ENTRY(__memset)
ltgr %r4,%r4 ltgr %r4,%r4
jz .Lmemset_exit jz .Lmemset_exit
ltgr %r3,%r3 ltgr %r3,%r3
...@@ -111,7 +112,10 @@ ENTRY(__memset) ...@@ -111,7 +112,10 @@ ENTRY(__memset)
xc 0(1,%r1),0(%r1) xc 0(1,%r1),0(%r1)
.Lmemset_mvc: .Lmemset_mvc:
mvc 1(1,%r1),0(%r1) mvc 1(1,%r1),0(%r1)
ENDPROC(__memset) SYM_FUNC_END(__memset)
EXPORT_SYMBOL(__memset)
SYM_FUNC_ALIAS(memset, __memset)
EXPORT_SYMBOL(memset) EXPORT_SYMBOL(memset)
/* /*
...@@ -119,8 +123,7 @@ EXPORT_SYMBOL(memset) ...@@ -119,8 +123,7 @@ EXPORT_SYMBOL(memset)
* *
* void *memcpy(void *dest, const void *src, size_t n) * void *memcpy(void *dest, const void *src, size_t n)
*/ */
WEAK(memcpy) SYM_FUNC_START(__memcpy)
ENTRY(__memcpy)
ltgr %r4,%r4 ltgr %r4,%r4
jz .Lmemcpy_exit jz .Lmemcpy_exit
aghi %r4,-1 aghi %r4,-1
...@@ -141,7 +144,10 @@ ENTRY(__memcpy) ...@@ -141,7 +144,10 @@ ENTRY(__memcpy)
j .Lmemcpy_remainder j .Lmemcpy_remainder
.Lmemcpy_mvc: .Lmemcpy_mvc:
mvc 0(1,%r1),0(%r3) mvc 0(1,%r1),0(%r3)
ENDPROC(__memcpy) SYM_FUNC_END(__memcpy)
EXPORT_SYMBOL(__memcpy)
SYM_FUNC_ALIAS(memcpy, __memcpy)
EXPORT_SYMBOL(memcpy) EXPORT_SYMBOL(memcpy)
/* /*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment