summaryrefslogtreecommitdiffstats
path: root/arch/s390
diff options
context:
space:
mode:
authorAlexander Gordeev <agordeev@linux.ibm.com>2023-04-03 08:44:38 +0200
committerVasily Gorbik <gor@linux.ibm.com>2023-04-19 17:24:16 +0200
commit39218bcf941ab1a5eabbf350c0f7a1f1325434b0 (patch)
treeb6ed066b3024e64bb6edfd6efbdcda350806fdc7 /arch/s390
parents390/kdump: cleanup do_start_kdump() prototype and usage (diff)
downloadlinux-39218bcf941ab1a5eabbf350c0f7a1f1325434b0.tar.xz
linux-39218bcf941ab1a5eabbf350c0f7a1f1325434b0.zip
s390/kdump: fix virtual vs physical address confusion
Fix virtual vs physical address confusion (which currently are the same). Signed-off-by: Alexander Gordeev <agordeev@linux.ibm.com> Reviewed-by: Heiko Carstens <hca@linux.ibm.com> Signed-off-by: Heiko Carstens <hca@linux.ibm.com> Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
Diffstat (limited to 'arch/s390')
-rw-r--r--arch/s390/kernel/machine_kexec.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/arch/s390/kernel/machine_kexec.c b/arch/s390/kernel/machine_kexec.c
index 3e0fd01a192a..fb887674e159 100644
--- a/arch/s390/kernel/machine_kexec.c
+++ b/arch/s390/kernel/machine_kexec.c
@@ -29,8 +29,7 @@
#include <asm/nmi.h>
#include <asm/sclp.h>
-typedef void (*relocate_kernel_t)(kimage_entry_t *, unsigned long,
- unsigned long);
+typedef void (*relocate_kernel_t)(unsigned long, unsigned long, unsigned long);
extern const unsigned char relocate_kernel[];
extern const unsigned long long relocate_kernel_len;
@@ -58,7 +57,7 @@ static void __do_machine_kdump(void *image)
* prefix register of this CPU to zero
*/
memcpy(absolute_pointer(__LC_FPREGS_SAVE_AREA),
- (void *)(prefix + __LC_FPREGS_SAVE_AREA), 512);
+ phys_to_virt(prefix + __LC_FPREGS_SAVE_AREA), 512);
__load_psw_mask(PSW_MASK_BASE | PSW_DEFAULT_KEY | PSW_MASK_EA | PSW_MASK_BA);
start_kdump = (void *)((struct kimage *) image)->start;
@@ -209,7 +208,7 @@ int machine_kexec_prepare(struct kimage *image)
return -EINVAL;
/* Get the destination where the assembler code should be copied to.*/
- reboot_code_buffer = (void *) page_to_phys(image->control_code_page);
+ reboot_code_buffer = page_to_virt(image->control_code_page);
/* Then copy it */
memcpy(reboot_code_buffer, relocate_kernel, relocate_kernel_len);
@@ -249,18 +248,18 @@ void machine_crash_shutdown(struct pt_regs *regs)
*/
static void __do_machine_kexec(void *data)
{
- unsigned long diag308_subcode;
- relocate_kernel_t data_mover;
+ unsigned long data_mover, entry, diag308_subcode;
struct kimage *image = data;
- data_mover = (relocate_kernel_t) page_to_phys(image->control_code_page);
+ data_mover = page_to_phys(image->control_code_page);
+ entry = virt_to_phys(&image->head);
diag308_subcode = DIAG308_CLEAR_RESET;
if (sclp.has_iplcc)
diag308_subcode |= DIAG308_FLAG_EI;
s390_reset_system();
__arch_local_irq_stnsm(0xfb); /* disable DAT - avoid no-execute */
- (*data_mover)(&image->head, image->start, diag308_subcode);
+ (*(relocate_kernel_t)data_mover)(entry, image->start, diag308_subcode);
/* Die if kexec returns */
disabled_wait();