Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1a708575 authored by Vasily Gorbik's avatar Vasily Gorbik Committed by Greg Kroah-Hartman
Browse files

s390/maccess: add no DAT mode to kernel_write



[ Upstream commit d6df52e9996dcc2062c3d9c9123288468bb95b52 ]

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>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent 627d15ee
Loading
Loading
Loading
Loading
+9 −5
Original line number Diff line number Diff line
@@ -62,12 +62,16 @@ notrace void *s390_kernel_write(void *dst, const void *src, size_t size)
	long copied;

	spin_lock_irqsave(&s390_kernel_write_lock, flags);
	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);

	return dst;