Re: [PATCH -tip v3 4/7] kprobes: Ignore break_handler

Masami Hiramatsu
2018-05-18T13:38:12Z

On Fri, 18 May 2018 08:16:36 +0200
Ingo Molnar <mingo@kernel.org> wrote:

>
> * Masami Hiramatsu <mhiramat@kernel.org> wrote:
>
> > Ignore break_handler related code because it was only
> > used by jprobe and jprobe is removed.
> >
> > Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org>
> > ---
> > Documentation/kprobes.txt | 2 +-
> > kernel/kprobes.c | 39 +++++----------------------------------
> > 2 files changed, 6 insertions(+), 35 deletions(-)
>
> Even after all these changes there's quite a bit of ->break_handler() use:
>
> triton:~/tip> git grep -w break_handler
> arch/arc/kernel/kprobes.c: if (p->break_handler && p->break_handler(p, regs)) {
> arch/arm/probes/kprobes/core.c: * for calling the break_handler below on re-entry,
> arch/arm/probes/kprobes/core.c: if (cur->break_handler && cur->break_handler(cur, regs)) {
> arch/arm64/kernel/probes/kprobes.c: * for calling the break_handler below on re-entry,
> arch/arm64/kernel/probes/kprobes.c: if (cur_kprobe->break_handler &&
> arch/arm64/kernel/probes/kprobes.c: cur_kprobe->break_handler(cur_kprobe, regs)) {
> arch/ia64/kernel/kprobes.c: if (p->break_handler && p->break_handler(p, regs)) {
> arch/mips/kernel/kprobes.c: if (p->break_handler && p->break_handler(p, regs))
> arch/powerpc/kernel/kprobes.c: if (p->break_handler && p->break_handler(p, regs)) {
> arch/s390/kernel/kprobes.c: * for calling the break_handler below on re-entry
> arch/s390/kernel/kprobes.c: if (p->break_handler && p->break_handler(p, regs)) {
> arch/s390/kernel/kprobes.c: * break_handler "returns" to the original
> arch/sh/kernel/kprobes.c: if (p->break_handler && p->break_handler(p, regs)) {
> arch/sh/kernel/kprobes.c: if (p->break_handler &&
> arch/sh/kernel/kprobes.c: p->break_handler(p, args->regs))
> arch/sparc/kernel/kprobes.c: if (p->break_handler && p->break_handler(p, regs))
> arch/x86/include/asm/kprobes.h: * a post_handler or break_handler).
> include/linux/kprobes.h: kprobe_break_handler_t break_handler;
>
> Nothing appears to be actually _setting_ the break_handler, so all of this is
> stale code as well which should be removed?

Yes, break_handler() is only for jprobe, not for user-defined handler.
I already have a series of those patches, but I think I need to send it
to each arch maintainer.

Thank you,

>
> Thanks,
>
> Ingo

--
Masami Hiramatsu <mhiramat@kernel.org>