Messages in this thread | | | Date | Fri, 4 Jan 2008 12:13:42 +0530 | From | "Abhishek Sagar" <> | Subject | Re: [PATCH] x86: kprobes change kprobe_handler flow |
| |
On 1/4/08, Masami Hiramatsu <mhiramat@redhat.com> wrote: > > + case KPROBE_HIT_SS: > > + if (*p->ainsn.insn == BREAKPOINT_INSTRUCTION) { > > + regs->flags &= ~TF_MASK; > > + regs->flags |= kcb->kprobe_saved_flags; > > + return 0; > > + } else { > > + recursive_singlestep(p, regs, kcb); > > + } > > + break; > > + default: > > + /* impossible cases */ > > + WARN_ON(1); > > WARN_ON() does not call panic(). Since the kernel doesn't stop, > we need to prepare singlestep after that.
We shouldn't panic in 'default'. First, we'll never hit this case, and if we do then we can be sure that the fault is not due to a probe. So instead of singlestepping we'll let the kernel handle it. If it cant, it'll panic/die() for us. I'll try to cleanup this case and incorporate these suggestions in a separate patch, as u suggested.
> Masami Hiramatsu > > Software Engineer > Hitachi Computer Products (America) Inc. > Software Solutions Division > > e-mail: mhiramat@redhat.com, masami.hiramatsu.pt@hitachi.com
-- Thanks, Abhishek Sagar
| |