s390: introduce .boot.data section

Introduce .boot.data section which is "shared" between the decompressor
code and the decompressed kernel. The decompressor will store values in
it, and copy over to the decompressed image before starting it. This
method allows to avoid using pre-defined addresses and other hacks to
pass values between those boot phases.

.boot.data section is a part of init data, and will be freed after kernel
initialization is complete.

For uncompressed kernel image, .boot.data section is basically the same
as .init.data

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>
This commit is contained in:
Vasily Gorbik
2018-04-10 14:14:02 +02:00
committed by Martin Schwidefsky
parent 7516fc11e4
commit d1b52a4388
6 changed files with 56 additions and 4 deletions

View File

@@ -5,6 +5,8 @@
#include "compressed/decompressor.h"
#include "boot.h"
extern char __boot_data_start[], __boot_data_end[];
void error(char *x)
{
sclp_early_printk("\n\n");
@@ -36,6 +38,13 @@ static void rescue_initrd(void)
INITRD_START = min_initrd_addr;
}
static void copy_bootdata(void)
{
if (__boot_data_end - __boot_data_start != vmlinux.bootdata_size)
error(".boot.data section size mismatch");
memcpy((void *)vmlinux.bootdata_off, __boot_data_start, vmlinux.bootdata_size);
}
void startup_kernel(void)
{
void *img;
@@ -45,5 +54,6 @@ void startup_kernel(void)
img = decompress_kernel();
memmove((void *)vmlinux.default_lma, img, vmlinux.image_size);
}
copy_bootdata();
vmlinux.entry();
}