summaryrefslogtreecommitdiff
path: root/arch/s390/boot/compressed/vmlinux.lds.S
diff options
context:
space:
mode:
authorAlexander Egorenkov <egorenar@linux.ibm.com>2021-06-30 18:17:53 +0300
committerHeiko Carstens <hca@linux.ibm.com>2021-07-27 10:39:13 +0300
commit256d78d08177d72ae27621378699c9b35231d524 (patch)
treeaa4e609c90c455d2d282948263ea8b4353331f58 /arch/s390/boot/compressed/vmlinux.lds.S
parent7fadcc078785416b1e2423fc624e054bb5a6e3b0 (diff)
downloadlinux-256d78d08177d72ae27621378699c9b35231d524.tar.xz
s390/boot: make stacks part of the decompressor's image
Instead of using constant addresses for the normal and dump-info stacks, allocate both stacks in the decompressor's image and load the stack register in a position-independent manner. This will allow loading and entering the decompressor at an arbitrary memory address without corrupting the content at the fixed addresses used until now for both stacks. This is one of the prerequisites for being able to kexec the decompressor from its load address without relocating it first. Signed-off-by: Alexander Egorenkov <egorenar@linux.ibm.com> Acked-by: Heiko Carstens <hca@linux.ibm.com> Reviewed-by: Vasily Gorbik <gor@linux.ibm.com> Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
Diffstat (limited to 'arch/s390/boot/compressed/vmlinux.lds.S')
-rw-r--r--arch/s390/boot/compressed/vmlinux.lds.S13
1 files changed, 13 insertions, 0 deletions
diff --git a/arch/s390/boot/compressed/vmlinux.lds.S b/arch/s390/boot/compressed/vmlinux.lds.S
index 27a09c1c78f6..0bd8aaaa4b33 100644
--- a/arch/s390/boot/compressed/vmlinux.lds.S
+++ b/arch/s390/boot/compressed/vmlinux.lds.S
@@ -1,6 +1,8 @@
/* SPDX-License-Identifier: GPL-2.0 */
#include <asm-generic/vmlinux.lds.h>
#include <asm/vmlinux.lds.h>
+#include <asm/thread_info.h>
+#include <asm/page.h>
OUTPUT_FORMAT("elf64-s390", "elf64-s390", "elf64-s390")
OUTPUT_ARCH(s390:64-bit)
@@ -69,6 +71,17 @@ SECTIONS
*(.bss)
*(.bss.*)
*(COMMON)
+ /*
+ * Stacks for the decompressor
+ */
+ . = ALIGN(PAGE_SIZE);
+ _dump_info_stack_start = .;
+ . += PAGE_SIZE;
+ _dump_info_stack_end = .;
+ . = ALIGN(PAGE_SIZE);
+ _stack_start = .;
+ . += BOOT_STACK_SIZE;
+ _stack_end = .;
_ebss = .;
}