Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=f794c8279d02ccd69429d816eb03fa12c130d06d
Commit:     f794c8279d02ccd69429d816eb03fa12c130d06d
Parent:     c3442e296517aee733d62fc3fe03211598902c7d
Author:     Martin Schwidefsky <[EMAIL PROTECTED]>
AuthorDate: Mon Mar 5 23:35:38 2007 +0100
Committer:  Martin Schwidefsky <[EMAIL PROTECTED]>
CommitDate: Mon Mar 5 23:35:38 2007 +0100

    [S390] kprobes breaks BUG_ON
    
    The illegal operation handler calls the die notifier with DIE_BPT to
    let kprobes pick up its breakpoint. If kprobes does not find its
    breakpoint it returns NOTIFY_STOP instead of NOTIFY_DONE.
    Since we use stop_machine_run on s390 to arm/disarm the kprobes
    breakpoints the race that kprobe_handler tries to solve by checking
    for the kprobes breakpoints does not exist. Removing the check makes
    BUG_ON working again.
    
    Signed-off-by: Martin Schwidefsky <[EMAIL PROTECTED]>
---
 arch/s390/kernel/kprobes.c |   21 +++++++--------------
 1 files changed, 7 insertions(+), 14 deletions(-)

diff --git a/arch/s390/kernel/kprobes.c b/arch/s390/kernel/kprobes.c
index a466bab..8af549e 100644
--- a/arch/s390/kernel/kprobes.c
+++ b/arch/s390/kernel/kprobes.c
@@ -337,21 +337,14 @@ static int __kprobes kprobe_handler(struct pt_regs *regs)
        }
 
        p = get_kprobe(addr);
-       if (!p) {
-               if (*addr != BREAKPOINT_INSTRUCTION) {
-                       /*
-                        * The breakpoint instruction was removed right
-                        * after we hit it.  Another cpu has removed
-                        * either a probepoint or a debugger breakpoint
-                        * at this address.  In either case, no further
-                        * handling of this interrupt is appropriate.
-                        *
-                        */
-                       ret = 1;
-               }
-               /* Not one of ours: let kernel handle it */
+       if (!p)
+               /*
+                * No kprobe at this address. The fault has not been
+                * caused by a kprobe breakpoint. The race of breakpoint
+                * vs. kprobe remove does not exist because on s390 we
+                * use stop_machine_run to arm/disarm the breakpoints.
+                */
                goto no_kprobe;
-       }
 
        kcb->kprobe_status = KPROBE_HIT_ACTIVE;
        set_current_kprobe(p, regs, kcb);
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to