[PATCH 05/17] arm: TIF_NOTIFY_RESUME

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Roland McGrath
Date: Friday, April 24, 2009 - 5:09 pm

This makes arm support TIF_NOTIFY_RESUME, so that set_notify_resume()
requests a call to tracehook_notify_resume() on the way back to user mode.

Signed-off-by: Roland McGrath <roland@redhat.com>
---
 arch/arm/include/asm/thread_info.h |    4 ++++
 arch/arm/kernel/entry-common.S     |    2 +-
 arch/arm/kernel/signal.c           |    5 +++++
 3 files changed, 10 insertions(+), 1 deletions(-)

diff --git a/arch/arm/include/asm/thread_info.h b/arch/arm/include/asm/thread_info.h
index 4f88482..def86a0 100644
--- a/arch/arm/include/asm/thread_info.h
+++ b/arch/arm/include/asm/thread_info.h
@@ -129,12 +129,14 @@ extern void vfp_sync_state(struct thread_info *thread);
  * thread information flags:
  *  TIF_SYSCALL_TRACE	- syscall trace active
  *  TIF_SIGPENDING	- signal pending
+ *  TIF_NOTIFY_RESUME	- tracing notification pending
  *  TIF_NEED_RESCHED	- rescheduling necessary
  *  TIF_USEDFPU		- FPU was used by this task this quantum (SMP)
  *  TIF_POLLING_NRFLAG	- true if poll_idle() is polling TIF_NEED_RESCHED
  */
 #define TIF_SIGPENDING		0
 #define TIF_NEED_RESCHED	1
+#define TIF_NOTIFY_RESUME	2
 #define TIF_SYSCALL_TRACE	8
 #define TIF_POLLING_NRFLAG	16
 #define TIF_USING_IWMMXT	17
@@ -142,6 +144,7 @@ extern void vfp_sync_state(struct thread_info *thread);
 #define TIF_FREEZE		19
 
 #define _TIF_SIGPENDING		(1 << TIF_SIGPENDING)
+#define _TIF_NOTIFY_RESUME	(1 << TIF_NOTIFY_RESUME)
 #define _TIF_NEED_RESCHED	(1 << TIF_NEED_RESCHED)
 #define _TIF_SYSCALL_TRACE	(1 << TIF_SYSCALL_TRACE)
 #define _TIF_POLLING_NRFLAG	(1 << TIF_POLLING_NRFLAG)
@@ -152,6 +155,7 @@ extern void vfp_sync_state(struct thread_info *thread);
  * Change these and you break ASM code in entry-common.S
  */
 #define _TIF_WORK_MASK		0x000000ff
+#define _TIF_DO_NOTIFY_RESUME	(_TIF_SIGPENDING | _TIF_NOTIFY_RESUME)
 
 #endif /* __KERNEL__ */
 #endif /* __ASM_ARM_THREAD_INFO_H */
diff --git a/arch/arm/kernel/entry-common.S b/arch/arm/kernel/entry-common.S
index b55cb03..2523cac 100644
--- a/arch/arm/kernel/entry-common.S
+++ b/arch/arm/kernel/entry-common.S
@@ -51,7 +51,7 @@ fast_work_pending:
 work_pending:
 	tst	r1, #_TIF_NEED_RESCHED
 	bne	work_resched
-	tst	r1, #_TIF_SIGPENDING
+	tst	r1, #_TIF_DO_NOTIFY_RESUME
 	beq	no_work_pending
 	mov	r0, sp				@ 'regs'
 	mov	r2, why				@ 'syscall'
diff --git a/arch/arm/kernel/signal.c b/arch/arm/kernel/signal.c
index 51e2187..6663ee0 100644
--- a/arch/arm/kernel/signal.c
+++ b/arch/arm/kernel/signal.c
@@ -705,4 +705,9 @@ do_notify_resume(struct pt_regs *regs, unsigned int thread_flags, int syscall)
 {
 	if (thread_flags & _TIF_SIGPENDING)
 		do_signal(&current->blocked, regs, syscall);
+
+	if (thread_flags & _TIF_NOTIFY_RESUME) {
+		clear_thread_flag(TIF_NOTIFY_RESUME);
+		tracehook_notify_resume(regs);
+	}
 }
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH 0/17] tracehook &amp; user_regset for ARM, Roland McGrath, (Fri Apr 24, 5:06 pm)
[PATCH 01/17] arm: arch_ptrace clean-up, Roland McGrath, (Fri Apr 24, 5:07 pm)
[PATCH 03/17] arm: tracehook_report_syscall, Roland McGrath, (Fri Apr 24, 5:08 pm)
[PATCH 04/17] arm: tracehook_signal_handler, Roland McGrath, (Fri Apr 24, 5:09 pm)
[PATCH 05/17] arm: TIF_NOTIFY_RESUME, Roland McGrath, (Fri Apr 24, 5:09 pm)
[PATCH 06/17] arm: user_regset: general regs, Roland McGrath, (Fri Apr 24, 5:10 pm)
[PATCH 07/17] arm: user_regset: FPU regs, Roland McGrath, (Fri Apr 24, 5:10 pm)
[PATCH 08/17] arm: CORE_DUMP_USE_REGSET, Roland McGrath, (Fri Apr 24, 5:11 pm)
[PATCH 09/17] arm: user_regset: VFP regs, Roland McGrath, (Fri Apr 24, 5:11 pm)
[PATCH 10/17] arm: user_regset: VFP in core dumps, Roland McGrath, (Fri Apr 24, 5:12 pm)
[PATCH 11/17] arm: user_regset: iWMMXt regs, Roland McGrath, (Fri Apr 24, 5:12 pm)
[PATCH 12/17] arm: user_regset: iWMMXt in core dumps, Roland McGrath, (Fri Apr 24, 5:12 pm)
[PATCH 13/17] arm: user_regset: Crunch regs, Roland McGrath, (Fri Apr 24, 5:13 pm)
[PATCH 14/17] arm: user_regset: Crunch in core dumps, Roland McGrath, (Fri Apr 24, 5:13 pm)
[PATCH 16/17] arm: asm/syscall.h (unfinished), Roland McGrath, (Fri Apr 24, 5:15 pm)
[PATCH 17/17] arm: HAVE_ARCH_TRACEHOOK, Roland McGrath, (Fri Apr 24, 5:15 pm)
Re: [PATCH 12/17] arm: user_regset: iWMMXt in core dumps, Roland McGrath, (Mon Apr 27, 7:53 pm)
Re: [PATCH 0/17] tracehook &amp; user_regset for ARM, Christoph Hellwig, (Sat Jun 6, 7:42 am)
Re: [PATCH 01/17] arm: arch_ptrace clean-up, Russell King, (Fri Jun 19, 2:13 am)
Re: [PATCH 16/17] arm: asm/syscall.h (unfinished), Russell King, (Fri Jun 19, 2:31 am)
Re: [PATCH 01/17] arm: arch_ptrace clean-up, Roland McGrath, (Tue Jun 23, 11:55 pm)
Re: [PATCH 16/17] arm: asm/syscall.h (unfinished), Roland McGrath, (Wed Jun 24, 1:56 am)