diff options
author | Vasily Gorbik <gor@linux.ibm.com> | 2018-07-19 13:11:28 +0200 |
---|---|---|
committer | Martin Schwidefsky <schwidefsky@de.ibm.com> | 2018-10-09 11:21:02 +0200 |
commit | 8f75582a2fb6e2c5afc5252b6d6932f61a79c939 (patch) | |
tree | ce09a3124eabde2b2e88f03d030f2a54ecbe450a /arch/s390/boot/startup.c | |
parent | 32ce55a6592fc3e117e70953001a9ea1931f7941 (diff) |
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: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'arch/s390/boot/startup.c')
-rw-r--r-- | arch/s390/boot/startup.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/arch/s390/boot/startup.c b/arch/s390/boot/startup.c new file mode 100644 index 000000000000..2a9ce355f8e6 --- /dev/null +++ b/arch/s390/boot/startup.c @@ -0,0 +1,17 @@ +// SPDX-License-Identifier: GPL-2.0 +#include <linux/string.h> +#include "compressed/decompressor.h" +#include "boot.h" + +void startup_kernel(void) +{ + void (*startup_continue)(void) = (void *)0x100000; + unsigned long uncompressed_size; + void *uncompressed_img; + + if (!IS_ENABLED(CONFIG_KERNEL_UNCOMPRESSED)) { + uncompressed_img = decompress_kernel(&uncompressed_size); + memmove(startup_continue, uncompressed_img, uncompressed_size); + } + startup_continue(); +} |