lkml.org 
[lkml]   [2011]   [Jan]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC] [PATCH 2.6.37-rc5-tip 13/20] 13: x86: x86 specific probe handling
* Peter Zijlstra <peterz@infradead.org> [2011-01-25 14:56:22]:

> On Thu, 2010-12-16 at 15:29 +0530, Srikar Dronamraju wrote:
> >
> > +void arch_uprobe_enable_sstep(struct pt_regs *regs)
> > +{
> > + /*
> > + * Enable single-stepping by
> > + * - Set TF on stack
> > + * - Set TIF_SINGLESTEP: Guarantees that TF is set when
> > + * returning to user mode.
> > + * - Indicate that TF is set by us.
> > + */
> > + regs->flags |= X86_EFLAGS_TF;
> > + set_thread_flag(TIF_SINGLESTEP);
> > + set_thread_flag(TIF_FORCED_TF);
> > +}
> > +
> > +void arch_uprobe_disable_sstep(struct pt_regs *regs)
> > +{
> > + /* Disable single-stepping by clearing what we set */
> > + clear_thread_flag(TIF_SINGLESTEP);
> > + clear_thread_flag(TIF_FORCED_TF);
> > + regs->flags &= ~X86_EFLAGS_TF;
> > +}
>
> Why not use the code from arch/x86/kernel/step.c?

user_enable_single_step and user_disable_single_step that are
defined in arch/x86/kernel/step.c cant be called in interrupt context.

Initially we were looking at enabling/disabling singlestep in
interrupt context. Even now we disable singlestep in post notifier in
interrupt context.

Though arch/x86/kernel/step.c has a static function
enable_single_step which is identical to arch_uprobe_enable_sstep;
there is no equivalent function for arch_uprobe_disable_sstep.

--
Thanks and Regards
Srikar


\
 
 \ /
  Last update: 2011-01-27 10:49    [W:0.144 / U:0.044 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site