2 * S390 kdump lowlevel functions (new kernel)
4 * Copyright IBM Corp. 2011
5 * Author(s): Michael Holzheu <holzheu@linux.vnet.ibm.com>
8 #define DATAMOVER_ADDR 0x4000
9 #define COPY_PAGE_ADDR 0x6000
11 #ifdef CONFIG_CRASH_DUMP
14 # kdump entry (new kernel - not yet relocated)
16 # Note: This code has to be position independent
23 larl %r2,.Lbase_addr # Check, if we have been
24 lg %r2,0(%r2) # already relocated:
26 jne .Lrelocate # No : Start data mover
27 lghi %r2,0 # Yes: Start kdump kernel
28 brasl %r14,startup_kdump_relocated
32 lg %r2,0x418(%r4) # Get kdump base
33 lg %r3,0x420(%r4) # Get kdump size
35 larl %r10,.Lcopy_start # Source of data mover
36 lghi %r8,DATAMOVER_ADDR # Target of data mover
37 mvc 0(256,%r8),0(%r10) # Copy data mover code
39 agr %r8,%r2 # Copy data mover to
40 mvc 0(256,%r8),0(%r10) # reserved mem
42 lghi %r14,DATAMOVER_ADDR # Jump to copied data mover
48 # kdump data mover code (runs at address DATAMOVER_ADDR)
50 # r2: kdump base address
56 lgr %r11,%r2 # Save kdump base address
58 agr %r12,%r3 # Compute kdump end address
61 lghi %r10,COPY_PAGE_ADDR # Load copy page address
63 mvc 0(256,%r10),0(%r5) # Copy old kernel to tmp
64 mvc 0(256,%r5),0(%r11) # Copy new kernel to old
65 mvc 0(256,%r11),0(%r10) # Copy tmp to new
71 lg %r14,.Lstartup_kdump-0b(%r13)
72 basr %r14,%r14 # Start relocated kernel
74 .long 0x00000000,0x00000000 + startup_kdump_relocated
78 # Startup of kdump (relocated new kernel)
81 startup_kdump_relocated:
84 mvc 0(8,%r0),.Lrestart_psw-0b(%r13) # Setup restart PSW
85 mvc 464(16,%r0),.Lpgm_psw-0b(%r13) # Setup pgm check PSW
86 lhi %r1,1 # Start new kernel
87 diag %r1,%r1,0x308 # with diag 308
89 .Lno_diag308: # No diag 308
90 sam31 # Switch to 31 bit addr mode
91 sr %r1,%r1 # Erase register r1
92 sr %r2,%r2 # Erase register r2
93 sigp %r1,%r2,0x12 # Switch to 31 bit arch mode
94 lpsw 0 # Start new kernel...
97 .long 0x00080000,0x80000000 + startup
99 .quad 0x0000000180000000,0x0000000000000000 + .Lno_diag308
104 larl %r13,startup_kdump_crash
108 .quad 0x0002000080000000,0x0000000000000000 + startup_kdump_crash
111 0: lpsw startup_kdump_crash-0b(%r13)
114 .long 0x000a0000,0x00000000 + startup_kdump_crash
115 #endif /* CONFIG_64BIT */
116 #endif /* CONFIG_CRASH_DUMP */