Re: Why do kprobes and uprobes singlestep?

2021-03-03 Thread Andy Lutomirski
> On Mar 3, 2021, at 10:11 AM, Daniel Xu wrote: > > On Tue, Mar 02, 2021 at 06:18:23PM -0800, Alexei Starovoitov wrote: >>> On Tue, Mar 2, 2021 at 5:46 PM Andy Lutomirski wrote: >>> >>> On Mar 2, 2021, at 5:22 PM, Alexei Starovoitov wrote: On Tue, Mar 2, 2021 at

Re: Why do kprobes and uprobes singlestep?

2021-03-03 Thread Daniel Xu
On Tue, Mar 02, 2021 at 06:18:23PM -0800, Alexei Starovoitov wrote: > On Tue, Mar 2, 2021 at 5:46 PM Andy Lutomirski wrote: > > > > > > > On Mar 2, 2021, at 5:22 PM, Alexei Starovoitov > > > wrote: > > > > > > On Tue, Mar 2, 2021 at 1:02 PM Andy Lutomirski > > > wrote: > > >> > > >> > >

Re: Why do kprobes and uprobes singlestep?

2021-03-03 Thread Oleg Nesterov
On 03/02, Alexei Starovoitov wrote: > > Especially if such tightening will come with performance boost for > uprobe on a nop and unprobe at the start (which is typically push or > alu on %sp). > That would be a great step forward. Just in case, nop and push are emulated without additional

Re: Why do kprobes and uprobes singlestep?

2021-03-03 Thread Alexei Starovoitov
On Tue, Mar 2, 2021 at 5:46 PM Andy Lutomirski wrote: > > > > On Mar 2, 2021, at 5:22 PM, Alexei Starovoitov > > wrote: > > > > On Tue, Mar 2, 2021 at 1:02 PM Andy Lutomirski wrote: > >> > >> > On Mar 2, 2021, at 12:24 PM, Alexei Starovoitov > wrote: > >>> > >>> On Tue, Mar 2,

Re: Why do kprobes and uprobes singlestep?

2021-03-03 Thread Andy Lutomirski
> On Mar 2, 2021, at 5:22 PM, Alexei Starovoitov > wrote: > > On Tue, Mar 2, 2021 at 1:02 PM Andy Lutomirski wrote: >> >> On Mar 2, 2021, at 12:24 PM, Alexei Starovoitov wrote: >>> >>> On Tue, Mar 2, 2021 at 10:38 AM Andy Lutomirski wrote: Is there something like

Re: Why do kprobes and uprobes singlestep?

2021-03-03 Thread Alexei Starovoitov
On Tue, Mar 2, 2021 at 1:02 PM Andy Lutomirski wrote: > > > > On Mar 2, 2021, at 12:24 PM, Alexei Starovoitov > > wrote: > > > > On Tue, Mar 2, 2021 at 10:38 AM Andy Lutomirski wrote: > >> > >> Is there something like a uprobe test suite? How maintained / > >> actively used is uprobe? > > >

Re: Why do kprobes and uprobes singlestep?

2021-03-02 Thread Andy Lutomirski
> On Mar 2, 2021, at 12:24 PM, Alexei Starovoitov > wrote: > > On Tue, Mar 2, 2021 at 10:38 AM Andy Lutomirski wrote: >> >> Is there something like a uprobe test suite? How maintained / >> actively used is uprobe? > > uprobe+bpf is heavily used in production. > selftests/bpf has only one

Re: Why do kprobes and uprobes singlestep?

2021-03-02 Thread Andy Lutomirski
> On Mar 2, 2021, at 12:25 PM, Oleg Nesterov wrote: > > On 03/01, Andy Lutomirski wrote: >> >>> On Mon, Mar 1, 2021 at 8:51 AM Oleg Nesterov wrote: >>> >>> But I guess this has nothing to do with uprobes, they do not single-step >>> in kernel mode, right? >> >> They single-step user

Re: Why do kprobes and uprobes singlestep?

2021-03-02 Thread Oleg Nesterov
On 03/02, Masami Hiramatsu wrote: > > > Not sure I understand you correctly, I know almost nothing about low-level > > x86 magic. > > x86 has normal interrupt and NMI. When an NMI occurs the CPU masks NMI > (the mask itself is hidden status) and IRET releases the mask. The problem > is that if an

Re: Why do kprobes and uprobes singlestep?

2021-03-02 Thread Oleg Nesterov
forgot to add Srikar, sorry for resend... On 03/01, Andy Lutomirski wrote: > > On Mon, Mar 1, 2021 at 8:51 AM Oleg Nesterov wrote: > > > > But I guess this has nothing to do with uprobes, they do not single-step > > in kernel mode, right? > > They single-step user code, though, and the code that

Re: Why do kprobes and uprobes singlestep?

2021-03-02 Thread Oleg Nesterov
On 03/01, Andy Lutomirski wrote: > > On Mon, Mar 1, 2021 at 8:51 AM Oleg Nesterov wrote: > > > > But I guess this has nothing to do with uprobes, they do not single-step > > in kernel mode, right? > > They single-step user code, though, and the code that makes this work > is quite ugly.

Re: Why do kprobes and uprobes singlestep?

2021-03-02 Thread Alexei Starovoitov
On Tue, Mar 2, 2021 at 10:38 AM Andy Lutomirski wrote: > > Is there something like a uprobe test suite? How maintained / > actively used is uprobe? uprobe+bpf is heavily used in production. selftests/bpf has only one test for it though. Why are you asking?

Re: Why do kprobes and uprobes singlestep?

2021-03-01 Thread Andy Lutomirski
On Mon, Mar 1, 2021 at 6:22 PM Masami Hiramatsu wrote: > > Hi Oleg and Andy, > > On Mon, 1 Mar 2021 17:51:31 +0100 > Oleg Nesterov wrote: > > > Hi Andy, > > > > sorry for delay. > > > > On 02/23, Andy Lutomirski wrote: > > > > > > A while back, I let myself be convinced that kprobes genuinely

Re: Why do kprobes and uprobes singlestep?

2021-03-01 Thread Masami Hiramatsu
Hi Oleg and Andy, On Mon, 1 Mar 2021 17:51:31 +0100 Oleg Nesterov wrote: > Hi Andy, > > sorry for delay. > > On 02/23, Andy Lutomirski wrote: > > > > A while back, I let myself be convinced that kprobes genuinely need to > > single-step the kernel on occasion, and I decided that this sucked

Re: Why do kprobes and uprobes singlestep?

2021-03-01 Thread Andy Lutomirski
On Mon, Mar 1, 2021 at 8:51 AM Oleg Nesterov wrote: > > Hi Andy, > > sorry for delay. > > On 02/23, Andy Lutomirski wrote: > > > > A while back, I let myself be convinced that kprobes genuinely need to > > single-step the kernel on occasion, and I decided that this sucked but > > I could live

Re: Why do kprobes and uprobes singlestep?

2021-03-01 Thread Oleg Nesterov
Hi Andy, sorry for delay. On 02/23, Andy Lutomirski wrote: > > A while back, I let myself be convinced that kprobes genuinely need to > single-step the kernel on occasion, and I decided that this sucked but > I could live with it. it would, however, be Really Really Nice (tm) > if we could have

Re: Why do kprobes and uprobes singlestep?

2021-02-25 Thread Peter Zijlstra
On Wed, Feb 24, 2021 at 11:45:10AM -0800, Andy Lutomirski wrote: > I guess I see the point for CALL, JMP and RET, but it seems like we > could emulate those cases instead fairly easily. Today, yes. CALL emulation was 'recently' made possible by having #BP have a stack gap. We have emulation for

Re: Why do kprobes and uprobes singlestep?

2021-02-25 Thread Masami Hiramatsu
On Wed, 24 Feb 2021 22:03:12 -0800 Andy Lutomirski wrote: > On Wed, Feb 24, 2021 at 6:22 PM Masami Hiramatsu wrote: > > > > On Wed, 24 Feb 2021 11:45:10 -0800 > > Andy Lutomirski wrote: > > > > > On Tue, Feb 23, 2021 at 5:18 PM Masami Hiramatsu > > > wrote: > > > > > > > > On Tue, 23 Feb

Re: Why do kprobes and uprobes singlestep?

2021-02-24 Thread Andy Lutomirski
On Wed, Feb 24, 2021 at 6:22 PM Masami Hiramatsu wrote: > > On Wed, 24 Feb 2021 11:45:10 -0800 > Andy Lutomirski wrote: > > > On Tue, Feb 23, 2021 at 5:18 PM Masami Hiramatsu > > wrote: > > > > > > On Tue, 23 Feb 2021 15:24:19 -0800 > > > Andy Lutomirski wrote: > > > > > > > A while back, I

Re: Why do kprobes and uprobes singlestep?

2021-02-24 Thread Masami Hiramatsu
On Wed, 24 Feb 2021 11:45:10 -0800 Andy Lutomirski wrote: > On Tue, Feb 23, 2021 at 5:18 PM Masami Hiramatsu wrote: > > > > On Tue, 23 Feb 2021 15:24:19 -0800 > > Andy Lutomirski wrote: > > > > > A while back, I let myself be convinced that kprobes genuinely need to > > > single-step the

Re: Why do kprobes and uprobes singlestep?

2021-02-24 Thread Andy Lutomirski
On Tue, Feb 23, 2021 at 5:18 PM Masami Hiramatsu wrote: > > On Tue, 23 Feb 2021 15:24:19 -0800 > Andy Lutomirski wrote: > > > A while back, I let myself be convinced that kprobes genuinely need to > > single-step the kernel on occasion, and I decided that this sucked but > > I could live with

Re: Why do kprobes and uprobes singlestep?

2021-02-23 Thread Masami Hiramatsu
On Tue, 23 Feb 2021 15:24:19 -0800 Andy Lutomirski wrote: > A while back, I let myself be convinced that kprobes genuinely need to > single-step the kernel on occasion, and I decided that this sucked but > I could live with it. it would, however, be Really Really Nice (tm) > if we could have a

Why do kprobes and uprobes singlestep?

2021-02-23 Thread Andy Lutomirski
A while back, I let myself be convinced that kprobes genuinely need to single-step the kernel on occasion, and I decided that this sucked but I could live with it. it would, however, be Really Really Nice (tm) if we could have a rule that anyone running x86 Linux who single-steps the kernel (e.g.