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

Commit 8f75582a authored by Vasily Gorbik's avatar Vasily Gorbik Committed by Martin Schwidefsky
Browse files

s390: remove decompressor's head.S



Decompressor's head.S provided "data mover" sole purpose of which has
been to safely move uncompressed kernel at 0x100000 and jump to it.

With current bzImage layout entire decompressor's code guaranteed to be
in a safe location under 0x100000, and hence could not be overwritten
during kernel move. For that reason head.S could be replaced with simple
memmove function. To do so introduce early boot code phase which is
executed from arch/s390/boot/head.S after "verify_facilities" and takes
care of optional kernel image decompression and transition to it.

Reviewed-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: default avatarVasily Gorbik <gor@linux.ibm.com>
Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
parent 32ce55a6
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -27,7 +27,7 @@ endif

CFLAGS_sclp_early_core.o += -I$(srctree)/drivers/s390/char

obj-y	:= head.o als.o ebcdic.o sclp_early_core.o mem.o
obj-y	:= head.o als.o startup.o ebcdic.o sclp_early_core.o mem.o
targets	:= bzImage startup.a $(obj-y)
subdir-	:= compressed

arch/s390/boot/boot.h

0 → 100644
+7 −0
Original line number Diff line number Diff line
/* SPDX-License-Identifier: GPL-2.0 */
#ifndef BOOT_BOOT_H
#define BOOT_BOOT_H

void startup_kernel(void);

#endif /* BOOT_BOOT_H */
+1 −4
Original line number Diff line number Diff line
@@ -9,7 +9,7 @@ KCOV_INSTRUMENT := n
GCOV_PROFILE := n
UBSAN_SANITIZE := n

obj-y	:= $(if $(CONFIG_KERNEL_UNCOMPRESSED),,head.o misc.o) piggy.o
obj-y	:= $(if $(CONFIG_KERNEL_UNCOMPRESSED),,misc.o) piggy.o
targets	:= vmlinux.lds vmlinux vmlinux.bin vmlinux.bin.gz vmlinux.bin.bz2
targets += vmlinux.bin.xz vmlinux.bin.lzma vmlinux.bin.lzo vmlinux.bin.lz4
targets += vmlinux.scr.lds $(obj-y) $(if $(CONFIG_KERNEL_UNCOMPRESSED),,sizes.h)
@@ -32,9 +32,6 @@ quiet_cmd_sizes = GEN $@
$(obj)/sizes.h: vmlinux
	$(call if_changed,sizes)

AFLAGS_head.o += -I$(objtree)/$(obj)
$(obj)/head.o: $(obj)/sizes.h

CFLAGS_misc.o += -I$(objtree)/$(obj)
$(obj)/misc.o: $(obj)/sizes.h

+11 −0
Original line number Diff line number Diff line
/* SPDX-License-Identifier: GPL-2.0 */
#ifndef BOOT_COMPRESSED_DECOMPRESSOR_H
#define BOOT_COMPRESSED_DECOMPRESSOR_H

#ifdef CONFIG_KERNEL_UNCOMPRESSED
static inline void *decompress_kernel(unsigned long *uncompressed_size) {}
#else
void *decompress_kernel(unsigned long *uncompressed_size);
#endif

#endif /* BOOT_COMPRESSED_DECOMPRESSOR_H */

arch/s390/boot/compressed/head.S

deleted100644 → 0
+0 −52
Original line number Diff line number Diff line
/* SPDX-License-Identifier: GPL-2.0 */
/*
 * Startup glue code to uncompress the kernel
 *
 * Copyright IBM Corp. 2010
 *
 *   Author(s):	Martin Schwidefsky <schwidefsky@de.ibm.com>
 */

#include <linux/init.h>
#include <linux/linkage.h>
#include <asm/asm-offsets.h>
#include <asm/thread_info.h>
#include <asm/page.h>
#include <asm/ptrace.h>
#include "sizes.h"

__HEAD
ENTRY(startup_decompressor)
	basr	%r13,0			# get base
.LPG1:
	# setup stack
	lg	%r15,.Lstack-.LPG1(%r13)
	brasl	%r14,decompress_kernel
	# Set up registers for memory mover. We move the decompressed image to
	# 0x100000, where startup_continue of the decompressed image is supposed
	# to be.
	lgr	%r4,%r2
	lg	%r2,.Loffset-.LPG1(%r13)
	lg	%r3,.Lmvsize-.LPG1(%r13)
	lgr	%r5,%r3
	# Move the memory mover someplace safe so it doesn't overwrite itself.
	la	%r1,0x200
	mvc	0(mover_end-mover,%r1),mover-.LPG1(%r13)
	# When the memory mover is done we pass control to
	# arch/s390/kernel/head64.S:startup_continue which lives at 0x100000 in
	# the decompressed image.
	lgr	%r6,%r2
	br	%r1
mover:
	mvcle	%r2,%r4,0
	jo	mover
	br	%r6
mover_end:

	.align	8
.Lstack:
	.quad	0x8000 + THREAD_SIZE - STACK_FRAME_OVERHEAD
.Loffset:
	.quad	0x100000
.Lmvsize:
	.quad	SZ__bss_start
Loading