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

s390/maccess: add no DAT mode to kernel_write

To be able to patch kernel code before paging is initialized do plain
memcpy if DAT is off. This is required to enable early jump label
initialization.
Reviewed-by: default avatarHeiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: default avatarVasily Gorbik <gor@linux.ibm.com>
Signed-off-by: default avatarHeiko Carstens <heiko.carstens@de.ibm.com>
parent 3047766b
...@@ -62,12 +62,16 @@ notrace void *s390_kernel_write(void *dst, const void *src, size_t size) ...@@ -62,12 +62,16 @@ notrace void *s390_kernel_write(void *dst, const void *src, size_t size)
long copied; long copied;
spin_lock_irqsave(&s390_kernel_write_lock, flags); spin_lock_irqsave(&s390_kernel_write_lock, flags);
if (!(flags & PSW_MASK_DAT)) {
memcpy(dst, src, size);
} else {
while (size) { while (size) {
copied = s390_kernel_write_odd(tmp, src, size); copied = s390_kernel_write_odd(tmp, src, size);
tmp += copied; tmp += copied;
src += copied; src += copied;
size -= copied; size -= copied;
} }
}
spin_unlock_irqrestore(&s390_kernel_write_lock, flags); spin_unlock_irqrestore(&s390_kernel_write_lock, flags);
return dst; return dst;
......
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