Skip to content

Commit

Permalink
[S390] fix io_return critical section cleanup
Browse files Browse the repository at this point in the history
If a machine check interrupts the io interrupt handler on one of the
instructions between io_return and io_leave the critical section
cleanup code will move the return psw to io_work_loop. By doing that
the switch from the asynchronous interrupt stack to the process stack
is skipped. If e.g. TIF_NEED_RESCHED is set things break because
the scheduler is called with the asynchronous interrupts stack.
Moving the psw back to io_return instead fixes the problem.

Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
  • Loading branch information
Martin Schwidefsky authored and Martin Schwidefsky committed Apr 9, 2010
1 parent 35ac734 commit 176b180
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
8 changes: 7 additions & 1 deletion arch/s390/kernel/entry.S
Original file line number Diff line number Diff line change
Expand Up @@ -964,7 +964,7 @@ cleanup_critical:
clc 4(4,%r12),BASED(cleanup_table_io_work_loop)
bl BASED(0f)
clc 4(4,%r12),BASED(cleanup_table_io_work_loop+4)
bl BASED(cleanup_io_return)
bl BASED(cleanup_io_work_loop)
0:
br %r14

Expand Down Expand Up @@ -1038,6 +1038,12 @@ cleanup_sysc_leave_insn:
.long sysc_done - 8 + 0x80000000

cleanup_io_return:
mvc __LC_RETURN_PSW(4),0(%r12)
mvc __LC_RETURN_PSW+4(4),BASED(cleanup_table_io_return)
la %r12,__LC_RETURN_PSW
br %r14

cleanup_io_work_loop:
mvc __LC_RETURN_PSW(4),0(%r12)
mvc __LC_RETURN_PSW+4(4),BASED(cleanup_table_io_work_loop)
la %r12,__LC_RETURN_PSW
Expand Down
8 changes: 7 additions & 1 deletion arch/s390/kernel/entry64.S
Original file line number Diff line number Diff line change
Expand Up @@ -946,7 +946,7 @@ cleanup_critical:
clc 8(8,%r12),BASED(cleanup_table_io_work_loop)
jl 0f
clc 8(8,%r12),BASED(cleanup_table_io_work_loop+8)
jl cleanup_io_return
jl cleanup_io_work_loop
0:
br %r14

Expand Down Expand Up @@ -1020,6 +1020,12 @@ cleanup_sysc_leave_insn:
.quad sysc_done - 16

cleanup_io_return:
mvc __LC_RETURN_PSW(8),0(%r12)
mvc __LC_RETURN_PSW+8(8),BASED(cleanup_table_io_return)
la %r12,__LC_RETURN_PSW
br %r14

cleanup_io_work_loop:
mvc __LC_RETURN_PSW(8),0(%r12)
mvc __LC_RETURN_PSW+8(8),BASED(cleanup_table_io_work_loop)
la %r12,__LC_RETURN_PSW
Expand Down

0 comments on commit 176b180

Please sign in to comment.