From 653beba24d4cd281b078eab48c9bce956939061c Mon Sep 17 00:00:00 2001 From: Philipp Rudo Date: Thu, 7 Mar 2019 15:56:34 +0100 Subject: s390/kexec_file: Load new kernel to absolute 0 The leading 64 kB of a kernel image doesn't contain any data needed to boot the new kernel when it was loaded via kexec_file. Thus kexec_file currently strips them off before loading the image. Keep the leading 64 kB in order to be able to pass a ipl_report to the next kernel. Signed-off-by: Philipp Rudo Signed-off-by: Martin Schwidefsky --- arch/s390/kernel/kexec_elf.c | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) (limited to 'arch/s390/kernel/kexec_elf.c') diff --git a/arch/s390/kernel/kexec_elf.c b/arch/s390/kernel/kexec_elf.c index c74ff6b54344..42bcd93f4318 100644 --- a/arch/s390/kernel/kexec_elf.c +++ b/arch/s390/kernel/kexec_elf.c @@ -39,28 +39,20 @@ static int kexec_file_add_kernel_elf(struct kimage *image, buf.bufsz = phdr->p_filesz; buf.mem = ALIGN(phdr->p_paddr, phdr->p_align); + if (image->type == KEXEC_TYPE_CRASH) + buf.mem += crashk_res.start; buf.memsz = phdr->p_memsz; + data->memsz = ALIGN(data->memsz, phdr->p_align) + buf.memsz; if (entry - phdr->p_paddr < phdr->p_memsz) { data->kernel_buf = buf.buffer; + data->kernel_mem = buf.mem; data->parm = buf.buffer + PARMAREA; - data->memsz += STARTUP_NORMAL_OFFSET; - - buf.buffer += STARTUP_NORMAL_OFFSET; - buf.bufsz -= STARTUP_NORMAL_OFFSET; - - buf.mem += STARTUP_NORMAL_OFFSET; - buf.memsz -= STARTUP_NORMAL_OFFSET; } - if (image->type == KEXEC_TYPE_CRASH) - buf.mem += crashk_res.start; - ret = kexec_add_buffer(&buf); if (ret) return ret; - - data->memsz = ALIGN(data->memsz, phdr->p_align) + buf.memsz; } return data->memsz ? 0 : -EINVAL; -- cgit