diff options
author | Philipp Rudo <prudo@linux.ibm.com> | 2019-03-07 15:56:34 +0100 |
---|---|---|
committer | Martin Schwidefsky <schwidefsky@de.ibm.com> | 2019-04-29 10:44:00 +0200 |
commit | 653beba24d4cd281b078eab48c9bce956939061c (patch) | |
tree | 666e391e3156330ba0f82d216408aae68bd9e2e6 /arch/s390/kernel/machine_kexec_file.c | |
parent | s390/kexec_file: Unify loader code (diff) | |
download | wireguard-linux-653beba24d4cd281b078eab48c9bce956939061c.tar.xz wireguard-linux-653beba24d4cd281b078eab48c9bce956939061c.zip |
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>
Diffstat (limited to 'arch/s390/kernel/machine_kexec_file.c')
-rw-r--r-- | arch/s390/kernel/machine_kexec_file.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/arch/s390/kernel/machine_kexec_file.c b/arch/s390/kernel/machine_kexec_file.c index 08409d61aeca..0e2a5a7a1b7c 100644 --- a/arch/s390/kernel/machine_kexec_file.c +++ b/arch/s390/kernel/machine_kexec_file.c @@ -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; } |