Skip to content

Commit 97cee3d

Browse files
svens-s390Vasily Gorbik
authored andcommitted
s390/kdump: Make kdump ready for lowcore relocation
In preparation of having lowcore at different address than zero, add the base register to all lowcore accesses in store_status() and __do_machine_kdump(). Reviewed-by: Heiko Carstens <[email protected]> Signed-off-by: Sven Schnelle <[email protected]> Signed-off-by: Vasily Gorbik <[email protected]>
1 parent 361f6ec commit 97cee3d

File tree

2 files changed

+12
-16
lines changed

2 files changed

+12
-16
lines changed

arch/s390/kernel/machine_kexec.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ static void __do_machine_kdump(void *data)
6262
* This need to be done *after* s390_reset_system set the
6363
* prefix register of this CPU to zero
6464
*/
65-
memcpy(absolute_pointer(__LC_FPREGS_SAVE_AREA),
65+
memcpy(absolute_pointer(get_lowcore()->floating_pt_save_area),
6666
phys_to_virt(prefix + __LC_FPREGS_SAVE_AREA), 512);
6767

6868
call_nodat(1, int, purgatory, int, 1);

arch/s390/kernel/reipl.S

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
#include <asm/asm-offsets.h>
1010
#include <asm/nospec-insn.h>
1111
#include <asm/sigp.h>
12+
#include <asm/lowcore.h>
1213

1314
GEN_BR_THUNK %r9
1415

@@ -20,20 +21,15 @@
2021
# r3 = Parameter for function
2122
#
2223
SYM_CODE_START(store_status)
23-
/* Save register one and load save area base */
24-
stg %r1,__LC_SAVE_AREA_RESTART
24+
STMG_LC %r0,%r15,__LC_GPREGS_SAVE_AREA
2525
/* General purpose registers */
26-
lghi %r1,__LC_GPREGS_SAVE_AREA
27-
stmg %r0,%r15,0(%r1)
28-
mvc 8(8,%r1),__LC_SAVE_AREA_RESTART
26+
GET_LC %r13
2927
/* Control registers */
30-
lghi %r1,__LC_CREGS_SAVE_AREA
31-
stctg %c0,%c15,0(%r1)
28+
stctg %c0,%c15,__LC_CREGS_SAVE_AREA(%r13)
3229
/* Access registers */
33-
lghi %r1,__LC_AREGS_SAVE_AREA
34-
stam %a0,%a15,0(%r1)
30+
stamy %a0,%a15,__LC_AREGS_SAVE_AREA(%r13)
3531
/* Floating point registers */
36-
lghi %r1,__LC_FPREGS_SAVE_AREA
32+
lay %r1,__LC_FPREGS_SAVE_AREA(%r13)
3733
std %f0, 0x00(%r1)
3834
std %f1, 0x08(%r1)
3935
std %f2, 0x10(%r1)
@@ -51,21 +47,21 @@ SYM_CODE_START(store_status)
5147
std %f14,0x70(%r1)
5248
std %f15,0x78(%r1)
5349
/* Floating point control register */
54-
lghi %r1,__LC_FP_CREG_SAVE_AREA
50+
lay %r1,__LC_FP_CREG_SAVE_AREA(%r13)
5551
stfpc 0(%r1)
5652
/* CPU timer */
57-
lghi %r1,__LC_CPU_TIMER_SAVE_AREA
53+
lay %r1,__LC_CPU_TIMER_SAVE_AREA(%r13)
5854
stpt 0(%r1)
5955
/* Store prefix register */
60-
lghi %r1,__LC_PREFIX_SAVE_AREA
56+
lay %r1,__LC_PREFIX_SAVE_AREA(%r13)
6157
stpx 0(%r1)
6258
/* Clock comparator - seven bytes */
63-
lghi %r1,__LC_CLOCK_COMP_SAVE_AREA
6459
larl %r4,clkcmp
6560
stckc 0(%r4)
61+
lay %r1,__LC_CLOCK_COMP_SAVE_AREA(%r13)
6662
mvc 1(7,%r1),1(%r4)
6763
/* Program status word */
68-
lghi %r1,__LC_PSW_SAVE_AREA
64+
lay %r1,__LC_PSW_SAVE_AREA(%r13)
6965
epsw %r4,%r5
7066
st %r4,0(%r1)
7167
st %r5,4(%r1)

0 commit comments

Comments
 (0)