diff options
author | Vasily Gorbik <gor@linux.ibm.com> | 2018-07-19 16:51:25 +0200 |
---|---|---|
committer | Martin Schwidefsky <schwidefsky@de.ibm.com> | 2018-10-09 11:21:02 +0200 |
commit | 369f91c374514f9491d52fec12f7ee9ef6d44b23 (patch) | |
tree | 5a505c3f47a36b8e71247278c9f95d844764d5e3 /arch/s390/boot/startup.c | |
parent | 8f75582a2fb6e2c5afc5252b6d6932f61a79c939 (diff) | |
download | linux-stable-369f91c374514f9491d52fec12f7ee9ef6d44b23.tar.gz linux-stable-369f91c374514f9491d52fec12f7ee9ef6d44b23.tar.bz2 linux-stable-369f91c374514f9491d52fec12f7ee9ef6d44b23.zip |
s390/decompressor: rework uncompressed image info collection
The kernel decompressor has to know several bits of information about
uncompressed image. Currently this info is collected by running "nm" on
uncompressed vmlinux + "sed" and producing sizes.h file. This method
worked well, but it has several disadvantages. Obscure symbols name
pattern matching is fragile. Adding new values makes pattern even
longer. Logic is spread across code and make file. Limited ability to
adjust symbols values (currently magic lma value of 0x100000 is always
subtracted). Apart from that same pieces of information (and more)
would be needed for early memory detection and features like KASLR
outside of boot/compressed/ folder where sizes.h is generated.
To overcome limitations new "struct vmlinux_info" has been introduced
to include values needed for the decompressor and the rest of the
boot code. The only static instance of vmlinux_info is produced during
vmlinux link step by filling in struct fields by the linker (like it is
done with input_data in boot/compressed/vmlinux.scr.lds.S). This way
individual values could be adjusted with all the knowledge linker has
and arithmetic it supports. Later .vmlinux.info section (which contains
struct vmlinux_info) is transplanted into the decompressor image and
dropped from uncompressed image altogether.
While doing that replace "compressed/vmlinux.scr.lds.S" linker
script (whose purpose is to rename .data section in piggy.o to
.rodata.compressed) with plain objcopy command. And simplify
decompressor's linker script.
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 | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/arch/s390/boot/startup.c b/arch/s390/boot/startup.c index 2a9ce355f8e6..474dee84d8a8 100644 --- a/arch/s390/boot/startup.c +++ b/arch/s390/boot/startup.c @@ -5,13 +5,11 @@ void startup_kernel(void) { - void (*startup_continue)(void) = (void *)0x100000; - unsigned long uncompressed_size; - void *uncompressed_img; + void *img; if (!IS_ENABLED(CONFIG_KERNEL_UNCOMPRESSED)) { - uncompressed_img = decompress_kernel(&uncompressed_size); - memmove(startup_continue, uncompressed_img, uncompressed_size); + img = decompress_kernel(); + memmove((void *)vmlinux.default_lma, img, vmlinux.image_size); } - startup_continue(); + vmlinux.entry(); } |