Skip to content

Commit

Permalink
s390/maccess: add no DAT mode to kernel_write
Browse files Browse the repository at this point in the history
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: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
  • Loading branch information
Vasily Gorbik authored and Heiko Carstens committed Jun 29, 2020
1 parent 3047766 commit d6df52e
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions arch/s390/mm/maccess.c
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,15 @@ notrace void *s390_kernel_write(void *dst, const void *src, size_t size)
long copied;

spin_lock_irqsave(&s390_kernel_write_lock, flags);
while (size) {
copied = s390_kernel_write_odd(tmp, src, size);
tmp += copied;
src += copied;
size -= copied;
if (!(flags & PSW_MASK_DAT)) {
memcpy(dst, src, size);
} else {
while (size) {
copied = s390_kernel_write_odd(tmp, src, size);
tmp += copied;
src += copied;
size -= copied;
}
}
spin_unlock_irqrestore(&s390_kernel_write_lock, flags);

Expand Down

0 comments on commit d6df52e

Please sign in to comment.