lkml.org 
[lkml]   [2017]   [Oct]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [BUGFIX PATCH] kprobes/x86: Remove IRQ disabling from jprobe handlers

* Masami Hiramatsu <mhiramat@kernel.org> wrote:

> On Tue, 3 Oct 2017 11:33:44 +0200
> Ingo Molnar <mingo@kernel.org> wrote:
>
> >
> > * Masami Hiramatsu <mhiramat@kernel.org> wrote:
> >
> > > Jprobe actually doesn't need to disable IRQs while calling
> > > handlers, because Documentation/kprobes.txt says:
> > >
> > > -----
> > > Probe handlers are run with preemption disabled. Depending on the
> > > architecture and optimization state, handlers may also run with
> > > interrupts disabled (e.g., kretprobe handlers and optimized kprobe
> > > handlers run without interrupt disabled on x86/x86-64).
> > > -----
> > >
> > > So let's remove IRQ disabling from jprobes too.
> > >
> > > Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org>
> > > ---
> > > arch/x86/kernel/kprobes/core.c | 2 --
> > > 1 file changed, 2 deletions(-)
> > >
> > > diff --git a/arch/x86/kernel/kprobes/core.c b/arch/x86/kernel/kprobes/core.c
> > > index b48e0efd668e..bd36f3c33cd0 100644
> > > --- a/arch/x86/kernel/kprobes/core.c
> > > +++ b/arch/x86/kernel/kprobes/core.c
> > > @@ -1099,8 +1099,6 @@ int setjmp_pre_handler(struct kprobe *p, struct pt_regs *regs)
> > > * raw stack chunk with redzones:
> > > */
> > > __memcpy(kcb->jprobes_stack, (kprobe_opcode_t *)addr, MIN_STACK_SIZE(addr));
> > > - regs->flags &= ~X86_EFLAGS_IF;
> > > - trace_hardirqs_off();
> > > regs->ip = (unsigned long)(jp->entry);
> > >
> > > /*
> >
> > Could you please also do a patch that disables jprobes permanently, in preparation
> > of eventually removing them later?
>
> Would you mean introducing CONFIG_JPROBE_API and cut APIs out,
> or just adding "__deprecated" for each API?

No, I'd suggest removing in-kernel uses and disabling jprobes in the Kconfig
altogether, but without removing the code and its integration for the time being.

Thanks,

Ingo

\
 
 \ /
  Last update: 2017-10-03 19:11    [W:0.198 / U:0.624 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site