Re: [Bug 10489] Kprobe smoke test lockdep warning

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Peter Zijlstra
Date: Tuesday, April 22, 2008 - 6:09 am

On Mon, 2008-04-21 at 18:54 -0400, Masami Hiramatsu wrote:

My reply to BZ 10489:



how I love this stuff...


Ok, do_debug() is a trap, this can happen at any time regardless of the
machine's IRQ state. So the first thing we do is fix up the IRQ state.
Then we call this die notifier stuff; and return with messed up IRQ
state... YAY.

So, kprobes fudges it..

  notify_die(DIE_DEBUG)
    kprobe_exceptions_notify()
      post_kprobe_handler()
        modify regs->flags
        trace_hardirqs_fixup_flags(regs->flags);  <--- must be it

So what's the use of modifying flags if they're not meant to take effect
at some point.

/me tries to reproduce issue; enable kprobes test thingy && boot

OK, that reproduces..

So the below makes it work - but I'm not getting this code; at the time
I wrote that stuff I CC'ed each and every kprobe maintainer listed in
the usual places but got no reposonse - can some please explain this
stuff to me?

Are the saved flags only for the TF bit or are they made in full effect
later (and if so, where) ?

Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
---
diff --git a/arch/x86/kernel/kprobes.c b/arch/x86/kernel/kprobes.c
index 34a5912..fe71e64 100644
--- a/arch/x86/kernel/kprobes.c
+++ b/arch/x86/kernel/kprobes.c
@@ -865,7 +865,6 @@ static int __kprobes post_kprobe_handler(struct pt_regs *regs)
 
        resume_execution(cur, regs, kcb);
        regs->flags |= kcb->kprobe_saved_flags;
-       trace_hardirqs_fixup_flags(regs->flags);
 
        /* Restore back the original saved kprobes variables and continue. */
        if (kcb->kprobe_status == KPROBE_REENTER) {



--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[Bug 10489] Kprobe smoke test lockdep warning, Adrian Bunk, (Mon Apr 21, 8:06 am)
Re: [Bug 10489] Kprobe smoke test lockdep warning, Vegard Nossum, (Mon Apr 21, 8:13 am)
Re: [Bug 10489] Kprobe smoke test lockdep warning, Masami Hiramatsu, (Mon Apr 21, 3:54 pm)
Re: [Bug 10489] Kprobe smoke test lockdep warning, Peter Zijlstra, (Tue Apr 22, 6:09 am)
Re: [Bug 10489] Kprobe smoke test lockdep warning, Peter Zijlstra, (Tue Apr 22, 6:26 am)
Re: [Bug 10489] Kprobe smoke test lockdep warning, Masami Hiramatsu, (Tue Apr 22, 8:25 am)
Re: [Bug 10489] Kprobe smoke test lockdep warning, Peter Zijlstra, (Tue Apr 22, 9:05 am)
Re: [Bug 10489] Kprobe smoke test lockdep warning, Masami Hiramatsu, (Tue Apr 22, 9:18 am)
Re: [Bug 10489] Kprobe smoke test lockdep warning, Masami Hiramatsu, (Tue Apr 22, 9:23 am)
Re: [Bug 10489] Kprobe smoke test lockdep warning, Masami Hiramatsu, (Tue Apr 22, 12:51 pm)
Re: [Bug 10489] Kprobe smoke test lockdep warning, Ingo Molnar, (Tue Jul 15, 2:19 am)