summaryrefslogtreecommitdiff
path: root/arch/s390/tools
diff options
context:
space:
mode:
authorAlexander Gordeev <agordeev@linux.ibm.com>2024-03-22 16:39:57 +0300
committerAlexander Gordeev <agordeev@linux.ibm.com>2024-04-17 14:38:02 +0300
commit56b1069c40c777e9cba595a62857293628067d65 (patch)
tree28cdfa38027fbc9e156b421582fa00620ca15a2b /arch/s390/tools
parent54f2ecc3188f78723267826f634e0747169f8685 (diff)
downloadlinux-56b1069c40c777e9cba595a62857293628067d65.tar.xz
s390/boot: Rework deployment of the kernel image
Rework deployment of kernel image for both compressed and uncompressed variants as defined by CONFIG_KERNEL_UNCOMPRESSED kernel configuration variable. In case CONFIG_KERNEL_UNCOMPRESSED is disabled avoid uncompressing the kernel to a temporary buffer and copying it to the target address. Instead, uncompress it directly to the target destination. In case CONFIG_KERNEL_UNCOMPRESSED is enabled avoid moving the kernel to default 0x100000 location when KASLR is disabled or failed. Instead, use the uncompressed kernel image directly. In case KASLR is disabled or failed .amode31 section location in memory is not randomized and precedes the kernel image. In case CONFIG_KERNEL_UNCOMPRESSED is disabled that location overlaps the area used by the decompression algorithm. That is fine, since that area is not used after the decompression finished and the size of .amode31 section is not expected to exceed BOOT_HEAP_SIZE ever. There is no decompression in case CONFIG_KERNEL_UNCOMPRESSED is enabled. Therefore, rename decompress_kernel() to deploy_kernel(), which better describes both uncompressed and compressed cases. Introduce AMODE31_SIZE macro to avoid immediate value of 0x3000 (the size of .amode31 section) in the decompressor linker script. Modify the vmlinux linker script to force the size of .amode31 section to AMODE31_SIZE (the value of (_eamode31 - _samode31) could otherwise differ as result of compiler options used). Introduce __START_KERNEL macro that defines the kernel ELF image entry point and set it to the currrent value of 0x100000. Signed-off-by: Alexander Gordeev <agordeev@linux.ibm.com>
Diffstat (limited to 'arch/s390/tools')
-rw-r--r--arch/s390/tools/relocs.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/s390/tools/relocs.c b/arch/s390/tools/relocs.c
index b4f35506779b..a74dbd5c9896 100644
--- a/arch/s390/tools/relocs.c
+++ b/arch/s390/tools/relocs.c
@@ -280,7 +280,7 @@ static int do_reloc(struct section *sec, Elf_Rel *rel)
case R_390_GOTOFF64:
break;
case R_390_64:
- add_reloc(&relocs64, offset - (ehdr.e_entry - 0x100000));
+ add_reloc(&relocs64, offset - ehdr.e_entry);
break;
default:
die("Unsupported relocation type: %d\n", r_type);