summaryrefslogtreecommitdiffstats
path: root/arch/s390/boot/startup.c
diff options
context:
space:
mode:
authorAlexander Egorenkov <egorenar@linux.ibm.com>2021-06-15 14:15:07 +0200
committerHeiko Carstens <hca@linux.ibm.com>2021-07-27 09:39:15 +0200
commit84733284f67b1a937f6205fdb16aa5cbb8b4f53d (patch)
tree4d271615ac8c5e35ec7976f01e0722472f47b2d6 /arch/s390/boot/startup.c
parentf1d3c5323772a215d910aeaf697d210a3671cf81 (diff)
downloadlinux-84733284f67b1a937f6205fdb16aa5cbb8b4f53d.tar.gz
linux-84733284f67b1a937f6205fdb16aa5cbb8b4f53d.tar.bz2
linux-84733284f67b1a937f6205fdb16aa5cbb8b4f53d.zip
s390/boot: introduce boot data 'initrd_data'
The new boot data struct shall replace global variables INITRD_START and INITRD_SIZE. It is initialized in the decompressor and passed to the decompressed kernel. In comparison to the old solution, this one doesn't access data at fixed physical addresses which will become important when the decompressor becomes relocatable. Signed-off-by: Alexander Egorenkov <egorenar@linux.ibm.com> Acked-by: Heiko Carstens <hca@linux.ibm.com> Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
Diffstat (limited to 'arch/s390/boot/startup.c')
-rw-r--r--arch/s390/boot/startup.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/arch/s390/boot/startup.c b/arch/s390/boot/startup.c
index 8b07a704f2f5..694780339db0 100644
--- a/arch/s390/boot/startup.c
+++ b/arch/s390/boot/startup.c
@@ -23,6 +23,7 @@ unsigned long __bootdata_preserved(MODULES_VADDR);
unsigned long __bootdata_preserved(MODULES_END);
unsigned long __bootdata(ident_map_size);
int __bootdata(is_full_image) = 1;
+struct initrd_data __bootdata(initrd_data);
u64 __bootdata_preserved(stfle_fac_list[16]);
u64 __bootdata_preserved(alt_stfle_fac_list[16]);
@@ -86,12 +87,12 @@ static void rescue_initrd(unsigned long addr)
{
if (!IS_ENABLED(CONFIG_BLK_DEV_INITRD))
return;
- if (!INITRD_START || !INITRD_SIZE)
+ if (!initrd_data.start || !initrd_data.size)
return;
- if (addr <= INITRD_START)
+ if (addr <= initrd_data.start)
return;
- memmove((void *)addr, (void *)INITRD_START, INITRD_SIZE);
- INITRD_START = addr;
+ memmove((void *)addr, (void *)initrd_data.start, initrd_data.size);
+ initrd_data.start = addr;
}
static void copy_bootdata(void)
@@ -283,6 +284,9 @@ void startup_kernel(void)
unsigned long safe_addr;
void *img;
+ initrd_data.start = parmarea.initrd_start;
+ initrd_data.size = parmarea.initrd_size;
+
setup_lpp();
store_ipl_parmblock();
safe_addr = mem_safe_offset();