From 8f75582a2fb6e2c5afc5252b6d6932f61a79c939 Mon Sep 17 00:00:00 2001 From: Vasily Gorbik Date: Thu, 19 Jul 2018 13:11:28 +0200 Subject: 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 Signed-off-by: Vasily Gorbik Signed-off-by: Martin Schwidefsky --- arch/s390/boot/compressed/misc.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'arch/s390/boot/compressed/misc.c') diff --git a/arch/s390/boot/compressed/misc.c b/arch/s390/boot/compressed/misc.c index f66ad73c205b..321f6151ded9 100644 --- a/arch/s390/boot/compressed/misc.c +++ b/arch/s390/boot/compressed/misc.c @@ -12,6 +12,7 @@ #include #include #include "sizes.h" +#include "decompressor.h" /* * gzip declarations @@ -82,7 +83,7 @@ static void error(char *x) asm volatile("lpsw %0" : : "Q" (psw)); } -unsigned long decompress_kernel(void) +void *decompress_kernel(unsigned long *uncompressed_size) { void *output, *kernel_end; @@ -111,6 +112,8 @@ unsigned long decompress_kernel(void) free_mem_end_ptr = free_mem_ptr + HEAP_SIZE; __decompress(input_data, input_len, NULL, NULL, output, 0, NULL, error); - return (unsigned long) output; + if (uncompressed_size) + *uncompressed_size = SZ__bss_start; + return output; } -- cgit v1.2.3