Commit 9365965d authored by Heiko Carstens's avatar Heiko Carstens

s390: always clear kernel stack backchain before calling functions

Clear the kernel stack backchain before potentially calling the
lockdep trace_hardirqs_off/on functions. Without this walking the
kernel backchain, e.g. during a panic, might stop too early.
Signed-off-by: default avatarHeiko Carstens <hca@linux.ibm.com>
parent 58659247
...@@ -413,6 +413,7 @@ ENTRY(system_call) ...@@ -413,6 +413,7 @@ ENTRY(system_call)
mvc __PT_PSW(16,%r11),__LC_SVC_OLD_PSW mvc __PT_PSW(16,%r11),__LC_SVC_OLD_PSW
mvc __PT_INT_CODE(4,%r11),__LC_SVC_ILC mvc __PT_INT_CODE(4,%r11),__LC_SVC_ILC
stg %r14,__PT_FLAGS(%r11) stg %r14,__PT_FLAGS(%r11)
xc __SF_BACKCHAIN(8,%r15),__SF_BACKCHAIN(%r15)
ENABLE_INTS ENABLE_INTS
.Lsysc_do_svc: .Lsysc_do_svc:
# clear user controlled register to prevent speculative use # clear user controlled register to prevent speculative use
...@@ -429,7 +430,6 @@ ENTRY(system_call) ...@@ -429,7 +430,6 @@ ENTRY(system_call)
jnl .Lsysc_nr_ok jnl .Lsysc_nr_ok
slag %r8,%r1,3 slag %r8,%r1,3
.Lsysc_nr_ok: .Lsysc_nr_ok:
xc __SF_BACKCHAIN(8,%r15),__SF_BACKCHAIN(%r15)
stg %r2,__PT_ORIG_GPR2(%r11) stg %r2,__PT_ORIG_GPR2(%r11)
stg %r7,STACK_FRAME_OVERHEAD(%r15) stg %r7,STACK_FRAME_OVERHEAD(%r15)
lg %r9,0(%r8,%r10) # get system call add. lg %r9,0(%r8,%r10) # get system call add.
...@@ -698,8 +698,8 @@ ENTRY(pgm_check_handler) ...@@ -698,8 +698,8 @@ ENTRY(pgm_check_handler)
mvc __THREAD_per_address(8,%r14),__LC_PER_ADDRESS mvc __THREAD_per_address(8,%r14),__LC_PER_ADDRESS
mvc __THREAD_per_cause(2,%r14),__LC_PER_CODE mvc __THREAD_per_cause(2,%r14),__LC_PER_CODE
mvc __THREAD_per_paid(1,%r14),__LC_PER_ACCESS_ID mvc __THREAD_per_paid(1,%r14),__LC_PER_ACCESS_ID
6: RESTORE_SM_CLEAR_PER 6: xc __SF_BACKCHAIN(8,%r15),__SF_BACKCHAIN(%r15)
xc __SF_BACKCHAIN(8,%r15),__SF_BACKCHAIN(%r15) RESTORE_SM_CLEAR_PER
larl %r1,pgm_check_table larl %r1,pgm_check_table
llgh %r10,__PT_INT_CODE+2(%r11) llgh %r10,__PT_INT_CODE+2(%r11)
nill %r10,0x007f nill %r10,0x007f
...@@ -730,8 +730,8 @@ ENTRY(pgm_check_handler) ...@@ -730,8 +730,8 @@ ENTRY(pgm_check_handler)
# PER event in supervisor state, must be kprobes # PER event in supervisor state, must be kprobes
# #
.Lpgm_kprobe: .Lpgm_kprobe:
RESTORE_SM_CLEAR_PER
xc __SF_BACKCHAIN(8,%r15),__SF_BACKCHAIN(%r15) xc __SF_BACKCHAIN(8,%r15),__SF_BACKCHAIN(%r15)
RESTORE_SM_CLEAR_PER
lgr %r2,%r11 # pass pointer to pt_regs lgr %r2,%r11 # pass pointer to pt_regs
brasl %r14,do_per_trap brasl %r14,do_per_trap
j .Lpgm_return j .Lpgm_return
...@@ -777,10 +777,10 @@ ENTRY(io_int_handler) ...@@ -777,10 +777,10 @@ ENTRY(io_int_handler)
.Lio_skip_asce: .Lio_skip_asce:
mvc __PT_INT_CODE(12,%r11),__LC_SUBCHANNEL_ID mvc __PT_INT_CODE(12,%r11),__LC_SUBCHANNEL_ID
xc __PT_FLAGS(8,%r11),__PT_FLAGS(%r11) xc __PT_FLAGS(8,%r11),__PT_FLAGS(%r11)
xc __SF_BACKCHAIN(8,%r15),__SF_BACKCHAIN(%r15)
TSTMSK __LC_CPU_FLAGS,_CIF_IGNORE_IRQ TSTMSK __LC_CPU_FLAGS,_CIF_IGNORE_IRQ
jo .Lio_restore jo .Lio_restore
TRACE_IRQS_OFF TRACE_IRQS_OFF
xc __SF_BACKCHAIN(8,%r15),__SF_BACKCHAIN(%r15)
.Lio_loop: .Lio_loop:
lgr %r2,%r11 # pass pointer to pt_regs lgr %r2,%r11 # pass pointer to pt_regs
lghi %r3,IO_INTERRUPT lghi %r3,IO_INTERRUPT
...@@ -965,10 +965,10 @@ ENTRY(ext_int_handler) ...@@ -965,10 +965,10 @@ ENTRY(ext_int_handler)
mvc __PT_INT_PARM(4,%r11),__LC_EXT_PARAMS mvc __PT_INT_PARM(4,%r11),__LC_EXT_PARAMS
mvc __PT_INT_PARM_LONG(8,%r11),0(%r1) mvc __PT_INT_PARM_LONG(8,%r11),0(%r1)
xc __PT_FLAGS(8,%r11),__PT_FLAGS(%r11) xc __PT_FLAGS(8,%r11),__PT_FLAGS(%r11)
xc __SF_BACKCHAIN(8,%r15),__SF_BACKCHAIN(%r15)
TSTMSK __LC_CPU_FLAGS,_CIF_IGNORE_IRQ TSTMSK __LC_CPU_FLAGS,_CIF_IGNORE_IRQ
jo .Lio_restore jo .Lio_restore
TRACE_IRQS_OFF TRACE_IRQS_OFF
xc __SF_BACKCHAIN(8,%r15),__SF_BACKCHAIN(%r15)
lgr %r2,%r11 # pass pointer to pt_regs lgr %r2,%r11 # pass pointer to pt_regs
lghi %r3,EXT_INTERRUPT lghi %r3,EXT_INTERRUPT
brasl %r14,do_IRQ brasl %r14,do_IRQ
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment