[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250904084949.GB27255@redhat.com>
Date: Thu, 4 Sep 2025 10:49:50 +0200
From: Oleg Nesterov <oleg@...hat.com>
To: Jiri Olsa <olsajiri@...il.com>
Cc: Masami Hiramatsu <mhiramat@...nel.org>,
Peter Zijlstra <peterz@...radead.org>,
Andrii Nakryiko <andrii@...nel.org>, bpf@...r.kernel.org,
linux-kernel@...r.kernel.org, linux-trace-kernel@...r.kernel.org,
x86@...nel.org, Song Liu <songliubraving@...com>,
Yonghong Song <yhs@...com>,
John Fastabend <john.fastabend@...il.com>,
Hao Luo <haoluo@...gle.com>, Steven Rostedt <rostedt@...dmis.org>,
Ingo Molnar <mingo@...nel.org>
Subject: Re: [PATCH perf/core 02/11] uprobes: Skip emulate/sstep on unique
uprobe when ip is changed
On 09/03, Jiri Olsa wrote:
>
> On Wed, Sep 03, 2025 at 01:26:48PM +0200, Oleg Nesterov wrote:
> > On 09/02, Jiri Olsa wrote:
> > >
> > > If user decided to take execution elsewhere, it makes little sense
> > > to execute the original instruction, so let's skip it.
> >
> > Exactly.
> >
> > So why do we need all these "is_unique" complications? Only a single
> > is_unique/exclusive consumer can change regs->ip, so I guess handle_swbp()
> > can just do
> >
> > handler_chain(uprobe, regs);
> > if (instruction_pointer(regs) != bp_vaddr)
> > goto out;
>
> hum, that's what I did in rfc [1] but I thought you did not like that [2]
>
> [1] https://lore.kernel.org/bpf/20250801210238.2207429-2-jolsa@kernel.org/
> [2] https://lore.kernel.org/bpf/20250802103426.GC31711@redhat.com/
>
> I guess I misunderstood your reply [2], I'd be happy to drop the
> unique/exclusive flag
Well, but that rfc didn't introduce the exclusive consumers, and I think
we agree that even with these changes the non-exclusive consumers must
never change regs->ip?
> > But if a non-exclusive consumer changes regs->ip, we have a problem
> > anyway, right?
> >
> > We can probably add something like
> >
> > rc = uc->handler(uc, regs, &cookie);
> > + WARN_ON(!uc->is_unique && instruction_pointer(regs) != bp_vaddr);
> >
> > into handler_chain(), although I don't think this is needed.
Oleg.
Powered by blists - more mailing lists