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 <prudo@linux.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
This commit is contained in:
Philipp Rudo
2019-03-07 15:56:34 +01:00
committed by Martin Schwidefsky
parent 8e49642613
commit 653beba24d
5 changed files with 28 additions and 18 deletions

View File

@ -17,7 +17,8 @@ const struct kexec_file_ops * const kexec_file_loaders[] = {
NULL,
};
static int kexec_file_update_purgatory(struct kimage *image)
static int kexec_file_update_purgatory(struct kimage *image,
struct s390_load_data *data)
{
u64 entry, type;
int ret;
@ -76,7 +77,7 @@ static int kexec_file_add_purgatory(struct kimage *image,
if (ret)
return ret;
ret = kexec_file_update_purgatory(image);
ret = kexec_file_update_purgatory(image, data);
return ret;
}
@ -136,6 +137,13 @@ void *kexec_file_add_components(struct kimage *image,
if (ret)
return ERR_PTR(ret);
if (data.kernel_mem == 0) {
unsigned long restart_psw = 0x0008000080000000UL;
restart_psw += image->start;
memcpy(data.kernel_buf, &restart_psw, sizeof(restart_psw));
image->start = 0;
}
return NULL;
}