lkml.org 
[lkml]   [2011]   [Jul]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC PATCH -tip ] [BUGFIX] x86: Remove preempt disabling from kprobes
On Fri, Jul 01, 2011 at 10:14:08PM +0900, Masami Hiramatsu wrote:
> Steven Rostedt reported that putting kprobe on the instruction which
> loads preempt_count causes the wrong result, as below.
>
> Kprobes requires preemption to be disabled as it single steps the code
> it replaced with a breakpoint. But because the code that is single
> stepped could be reading the preempt count, the kprobe disabling of the
> preempt count can cause the wrong value to end up as a result. Here's an
> example:

...

> We just caused preempt count to increment twice when it should have only
> incremented once, and this screws everything else up.
>
> To solve this, I've removed preempt disabling code from kprobes,
> since the breakpoint exception and kprobes single step routine
> disables interrupts, it doesn't need to disable preemption while
> single-stepping anymore.
>
> This patch is for -tip tree, and it can be applied to linus tree too.
>
> Signed-off-by: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
> Reported-by: Steven Rostedt <rostedt@goodmis.org>
> ---

Acked-by: Ananth N Mavinakayanahalli <ananth@in.ibm.com>


\
 
 \ /
  Last update: 2011-07-02 08:11    [W:0.106 / U:0.412 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site