Commit 030f7951 authored by Heiko Carstens's avatar Heiko Carstens Committed by Vasily Gorbik

s390/uaccess: Make s390_kernel_write() usable for decompressor

To avoid lots of ifdefs in C code make s390_kernel_write() usable for
the decompressor: simply use memcpy() for this case since there is no
write protection enabled that early.
Reviewed-by: default avatarAlexander Gordeev <agordeev@linux.ibm.com>
Tested-by: default avatarSven Schnelle <svens@linux.ibm.com>
Signed-off-by: default avatarHeiko Carstens <hca@linux.ibm.com>
Signed-off-by: default avatarVasily Gorbik <gor@linux.ibm.com>
parent ace76fac
...@@ -332,7 +332,14 @@ static inline unsigned long __must_check clear_user(void __user *to, unsigned lo ...@@ -332,7 +332,14 @@ static inline unsigned long __must_check clear_user(void __user *to, unsigned lo
return __clear_user(to, n); return __clear_user(to, n);
} }
void *s390_kernel_write(void *dst, const void *src, size_t size); void *__s390_kernel_write(void *dst, const void *src, size_t size);
static inline void *s390_kernel_write(void *dst, const void *src, size_t size)
{
if (__is_defined(__DECOMPRESSOR))
return memcpy(dst, src, size);
return __s390_kernel_write(dst, src, size);
}
int __noreturn __put_kernel_bad(void); int __noreturn __put_kernel_bad(void);
......
...@@ -48,7 +48,7 @@ static notrace long s390_kernel_write_odd(void *dst, const void *src, size_t siz ...@@ -48,7 +48,7 @@ static notrace long s390_kernel_write_odd(void *dst, const void *src, size_t siz
} }
/* /*
* s390_kernel_write - write to kernel memory bypassing DAT * __s390_kernel_write - write to kernel memory bypassing DAT
* @dst: destination address * @dst: destination address
* @src: source address * @src: source address
* @size: number of bytes to copy * @size: number of bytes to copy
...@@ -61,7 +61,7 @@ static notrace long s390_kernel_write_odd(void *dst, const void *src, size_t siz ...@@ -61,7 +61,7 @@ static notrace long s390_kernel_write_odd(void *dst, const void *src, size_t siz
*/ */
static DEFINE_SPINLOCK(s390_kernel_write_lock); static DEFINE_SPINLOCK(s390_kernel_write_lock);
notrace void *s390_kernel_write(void *dst, const void *src, size_t size) notrace void *__s390_kernel_write(void *dst, const void *src, size_t size)
{ {
void *tmp = dst; void *tmp = dst;
unsigned long flags; unsigned long flags;
......
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