Skip to content

Commit 39218bc

Browse files
Alexander GordeevVasily Gorbik
authored andcommitted
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>
1 parent 86295cb commit 39218bc

1 file changed

Lines changed: 7 additions & 8 deletions

File tree

arch/s390/kernel/machine_kexec.c

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,7 @@
2929
#include <asm/nmi.h>
3030
#include <asm/sclp.h>
3131

32-
typedef void (*relocate_kernel_t)(kimage_entry_t *, unsigned long,
33-
unsigned long);
32+
typedef void (*relocate_kernel_t)(unsigned long, unsigned long, unsigned long);
3433

3534
extern const unsigned char relocate_kernel[];
3635
extern const unsigned long long relocate_kernel_len;
@@ -58,7 +57,7 @@ static void __do_machine_kdump(void *image)
5857
* prefix register of this CPU to zero
5958
*/
6059
memcpy(absolute_pointer(__LC_FPREGS_SAVE_AREA),
61-
(void *)(prefix + __LC_FPREGS_SAVE_AREA), 512);
60+
phys_to_virt(prefix + __LC_FPREGS_SAVE_AREA), 512);
6261

6362
__load_psw_mask(PSW_MASK_BASE | PSW_DEFAULT_KEY | PSW_MASK_EA | PSW_MASK_BA);
6463
start_kdump = (void *)((struct kimage *) image)->start;
@@ -209,7 +208,7 @@ int machine_kexec_prepare(struct kimage *image)
209208
return -EINVAL;
210209

211210
/* Get the destination where the assembler code should be copied to.*/
212-
reboot_code_buffer = (void *) page_to_phys(image->control_code_page);
211+
reboot_code_buffer = page_to_virt(image->control_code_page);
213212

214213
/* Then copy it */
215214
memcpy(reboot_code_buffer, relocate_kernel, relocate_kernel_len);
@@ -249,18 +248,18 @@ void machine_crash_shutdown(struct pt_regs *regs)
249248
*/
250249
static void __do_machine_kexec(void *data)
251250
{
252-
unsigned long diag308_subcode;
253-
relocate_kernel_t data_mover;
251+
unsigned long data_mover, entry, diag308_subcode;
254252
struct kimage *image = data;
255253

256-
data_mover = (relocate_kernel_t) page_to_phys(image->control_code_page);
254+
data_mover = page_to_phys(image->control_code_page);
255+
entry = virt_to_phys(&image->head);
257256
diag308_subcode = DIAG308_CLEAR_RESET;
258257
if (sclp.has_iplcc)
259258
diag308_subcode |= DIAG308_FLAG_EI;
260259
s390_reset_system();
261260

262261
__arch_local_irq_stnsm(0xfb); /* disable DAT - avoid no-execute */
263-
(*data_mover)(&image->head, image->start, diag308_subcode);
262+
(*(relocate_kernel_t)data_mover)(entry, image->start, diag308_subcode);
264263

265264
/* Die if kexec returns */
266265
disabled_wait();

0 commit comments

Comments
 (0)