From: Oleg Nesterov <oleg@redhat.com>
To: Jiri Olsa <olsajiri@gmail.com>
Cc: Andrii Nakryiko <andrii.nakryiko@gmail.com>,
Alexei Starovoitov <alexei.starovoitov@gmail.com>,
yunwei356@gmail.com, bpf <bpf@vger.kernel.org>,
Alexei Starovoitov <ast@kernel.org>,
lsf-pc <lsf-pc@lists.linux-foundation.org>,
Yonghong Song <yonghong.song@linux.dev>,
Daniel Borkmann <daniel@iogearbox.net>
Subject: Re: [LSF/MM/BPF TOPIC] faster uprobes
Date: Mon, 11 Mar 2024 18:02:31 +0100 [thread overview]
Message-ID: <20240311170231.GB28588@redhat.com> (raw)
In-Reply-To: <Ze81Y2oal2Lg03HA@krava>
On 03/11, Jiri Olsa wrote:
>
> On Mon, Mar 11, 2024 at 04:06:59PM +0100, Oleg Nesterov wrote:
> > I forgot everything about the low-level x86_64 code, but...
> >
> > On 03/11, Jiri Olsa wrote:
> > >
> > > #ifdef CONFIG_X86_64
> > > +
> > > +asm (
> > > + ".pushsection .rodata\n"
> > > + ".global uretprobe_syscall_entry\n"
> > > + "uretprobe_syscall_entry:\n"
> > > + "push %rax\n"
> > > + "mov $462, %rax\n"
> > > + "syscall\n"
> >
> > Hmm... I think you need to save/restore more registers clobbered by
> > syscall/entry_SYSCALL_64 ?
>
> hum, so the call happens on the function call return, so I thought
> we should just preserve callee saved registers which seems to be
> taken care of by the entry_SYSCALL_64 path..
Yes, but we do not know if the (ret)probed function obeys the C-calling
convention, perhaps it is low level asm code or not a C function.
> I will double check
but I won't insist if you think we do not care.
> > > +
> > > + regs->ax = ax;
> >
> > probably not strictly needed, we are going to return ax...
>
> it needs to be there for the bpf program to read proper return
> value from regs
OK, I see, thanks.
Oleg.
next prev parent reply other threads:[~2024-03-11 17:04 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-29 14:39 [LSF/MM/BPF TOPIC] faster uprobes Jiri Olsa
2024-03-01 0:25 ` Andrii Nakryiko
2024-03-01 8:18 ` Jiri Olsa
2024-03-01 17:01 ` Alexei Starovoitov
2024-03-01 17:26 ` Andrii Nakryiko
2024-03-01 18:08 ` Yunwei 123
2024-03-03 10:20 ` Jiri Olsa
2024-03-05 0:55 ` Andrii Nakryiko
2024-03-05 8:24 ` Jiri Olsa
2024-03-05 15:30 ` Jiri Olsa
2024-03-05 17:30 ` Andrii Nakryiko
2024-03-11 10:59 ` Jiri Olsa
2024-03-11 15:06 ` Oleg Nesterov
2024-03-11 16:46 ` Jiri Olsa
2024-03-11 17:02 ` Oleg Nesterov [this message]
2024-03-11 21:11 ` Jiri Olsa
2024-03-11 17:32 ` Andrii Nakryiko
2024-03-11 21:26 ` Jiri Olsa
2024-03-11 23:05 ` Andrii Nakryiko
2024-03-02 20:46 ` Jiri Olsa
2024-03-02 21:08 ` Alexei Starovoitov
2024-03-02 21:49 ` Oleg Nesterov
2024-03-01 19:39 ` Kui-Feng Lee
2024-03-05 17:18 ` Jiri Olsa
2024-03-05 23:53 ` Song Liu
2024-03-07 9:15 ` Jiri Olsa
2024-03-07 23:02 ` Kui-Feng Lee
2024-03-08 15:43 ` Andrei Matei
2024-03-12 17:16 ` Kui-Feng Lee
2024-03-13 1:32 ` Andrei Matei
2024-03-13 5:42 ` Kui-Feng Lee
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240311170231.GB28588@redhat.com \
--to=oleg@redhat.com \
--cc=alexei.starovoitov@gmail.com \
--cc=andrii.nakryiko@gmail.com \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=lsf-pc@lists.linux-foundation.org \
--cc=olsajiri@gmail.com \
--cc=yonghong.song@linux.dev \
--cc=yunwei356@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox