Skip to content

Commit 04a24ae

Browse files
committed
Merge tag 'for-3.14' of git://openrisc.net/~jonas/linux
Pull OpenRISC updates from Jonas Bonn: "The interesting change here is a rework of the OpenRISC signal handling to make it more like other architectures in the hopes that this makes it easier for others to comment on and understand. This rework fixes some real bugs, like the fact that syscall restart did not work reliably" * tag 'for-3.14' of git://openrisc.net/~jonas/linux: openrisc: Use get_signal() signal_setup_done() openrisc: Rework signal handling
2 parents 4bcec91 + 548dafe commit 04a24ae

2 files changed

Lines changed: 149 additions & 143 deletions

File tree

‎arch/openrisc/kernel/entry.S‎

Lines changed: 33 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -853,37 +853,44 @@ UNHANDLED_EXCEPTION(_vector_0x1f00,0x1f00)
853853

854854
/* ========================================================[ return ] === */
855855

856+
_resume_userspace:
857+
DISABLE_INTERRUPTS(r3,r4)
858+
l.lwz r4,TI_FLAGS(r10)
859+
l.andi r13,r4,_TIF_WORK_MASK
860+
l.sfeqi r13,0
861+
l.bf _restore_all
862+
l.nop
863+
856864
_work_pending:
857-
/*
858-
* if (current_thread_info->flags & _TIF_NEED_RESCHED)
859-
* schedule();
860-
*/
861-
l.lwz r5,TI_FLAGS(r10)
862-
l.andi r3,r5,_TIF_NEED_RESCHED
863-
l.sfnei r3,0
864-
l.bnf _work_notifysig
865+
l.lwz r5,PT_ORIG_GPR11(r1)
866+
l.sfltsi r5,0
867+
l.bnf 1f
865868
l.nop
866-
l.jal schedule
869+
l.andi r5,r5,0
870+
1:
871+
l.jal do_work_pending
872+
l.ori r3,r1,0 /* pt_regs */
873+
874+
l.sfeqi r11,0
875+
l.bf _restore_all
867876
l.nop
868-
l.j _resume_userspace
877+
l.sfltsi r11,0
878+
l.bnf 1f
869879
l.nop
870-
871-
/* Handle pending signals and notify-resume requests.
872-
* do_notify_resume must be passed the latest pushed pt_regs, not
873-
* necessarily the "userspace" ones. Also, pt_regs->syscallno
874-
* must be set so that the syscall restart functionality works.
875-
*/
876-
_work_notifysig:
877-
l.jal do_notify_resume
878-
l.ori r3,r1,0 /* pt_regs */
879-
880-
_resume_userspace:
881-
DISABLE_INTERRUPTS(r3,r4)
882-
l.lwz r3,TI_FLAGS(r10)
883-
l.andi r3,r3,_TIF_WORK_MASK
884-
l.sfnei r3,0
885-
l.bf _work_pending
880+
l.and r11,r11,r0
881+
l.ori r11,r11,__NR_restart_syscall
882+
l.j _syscall_check_trace_enter
886883
l.nop
884+
1:
885+
l.lwz r11,PT_ORIG_GPR11(r1)
886+
/* Restore arg registers */
887+
l.lwz r3,PT_GPR3(r1)
888+
l.lwz r4,PT_GPR4(r1)
889+
l.lwz r5,PT_GPR5(r1)
890+
l.lwz r6,PT_GPR6(r1)
891+
l.lwz r7,PT_GPR7(r1)
892+
l.j _syscall_check_trace_enter
893+
l.lwz r8,PT_GPR8(r1)
887894

888895
_restore_all:
889896
RESTORE_ALL

0 commit comments

Comments
 (0)