[lkml]   [2010]   [Feb]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH 1/2] Blackfin: initial tracehook support
On Thu, Feb 11, 2010 at 15:46, Roland McGrath wrote:
>>  config BLACKFIN
>>       def_bool y
>>       select HAVE_ARCH_KGDB
>> +     select HAVE_ARCH_TRACEHOOK
> Don't define this until you have all its constituents as listed in the
> arch/Kconfig comment.  I don't see user_regset support.

where is user_regset actually used ? i only see it in fs/binfmt_elf.c
and core dumps, neither of which work on nommu systems (or at least on
Blackfin systems).

>> +static inline void
>> +syscall_get_arguments(struct task_struct *task, struct pt_regs *regs,
>> +                      unsigned int i, unsigned int n, unsigned long *args)
>> +{
>> +     /* wtf is "i" ? */
>> +     BUG_ON(i);
> i is the starting number.  args[0] gets the i'th argument,
> args[n - 1] gets the i+n-1'th argument.

i dont see anyone calling syscall_get_arguments() with i!=0, and a few
other arches are doing the BUG_ON(i) thing too.

but should be easy to implement this with memory walking code ...

>> +asmlinkage void syscall_trace_leave(struct pt_regs *regs)
>> +{
>> +     if (test_thread_flag(TIF_SYSCALL_TRACE))
>> +             tracehook_report_syscall_exit(regs, 0);
>>  }
> Is it in fact true that single-step reports still come normally after a
> syscall instruction?

this is unchanged from the previous Blackfin behavior, and it's how
most arches behaved in 2.6.32. but looking in latest mainline, it
seems people are changing to:
if (test_thread_flag(TIF_SINGLESTEP) || test_thread_flag(TIF_SYSCALL_TRACE))
tracehook_report_syscall_exit(regs, 0);
so changing Blackfin too should be straightforward i guess

>> @@ -213,7 +213,7 @@
>>        */
>>       if (regs->syscfg & TRACE_BITS) {
>>               regs->syscfg &= ~TRACE_BITS;
>> -             ptrace_notify(SIGTRAP);
>> +             tracehook_signal_handler(sig, info, ka, regs, 1);
>>       }
> This call should be made unconditionally, and it should be made after the
> signal mask changes have been made (i.e. at the end of handle_signal).  I
> think it's wrong to clear the single-step flag here.  Instead, pass
> (regs->syscfg & TRACE_BITS) as the last argument.
> With ptrace, it makes no difference one way or the other because it will
> always either explicitly clear or explicitly set single-step before it
> resumes.  But in future, it will matter.

sounds like this issue is unrelated to tracehook and how we've been
doing signal/ptrace stuff has always been a little broken ...

i'll move it to how most arches seem to do it -- in do_signal after a
successful call to handle_signal and after clearing

thanks for the review
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

 \ /
  Last update: 2010-02-12 00:57    [from the cache]
©2003-2011 Jasper Spaans