lkml.org 
[lkml]   [2012]   [Nov]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC PATCH v1 11/31] ARC: Low level IRQ/Trap/Exception(non-MMU) Handling
> +	; --------- check for signals/restore-sigmask ------------
> + bbit0 r9, TIF_SIGPENDING, chk_next_work
> +
> + ; save CALLEE Regs.
> + ; (i) If this signal causes coredump - full regfile needed
> + ; (ii) If signal is SIGTRAP/SIGSTOP, task is being traced thus
> + ; tracer might call PEEKUSR for a CALLEE reg
> + ;
> + ; NOTE: SP will grow up by size of CALLEE Reg-File
> + SAVE_CALLEE_SAVED_USER ; clobbers r12
> +
> + ; save location of saved Callee Regs @ thread_struct->callee
> + GET_CURR_TASK_FIELD_PTR TASK_THREAD, r10
> + st sp, [r10, THREAD_CALLEE_REG]
> +
> + bl @do_signal
> +
> + ; unwind SP for cheap discard of Callee saved Regs
> + DISCARD_CALLEE_SAVED_USER

Uh-oh... And what if tracer wanted to modify callee-saved regs?

> + b resume_user_mode_begin ; loop back to start of U mode ret
> +
> + ; --- notify_resume ---
> +chk_next_work:
> + btst r9, TIF_NOTIFY_RESUME
> + blnz @do_notify_resume
> +
> + ;--------- All things done, go back to Userland ------
> +
> + b restore_regs

No. After NOTIFY_RESUME stuff you need to recheck SIGPENDING. This should
go to resume_user_mode_begin, not restore regs. Another problem here is
IRQ handling - you hit do_signal()/do_notify_resume() with IRQs disabled,
which is broken - you need to re-enable it before going into either.


\
 
 \ /
  Last update: 2012-11-16 06:42    [W:0.675 / U:0.276 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site