aboutsummaryrefslogtreecommitdiffstats
path: root/arch/s390/boot/compressed/decompressor.h
diff options
context:
space:
mode:
authorVasily Gorbik <gor@linux.ibm.com>2018-07-19 16:51:25 +0200
committerMartin Schwidefsky <schwidefsky@de.ibm.com>2018-10-09 11:21:02 +0200
commit369f91c374514f9491d52fec12f7ee9ef6d44b23 (patch)
tree5a505c3f47a36b8e71247278c9f95d844764d5e3 /arch/s390/boot/compressed/decompressor.h
parents390: remove decompressor's head.S (diff)
downloadlinux-dev-369f91c374514f9491d52fec12f7ee9ef6d44b23.tar.xz
linux-dev-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/compressed/decompressor.h')
-rw-r--r--arch/s390/boot/compressed/decompressor.h13
1 files changed, 11 insertions, 2 deletions
diff --git a/arch/s390/boot/compressed/decompressor.h b/arch/s390/boot/compressed/decompressor.h
index 0dd0b84679c4..011cbb6e0e08 100644
--- a/arch/s390/boot/compressed/decompressor.h
+++ b/arch/s390/boot/compressed/decompressor.h
@@ -3,9 +3,18 @@
#define BOOT_COMPRESSED_DECOMPRESSOR_H
#ifdef CONFIG_KERNEL_UNCOMPRESSED
-static inline void *decompress_kernel(unsigned long *uncompressed_size) {}
+static inline void *decompress_kernel(void) {}
#else
-void *decompress_kernel(unsigned long *uncompressed_size);
+void *decompress_kernel(void);
#endif
+struct vmlinux_info {
+ unsigned long default_lma;
+ void (*entry)(void);
+ unsigned long image_size; /* does not include .bss */
+};
+
+extern char _vmlinux_info[];
+#define vmlinux (*(struct vmlinux_info *)_vmlinux_info)
+
#endif /* BOOT_COMPRESSED_DECOMPRESSOR_H */