Re: [PATCH -tip] x86: kprobes: Cleanup preempt disabling and enabling

2018-03-04 Thread Masami Hiramatsu
On Sat, 3 Mar 2018 21:25:45 +0900 Masami Hiramatsu wrote: > On Sat, 3 Mar 2018 10:58:23 +0100 > Ingo Molnar wrote: > > > > > * Masami Hiramatsu wrote: > > > > > +/* > > > + * Interrupts are disabled on entry as trap3 is an interrupt gate and > > > they > > > + * remain disabled throughout t

Re: [PATCH -tip] x86: kprobes: Cleanup preempt disabling and enabling

2018-03-03 Thread Masami Hiramatsu
On Sat, 3 Mar 2018 10:58:23 +0100 Ingo Molnar wrote: > > * Masami Hiramatsu wrote: > > > +/* > > + * Interrupts are disabled on entry as trap3 is an interrupt gate and they > > + * remain disabled throughout this function. > > + */ > > +int kprobe_int3_handler(struct pt_regs *regs) > > +{ > >

Re: [PATCH -tip] x86: kprobes: Cleanup preempt disabling and enabling

2018-03-03 Thread Ingo Molnar
* Masami Hiramatsu wrote: > +/* > + * Interrupts are disabled on entry as trap3 is an interrupt gate and they > + * remain disabled throughout this function. > + */ > +int kprobe_int3_handler(struct pt_regs *regs) > +{ > + struct kprobe_ctlblk *kcb; > + int ret; > + > + if (user_mode

[PATCH -tip] x86: kprobes: Cleanup preempt disabling and enabling

2018-03-02 Thread Masami Hiramatsu
Cleanup x86/kprobes preempt counts so that preemt_disable() and preempt_enable_no_sched() are called from kprobe_int3_handler(). Only if a kprobe runs single-stepping, preemption is kept disabled and that is enabled when - single-stepping is finished - a fault occurs on single-steped instruction