]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
x86: tracehook: TIF_NOTIFY_RESUME
authorRoland McGrath <roland@redhat.com>
Sun, 20 Apr 2008 02:10:57 +0000 (19:10 -0700)
committerRoland McGrath <roland@redhat.com>
Sat, 26 Jul 2008 21:38:05 +0000 (14:38 -0700)
This adds TIF_NOTIFY_RESUME support for x86, both 64-bit and 32-bit.
When set, we call tracehook_notify_resume() on the way to user mode.

Signed-off-by: Roland McGrath <roland@redhat.com>
arch/x86/kernel/signal_32.c
arch/x86/kernel/signal_64.c
include/asm-x86/thread_info.h

index 22aae1683c14b1f61e149d7e5967d8cfc4d51ed0..4445d26efd478d42aae4857f349dfd44dcd964c1 100644 (file)
@@ -663,5 +663,10 @@ do_notify_resume(struct pt_regs *regs, void *unused, __u32 thread_info_flags)
        if (thread_info_flags & _TIF_SIGPENDING)
                do_signal(regs);
 
+       if (thread_info_flags & _TIF_NOTIFY_RESUME) {
+               clear_thread_flag(TIF_NOTIFY_RESUME);
+               tracehook_notify_resume(regs);
+       }
+
        clear_thread_flag(TIF_IRET);
 }
index cb7cf0216ab767f745b1f6fc9b14a7d657aebe8c..d01e3f6ef26d64cb6a078bb9005664f524fbd58a 100644 (file)
@@ -523,6 +523,11 @@ void do_notify_resume(struct pt_regs *regs, void *unused,
        /* deal with pending signal delivery */
        if (thread_info_flags & _TIF_SIGPENDING)
                do_signal(regs);
+
+       if (thread_info_flags & _TIF_NOTIFY_RESUME) {
+               clear_thread_flag(TIF_NOTIFY_RESUME);
+               tracehook_notify_resume(regs);
+       }
 }
 
 void signal_fault(struct pt_regs *regs, void __user *frame, char *where)
index da0a675adf94a1a753792d1bca54c45d4fe3bed4..4cd5b7bdc8cccd137674a03aba8bac33ec66d961 100644 (file)
@@ -71,6 +71,7 @@ struct thread_info {
  * Warning: layout of LSW is hardcoded in entry.S
  */
 #define TIF_SYSCALL_TRACE      0       /* syscall trace active */
+#define TIF_NOTIFY_RESUME      1       /* callback before returning to user */
 #define TIF_SIGPENDING         2       /* signal pending */
 #define TIF_NEED_RESCHED       3       /* rescheduling necessary */
 #define TIF_SINGLESTEP         4       /* reenable singlestep on user return*/
@@ -93,6 +94,7 @@ struct thread_info {
 #define TIF_BTS_TRACE_TS       27      /* record scheduling event timestamps */
 
 #define _TIF_SYSCALL_TRACE     (1 << TIF_SYSCALL_TRACE)
+#define _TIF_NOTIFY_RESUME     (1 << TIF_NOTIFY_RESUME)
 #define _TIF_SIGPENDING                (1 << TIF_SIGPENDING)
 #define _TIF_SINGLESTEP                (1 << TIF_SINGLESTEP)
 #define _TIF_NEED_RESCHED      (1 << TIF_NEED_RESCHED)
@@ -133,7 +135,7 @@ struct thread_info {
 
 /* Only used for 64 bit */
 #define _TIF_DO_NOTIFY_MASK                                            \
-       (_TIF_SIGPENDING|_TIF_MCE_NOTIFY)
+       (_TIF_SIGPENDING|_TIF_MCE_NOTIFY|_TIF_NOTIFY_RESUME)
 
 /* flags to check in __switch_to() */
 #define _TIF_WORK_CTXSW                                                        \